@appthen/cli 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/.eslintignore +16 -0
- package/.eslintrc.js +13 -0
- package/.gitignore +106 -0
- package/.prettierignore +1 -0
- package/.prettierrc +5 -0
- package/CHANGELOG.md +0 -0
- package/CONTRIBUTING.md +19 -0
- package/README.md +13 -0
- package/bin/code-generator.js +68 -0
- package/dist/index.js +48 -0
- package/jest.config.js +5 -0
- package/package.json +95 -0
- package/tests/basic.test.ts +4 -0
- package/tsconfig.json +26 -0
package/.editorconfig
ADDED
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: 'eslint-config-ali/typescript/react',
|
|
3
|
+
rules: {
|
|
4
|
+
'max-len': ['error', { code: 500 }],
|
|
5
|
+
'comma-dangle': 0,
|
|
6
|
+
'@typescript-eslint/no-unused-vars': 0,
|
|
7
|
+
'guard-for-in': 0,
|
|
8
|
+
'no-await-in-loop': 0,
|
|
9
|
+
'no-console': 0,
|
|
10
|
+
'no-lonely-if': 0,
|
|
11
|
+
'prefer-template': 0
|
|
12
|
+
},
|
|
13
|
+
};
|
package/.gitignore
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# project custom
|
|
2
|
+
build
|
|
3
|
+
es
|
|
4
|
+
lib
|
|
5
|
+
dist
|
|
6
|
+
output
|
|
7
|
+
package-lock.json
|
|
8
|
+
deploy-space/packages
|
|
9
|
+
deploy-space/.env
|
|
10
|
+
generated
|
|
11
|
+
cache
|
|
12
|
+
|
|
13
|
+
# IDE
|
|
14
|
+
.vscode
|
|
15
|
+
.idea
|
|
16
|
+
|
|
17
|
+
# Logs
|
|
18
|
+
logs
|
|
19
|
+
*.log
|
|
20
|
+
npm-debug.log*
|
|
21
|
+
yarn-debug.log*
|
|
22
|
+
yarn-error.log*
|
|
23
|
+
lerna-debug.log*
|
|
24
|
+
|
|
25
|
+
# Runtime data
|
|
26
|
+
pids
|
|
27
|
+
*.pid
|
|
28
|
+
*.seed
|
|
29
|
+
*.pid.lock
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
33
|
+
lib-cov
|
|
34
|
+
|
|
35
|
+
# Coverage directory used by tools like istanbul
|
|
36
|
+
coverage
|
|
37
|
+
|
|
38
|
+
# nyc test coverage
|
|
39
|
+
.nyc_output
|
|
40
|
+
|
|
41
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
42
|
+
.grunt
|
|
43
|
+
|
|
44
|
+
# Bower dependency directory (https://bower.io/)
|
|
45
|
+
bower_components
|
|
46
|
+
|
|
47
|
+
# node-waf configuration
|
|
48
|
+
.lock-wscript
|
|
49
|
+
|
|
50
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
51
|
+
build/Release
|
|
52
|
+
lib
|
|
53
|
+
|
|
54
|
+
# Dependency directories
|
|
55
|
+
node_modules/
|
|
56
|
+
jspm_packages/
|
|
57
|
+
|
|
58
|
+
# TypeScript v1 declaration files
|
|
59
|
+
typings/
|
|
60
|
+
|
|
61
|
+
# Optional npm cache directory
|
|
62
|
+
.npm
|
|
63
|
+
|
|
64
|
+
# Optional eslint cache
|
|
65
|
+
.eslintcache
|
|
66
|
+
|
|
67
|
+
# Optional REPL history
|
|
68
|
+
.node_repl_history
|
|
69
|
+
|
|
70
|
+
# Output of 'npm pack'
|
|
71
|
+
*.tgz
|
|
72
|
+
|
|
73
|
+
# Yarn Integrity file
|
|
74
|
+
.yarn-integrity
|
|
75
|
+
|
|
76
|
+
# dotenv environment variables file
|
|
77
|
+
.env
|
|
78
|
+
.env.test
|
|
79
|
+
|
|
80
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
81
|
+
.cache
|
|
82
|
+
|
|
83
|
+
# next.js build output
|
|
84
|
+
.next
|
|
85
|
+
|
|
86
|
+
# nuxt.js build output
|
|
87
|
+
.nuxt
|
|
88
|
+
|
|
89
|
+
# vuepress build output
|
|
90
|
+
.vuepress/dist
|
|
91
|
+
|
|
92
|
+
# Serverless directories
|
|
93
|
+
.serverless/
|
|
94
|
+
|
|
95
|
+
# FuseBox cache
|
|
96
|
+
.fusebox/
|
|
97
|
+
|
|
98
|
+
# DynamoDB Local files
|
|
99
|
+
.dynamodb/
|
|
100
|
+
|
|
101
|
+
# mac config files
|
|
102
|
+
.DS_Store
|
|
103
|
+
|
|
104
|
+
# codealike
|
|
105
|
+
codealike.json
|
|
106
|
+
.node
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/test-cases/
|
package/.prettierrc
ADDED
package/CHANGELOG.md
ADDED
|
File without changes
|
package/CONTRIBUTING.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-var */
|
|
3
|
+
/* eslint-disable prefer-arrow-callback */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
5
|
+
|
|
6
|
+
const pkg = require('../package.json');
|
|
7
|
+
|
|
8
|
+
var program = require('commander');
|
|
9
|
+
|
|
10
|
+
program
|
|
11
|
+
.command('generate', { isDefault: true })
|
|
12
|
+
.description('Generate code from ali lowcode schema')
|
|
13
|
+
.requiredOption('-p, --id <id>', 'project id')
|
|
14
|
+
.requiredOption('-a, --auth <auth>', 'auth token')
|
|
15
|
+
.option('-cc, --clear <clear>', 'clear cache')
|
|
16
|
+
// .option('-i, --input <input>', 'specify the input schema file')
|
|
17
|
+
.option('-o, --output <output>', 'specify the output directory', 'generated')
|
|
18
|
+
.option('-fn, --filter <filter>', 'filter docments')
|
|
19
|
+
.option('-fd, --folder <folder>', 'filter docments by folder')
|
|
20
|
+
.option('-fr, --frame <frame>', 'code frame web or app')
|
|
21
|
+
.option('-env, --env <env>', 'lowcode env')
|
|
22
|
+
.option('-c, --cwd <cwd>', 'specify the working directory', '.')
|
|
23
|
+
.option(
|
|
24
|
+
'-q, --quiet',
|
|
25
|
+
'be quiet, do not output anything unless get error',
|
|
26
|
+
false
|
|
27
|
+
)
|
|
28
|
+
.option('-vb, --verbose', 'be verbose, output more information', false)
|
|
29
|
+
.arguments('[input-schema] ali lowcode schema JSON file')
|
|
30
|
+
.action(function doGenerate(inputSchema, command) {
|
|
31
|
+
var options = command.opts();
|
|
32
|
+
if (options.cwd) {
|
|
33
|
+
process.chdir(options.cwd);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
require('../dist/index.js')
|
|
37
|
+
.run(inputSchema ? [inputSchema] : [], options)
|
|
38
|
+
.then((retCode) => {
|
|
39
|
+
process.exit(retCode);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
program
|
|
44
|
+
.command('version', { isDefault: false })
|
|
45
|
+
.description('show cli version')
|
|
46
|
+
.action(function doGenerate(inputSchema, command) {
|
|
47
|
+
console.log('version: ', pkg.version);
|
|
48
|
+
process.exit();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
program
|
|
52
|
+
.command('release-material', { isDefault: false })
|
|
53
|
+
.description('release material and upload to cdn')
|
|
54
|
+
.requiredOption('-a, --auth <auth>', 'auth token')
|
|
55
|
+
.action(function doGenerate(command) {
|
|
56
|
+
var options = command?.opts?.() || {};
|
|
57
|
+
if (options.cwd) {
|
|
58
|
+
process.chdir(options.cwd);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
require('../dist/index.js')
|
|
62
|
+
.releaseMaterial(options)
|
|
63
|
+
.then((retCode) => {
|
|
64
|
+
process.exit(retCode);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
program.parse(process.argv);
|