gant-core 0.0.1
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/bin/index.js +9 -0
- package/lib/cli/index.js +73272 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/template/core.txt +1 -0
- package/lib/cli/template/gantIndex.txt +18 -0
- package/lib/cli/template/index.html +10 -0
- package/lib/cli/template/template.config.txt +8 -0
- package/lib/cli/template/template.package.json +21 -0
- package/lib/cli/template/template.proxy.ts +12 -0
- package/lib/cli/template/template.routes.ts +2 -0
- package/lib/cli/template/template.setting.ts +1 -0
- package/lib/cli/template/template.vue.config.txt +9 -0
- package/lib/cli/template/template.vue.package.json +20 -0
- package/lib/cli/template/tsconfig.react.template.json +22 -0
- package/lib/cli/template/tsconfig.vue.template.json +21 -0
- package/lib/cli/template/types.d.ts +149 -0
- package/lib/cli/template/types.d.txt +145 -0
- package/lib/index.d.ts +2278 -0
- package/lib/index.js +6151 -0
- package/lib/index.js.map +1 -0
- package/package.json +87 -0
- package/rollup.config.js +94 -0
- package/tsconfig.json +26 -0
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gant-core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"gant-cli": "bin/index.js"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@ant-design/colors": "^7.0.2",
|
|
11
|
+
"@babel/preset-env": "^7.24.0",
|
|
12
|
+
"@babel/preset-react": "^7.23.3",
|
|
13
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
14
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
15
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
16
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
17
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
18
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
19
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
20
|
+
"@root/walk": "^1.1.0",
|
|
21
|
+
"@types/crypto-js": "^4.2.2",
|
|
22
|
+
"@types/ejs": "^3.1.5",
|
|
23
|
+
"@types/html-minifier-terser": "^7.0.2",
|
|
24
|
+
"@types/inquirer": "^9.0.7",
|
|
25
|
+
"@types/lodash-es": "^4.17.12",
|
|
26
|
+
"@types/node": "^20.11.16",
|
|
27
|
+
"@types/tmp": "^0.2.6",
|
|
28
|
+
"babel-loader": "^9.1.3",
|
|
29
|
+
"cli-progress": "^3.12.0",
|
|
30
|
+
"commander": "^11.1.0",
|
|
31
|
+
"css-loader": "^6.10.0",
|
|
32
|
+
"css-minimizer-webpack-plugin": "^6.0.0",
|
|
33
|
+
"ejs": "^3.1.9",
|
|
34
|
+
"fast-glob": "^3.3.2",
|
|
35
|
+
"file-loader": "^6.2.0",
|
|
36
|
+
"fs": "^0.0.1-security",
|
|
37
|
+
"html-loader": "^5.0.0",
|
|
38
|
+
"html-webpack-tags-plugin": "^3.0.2",
|
|
39
|
+
"i18next": "^23.10.1",
|
|
40
|
+
"inquirer": "^9.2.14",
|
|
41
|
+
"js-base64": "^3.7.7",
|
|
42
|
+
"less-loader": "^12.2.0",
|
|
43
|
+
"lodash-es": "^4.17.21",
|
|
44
|
+
"md5-node": "^1.0.1",
|
|
45
|
+
"mini-css-extract-plugin": "^2.8.1",
|
|
46
|
+
"path": "^0.12.7",
|
|
47
|
+
"picocolors": "^1.0.0",
|
|
48
|
+
"postcss": "^8.4.35",
|
|
49
|
+
"postcss-loader": "^8.1.1",
|
|
50
|
+
"postcss-preset-env": "^9.5.1",
|
|
51
|
+
"postcss-short": "^5.0.0",
|
|
52
|
+
"rollup": "^4.9.6",
|
|
53
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
54
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
55
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
56
|
+
"style-loader": "^3.3.4",
|
|
57
|
+
"swc-loader": "^0.2.6",
|
|
58
|
+
"tmp": "^0.2.3",
|
|
59
|
+
"ts-loader": "^9.5.1",
|
|
60
|
+
"typescript": "^5.3.3",
|
|
61
|
+
"url": "^0.11.3",
|
|
62
|
+
"url-loader": "^4.1.1",
|
|
63
|
+
"vue-loader": "^17.4.2"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "rollup --config rollup.config.js",
|
|
67
|
+
"dev": "rollup --config rollup.config.js --watch",
|
|
68
|
+
"publish": "npm publish --registry=https://registry.npmjs.org/"
|
|
69
|
+
},
|
|
70
|
+
"author": "vvey",
|
|
71
|
+
"license": "ISC",
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"ts-loader": "^9.5.1"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"axios": "^1.6.8",
|
|
77
|
+
"chokidar": "^3.6.0",
|
|
78
|
+
"crypto-js": "^4.2.0",
|
|
79
|
+
"esbuild": "^0.20.1",
|
|
80
|
+
"html-webpack-plugin": "^5.0.0",
|
|
81
|
+
"mitt": "^3.0.1",
|
|
82
|
+
"prettier": "^3.2.5",
|
|
83
|
+
"webpack": "^5.90.3",
|
|
84
|
+
"webpack-bundle-analyzer": "^4.10.1",
|
|
85
|
+
"webpack-dev-server": "^5.0.3"
|
|
86
|
+
}
|
|
87
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const typescript = require('rollup-plugin-typescript2');
|
|
2
|
+
const commonjs = require('@rollup/plugin-commonjs');
|
|
3
|
+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
|
|
4
|
+
const alias = require('@rollup/plugin-alias');
|
|
5
|
+
const json = require('@rollup/plugin-json');
|
|
6
|
+
const copy = require('rollup-plugin-copy');
|
|
7
|
+
const { dts } = require('rollup-plugin-dts');
|
|
8
|
+
|
|
9
|
+
const plugins = [
|
|
10
|
+
typescript({
|
|
11
|
+
exclude: 'node_modules',
|
|
12
|
+
tsconfig: './tsconfig.json',
|
|
13
|
+
}),
|
|
14
|
+
nodeResolve({
|
|
15
|
+
preferBuiltins: true,
|
|
16
|
+
exportConditions: ['node'],
|
|
17
|
+
}),
|
|
18
|
+
commonjs(),
|
|
19
|
+
json(),
|
|
20
|
+
// terser(),
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
module.exports = [
|
|
24
|
+
{
|
|
25
|
+
input: 'src/cli/index.ts', // 入口文件
|
|
26
|
+
output: {
|
|
27
|
+
file: 'lib/cli/index.js', // 输出文件
|
|
28
|
+
format: 'cjs', // 输出格式设置为 es
|
|
29
|
+
banner: '#!/usr/bin/env node', // 添加shebang,使得生成的文件可以直接作为可执行文件使用
|
|
30
|
+
sourcemap: true,
|
|
31
|
+
},
|
|
32
|
+
external: [
|
|
33
|
+
'prettier',
|
|
34
|
+
'esbuild',
|
|
35
|
+
'webpack',
|
|
36
|
+
'webpack-dev-server',
|
|
37
|
+
'html-webpack-plugin',
|
|
38
|
+
'webpack-bundle-analyzer',
|
|
39
|
+
'chokidar',
|
|
40
|
+
],
|
|
41
|
+
plugins: [
|
|
42
|
+
...plugins,
|
|
43
|
+
copy({
|
|
44
|
+
targets: [
|
|
45
|
+
{ src: 'src/cli/template', dest: 'lib/cli' },
|
|
46
|
+
{ src: 'src/cli/config/index.html', dest: 'lib/cli' },
|
|
47
|
+
],
|
|
48
|
+
}),
|
|
49
|
+
alias({
|
|
50
|
+
entries: [{ find: '@cli', replacement: 'src/cli' }],
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
watch: {
|
|
54
|
+
exclude: 'node_modules/**',
|
|
55
|
+
include: 'src/cli/**',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
input: 'src/index.ts', // 入口文件
|
|
60
|
+
output: {
|
|
61
|
+
format: 'es',
|
|
62
|
+
file: 'lib/index.js',
|
|
63
|
+
sourcemap: true,
|
|
64
|
+
},
|
|
65
|
+
external: [
|
|
66
|
+
'lodash-es',
|
|
67
|
+
'axios',
|
|
68
|
+
'crypto-js',
|
|
69
|
+
'mitt',
|
|
70
|
+
'webpack',
|
|
71
|
+
'webpack-dev-server',
|
|
72
|
+
],
|
|
73
|
+
plugins: [
|
|
74
|
+
...plugins,
|
|
75
|
+
alias({
|
|
76
|
+
entries: [{ find: '@core', replacement: 'src/core' }],
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
input: 'src/index.ts',
|
|
82
|
+
output: [{ file: 'lib/index.d.ts', format: 'es' }],
|
|
83
|
+
plugins: [
|
|
84
|
+
dts({
|
|
85
|
+
compilerOptions: {
|
|
86
|
+
paths: {
|
|
87
|
+
'@core/*': ['src/core/*'],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
],
|
|
92
|
+
external: [/\.(css|node)$/],
|
|
93
|
+
},
|
|
94
|
+
];
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"baseUrl": "./",
|
|
6
|
+
"target": "esnext",
|
|
7
|
+
"lib": ["esnext", "dom"],
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noImplicitReturns": true,
|
|
14
|
+
"allowJs": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"experimentalDecorators": true,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"paths": {
|
|
19
|
+
"@cli/*": ["src/cli/*"],
|
|
20
|
+
"@core/*": ["src/core/*"]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"include": ["src/**/*", "src/cli/types.d.ts", "config/b.ts"],
|
|
24
|
+
"exclude": ["node_modules"],
|
|
25
|
+
"allowImportingTsExtensions": [".ts", ".js"]
|
|
26
|
+
}
|