Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions modules/code-generator/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,7 @@ codealike.json

# types
/types

# backup files
*.bak

26 changes: 26 additions & 0 deletions modules/code-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.0.1](https://github.com/alibaba/lowcode-engine/compare/@alilc/lowcode-code-generator@1.0.0...@alilc/lowcode-code-generator@1.0.1) (2022-03-08)


### Features

* 在 skeleton 增加几个方法和事件 ([a7d436a](https://github.com/alibaba/lowcode-engine/commit/a7d436a0525a0ce0c7229710077111f283b452f4))
* modify npm private control & version ([ee55d02](https://github.com/alibaba/lowcode-engine/commit/ee55d024a7f964ccf35a0efabec817364cea8041))
* modify yuque link in README ([d522034](https://github.com/alibaba/lowcode-engine/commit/d522034879d20a7b5ed12f8fe02a30662a2ea7c6))
* remove CHANGELOG.md ([b996414](https://github.com/alibaba/lowcode-engine/commit/b996414c436b5d2439c8368eb4e001cdbcd02892))
* remove module field in material-parser package.json ([6141c27](https://github.com/alibaba/lowcode-engine/commit/6141c273c9c32eea22b5374679fe625e6ea15394))
* rename build:umd ([23c7959](https://github.com/alibaba/lowcode-engine/commit/23c795931e1d5cf43e9c21cd902441c69c1ecc63))
* replace tnpm with npm ([36caf0f](https://github.com/alibaba/lowcode-engine/commit/36caf0f18980c16f7ebb82ac845ad6b33e033567))
* support UMD packageing for react-renderer ([982d0d6](https://github.com/alibaba/lowcode-engine/commit/982d0d676b3dfbfc10a2190c0040126d6925ed37))


### Bug Fixes

* 🐛 修正一些示例地址 ([8d21283](https://github.com/alibaba/lowcode-engine/commit/8d212832e77a1ec763db668683917705774acd0d))
* 兼容 setters 为空的情况 ([56b459a](https://github.com/alibaba/lowcode-engine/commit/56b459a017a8350a911ef20f0166d1e62b6390e4))
* 修复 setup 的逻辑 ([1cfb15a](https://github.com/alibaba/lowcode-engine/commit/1cfb15aebea9796af23b2135f2aa4409d81283d7))
* 修正一些对内的地址 ([07cc1f2](https://github.com/alibaba/lowcode-engine/commit/07cc1f2954530c64a1a3d260e8d532c9e19892e8))
* 增加必要的方法 ([1b38a81](https://github.com/alibaba/lowcode-engine/commit/1b38a812653656aa02100a3b1b2a581188d1b3ef))
* fix tsconfig of material-parser ([46725cb](https://github.com/alibaba/lowcode-engine/commit/46725cb9f3166912c8f5b42f1e0b1177158c1ee3))
* lint&fix auto generated types.ts ([7dde970](https://github.com/alibaba/lowcode-engine/commit/7dde9701c7960b29523abddf32421cdbac47016d))
* The outline tree does not display the loop flag when the loop is an empty array ([191e284](https://github.com/alibaba/lowcode-engine/commit/191e284f2fa190c2b3aecb4df31849b2bdc99d38))

## 1.0.0 (2022-02-17)


Expand Down
2 changes: 1 addition & 1 deletion modules/code-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ console.log(result); // 出码结果(默认是递归结构描述的,可以传

## 参与共建

欢迎参与共建,如何共建请参阅:[./CONTRIBUTING.md](https://code.aone.alibaba-inc.com/ali-lowcode/code-generator/blob/develop/CONTRIBUTING.md)
欢迎参与共建,如何共建请参阅:[./CONTRIBUTING.md](https://github.com/alibaba/lowcode-engine/blob/main/modules/code-generator/CONTRIBUTING.md)
6 changes: 3 additions & 3 deletions modules/code-generator/example-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"type": "fetch",
"options": {
"method": "GET",
"uri": "https://shs.alibaba-inc.com/mock/1458/demo/user",
"uri": "https://shs.xxx.com/mock/1458/demo/user",
"isSync": true
},
"dataHandler": {
Expand All @@ -101,7 +101,7 @@
"type": "fetch",
"options": {
"method": "GET",
"uri": "https://shs.alibaba-inc.com/mock/1458/demo/orders",
"uri": "https://shs.xxx.com/mock/1458/demo/orders",
"isSync": true
},
"dataHandler": {
Expand Down Expand Up @@ -245,7 +245,7 @@
],
"constants": {
"ENV": "prod",
"DOMAIN": "xxx.alibaba-inc.com"
"DOMAIN": "xxx.xxx.com"
},
"css": "body {font-size: 12px;} .table { width: 100px;}",
"config": {
Expand Down
6 changes: 3 additions & 3 deletions modules/code-generator/example-schema.json5
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
type: 'fetch',
options: {
method: 'GET',
uri: 'https://shs.alibaba-inc.com/mock/1458/demo/user',
uri: 'https://shs.xxx.com/mock/1458/demo/user',
isSync: true,
},
dataHandler: {
Expand All @@ -101,7 +101,7 @@
type: 'fetch',
options: {
method: 'GET',
uri: 'https://shs.alibaba-inc.com/mock/1458/demo/orders',
uri: 'https://shs.xxx.com/mock/1458/demo/orders',
isSync: true,
},
dataHandler: {
Expand Down Expand Up @@ -245,7 +245,7 @@
],
constants: {
ENV: 'prod',
DOMAIN: 'xxx.alibaba-inc.com',
DOMAIN: 'xxx.xxx.com',
},
css: 'body {font-size: 12px;} .table { width: 100px;}',
config: {
Expand Down
5 changes: 3 additions & 2 deletions modules/code-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alilc/lowcode-code-generator",
"version": "1.0.0",
"version": "1.0.1",
"description": "出码引擎 for LowCode Engine",
"license": "MIT",
"main": "lib/index.js",
Expand Down Expand Up @@ -42,7 +42,8 @@
"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\\@ --prerelease beta && git push --follow-tags && npm publish --tag beta",
"release": "standard-version -t @alilc/lowcode-code-generator\\@ && git push --follow-tags && npm publish",
"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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ codealike.json
"type": "fetch",
"options": {
"method": "GET",
"uri": "https://shs.alibaba-inc.com/mock/1458/demo/user",
"uri": "https://shs.xxx.com/mock/1458/demo/user",
"isSync": true
},
"dataHandler": {
Expand All @@ -323,7 +323,7 @@ codealike.json
"type": "fetch",
"options": {
"method": "GET",
"uri": "https://shs.alibaba-inc.com/mock/1458/demo/orders",
"uri": "https://shs.xxx.com/mock/1458/demo/orders",
"isSync": true
},
"dataHandler": {
Expand Down Expand Up @@ -467,7 +467,7 @@ codealike.json
],
"constants": {
"ENV": "prod",
"DOMAIN": "xxx.alibaba-inc.com"
"DOMAIN": "xxx.xxx.com"
},
"css": "body {font-size: 12px;} .table { width: 100px;}",
"config": {
Expand Down Expand Up @@ -556,7 +556,7 @@ codealike.json
"author": "",
"license": "ISC",
"publishConfig": {
"registry": "https://registry.npm.alibaba-inc.com"
"registry": "https://registry.npm.xxx.com"
},
"dependencies": {
"@alilc/lowcode-code-generator": "^1.0.0-beta.16",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
},
repository: {
type: 'git',
url: 'http://gitlab.alibaba-inc.com/msd/leak-scan/tree/master',
url: 'http://gitlab.xxx.com/msd/leak-scan/tree/master',
},
private: true,
originTemplate: '@alifd/scaffold-lite-js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export type RaxFrameworkOptions = {

/**
* 构建配置
* @see https://rax.alibaba-inc.com/docs/guide/build-config
*/
buildConfig?: {
inlineStyle?: boolean | { forceEnableCSS: boolean };
Expand Down
2 changes: 0 additions & 2 deletions modules/code-generator/src/utils/jsExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { JSExpression, JSFunction, isJSExpression, isJSFunction } from '@alilc/l
import { CodeGeneratorError, IScope } from '../types';
import { transformExpressionLocalRef, ParseError } from './expressionParser';

// demo: https://riddle.alibaba-inc.com/riddles/3d4c977f

function parseFunction(content: string): t.FunctionExpression | null {
try {
const ast = parser.parse(`(${content});`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Home$$Page extends Component {
options: function () {
return {
method: 'GET',
uri: 'https://shs.alibaba-inc.com/mock/1458/demo/user',
uri: 'https://shs.xxx.com/mock/1458/demo/user',
isSync: true,
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@
id: 'urlParams',
type: 'urlParams',
},
// 示例数据源:https://shs.alibaba-inc.com/mock/1458/demo/user
// 示例数据源:https://shs.xxx.com/mock/1458/demo/user
{
id: 'user',
type: 'fetch',
options: {
method: 'GET',
uri: 'https://shs.alibaba-inc.com/mock/1458/demo/user',
uri: 'https://shs.xxx.com/mock/1458/demo/user',
isSync: true,
},
dataHandler: {
type: 'JSExpression',
value: 'function (response) {\nif (!response.success){\n throw new Error(response.message);\n }\n return response.data;\n}',
},
},
// 示例数据源:https://shs.alibaba-inc.com/mock/1458/demo/orders
// 示例数据源:https://shs.xxx.com/mock/1458/demo/orders
{
id: 'orders',
type: 'fetch',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,76 +133,4 @@
spma: 'spmademo',
creator: '张三',
},
b6ExtAttrs: {
externals: [
{
name: 'moment',
jsUrl: 'https://g.alicdn.com/code/lib/moment.js/2.29.1/moment-with-locales.min.js',
},
{
name: '@alilc/b6-setters',
jsUrl: 'https://build-success.oss-cn-hangzhou.aliyuncs.com/bundle/umd-pkg/default/library/%40ali/b6-setters/0.1.15.js',
},
{
name: 'shallowequal',
jsUrl: 'https://build-success.oss-cn-hangzhou.aliyuncs.com/bundle/umd-pkg/default/library/shallowequal/1.1.0.js',
},
{
name: 'tslib',
jsUrl: 'https://build-success.oss-cn-hangzhou.aliyuncs.com/bundle/umd-pkg/default/library/tslib/2.1.0.js',
},
{
name: 'antd',
jsUrl: 'https://g.alicdn.com/code/lib/antd/3.26.15/antd-with-locales.min.js',
cssUrl: 'https://g.alicdn.com/code/lib/antd/3.26.15/antd.min.css',
},
{
name: 'lodash',
jsUrl: 'https://g.alicdn.com/code/lib/lodash.js/4.17.20/lodash.min.js',
},
],
utils: [
{
name: 'message',
type: 'npm',
content: {
package: 'antd',
version: '3.x',
destructuring: true,
exportName: 'message',
},
},
{
name: 'modal',
type: 'npm',
content: {
package: 'antd',
version: '3.x',
destructuring: true,
exportName: 'Modal',
},
},
{
name: 'legaoBuiltin',
type: 'npm',
content: {
exportName: 'legaoBuiltin',
package: '@alilc/b6-compact-legao-builtin',
version: '1.x',
},
},
{
name: 'mocks',
type: 'npm',
content: {
package: '@alilc/b6-util-mocks',
version: '1.x',
exportName: 'mocks',
destructuring: true,
},
},
],
routerType: 'memory',
routerExact: true,
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"engines": { "node": ">=8.0.0" },
"repository": {
"type": "git",
"url": "http://gitlab.alibaba-inc.com/msd/leak-scan/tree/master"
"url": "http://gitlab.xxx.com/msd/leak-scan/tree/master"
},
"private": true,
"originTemplate": "@alifd/scaffold-lite-js"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const __$$constants = { ENV: "prod", DOMAIN: "xxx.alibaba-inc.com" };
const __$$constants = { ENV: "prod", DOMAIN: "xxx.xxx.com" };

export default __$$constants;
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Test$$Page extends React.Component {
options: function () {
return {
method: "GET",
uri: "https://shs.alibaba-inc.com/mock/1458/demo/user",
uri: "https://shs.xxx.com/mock/1458/demo/user",
isSync: true,
};
},
Expand All @@ -91,7 +91,7 @@ class Test$$Page extends React.Component {
options: function () {
return {
method: "GET",
uri: "https://shs.alibaba-inc.com/mock/1458/demo/orders",
uri: "https://shs.xxx.com/mock/1458/demo/orders",
isSync: true,
};
},
Expand Down
10 changes: 5 additions & 5 deletions modules/code-generator/test-cases/react-app/demo1/schema.json5
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,27 @@
id: 'urlParams',
type: 'urlParams',
},
// 示例数据源:https://shs.alibaba-inc.com/mock/1458/demo/user
// 示例数据源:https://shs.xxx.com/mock/1458/demo/user
{
id: 'user',
type: 'fetch',
options: {
method: 'GET',
uri: 'https://shs.alibaba-inc.com/mock/1458/demo/user',
uri: 'https://shs.xxx.com/mock/1458/demo/user',
isSync: true,
},
dataHandler: {
type: 'JSExpression',
value: 'function (response) {\nif (!response.data.success){\n throw new Error(response.data.message);\n }\n return response.data.data;\n}',
},
},
// 示例数据源:https://shs.alibaba-inc.com/mock/1458/demo/orders
// 示例数据源:https://shs.xxx.com/mock/1458/demo/orders
{
id: 'orders',
type: 'fetch',
options: {
method: 'GET',
uri: "https://shs.alibaba-inc.com/mock/1458/demo/orders",
uri: "https://shs.xxx.com/mock/1458/demo/orders",
isSync: true,
},
dataHandler: {
Expand Down Expand Up @@ -245,7 +245,7 @@
],
"constants": {
"ENV": "prod",
"DOMAIN": "xxx.alibaba-inc.com"
"DOMAIN": "xxx.xxx.com"
},
"css": "body {font-size: 12px;} .table { width: 100px;}",
"config": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"engines": { "node": ">=8.0.0" },
"repository": {
"type": "git",
"url": "http://gitlab.alibaba-inc.com/msd/leak-scan/tree/master"
"url": "http://gitlab.xxx.com/msd/leak-scan/tree/master"
},
"private": true,
"originTemplate": "@alifd/scaffold-lite-js"
Expand Down
Loading