GeezerVison is showing github.com — chore: 优化生成引擎版本号的逻辑 · lowcode-mirror/lowcode-engine@b9288e3
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: README.md +12-3Lines changed: 12 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -90,14 +90,21 @@ init(document.getElementById('lce')); | 90 | 90 | ``` | 91 | 91 |
| 92 | 92 | ### cdn 可选方式: | 93 | | -#### 方式 1:unpkg | | 93 | +#### 方式 1:alifd cdn | | 94 | +```html | | 95 | + | | 96 | + | | 97 | +https://alifd.alicdn.com/npm/@alilc/ [email protected]/dist/js/react-simulator-renderer.js | | 98 | +``` | | 99 | + | | 100 | +#### 方式 2:unpkg | 94 | 101 | ```html | 95 | 102 | | 96 | 103 |
| 97 | 104 | | 98 | 105 | ``` | 99 | 106 |
| 100 | | -#### 方式 2:jsdelivr | | 107 | +#### 方式 3:jsdelivr | 101 | 108 | ```html | 102 | 109 | | 103 | 110 |
| @@ -127,10 +134,12 @@ $ npm run setup | 127 | 134 | $ npm start | 128 | 135 | ``` | 129 | 136 |
| | 137 | +> 📢 npm 访问速度较慢,阿里员工可以使用 tnpm,其他同学建议使用 cnpm 或者指定镜像 registry。 | | 138 | +
| 130 | 139 | lowcode-engine 启动后,提供了几个 umd 文件,可以结合 [lowcode-demo](https://github.com/alibaba/lowcode-demo) 项目做调试,文件代理规则参考这里。 | 131 | 140 |
| 132 | 141 | ## 🤝 参与共建 | 133 | 142 |
| 134 | | -请先阅读 [贡献指南 WIP](http://lowcode-engine.cn/docs/react/contributing-cn). | | 143 | +请先阅读 [贡献指南 WIP](http://lowcode-engine.cn/?docs#/doc?url=contributing). | 135 | 144 |
| 136 | 145 | > 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。 |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/README.md +14-7Lines changed: 14 additions & 7 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 |
| 17 | 17 | [npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square | 18 | 18 | [npm-url]: http://npmjs.org/package/@alilc/lowcode-engine | 19 | | -[github-action-image]: https://github.com/ant-design/ant-design/workflows/%E2%9C%85%20test/badge.svg | 20 | | -[github-action-url]: https://github.com/ant-design/ant-design/actions?query=workflow%3A%22%E2%9C%85+test%22 | 21 | 19 |
| 22 | 20 | [download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square | 23 | 21 | [download-url]: https://npmjs.org/package/@alilc/lowcode-engine | 24 | | -[help-wanted-image]: https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open | | 22 | +[help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open | 25 | 23 | [help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22 | 26 | 24 | [discussions-image]: https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square | 27 | | -[discussions-url]: https://github.com/ant-design/ant-design/discussions | | 25 | +[discussions-url]: https://github.com/alibaba/lowcode-engine/discussions | 28 | 26 |
| 29 | 27 | [issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square | 30 | 28 | [issues-helper-url]: https://github.com/actions-cool/issues-helper | @@ -92,14 +90,21 @@ init(document.getElementById('lce')); | 92 | 90 | ``` | 93 | 91 |
| 94 | 92 | ### cdn 可选方式: | 95 | | -#### 方式 1:unpkg | | 93 | +#### 方式 1:alifd cdn | | 94 | +```html | | 95 | + | | 96 | + | | 97 | +https://alifd.alicdn.com/npm/@alilc/ [email protected]/dist/js/react-simulator-renderer.js | | 98 | +``` | | 99 | + | | 100 | +#### 方式 2:unpkg | 96 | 101 | ```html | 97 | 102 | | 98 | 103 |
| 99 | 104 | | 100 | 105 | ``` | 101 | 106 |
| 102 | | -#### 方式 2:jsdelivr | | 107 | +#### 方式 3:jsdelivr | 103 | 108 | ```html | 104 | 109 | | 105 | 110 |
| @@ -129,10 +134,12 @@ $ npm run setup | 129 | 134 | $ npm start | 130 | 135 | ``` | 131 | 136 |
| | 137 | +> 📢 npm 访问速度较慢,阿里员工可以使用 tnpm,其他同学建议使用 cnpm 或者指定镜像 registry。 | | 138 | +
| 132 | 139 | lowcode-engine 启动后,提供了几个 umd 文件,可以结合 [lowcode-demo](https://github.com/alibaba/lowcode-demo) 项目做调试,文件代理规则参考这里。 | 133 | 140 |
| 134 | 141 | ## 🤝 参与共建 | 135 | 142 |
| 136 | | -请先阅读 [贡献指南 WIP](http://lowcode-engine.cn/docs/react/contributing-cn). | | 143 | +请先阅读 [贡献指南 WIP](http://lowcode-engine.cn/?docs#/doc?url=contributing). | 137 | 144 |
| 138 | 145 | > 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。 |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/build.plugin.js +10-1Lines changed: 10 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); | | 2 | +const fse = require('fs-extra'); | | 3 | +// read from lerna | | 4 | +const lernaConfig = JSON.parse(fse.readFileSync('../../lerna.json', 'utf8')); | | 5 | +const { version } = lernaConfig; | 2 | 6 |
| 3 | | -module.exports = ({ onGetWebpackConfig }) => { | | 7 | +module.exports = ({ context, onGetWebpackConfig }) => { | 4 | 8 | onGetWebpackConfig((config) => { | 5 | 9 | config.resolve | 6 | 10 | .plugin('tsconfigpaths') | 7 | 11 | .use(TsconfigPathsPlugin, [{ | 8 | 12 | configFile: './tsconfig.json', | 9 | 13 | }]); | | 14 | + config | | 15 | + .plugin('define') | | 16 | + .use(context.webpack.DefinePlugin, [{ | | 17 | + VERSION_PLACEHOLDER: JSON.stringify(version), | | 18 | + }]); | 10 | 19 | config.plugins.delete('hot'); | 11 | 20 | config.devServer.hot(false); | 12 | 21 | }); | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/package.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | "start": "build-scripts start", | 14 | 14 | "version:update": "node ./scripts/version.js", | 15 | 15 | "build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo", | 16 | | - "build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json && npm run version:update", | | 16 | + "build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json", | 17 | 17 | "test": "build-scripts test --config build.test.json --jest-passWithNoTests" | 18 | 18 | }, | 19 | 19 | "license": "MIT", | | 41 | 41 | "build-plugin-fusion": "0.1.17-beta.0", | 42 | 42 | "build-plugin-moment-locales": "^0.1.0", | 43 | 43 | "build-plugin-react-app": "^1.8.0", | 44 | | - "fs-extra": "^9.0.1", | | 44 | + "fs-extra": "^10.0.0", | 45 | 45 | "prop-types": "^15.7.2", | 46 | 46 | "tsconfig-paths-webpack-plugin": "^3.2.0" | 47 | 47 | }, | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/src/engine-core.ts +3-4Lines changed: 3 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -176,10 +176,9 @@ export { | 176 | 176 | })(); | 177 | 177 |
| 178 | 178 | let engineInited = false; | 179 | | -export const version = '{{VERSION_PLACEHOLDER}}'; | 180 | | -const DEFAULT_VERSION = '1.0.0'; | 181 | | -const runtimeVersion = version.indexOf('VERSION_PLACEHOLDER') > -1 ? DEFAULT_VERSION : version; | 182 | | - engineConfig.set('ENGINE_VERSION', runtimeVersion); | | 179 | +// @ts-ignore webpack Define variable | | 180 | +export const version = VERSION_PLACEHOLDER; | | 181 | +engineConfig.set('ENGINE_VERSION', version); | 183 | 182 | export async function init( | 184 | 183 | container?: HTMLElement, | 185 | 184 | options?: EngineOptions, | |
Collapse file Copy file name to clipboardExpand all lines: packages/ignitor/build.plugin.js +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); | | 2 | +const fse = require('fs-extra'); | | 3 | +// read from lerna | | 4 | +const lernaConfig = JSON.parse(fse.readFileSync('../../lerna.json', 'utf8')); | | 5 | +const { version } = lernaConfig; | 2 | 6 |
| 3 | 7 | module.exports = ({ context, onGetWebpackConfig }) => { | 4 | 8 | onGetWebpackConfig((config) => { | @@ -7,6 +11,11 @@ module.exports = ({ context, onGetWebpackConfig }) => { | 7 | 11 | configFile: './tsconfig.json', | 8 | 12 | }, | 9 | 13 | ]); | | 14 | + config | | 15 | + .plugin('define') | | 16 | + .use(context.webpack.DefinePlugin, [{ | | 17 | + VERSION_PLACEHOLDER: JSON.stringify(version), | | 18 | + }]); | 10 | 19 | config.plugins.delete('hot'); | 11 | 20 | config.devServer.hot(false); | 12 | 21 | if (context.command === 'start') { | |
Collapse file Copy file name to clipboardExpand all lines: packages/ignitor/package.json +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 14 | 14 | }, | 15 | 15 | "license": "MIT", | 16 | 16 | "devDependencies": { | 17 | | - "@alib/build-scripts": "^0.1.18" | | 17 | + "@alib/build-scripts": "^0.1.18", | | 18 | + "fs-extra": "^10.0.0" | 18 | 19 | } | 19 | 20 | } |
|