alibaba / lowcode-engine

An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系
https://lowcode-engine.cn
MIT License
14.66k stars 2.55k forks source link

尝试将lowcode-engine中的code-generator版本升级失败 #2488

Open zhaoweihan2017 opened 1 year ago

zhaoweihan2017 commented 1 year ago

需求:使用官方提供的打包脚本将lowcode-engine中code-generator版本升级,然后在lowcode-code-generator-demo 项目中引入最新的code-generator版本,实现出码模块升级。

修改的code-generator中的package.json 如下:

{ "name": "sy-code-generator", "version": "1.1.7", "description": "出码引擎 for LowCode Engine", "license": "MIT", "main": "lib/index.js", "module": "es/index.js", "typings": "types/index.d.ts", "files": [ "bin", "lib", "es", "demo", "dist", "types", "standalone", "standalone-worker", "standalone-loader", "loader", "CHANGELOG.md", "README.md", "CONTRIBUTING.md", "example-schema.json", "example-schema.json5" ], "bin": { "lowcode-code-generator": "bin/lowcode-code-generator.js" }, "scripts": { "start": "jest --watchAll", "build": "npm run clean && node scripts/build", "build:standalone": "node scripts/build-standalone", "clean": "rimraf es lib dist types generated demo coverage output test-cases///actual", "lint": "eslint --ext .jsx,.js,.ts,.tsx src/", "lintfix": "eslint --ext .jsx,.js,.ts,.tsx --fix src/", "check:types": "tsc --noEmit", "template": "node ./scripts/build-template-static-files.js", "test": "npm run test:normal && npm run test:standalone", "test:normal": "jest", "test:standalone": "node scripts/test-standalone", "test:cov": "jest --coverage", "test:update-snapshots": "cross-env UPDATE_EXPECTED=true jest -u", "analyze:standalone": "ANALYZE=true node scripts/build-standalone", "release:beta": "standard-version -t @alilc/lowcode-code-generator\@ -r patch --prerelease beta && git push --follow-tags && npm publish --tag beta", "release:patch": "standard-version -t @alilc/lowcode-code-generator\@ -r patch && git push --follow-tags && npm publish", "release:minor": "standard-version -t @alilc/lowcode-code-generator\@ -r minor && git push --follow-tags && npm publish", "prepublishOnly": "npm run build", "demo": "node bin/lowcode-code-generator.js -i example-schema.json -o demo -s icejs" }, "standard-version": { "skip": { "changelog": true } }, "husky": { "hooks": { "pre-commit": "lint-staged", "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } }, "lint-staged": { "*/.{js,jsx,ts,tsx}": "eslint" }, "dependencies": { "@alilc/lowcode-types": "^1.0.0", "@babel/generator": "^7.12.11", "@babel/parser": "^7.12.11", "@babel/runtime": "^7.12.5", "@babel/traverse": "^7.12.12", "@babel/types": "^7.12.12", "@types/debug": "^4.1.7", "@types/fs-extra": "^9.0.12", "@types/glob": "^7.2.0", "@types/lodash": "^4.14.162", "@types/node-fetch": "2.x", "@types/qs": "^6.9.6", "@types/semver": "^7.3.4", "buffer": "^6.0.3", "chalk": "^4.1.0", "change-case": "^3.1.0", "commander": "^6.1.0", "debug": "^4.3.2", "fp-ts": "^2.11.9", "fs-extra": "9.x", "glob": "^7.2.0", "html-entities": "^2.3.2", "json5": "^2.2.0", "jsonc": "^2.0.0", "jszip": "^3.5.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "mock-fs": "^5.1.2", "moment": "^2.29.1", "nanomatch": "^1.2.13", "node-fetch": "2.x", "path-browserify": "^1.0.1", "prettier": "^2.5.1", "qs": "^6.10.1", "semver": "^7.3.4", "short-uuid": "^3.1.1", "babel-jest": "^26.5.2", "tslib": "^2.3.1" }, "browser": { "path": "path-browserify", "lodash": "lodash-es", "prettier": "prettier/standalone" }, "devDependencies": { "@iceworks/spec": "^1.4.2", "@types/babel__traverse": "^7.11.0", "@types/jest": "^27.0.2", "@types/lodash": "^4.14.162", "@types/node": "^14.14.20", "@types/prettier": "^2.4.2", "@typescript-eslint/eslint-plugin": "^4.12.0", "@typescript-eslint/parser": "^4.12.0", "concurrently": "^6.5.1", "cross-env": "^7.0.3", "esbuild": "^0.14.5", "esbuild-plugin-alias": "^0.2.1", "esbuild-plugin-ignore": "^1.1.0", "esbuild-visualizer": "^0.3.1", "eslint": "^7.17.0", "eslint-config-ali": "^11.4.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-react": "^7.22.0", "eslint-plugin-react-hooks": "^4.2.0", "jest": "^26.5.2", "jest-util": "^27.4.2", "rimraf": "^3.0.2", "standard-version": "^9.1.1", "ts-jest": "^26.5.2", "ts-loader": "^6.2.2", "ts-node": "^8.10.2", "tsconfig-paths": "^3.9.0", "typescript": "4.x", "yargs-parser": "^20.2.9" }, "engines": { "node": ">=10.0.0" }, "publishConfig": { "registry": "https://registry.npmjs.org/" }, "repository": { "type": "http", "url": "https://github.com/alibaba/lowcode-engine/tree/main/modules/code-generator" }, "bugs": "https://github.com/alibaba/lowcode-engine/issues", "homepage": "https://github.com/alibaba/lowcode-engine/#readme" }

使用npm publish 报错如下:

[build:types] 'sh' �����ڲ����ⲿ���Ҳ���ǿ����еij��� [build:types] ���������ļ��� [build:cjs] building cjs... [build:esm] building esm... [build:standalone] building... [build:cjs] X [ERROR] Unterminated string literal [build:cjs] [build:cjs] src/types/jsx.ts:1:81: [build:cjs] 1 │ ...cTypeNodeSchema, IPublicTypeCompositeValue } from '@alilc/lowcode- [build:cjs] ╵ ^ [build:cjs] [build:cjs] Error: Build failed with 1 error: [build:cjs] src/types/jsx.ts:1:81: ERROR: Unterminated string literal [build:cjs] at failureErrorWithLog (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1624:15) [build:cjs] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1266:28 [build:cjs] at runOnEndCallbacks (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1179:65)
[build:cjs] at buildResponseToResult (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1264:7)[build:cjs] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1377:14 [build:cjs] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:678:9 [build:cjs] at handleIncomingPacket (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:775:9)
[build:cjs] at Socket.readFromStdout (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:644:7) [build:cjs] at Socket.emit (events.js:400:28) [build:cjs] at addChunk (internal/streams/readable.js:293:12) { [build:cjs] errors: [ [build:cjs] { [build:cjs] detail: undefined, [build:cjs] id: '', [build:cjs] location: [Object], [build:cjs] notes: [], [build:cjs] pluginName: '', [build:cjs] text: 'Unterminated string literal' [build:cjs] } [build:cjs] ], [build:cjs] warnings: [] [build:cjs] } [build:esm] X [ERROR] Unterminated string literal [build:esm] [build:esm] src/types/jsx.ts:1:81: [build:esm] 1 │ ...cTypeNodeSchema, IPublicTypeCompositeValue } from '@alilc/lowcode- [build:esm] ╵ ^ [build:esm] [build:esm] Error: Build failed with 1 error: [build:esm] src/types/jsx.ts:1:81: ERROR: Unterminated string literal [build:esm] at failureErrorWithLog (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1624:15) [build:esm] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1266:28 [build:esm] at runOnEndCallbacks (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1179:65)
[build:esm] at buildResponseToResult (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1264:7)[build:esm] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1377:14 [build:esm] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:678:9 [build:esm] at handleIncomingPacket (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:775:9)
[build:esm] at Socket.readFromStdout (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:644:7) [build:esm] at Socket.emit (events.js:400:28) [build:esm] at addChunk (internal/streams/readable.js:293:12) { [build:esm] errors: [ [build:esm] { [build:esm] detail: undefined, [build:esm] id: '', [build:esm] location: [Object], [build:esm] notes: [], [build:esm] pluginName: '', [build:esm] text: 'Unterminated string literal' [build:esm] } [build:esm] ], [build:esm] warnings: [] [build:esm] } [build:standalone-worker] building... [build:esm] node scripts/build --format=esm --out=es exited with code 1 --> Sending SIGTERM to other processes.. [build:cjs] node scripts/build --format=cjs --out=lib exited with code 1 --> Sending SIGTERM to other processes.. [build:types] sh scripts/build-types exited with code 1 --> Sending SIGTERM to other processes.. [build:standalone] X [ERROR] Unterminated string literal [build:standalone] [build:standalone] src/types/jsx.ts:1:81: [build:standalone] 1 │ ...cTypeNodeSchema, IPublicTypeCompositeValue } from '@alilc/lowcode- [build:standalone] ╵ ^ [build:standalone] [build:standalone] Error: Build failed with 1 error: [build:standalone] src/types/jsx.ts:1:81: ERROR: Unterminated string literal [build:standalone] at failureErrorWithLog (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1624:15) [build:standalone] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1266:28 [build:standalone] at runOnEndCallbacks (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1046:63) [build:standalone] at buildResponseToResult (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1264:7) [build:standalone] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1377:14 [build:standalone] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:678:9 [build:standalone] at handleIncomingPacket (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:775:9) [build:standalone] at Socket.readFromStdout (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:644:7) [build:standalone] at Socket.emit (events.js:400:28) [build:standalone] at addChunk (internal/streams/readable.js:293:12) { [build:standalone] errors: [ [build:standalone] { [build:standalone] detail: undefined, [build:standalone] id: '', [build:standalone] location: [Object], [build:standalone] notes: [], [build:standalone] pluginName: '', [build:standalone] text: 'Unterminated string literal' [build:standalone] } [build:standalone] ], [build:standalone] warnings: [] [build:standalone] } [build:standalone-loader] build standalone-loader: packageVersion=1.1.7 [build:standalone-loader] building cjs... [build:standalone-loader] done [build:standalone-worker] X [ERROR] Unterminated string literal [build:standalone-worker] [build:standalone-worker] src/types/jsx.ts:1:81: [build:standalone-worker] 1 │ ...cTypeNodeSchema, IPublicTypeCompositeValue } from '@alilc/lowcode- [build:standalone-worker] ╵ ^ [build:standalone-worker] [build:standalone-worker] Error: Build failed with 1 error: [build:standalone-worker] src/types/jsx.ts:1:81: ERROR: Unterminated string literal [build:standalone-worker] at failureErrorWithLog (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1624:15) [build:standalone-worker] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1266:28 [build:standalone-worker] at runOnEndCallbacks (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1046:63) [build:standalone-worker] at buildResponseToResult (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1264:7) [build:standalone-worker] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1377:14 [build:standalone-worker] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:678:9 [build:standalone-worker] at handleIncomingPacket (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:775:9) [build:standalone-worker] at Socket.readFromStdout (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:644:7) [build:standalone-worker] at Socket.emit (events.js:400:28) [build:standalone-worker] at addChunk (internal/streams/readable.js:293:12) { [build:standalone-worker] errors: [ [build:standalone-worker] { [build:standalone-worker] detail: undefined, [build:standalone-worker] id: '', [build:standalone-worker] location: [Object], [build:standalone-worker] notes: [], [build:standalone-worker] pluginName: '', [build:standalone-worker] text: 'Unterminated string literal' [build:standalone-worker] } [build:standalone-worker] ], [build:standalone-worker] warnings: [] [build:standalone-worker] } [build:cli] building... [build:cli] X [ERROR] Unterminated string literal [build:cli] [build:cli] src/types/jsx.ts:1:81: [build:cli] 1 │ ...cTypeNodeSchema, IPublicTypeCompositeValue } from '@alilc/lowcode- [build:cli] ╵ ^ [build:cli] [build:cli] Error: Build failed with 1 error: [build:cli] src/types/jsx.ts:1:81: ERROR: Unterminated string literal [build:cli] at failureErrorWithLog (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1624:15) [build:cli] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1266:28 [build:cli] at runOnEndCallbacks (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1046:63)
[build:cli] at buildResponseToResult (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1264:7)[build:cli] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:1377:14 [build:cli] at D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:678:9 [build:cli] at handleIncomingPacket (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:775:9)
[build:cli] at Socket.readFromStdout (D:\lowcode-work\lowcode-engine-main(1)\lowcode-engine-main\modules\code-generator\node_modules\esbuild\lib\main.js:644:7) [build:cli] at Socket.emit (events.js:400:28) [build:cli] at addChunk (internal/streams/readable.js:293:12) { [build:cli] errors: [ [build:cli] { [build:cli] detail: undefined, [build:cli] id: '', [build:cli] location: [Object], [build:cli] notes: [], [build:cli] pluginName: '', [build:cli] text: 'Unterminated string literal' [build:cli] } [build:cli] ], [build:cli] warnings: [] [build:cli] } [build:cli] node scripts/build-cli exited with code 1 --> Sending SIGTERM to other processes.. [build:standalone-worker] node scripts/build-standalone-worker exited with code 1 --> Sending SIGTERM to other processes.. [build:standalone-loader] node scripts/build-standalone-loader exited with code 0 [build:standalone] node scripts/build-standalone exited with code 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sy-code-generator@1.1.7 build: npm run clean && node scripts/build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sy-code-generator@1.1.7 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sy-code-generator@1.1.7 prepublishOnly: npm run build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sy-code-generator@1.1.7 prepublishOnly script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

qingniaotonghua commented 1 year ago

从最新版本的 lowcode-engine 仓库修改 code-generator 并发布并未发现异常,如图: image