@gct-paas/cli 0.0.1-dev.7.1 → 0.0.1-dev.8
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/dist/bin.cjs +5 -0
- package/dist/commands/index.cjs +21 -0
- package/dist/index.cjs +47 -0
- package/dist/interface/i-command/i-command.cjs +1 -0
- package/dist/interface/index.cjs +16 -0
- package/dist/utils/index.cjs +18 -0
- package/dist/utils/local-binaries/local-binaries.cjs +19 -0
- package/es/bin.d.ts +2 -0
- package/es/commands/index.d.ts +5 -0
- package/{dist → es}/commands/index.mjs +0 -6
- package/es/index.d.ts +2 -0
- package/{dist → es}/index.mjs +1 -1
- package/es/interface/i-command/i-command.d.ts +22 -0
- package/es/interface/index.d.ts +1 -0
- package/es/types/index.d.ts +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/local-binaries/local-binaries.d.ts +3 -0
- package/package.json +20 -54
- package/dist/commands/create-template/create-template.d.ts +0 -6
- package/dist/commands/create-template/create-template.mjs +0 -29
- package/dist/commands/update-template/update-template.d.ts +0 -6
- package/dist/commands/update-template/update-template.mjs +0 -17
- package/dist/commands/zip/zip.d.ts +0 -21
- package/dist/commands/zip/zip.mjs +0 -9
- package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +0 -9
- package/dist/core/commitlint/commitlint-config/commitlint-config.mjs +0 -28
- package/dist/core/commitlint/index.d.ts +0 -1
- package/dist/core/commitlint/index.mjs +0 -1
- package/dist/core/constants/index.d.ts +0 -12
- package/dist/core/constants/index.mjs +0 -24
- package/dist/core/eslint/eslint-config/eslint-config.d.ts +0 -9
- package/dist/core/eslint/eslint-config/eslint-config.mjs +0 -109
- package/dist/core/eslint/index.d.ts +0 -1
- package/dist/core/eslint/index.mjs +0 -1
- package/dist/core/index.d.ts +0 -8
- package/dist/core/index.mjs +0 -8
- package/dist/core/prettier/index.d.ts +0 -1
- package/dist/core/prettier/index.mjs +0 -1
- package/dist/core/prettier/prettier-config/prettier-config.d.ts +0 -22
- package/dist/core/prettier/prettier-config/prettier-config.mjs +0 -26
- package/dist/core/rollup/index.d.ts +0 -2
- package/dist/core/rollup/index.mjs +0 -2
- package/dist/core/rollup/rollup-config/dev-config.d.ts +0 -9
- package/dist/core/rollup/rollup-config/dev-config.mjs +0 -101
- package/dist/core/rollup/rollup-plugins/copy-file.d.ts +0 -37
- package/dist/core/rollup/rollup-plugins/copy-file.mjs +0 -18
- package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
- package/dist/core/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
- package/dist/core/rollup/rollup-plugins/index.d.ts +0 -2
- package/dist/core/rollup/rollup-plugins/index.mjs +0 -2
- package/dist/core/stylelint/index.d.ts +0 -1
- package/dist/core/stylelint/index.mjs +0 -1
- package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +0 -9
- package/dist/core/stylelint/stylelint-config/stylelint-config.mjs +0 -21
- package/dist/core/template/actions/create-template.d.ts +0 -16
- package/dist/core/template/actions/create-template.mjs +0 -43
- package/dist/core/template/actions/update-template.d.ts +0 -18
- package/dist/core/template/actions/update-template.mjs +0 -61
- package/dist/core/template/actions/zip.d.ts +0 -9
- package/dist/core/template/actions/zip.mjs +0 -13
- package/dist/core/template/constant/index.d.ts +0 -1
- package/dist/core/template/constant/index.mjs +0 -1
- package/dist/core/template/index.d.ts +0 -3
- package/dist/core/template/index.mjs +0 -3
- package/dist/core/util/index.d.ts +0 -17
- package/dist/core/util/index.mjs +0 -7
- package/dist/core/util/watcher/watcher.d.ts +0 -48
- package/dist/core/util/watcher/watcher.mjs +0 -97
- package/dist/core/vite/index.d.ts +0 -4
- package/dist/core/vite/index.mjs +0 -8
- package/dist/core/vite/vite-config/vite-base-config.d.ts +0 -9
- package/dist/core/vite/vite-config/vite-base-config.mjs +0 -53
- package/dist/core/vite/vite-config/vite-config.d.ts +0 -9
- package/dist/core/vite/vite-config/vite-config.mjs +0 -31
- package/dist/core/vite/vite-config/vite-dev-config.d.ts +0 -9
- package/dist/core/vite/vite-config/vite-dev-config.mjs +0 -19
- package/dist/core/vite/vite-config/vite-plugin-config.d.ts +0 -25
- package/dist/core/vite/vite-config/vite-plugin-config.mjs +0 -97
- /package/{dist → es}/bin.mjs +0 -0
- /package/{dist → es}/interface/i-command/i-command.mjs +0 -0
- /package/{dist → es}/interface/index.mjs +0 -0
- /package/{dist → es}/utils/index.mjs +0 -0
- /package/{dist → es}/utils/local-binaries/local-binaries.mjs +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { defineConfig, mergeConfig } from "vite";
|
|
2
|
-
import vue from "@vitejs/plugin-vue";
|
|
3
|
-
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
4
|
-
import { babel } from "@rollup/plugin-babel";
|
|
5
|
-
import json from "@rollup/plugin-json";
|
|
6
|
-
import path from "path";
|
|
7
|
-
import { DEFAULT_EXTERNAL } from "../../constants/index.mjs";
|
|
8
|
-
export function defineViteBaseConfig(opts = {}) {
|
|
9
|
-
const cwd = process.cwd();
|
|
10
|
-
const outDir = path.resolve(cwd, "dist");
|
|
11
|
-
return mergeConfig(
|
|
12
|
-
defineConfig({
|
|
13
|
-
css: {
|
|
14
|
-
preprocessorOptions: {
|
|
15
|
-
scss: {
|
|
16
|
-
additionalData: `@use "@gct-paas/scss/style/global.scss" as *;`
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
build: {
|
|
21
|
-
outDir,
|
|
22
|
-
rollupOptions: {
|
|
23
|
-
external: DEFAULT_EXTERNAL
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
plugins: [
|
|
27
|
-
json(),
|
|
28
|
-
vue(),
|
|
29
|
-
vueJsx(),
|
|
30
|
-
babel({
|
|
31
|
-
babelHelpers: "bundled",
|
|
32
|
-
presets: [
|
|
33
|
-
[
|
|
34
|
-
"@babel/preset-env",
|
|
35
|
-
{
|
|
36
|
-
useBuiltIns: "usage",
|
|
37
|
-
corejs: 3,
|
|
38
|
-
bugfixes: true,
|
|
39
|
-
targets: {
|
|
40
|
-
chrome: "85",
|
|
41
|
-
edge: "85",
|
|
42
|
-
firefox: "79",
|
|
43
|
-
safari: "14.1"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
]
|
|
48
|
-
})
|
|
49
|
-
]
|
|
50
|
-
}),
|
|
51
|
-
opts
|
|
52
|
-
);
|
|
53
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defineConfig, mergeConfig } from "vite";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import * as rf from "rimraf";
|
|
4
|
-
import { defineViteBaseConfig } from "./vite-base-config.mjs";
|
|
5
|
-
export function defineViteConfig(opts = {}) {
|
|
6
|
-
const cwd = process.cwd();
|
|
7
|
-
const outDir = path.resolve(cwd, "dist");
|
|
8
|
-
rf.sync(outDir);
|
|
9
|
-
return mergeConfig(
|
|
10
|
-
defineViteBaseConfig(
|
|
11
|
-
defineConfig({
|
|
12
|
-
build: {
|
|
13
|
-
lib: {
|
|
14
|
-
entry: path.resolve(cwd, "src/index.ts"),
|
|
15
|
-
formats: ["system", "cjs"],
|
|
16
|
-
fileName(format) {
|
|
17
|
-
if (format === "system" || format === "systemjs") {
|
|
18
|
-
return `[name].system.min.js`;
|
|
19
|
-
}
|
|
20
|
-
if (format === "cjs" || format === "commonjs") {
|
|
21
|
-
return `[name].min.cjs`;
|
|
22
|
-
}
|
|
23
|
-
return `[name].${format}.min.js`;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
),
|
|
29
|
-
opts
|
|
30
|
-
);
|
|
31
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineConfig, mergeConfig } from "vite";
|
|
2
|
-
import vue from "@vitejs/plugin-vue";
|
|
3
|
-
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
4
|
-
import json from "@rollup/plugin-json";
|
|
5
|
-
export function defineDevViteConfig(opts = {}) {
|
|
6
|
-
return mergeConfig(
|
|
7
|
-
defineConfig({
|
|
8
|
-
css: {
|
|
9
|
-
preprocessorOptions: {
|
|
10
|
-
scss: {
|
|
11
|
-
additionalData: `@use "@gct-paas/scss/style/global.scss" as *;`
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
plugins: [json(), vue(), vueJsx()]
|
|
16
|
-
}),
|
|
17
|
-
opts
|
|
18
|
-
);
|
|
19
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { UserConfig } from 'vite';
|
|
2
|
-
/**
|
|
3
|
-
* 设计端构建配置
|
|
4
|
-
*
|
|
5
|
-
* @export
|
|
6
|
-
* @param {UserConfig} [opts={}]
|
|
7
|
-
* @returns {*} {UserConfig}
|
|
8
|
-
*/
|
|
9
|
-
export declare function defineDesignPluginViteConfig(opts?: UserConfig): UserConfig;
|
|
10
|
-
/**
|
|
11
|
-
* 移动端插件构建配置
|
|
12
|
-
*
|
|
13
|
-
* @export
|
|
14
|
-
* @param {UserConfig} [opts={}]
|
|
15
|
-
* @returns {*} {UserConfig}
|
|
16
|
-
*/
|
|
17
|
-
export declare function defineMobilePluginViteConfig(opts?: UserConfig): UserConfig;
|
|
18
|
-
/**
|
|
19
|
-
* 网页端插件构建配置
|
|
20
|
-
*
|
|
21
|
-
* @export
|
|
22
|
-
* @param {UserConfig} [opts={}]
|
|
23
|
-
* @returns {*} {UserConfig}
|
|
24
|
-
*/
|
|
25
|
-
export declare function defineWebPluginViteConfig(opts?: UserConfig): UserConfig;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { mergeConfig } from "vite";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { defineViteBaseConfig } from "./vite-base-config.mjs";
|
|
4
|
-
const formats = ["system", "cjs"];
|
|
5
|
-
function formatFileName(format) {
|
|
6
|
-
if (format === "system" || format === "systemjs") {
|
|
7
|
-
return `[name].system.min.js`;
|
|
8
|
-
}
|
|
9
|
-
if (format === "cjs" || format === "commonjs") {
|
|
10
|
-
return `[name].min.cjs`;
|
|
11
|
-
}
|
|
12
|
-
return `[name].${format}.min.js`;
|
|
13
|
-
}
|
|
14
|
-
function assetFileNames(assetInfo, name) {
|
|
15
|
-
if (assetInfo.names.length > 0 && assetInfo.names[0].endsWith(".css")) {
|
|
16
|
-
return name + ".min.css";
|
|
17
|
-
}
|
|
18
|
-
return assetInfo.names[0];
|
|
19
|
-
}
|
|
20
|
-
export function defineDesignPluginViteConfig(opts = {}) {
|
|
21
|
-
const cwd = process.cwd();
|
|
22
|
-
const designEntry = path.resolve(cwd, "src/index.ts");
|
|
23
|
-
return mergeConfig(
|
|
24
|
-
defineViteBaseConfig({
|
|
25
|
-
build: {
|
|
26
|
-
emptyOutDir: false,
|
|
27
|
-
rollupOptions: {
|
|
28
|
-
output: {
|
|
29
|
-
assetFileNames: (assetInfo) => {
|
|
30
|
-
return assetFileNames(assetInfo, "design");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
lib: {
|
|
35
|
-
entry: {
|
|
36
|
-
design: designEntry
|
|
37
|
-
},
|
|
38
|
-
formats,
|
|
39
|
-
fileName: formatFileName
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}),
|
|
43
|
-
opts
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
export function defineMobilePluginViteConfig(opts = {}) {
|
|
47
|
-
const cwd = process.cwd();
|
|
48
|
-
const mobileEntry = path.resolve(cwd, "src/index.ts");
|
|
49
|
-
return mergeConfig(
|
|
50
|
-
defineViteBaseConfig({
|
|
51
|
-
build: {
|
|
52
|
-
emptyOutDir: false,
|
|
53
|
-
rollupOptions: {
|
|
54
|
-
output: {
|
|
55
|
-
assetFileNames: (assetInfo) => {
|
|
56
|
-
return assetFileNames(assetInfo, "mobile");
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
lib: {
|
|
61
|
-
entry: {
|
|
62
|
-
mobile: mobileEntry
|
|
63
|
-
},
|
|
64
|
-
formats,
|
|
65
|
-
fileName: formatFileName
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}),
|
|
69
|
-
opts
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
export function defineWebPluginViteConfig(opts = {}) {
|
|
73
|
-
const cwd = process.cwd();
|
|
74
|
-
const webEntry = path.resolve(cwd, "src/index.ts");
|
|
75
|
-
return mergeConfig(
|
|
76
|
-
defineViteBaseConfig({
|
|
77
|
-
build: {
|
|
78
|
-
emptyOutDir: false,
|
|
79
|
-
rollupOptions: {
|
|
80
|
-
output: {
|
|
81
|
-
assetFileNames: (assetInfo) => {
|
|
82
|
-
return assetFileNames(assetInfo, "web");
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
lib: {
|
|
87
|
-
entry: {
|
|
88
|
-
web: webEntry
|
|
89
|
-
},
|
|
90
|
-
formats,
|
|
91
|
-
fileName: formatFileName
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}),
|
|
95
|
-
opts
|
|
96
|
-
);
|
|
97
|
-
}
|
/package/{dist → es}/bin.mjs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|