GeezerVison is showing github.com — fix: compatible with {} in template literals · EsonSu2000/lowcode-engine@48bc8d7
File treeExpand file treeCollapse file tree Open diff view settings template/files/src/layouts/BasicLayout/components/Logo
tests/fixtures/test-cases demo1/expected/demo-project layouts/BasicLayout/components/Logo
demo2-utils-name-alias/expected/demo-project layouts/BasicLayout/components/Logo
demo2/expected/demo-project layouts/BasicLayout/components/Logo
demo3/expected/demo-project layouts/BasicLayout/components/Logo
demo4/expected/demo-project layouts/BasicLayout/components/Logo
demo5/expected/demo-project layouts/BasicLayout/components/Logo
demo6-literal-condition/expected/demo-project layouts/BasicLayout/components/Logo
demo7-literal-condition2/expected/demo-project layouts/BasicLayout/components/Logo
demo8-datasource-prop/expected/demo-project layouts/BasicLayout/components/Logo
demo9-datasource-engine/expected/demo-project layouts/BasicLayout/components/Logo
demo_10-jsslot/expected/demo-project layouts/BasicLayout/components/Logo
demo_11-jsslot-2/expected/demo-project layouts/BasicLayout/components/Logo
demo01/expected/demo-project/src demo02/expected/demo-project/src demo03/expected/demo-project/src demo04/expected/demo-project/src demo05/expected/demo-project/src demo06-jsslot/expected/demo-project/src demo07-newline-in-props/expected/demo-project/src demo08-jsslot-with-multiple-children/expected/demo-project/src demo09-jsslot-with-conditional-children/expected/demo-project/src demo10-jsslot-with-loop-children/expected/demo-project/src demo11-utils-name-alias/expected/demo-project/src demo12-refs/expected/demo-project/src demo13-datasource-prop/expected/demo-project/src
demo1/expected/demo-project/src demo2-utils-name-alias/expected/demo-project/src demo2/expected/demo-project/src demo3/expected/demo-project/src demo4/expected/demo-project/src demo5/expected/demo-project/src demo6-literal-condition/expected/demo-project/src demo7-literal-condition2/expected/demo-project/src demo8-datasource-prop/expected/demo-project/src demo9-datasource-engine/expected/demo-project/src demo_10-jsslot/expected/demo-project/src demo_11-jsslot-2/expected/demo-project/src
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: docs/docs/guide/expand/runtime/codeGeneration.md +4-3Lines changed: 4 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,9 +23,9 @@ sidebar_position: 1 | 23 | 23 | ## 如何使用 | 24 | 24 | ### 1) 通过命令行快速体验 | 25 | 25 |
| 26 | | -欢迎使用命令行工具快速体验:`npx @alilc/lowcode-code-generator -i example-schema.json -o generated -s icejs` | | 26 | +欢迎使用命令行工具快速体验:`npx @alilc/lowcode-code-generator -i example-schema.json -o generated -s icejs3` | 27 | 27 |
| 28 | | ---其中 example-schema.json 可以从[这里下载](https://unpkg.com/@alilc/lowcode-code-generator@beta/example-schema.json) | | 28 | +--其中 example-schema.json 可以从[这里下载](https://alifd.alicdn.com/npm/@alilc/lowcode-code-generator@latest/example-schema.json) | 29 | 29 |
| 30 | 30 | ### 2) 通过设计器插件快速体验 | 31 | 31 |
| @@ -112,7 +112,7 @@ await CodeGenerator.init(); | 112 | 112 |
| 113 | 113 | ```javascript | 114 | 114 | const result = await CodeGenerator.generateCode({ | 115 | | - solution: 'icejs', // 出码方案 (目前内置有 icejs 和 rax ) | | 115 | + solution: 'icejs', // 出码方案 (目前内置有 icejs、icejs3 和 rax ) | 116 | 116 | schema, // 编排搭建出来的 schema | 117 | 117 | }); | 118 | 118 |
| @@ -124,6 +124,7 @@ console.log(result); // 出码结果 (默认是递归结构描述的,可以传 | 124 | 124 | ### 5)自定义出码 | 125 | 125 | 前端框架灵活多变,默认内置的出码方案很难满足所有人的需求,好在此代码生成器支持非常灵活的插件机制 -- 内置功能大多都是通过插件完成的(在 `src/plugins`下),比如: | 126 | 126 |  | | 127 | + | 127 | 128 | 所以您可以通过添加自己的插件或替换掉默认内置的插件来实现您的自定义功能。 | 128 | 129 | 为了方便自定义出码方案,出码模块还提供自定义出码方案的脚手架功能,即执行下面脚本即可生成一个自定义出码方案: | 129 | 130 | ```shell | |
Collapse file Copy file name to clipboardExpand all lines: docs/docs/specs/lowcode-spec.md +2-2Lines changed: 2 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1370,11 +1370,11 @@ export const recordEvent = function(logkey, gmkey, gokey, reqMethod) { | 1370 | 1370 | "i18n": { | 1371 | 1371 | "zh-CN": { | 1372 | 1372 | "i18n-hello": "你好", | 1373 | | - "i18n-chicken": "我有${count}只鸡" | | 1373 | + "i18n-chicken": "我有{count}只鸡" | 1374 | 1374 | }, | 1375 | 1375 | "en-US": { | 1376 | 1376 | "i18n-hello": "Hello", | 1377 | | - "i18n-chicken": "I have ${count} chicken" | | 1377 | + "i18n-chicken": "I have {count} chicken" | 1378 | 1378 | } | 1379 | 1379 | } | 1380 | 1380 | } | |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/example-schema.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 72 | 72 | "lifeCycles": { | 73 | 73 | "componentDidMount": { | 74 | 74 | "type": "JSFunction", | 75 | | - "value": "function() { console.log('componentDidMount'); }" | | 75 | + "value": "function componentDidMount() { console.log('componentDidMount'); }" | 76 | 76 | } | 77 | 77 | }, | 78 | 78 | "dataSource": { | |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/example-schema.json5 +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 72 | 72 | lifeCycles: { | 73 | 73 | componentDidMount: { | 74 | 74 | type: 'JSFunction', | 75 | | - value: "function() { console.log('componentDidMount'); }", | | 75 | + value: "function componentDidMount() { console.log('componentDidMount'); }", | 76 | 76 | }, | 77 | 77 | }, | 78 | 78 | dataSource: { | |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/src/plugins/project/framework/icejs3/plugins/buildConfig.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -103,7 +103,7 @@ export default defineConfig(() => ({ | 103 | 103 | importStyle: 'sass', | 104 | 104 | themePackage: '${getThemeInfo(cfg.themePackage).name}', | 105 | 105 | }` : `{ | 106 | | - importStyle: true, | | 106 | + importStyle: 'sass', | 107 | 107 | }`}), | 108 | 108 | locales(), | 109 | 109 | plugin(), | |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/src/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/components/Logo/index.style.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,13 +10,13 @@ export default function getFile(): [string[], ResultFile] { | 10 | 10 | display: flex; | 11 | 11 | align-items: center; | 12 | 12 | justify-content: center; | 13 | | - color: $color-text1-1; | | 13 | + color: #FF7300; | 14 | 14 | font-weight: bold; | 15 | 15 | font-size: 14px; | 16 | 16 | line-height: 22px; | 17 | 17 |
| 18 | 18 | &:visited, &:link { | 19 | | - color: $color-text1-1; | | 19 | + color: #FF7300; | 20 | 20 | } | 21 | 21 |
| 22 | 22 | img { | |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/src/plugins/project/i18n.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -41,7 +41,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => { | 41 | 41 | // 按低代码规范里面的要求进行变量替换 | 42 | 42 | const format = (msg, variables) => ( | 43 | 43 | typeof msg === 'string' | 44 | | - ? msg.replace(/\\\$\\{(\\w+)\\}/g, (match, key) => variables?.[key] ?? '') | | 44 | + ? msg.replace(/\\\$?\\{(\\w+)\\}/g, (match, key) => variables?.[key] ?? '') | 45 | 45 | : msg | 46 | 46 | ); | 47 | 47 |
| |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/tests/fixtures/test-cases/icejs3-app/demo1/expected/demo-project/ice.config.mts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -81,7 +81,7 @@ export default defineConfig(() => ({ | 81 | 81 | }, | 82 | 82 | plugins: [ | 83 | 83 | fusion({ | 84 | | - importStyle: true, | | 84 | + importStyle: 'sass', | 85 | 85 | }), | 86 | 86 | locales(), | 87 | 87 | plugin(), | |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/tests/fixtures/test-cases/icejs3-app/demo1/expected/demo-project/src/i18n.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,7 +19,7 @@ const isEmptyVariables = (variables) => | 19 | 19 | // 按低代码规范里面的要求进行变量替换 | 20 | 20 | const format = (msg, variables) => | 21 | 21 | typeof msg === 'string' | 22 | | - ? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '') | | 22 | + ? msg.replace(/\$?\{(\w+)\}/g, (match, key) => variables?.[key] ?? '') | 23 | 23 | : msg; | 24 | 24 |
| 25 | 25 | const i18nFormat = ({ id, defaultMessage, fallback }, variables) => { | |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/tests/fixtures/test-cases/icejs3-app/demo1/expected/demo-project/src/layouts/BasicLayout/components/Logo/index.module.scss +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | display: flex; | 4 | 4 | align-items: center; | 5 | 5 | justify-content: center; | 6 | | - color: $color-text1-1; | | 6 | + color: #FF7300; | 7 | 7 | font-weight: bold; | 8 | 8 | font-size: 14px; | 9 | 9 | line-height: 22px; | 10 | 10 |
| 11 | 11 | &:visited, &:link { | 12 | | - color: $color-text1-1; | | 12 | + color: #FF7300; | 13 | 13 | } | 14 | 14 |
| 15 | 15 | img { | |
|