GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: compatible with {} in template literals · EsonSu2000/lowcode-engine@48bc8d7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docs/docs
    • guide/expand/runtime
      • codeGeneration.md
    • specs
      • lowcode-spec.md
  • modules/code-generator
    • example-schema.json5
    • example-schema.json
    • src/plugins/project
      • framework/icejs3
        • plugins
          • buildConfig.ts
        • template/files/src/layouts/BasicLayout/components/Logo
          • index.style.ts
      • i18n.ts
    • tests/fixtures/test-cases
      • icejs3-app
        • demo1/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo2-utils-name-alias/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo2/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo3/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo4/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo5/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo6-literal-condition/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo7-literal-condition2/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo8-datasource-prop/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo9-datasource-engine/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo_10-jsslot/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
        • demo_11-jsslot-2/expected/demo-project
          • ice.config.mts
          • src
            • i18n.js
            • layouts/BasicLayout/components/Logo
              • index.module.scss
      • rax-app
        • demo01/expected/demo-project/src
          • i18n.js
        • demo02/expected/demo-project/src
          • i18n.js
        • demo03/expected/demo-project/src
          • i18n.js
        • demo04/expected/demo-project/src
          • i18n.js
        • demo05/expected/demo-project/src
          • i18n.js
        • demo06-jsslot/expected/demo-project/src
          • i18n.js
        • demo07-newline-in-props/expected/demo-project/src
          • i18n.js
        • demo08-jsslot-with-multiple-children/expected/demo-project/src
          • i18n.js
        • demo09-jsslot-with-conditional-children/expected/demo-project/src
          • i18n.js
        • demo10-jsslot-with-loop-children/expected/demo-project/src
          • i18n.js
        • demo11-utils-name-alias/expected/demo-project/src
          • i18n.js
        • demo12-refs/expected/demo-project/src
          • i18n.js
        • demo13-datasource-prop/expected/demo-project/src
          • i18n.js
      • react-app
        • demo1/expected/demo-project/src
          • i18n.js
        • demo2-utils-name-alias/expected/demo-project/src
          • i18n.js
        • demo2/expected/demo-project/src
          • i18n.js
        • demo3/expected/demo-project/src
          • i18n.js
        • demo4/expected/demo-project/src
          • i18n.js
        • demo5/expected/demo-project/src
          • i18n.js
        • demo6-literal-condition/expected/demo-project/src
          • i18n.js
        • demo7-literal-condition2/expected/demo-project/src
          • i18n.js
        • demo8-datasource-prop/expected/demo-project/src
          • i18n.js
        • demo9-datasource-engine/expected/demo-project/src
          • i18n.js
        • demo_10-jsslot/expected/demo-project/src
          • i18n.js
        • demo_11-jsslot-2/expected/demo-project/src
          • i18n.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/docs/guide/expand/runtime/codeGeneration.md‎

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 numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ sidebar_position: 1
2323
## 如何使用
2424
### 1) 通过命令行快速体验
2525

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`
2727

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)
2929

3030
### 2) 通过设计器插件快速体验
3131

@@ -112,7 +112,7 @@ await CodeGenerator.init();
112112

113113
```javascript
114114
const result = await CodeGenerator.generateCode({
115-
solution: 'icejs', // 出码方案 (目前内置有 icejs 和 rax )
115+
solution: 'icejs', // 出码方案 (目前内置有 icejs、icejs3 和 rax )
116116
schema, // 编排搭建出来的 schema
117117
});
118118

@@ -124,6 +124,7 @@ console.log(result); // 出码结果 (默认是递归结构描述的,可以传
124124
### 5)自定义出码
125125
前端框架灵活多变,默认内置的出码方案很难满足所有人的需求,好在此代码生成器支持非常灵活的插件机制 -- 内置功能大多都是通过插件完成的(在 `src/plugins`下),比如:
126126
![image.png](https://img.alicdn.com/imgextra/i1/O1CN01CEl2Hq1omnH0UCyGF_!!6000000005268-2-tps-457-376.png)
127+
127128
所以您可以通过添加自己的插件或替换掉默认内置的插件来实现您的自定义功能。
128129
为了方便自定义出码方案,出码模块还提供自定义出码方案的脚手架功能,即执行下面脚本即可生成一个自定义出码方案:
129130
```shell
Collapse file

‎docs/docs/specs/lowcode-spec.md‎

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 numberDiff line numberDiff line change
@@ -1370,11 +1370,11 @@ export const recordEvent = function(logkey, gmkey, gokey, reqMethod) {
13701370
"i18n": {
13711371
"zh-CN": {
13721372
"i18n-hello": "你好",
1373-
"i18n-chicken": "我有${count}只鸡"
1373+
"i18n-chicken": "我有{count}只鸡"
13741374
},
13751375
"en-US": {
13761376
"i18n-hello": "Hello",
1377-
"i18n-chicken": "I have ${count} chicken"
1377+
"i18n-chicken": "I have {count} chicken"
13781378
}
13791379
}
13801380
}
Collapse file

‎modules/code-generator/example-schema.json‎

Copy file name to clipboardExpand all lines: modules/code-generator/example-schema.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"lifeCycles": {
7373
"componentDidMount": {
7474
"type": "JSFunction",
75-
"value": "function() { console.log('componentDidMount'); }"
75+
"value": "function componentDidMount() { console.log('componentDidMount'); }"
7676
}
7777
},
7878
"dataSource": {
Collapse file

‎modules/code-generator/example-schema.json5‎

Copy file name to clipboardExpand all lines: modules/code-generator/example-schema.json5
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
lifeCycles: {
7373
componentDidMount: {
7474
type: 'JSFunction',
75-
value: "function() { console.log('componentDidMount'); }",
75+
value: "function componentDidMount() { console.log('componentDidMount'); }",
7676
},
7777
},
7878
dataSource: {
Collapse file

‎modules/code-generator/src/plugins/project/framework/icejs3/plugins/buildConfig.ts‎

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 numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default defineConfig(() => ({
103103
importStyle: 'sass',
104104
themePackage: '${getThemeInfo(cfg.themePackage).name}',
105105
}` : `{
106-
importStyle: true,
106+
importStyle: 'sass',
107107
}`}),
108108
locales(),
109109
plugin(),
Collapse file

‎modules/code-generator/src/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/components/Logo/index.style.ts‎

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 numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export default function getFile(): [string[], ResultFile] {
1010
display: flex;
1111
align-items: center;
1212
justify-content: center;
13-
color: $color-text1-1;
13+
color: #FF7300;
1414
font-weight: bold;
1515
font-size: 14px;
1616
line-height: 22px;
1717
1818
&:visited, &:link {
19-
color: $color-text1-1;
19+
color: #FF7300;
2020
}
2121
2222
img {
Collapse file

‎modules/code-generator/src/plugins/project/i18n.ts‎

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 numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
4141
// 按低代码规范里面的要求进行变量替换
4242
const format = (msg, variables) => (
4343
typeof msg === 'string'
44-
? msg.replace(/\\\$\\{(\\w+)\\}/g, (match, key) => variables?.[key] ?? '')
44+
? msg.replace(/\\\$?\\{(\\w+)\\}/g, (match, key) => variables?.[key] ?? '')
4545
: msg
4646
);
4747
Collapse file

‎modules/code-generator/tests/fixtures/test-cases/icejs3-app/demo1/expected/demo-project/ice.config.mts‎

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 numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default defineConfig(() => ({
8181
},
8282
plugins: [
8383
fusion({
84-
importStyle: true,
84+
importStyle: 'sass',
8585
}),
8686
locales(),
8787
plugin(),
Collapse file

‎modules/code-generator/tests/fixtures/test-cases/icejs3-app/demo1/expected/demo-project/src/i18n.js‎

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 numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const isEmptyVariables = (variables) =>
1919
// 按低代码规范里面的要求进行变量替换
2020
const format = (msg, variables) =>
2121
typeof msg === 'string'
22-
? msg.replace(/\$\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
22+
? msg.replace(/\$?\{(\w+)\}/g, (match, key) => variables?.[key] ?? '')
2323
: msg;
2424

2525
const i18nFormat = ({ id, defaultMessage, fallback }, variables) => {
Collapse file

‎modules/code-generator/tests/fixtures/test-cases/icejs3-app/demo1/expected/demo-project/src/layouts/BasicLayout/components/Logo/index.module.scss‎

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 numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
display: flex;
44
align-items: center;
55
justify-content: center;
6-
color: $color-text1-1;
6+
color: #FF7300;
77
font-weight: bold;
88
font-size: 14px;
99
line-height: 22px;
1010

1111
&:visited, &:link {
12-
color: $color-text1-1;
12+
color: #FF7300;
1313
}
1414

1515
img {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.