Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持分类页装修 #311

Merged
merged 62 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9b7844d
chore: support lynx3 & upgrade typescript
xwchris Nov 25, 2024
2ae5823
chore: update lynx3 config
xwchris Nov 27, 2024
206b635
chore: update lock
xwchris Nov 27, 2024
c013425
chore: update node version
xwchris Nov 27, 2024
4c78929
chore: update node version
xwchris Nov 27, 2024
d2d9297
chore: update version to 0.3.39-alpha.2
xwchris Nov 27, 2024
41b4015
chore: temp
xwchris Nov 28, 2024
7eebf0b
chore: update to rspack
xwchris Nov 29, 2024
43865cb
chore(release): publish version 0.3.39-alpha.3 --tag=alpha
Nov 29, 2024
4133c77
chore: test
xwchris Nov 29, 2024
0fedd6a
Merge branch 'feat/lynx3' of github.com:bytedance/mona into feat/lynx3
xwchris Nov 29, 2024
81a454b
chore(release): publish version 0.3.39-alpha.4 --tag=alpha
Nov 29, 2024
e9ef172
chore: 删除旧版代码
xwchris Dec 4, 2024
e752842
Merge branch 'feat/lynx3' of github.com:bytedance/mona into feat/lynx3
xwchris Dec 4, 2024
7a45a41
chore: 删除无用代码
xwchris Dec 4, 2024
e6fd75b
chore: 完善组件预览流程
xwchris Dec 4, 2024
969e456
chore: 修改命令
xwchris Dec 4, 2024
c43d328
chore: 删除无用的依赖
xwchris Dec 9, 2024
0078596
chore(release): publish version 0.3.39-alpha.5 --tag=alpha
Dec 9, 2024
af3be12
chore: 修改环境
xwchris Dec 10, 2024
921c735
chore: 修复entry
xwchris Dec 10, 2024
7b5ef79
chore(release): publish version 0.3.39-alpha.6 --tag=alpha
Dec 10, 2024
95dac02
增加状态
xwchris Dec 10, 2024
a62e9cb
chore(release): publish version 0.3.39-alpha.7 --tag=alpha
Dec 11, 2024
8a1da77
chore(release): publish version 0.3.39-alpha.8 --tag=alpha
Dec 11, 2024
15b0a1c
chore: update speedy
xwchris Dec 11, 2024
5b1c261
Merge branch 'feat/lynx3' of github.com:bytedance/mona into feat/lynx3
xwchris Dec 11, 2024
d954623
chore(release): publish version 0.3.39-alpha.9 --tag=alpha
Dec 11, 2024
ee84af1
chore: 修改命令
xwchris Dec 19, 2024
f160470
chore(release): publish version 0.3.39-alpha.10 --tag=alpha
Dec 19, 2024
d6f7c44
chore: 修复preview问题
xwchris Dec 19, 2024
2f62b3f
chore(release): publish version 0.3.39-alpha.11 --tag=alpha
Dec 19, 2024
b7e7059
chore: update nav preview
xwchris Dec 25, 2024
2726ffa
Merge branch 'feat/lynx3' of github.com:bytedance/mona into feat/lynx3
xwchris Dec 25, 2024
feaab7b
chore: 页面修改
xwchris Dec 25, 2024
be24656
chore: 增加category json
xwchris Dec 26, 2024
fb3e424
chore: update mona-shared
xwchris Dec 26, 2024
1956f21
chore(release): publish version 0.3.39-alpha.12 --tag=alpha
Dec 26, 2024
9d6b3c0
chore: template增加category
xwchris Dec 27, 2024
f342c53
chore(release): publish version 0.3.39-alpha.13 --tag=alpha
Dec 27, 2024
9f59bd2
chore: add template
xwchris Dec 27, 2024
ebe2125
chore(release): publish version 0.3.39-alpha.14 --tag=alpha
Dec 27, 2024
978beab
chore: 修改category
xwchris Dec 30, 2024
fef5703
chore(release): publish version 0.3.39-alpha.15 --tag=alpha
Dec 30, 2024
dc65575
Merge branch 'feat/lynx3' of github.com:bytedance/mona into feat/lynx3
xwchris Dec 30, 2024
e71825f
chore(release): publish version 0.3.39-alpha.16 --tag=alpha
Dec 30, 2024
ac26443
chore: 修改写入路径
xwchris Jan 2, 2025
6c64e44
Merge branch 'feat/lynx3' of github.com:bytedance/mona into feat/lynx3
xwchris Jan 2, 2025
c560051
chore(release): publish version 0.3.39-alpha.17 --tag=alpha
Jan 2, 2025
5e69a02
chore: update now
xwchris Jan 2, 2025
a66cd0b
chore(release): publish version 0.3.39-alpha.18 --tag=alpha
Jan 2, 2025
7eacceb
chore: 模板预览接口增加categoryList
xwchris Jan 6, 2025
21338a5
chore: 增加成功的日志
xwchris Jan 6, 2025
fca19a6
chore: 组件不支持本地预览
xwchris Jan 6, 2025
0e002a6
chore(release): publish version 0.3.39-alpha.19 --tag=alpha
Jan 6, 2025
916f4aa
chore: 修改模板预览
xwchris Jan 8, 2025
ea8d61b
chore: 模板推送默认数据
xwchris Jan 8, 2025
aafed17
chore: 修改版本
xwchris Jan 9, 2025
1496e39
chore: 更新mona-speedy
xwchris Jan 17, 2025
dc71a76
chore(release): publish v0.3.39-alpha.23
xwchris Jan 17, 2025
519182f
chore: update
xwchris Jan 21, 2025
b75fa3e
chore(release): publish v0.3.39
xwchris Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [14.18.0]
node-version: [18.17.1]

steps:
# prepare env
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

strategy:
matrix:
node-version: [14.18.0]
node-version: [18.17.1]

steps:
# run identifier
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
uses: azu/action-package-version-to-git-tag@v1
with:
version: ${{ env.cversion }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.7 }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: 'v'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ yarn-error.log*

.yarn
.yalc
yalc.lock

tsconfig.tsbuildinfo

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mona

mona 是抖店开放平台推出的抖店应用跨端开发方案,支持使用**React 框架**来开发应用,以求达到一次开发处处运行
mona 是抖店开放平台推出的抖店应用跨端开发方案,支持使用**React 框架**来开发应用,以求达到一次开发处处运行的目的

详细文档请点击[这里](https://op.jinritemai.com/docs/mona-docs/1169/2708)
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.3.38",
"version": "0.3.39",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"test": "jest",
"test:coverage": "jest --coverage",
"test:c": "jest --coverage",
"release": "node ./scripts/release.js",
"bnpm:sync": "node ./scripts/bnpmSync.js"
"release": "sh scripts/publish.sh",
"bnpm:sync": "node ./scripts/bnpmSync.js",
"publish:local": "lerna exec -- yalc publish"
},
"repository": {
"type": "git",
Expand All @@ -32,16 +33,16 @@
],
"packageManager": "[email protected]",
"engines": {
"node": ">=14"
"node": ">=18"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.1",
"@types/enzyme": "^3.10.10",
"@types/jest": "^27.0.2",
"@types/react-test-renderer": "^17.0.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
"canvas": "^2.8.0",
"chalk": "4.1.2",
"concurrently": "^7.6.0",
"enzyme": "^3.11.0",
"execa": "5.1.1",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -54,7 +55,8 @@
"semver": "^7.3.5",
"ts-jest": "^27.1.3",
"ts-node": "^10.4.0",
"concurrently": "^7.6.0",
"typescript": "^4.4.4"
"ts-patch": "^3.2.1",
"typescript": "5.6.3",
"typescript-transform-paths": "^3.5.2"
}
}
}
6 changes: 3 additions & 3 deletions packages/mona-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytedance/mona-cli",
"version": "0.3.38",
"version": "0.3.39",
"displayName": "mona",
"description": "Merchant app's developing and building tools",
"main": "./bin/mona",
Expand All @@ -20,8 +20,8 @@
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"@bytedance/mona-cli-commands": "0.3.38",
"@bytedance/mona-manager": "0.3.38"
"@bytedance/mona-cli-commands": "^0.3.39",
"@bytedance/mona-manager": "^0.3.39"
},
"devDependencies": {
"@types/node": "^16.4.5"
Expand Down
10 changes: 5 additions & 5 deletions packages/mona-clients/mona-client-max/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytedance/mona-client-max",
"version": "0.3.38",
"version": "0.3.39",
"description": "max for mona",
"main": "./dist/index.js",
"files": [
Expand All @@ -19,10 +19,10 @@
"mona"
],
"dependencies": {
"@bytedance/mona": "0.3.38",
"@bytedance/mona-client-web": "0.3.38",
"@bytedance/mona-shared": "0.3.38",
"@bytedance/mona-speedy-components": "0.0.37",
"@bytedance/mona": "^0.3.39",
"@bytedance/mona-client-web": "^0.3.39",
"@bytedance/mona-shared": "^0.3.39",
"@bytedance/mona-speedy-components": "0.0.38",
"axios": "^1.6.5"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mona-clients/mona-client-max/src/apis/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function _wrapPromise<T extends Callbacks>({
const _erroHandler =
erroHandler ||
function (err) {
return { errMsg: `${name}:fail ` + err?.message ?? '' } as any;
return { errMsg: `${name}:fail ` + (err?.message || '') } as any;
};
const promiseFunc = _global[name];

Expand Down
8 changes: 4 additions & 4 deletions packages/mona-clients/mona-client-mini/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytedance/mona-client-mini",
"version": "0.3.38",
"version": "0.3.39",
"description": "miniapp for mona",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -21,8 +21,8 @@
"license": "MIT",
"sideEffects": false,
"dependencies": {
"@bytedance/mona": "0.3.38",
"@bytedance/mona-shared": "0.3.38",
"@bytedance/mona": "^0.3.39",
"@bytedance/mona-shared": "^0.3.39",
"react-reconciler": "^0.26.2",
"scheduler": "^0.20.2"
},
Expand All @@ -37,7 +37,7 @@
"rollup": "2.53.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-typescript2": "0.36.0",
"tslib": "^2.3.1",
"typescript-json-schema": "^0.43.0",
"typescript-transform-paths": "^2.2.4"
Expand Down
10 changes: 5 additions & 5 deletions packages/mona-clients/mona-client-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytedance/mona-client-plugin",
"version": "0.3.38",
"version": "0.3.39",
"description": "plugin for mona",
"main": "./dist/index.js",
"files": [
Expand All @@ -17,10 +17,10 @@
"mona"
],
"dependencies": {
"@bytedance/mona": "0.3.38",
"@bytedance/mona-client-web": "0.3.38",
"@bytedance/mona-plugin-events": "0.3.38",
"@bytedance/mona-shared": "0.3.38"
"@bytedance/mona": "^0.3.39",
"@bytedance/mona-client-web": "^0.3.39",
"@bytedance/mona-plugin-events": "^0.3.39",
"@bytedance/mona-shared": "^0.3.39"
},
"peerDependencies": {
"react": "^17.0.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/mona-clients/mona-client-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytedance/mona-client-web",
"version": "0.3.38",
"version": "0.3.39",
"description": "web for mona",
"main": "./dist/index.js",
"files": [
Expand All @@ -19,8 +19,8 @@
"mona"
],
"dependencies": {
"@bytedance/mona": "0.3.38",
"@bytedance/mona-shared": "0.3.38",
"@bytedance/mona": "^0.3.39",
"@bytedance/mona-shared": "^0.3.39",
"ahooks": "^3.7.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/mona-manager-plugins/mona-cli-commands/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytedance/mona-cli-commands",
"version": "0.3.38",
"version": "0.3.39",
"displayName": "mona-cli-commands",
"description": "mona-cli commands plugins for mona-manager",
"main": "./dist/index",
Expand All @@ -16,8 +16,8 @@
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"@bytedance/mona-manager": "0.3.38",
"@bytedance/mona-shared": "0.3.38",
"@bytedance/mona-manager": "^0.3.39",
"@bytedance/mona-shared": "^0.3.39",
"@koa/cors": "^4.0.0",
"@koa/router": "^12.0.0",
"axios": "^1.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ const templates = [

const maxTemplateTypes = [
{
name: 'component(店铺装修组件开发)',
name: 'component(普通店铺装修组件开发)',
value: 'max',
},
{
name: 'component-old(旧版h5版本店铺装修组件开发)',
value: 'max-h5',
},
{
name: 'template(店铺装修模板开发)',
value: 'max-template',
},
{
name: 'nav-component(分类页导航组件开发,需特殊处理)',
value: 'max-component-nav',
},
];

type AskKey = keyof Omit<Answer, 'appId'>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ import { readUser, saveUser } from '@bytedance/mona-shared';

const WS_DOMAIN = 'opws.jinritemai.com';

function parseHeaders(headers: string) {
const result: Record<string, string> = {};
const lines = headers.split(';');
lines.forEach(line => {
const [key, value] = line.split('=');
result[key.trim()] = value.trim();
});
return result;
}

const login: IPlugin = ctx => {
ctx.registerCommand(
'login',
Expand All @@ -18,7 +28,7 @@ const login: IPlugin = ctx => {
},
args => {
const domain = args.domain || OPEN_DOMAIN;
const header = args.header ? JSON.parse(args.header) : OPEN_DEV_HEADERS;
const header = args.header ? parseHeaders(args.headers) : OPEN_DEV_HEADERS;

const openURL = `https://${domain}/authorization`;
const wsURL = `wss://${args.domain || WS_DOMAIN}/ws/api/terminal`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@bytedance/mona-manager-plugins-shared",
"displayName": "mona-manager-plugins-shared",
"version": "0.3.38",
"version": "0.3.39",
"description": "mona-manager plugins shared utils and plugins",
"main": "./dist/index.js",
"module": "./dist/index.js",
"scripts": {
"build": "yarn clean && ttsc -b",
"start": "ttsc -b -w",
"build": "yarn clean && tspc -b",
"start": "tspc -b -w",
"clean": "rm -rf dist",
"test": "jest"
},
Expand All @@ -17,16 +17,14 @@
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"@bytedance/mona-manager": "0.3.38",
"@bytedance/mona-manager": "^0.3.39",
"copy-webpack-plugin": "^10.2.0",
"webpack": "^5.58.2"
},
"devDependencies": {
"@types/node": "^16.4.5",
"react": "^17.0.2",
"ttypescript": "^1.5.12",
"typescript-json-schema": "^0.43.0",
"typescript-transform-paths": "^2.2.4"
"typescript-json-schema": "^0.43.0"
},
"publishConfig": {
"access": "public",
Expand Down
14 changes: 6 additions & 8 deletions packages/mona-manager-plugins/mona-service-commands/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytedance/mona-service-commands",
"version": "0.3.38",
"version": "0.3.39",
"displayName": "mona-service-commands",
"description": "mona-service commands plugins for mona-manager",
"main": "./dist/index.js",
Expand All @@ -9,16 +9,16 @@
"dist"
],
"scripts": {
"build": "yarn clean && ttsc -b",
"start": "ttsc -b -w",
"build": "yarn clean && tspc -b",
"start": "tspc -b -w",
"clean": "rm -rf dist",
"test": "jest"
},
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"@bytedance/mona-manager": "0.3.38",
"@bytedance/mona-shared": "0.3.38",
"@bytedance/mona-manager": "^0.3.39",
"@bytedance/mona-shared": "^0.3.39",
"archiver": "^5.3.0",
"assert": "^2.0.0",
"axios": "^1.6.5",
Expand All @@ -39,9 +39,7 @@
"@types/minimist": "^1.2.2",
"@types/node": "^16.4.5",
"@types/qrcode": "^1.4.2",
"ttypescript": "^1.5.12",
"typescript-json-schema": "^0.43.0",
"typescript-transform-paths": "^2.2.4"
"typescript-json-schema": "^0.43.0"
},
"publishConfig": {
"access": "public",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,20 @@ export function readUser(): { cookie: string; nickName: string; userId: string }
export function saveUser(data: any) {
fs.writeFileSync(userDataFile, JSON.stringify(data));
}
function parseHeaders(headers: string) {
const result: Record<string, string> = {};
const lines = headers.split(';');
lines.forEach(line => {
const [key, value] = line.split('=');
result[key.trim()] = value.trim();
});
return result;
}

export function generateRequestFromOpen(args: any, cookie: string) {
return function <T = any>(path: string, options?: AxiosRequestConfig<any>): Promise<T> {
const domain = args.domain || OPEN_DOMAIN;
const header = args.header ? JSON.parse(args.header) : OPEN_DEV_HEADERS;
const header = args.headers ? parseHeaders(args.headers) : OPEN_DEV_HEADERS;
const url = `https://${domain}${path}`;

const config = {
Expand All @@ -63,6 +72,9 @@ export function generateRequestFromOpen(args: any, cookie: string) {
return axios.request(config).then(res => {
const data = res.data as any;
if (data.code === 0) {
if (args.debug) {
console.log(` [path: ${path}, logid:${res?.headers?.['x-tt-logid'] || 'unknow'}] `)
}
return data.data;
} else {
throw new Error(
Expand Down
Loading