@varlet/cli 2.10.0 → 2.10.1-alpha.1682608027166
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/lib/client/appType.d.ts +4 -4
- package/lib/client/appType.js +7 -7
- package/lib/client/index.d.ts +18 -18
- package/lib/client/index.js +109 -109
- package/lib/node/bin.d.ts +2 -2
- package/lib/node/bin.js +148 -148
- package/lib/node/commands/build.d.ts +1 -1
- package/lib/node/commands/build.js +15 -15
- package/lib/node/commands/changelog.d.ts +5 -5
- package/lib/node/commands/changelog.js +20 -20
- package/lib/node/commands/checklist.d.ts +6 -6
- package/lib/node/commands/checklist.js +64 -64
- package/lib/node/commands/commitLint.d.ts +4 -4
- package/lib/node/commands/commitLint.js +19 -19
- package/lib/node/commands/compile.d.ts +3 -3
- package/lib/node/commands/compile.js +31 -31
- package/lib/node/commands/create.d.ts +7 -7
- package/lib/node/commands/create.js +91 -91
- package/lib/node/commands/dev.d.ts +6 -6
- package/lib/node/commands/dev.js +42 -42
- package/lib/node/commands/extension.d.ts +3 -3
- package/lib/node/commands/extension.js +5 -5
- package/lib/node/commands/gen.d.ts +7 -7
- package/lib/node/commands/gen.js +68 -68
- package/lib/node/commands/icons.d.ts +1 -1
- package/lib/node/commands/icons.js +82 -82
- package/lib/node/commands/jest.d.ts +7 -7
- package/lib/node/commands/jest.js +27 -27
- package/lib/node/commands/lint.d.ts +1 -1
- package/lib/node/commands/lint.js +42 -42
- package/lib/node/commands/preview.d.ts +1 -1
- package/lib/node/commands/preview.js +18 -18
- package/lib/node/commands/release.d.ts +5 -5
- package/lib/node/commands/release.js +150 -150
- package/lib/node/commands/vite.d.ts +2 -2
- package/lib/node/commands/vite.js +14 -14
- package/lib/node/compiler/compileModule.d.ts +4 -4
- package/lib/node/compiler/compileModule.js +71 -71
- package/lib/node/compiler/compileSFC.d.ts +6 -6
- package/lib/node/compiler/compileSFC.js +97 -96
- package/lib/node/compiler/compileScript.d.ts +13 -13
- package/lib/node/compiler/compileScript.js +126 -126
- package/lib/node/compiler/compileSiteEntry.d.ts +18 -18
- package/lib/node/compiler/compileSiteEntry.js +121 -121
- package/lib/node/compiler/compileStyle.d.ts +10 -10
- package/lib/node/compiler/compileStyle.js +41 -41
- package/lib/node/compiler/compileTemplateHighlight.d.ts +18 -18
- package/lib/node/compiler/compileTemplateHighlight.js +128 -128
- package/lib/node/compiler/compileTypes.d.ts +2 -2
- package/lib/node/compiler/compileTypes.js +40 -40
- package/lib/node/config/varlet.config.d.ts +73 -73
- package/lib/node/config/varlet.config.js +27 -27
- package/lib/node/config/varlet.default.config.d.ts +2 -2
- package/lib/node/config/varlet.default.config.js +271 -271
- package/lib/node/config/vite.config.d.ts +13 -13
- package/lib/node/config/vite.config.js +115 -115
- package/lib/node/index.d.ts +15 -15
- package/lib/node/index.js +15 -15
- package/lib/node/shared/constant.d.ts +51 -51
- package/lib/node/shared/constant.js +58 -58
- package/lib/node/shared/fsUtils.d.ts +15 -15
- package/lib/node/shared/fsUtils.js +54 -54
- package/lib/node/shared/logger.d.ts +8 -8
- package/lib/node/shared/logger.js +18 -18
- package/package.json +7 -7
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import vue from '@vitejs/plugin-vue';
|
|
2
|
-
import jsx from '@vitejs/plugin-vue-jsx';
|
|
3
|
-
import { markdown, html, inlineCss, copy } from '@varlet/vite-plugins';
|
|
4
|
-
import { ES_DIR, SITE_CONFIG, SITE_DIR, SITE_MOBILE_ROUTES, SITE_OUTPUT_PATH, SITE_PC_ROUTES, SITE_PUBLIC_PATH, VITE_RESOLVE_EXTENSIONS, EXTENSION_ENTRY, } from '../shared/constant.js';
|
|
5
|
-
import { get } from 'lodash-es';
|
|
6
|
-
import { resolve } from 'path';
|
|
7
|
-
export function getDevConfig(varletConfig) {
|
|
8
|
-
const defaultLanguage = get(varletConfig, 'defaultLanguage');
|
|
9
|
-
const host = get(varletConfig, 'host');
|
|
10
|
-
return {
|
|
11
|
-
root: SITE_DIR,
|
|
12
|
-
resolve: {
|
|
13
|
-
extensions: VITE_RESOLVE_EXTENSIONS,
|
|
14
|
-
alias: {
|
|
15
|
-
'@config': SITE_CONFIG,
|
|
16
|
-
'@pc-routes': SITE_PC_ROUTES,
|
|
17
|
-
'@mobile-routes': SITE_MOBILE_ROUTES,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
server: {
|
|
21
|
-
port: get(varletConfig, 'port'),
|
|
22
|
-
host: host === 'localhost' ? '0.0.0.0' : host,
|
|
23
|
-
},
|
|
24
|
-
publicDir: SITE_PUBLIC_PATH,
|
|
25
|
-
plugins: [
|
|
26
|
-
vue({
|
|
27
|
-
include: [/\.vue$/, /\.md$/],
|
|
28
|
-
}),
|
|
29
|
-
jsx(),
|
|
30
|
-
markdown({ style: get(varletConfig, 'highlight.style') }),
|
|
31
|
-
copy({ paths: get(varletConfig, 'copy', []) }),
|
|
32
|
-
html({
|
|
33
|
-
data: {
|
|
34
|
-
logo: get(varletConfig, `logo`),
|
|
35
|
-
baidu: get(varletConfig, `analysis.baidu`, ''),
|
|
36
|
-
pcTitle: get(varletConfig, `pc.title['${defaultLanguage}']`),
|
|
37
|
-
mobileTitle: get(varletConfig, `mobile.title['${defaultLanguage}']`),
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
],
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export function getBuildConfig(varletConfig) {
|
|
44
|
-
const devConfig = getDevConfig(varletConfig);
|
|
45
|
-
return Object.assign(Object.assign({}, devConfig), { base: './', build: {
|
|
46
|
-
outDir: SITE_OUTPUT_PATH,
|
|
47
|
-
reportCompressedSize: false,
|
|
48
|
-
emptyOutDir: true,
|
|
49
|
-
cssTarget: 'chrome61',
|
|
50
|
-
rollupOptions: {
|
|
51
|
-
input: {
|
|
52
|
-
main: resolve(SITE_DIR, 'index.html'),
|
|
53
|
-
mobile: resolve(SITE_DIR, 'mobile.html'),
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
} });
|
|
57
|
-
}
|
|
58
|
-
export function getBundleConfig(varletConfig, buildOptions) {
|
|
59
|
-
const plugins = [];
|
|
60
|
-
const name = get(varletConfig, 'name');
|
|
61
|
-
const { fileName, output, format, emptyOutDir } = buildOptions;
|
|
62
|
-
if (format === 'umd') {
|
|
63
|
-
plugins.push(inlineCss({
|
|
64
|
-
jsFile: resolve(output, fileName),
|
|
65
|
-
cssFile: resolve(output, 'style.css'),
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
const define = format === 'umd'
|
|
69
|
-
? {
|
|
70
|
-
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
71
|
-
}
|
|
72
|
-
: undefined;
|
|
73
|
-
return {
|
|
74
|
-
logLevel: 'silent',
|
|
75
|
-
define,
|
|
76
|
-
plugins,
|
|
77
|
-
build: {
|
|
78
|
-
minify: format === 'cjs' ? false : 'esbuild',
|
|
79
|
-
emptyOutDir,
|
|
80
|
-
copyPublicDir: false,
|
|
81
|
-
lib: {
|
|
82
|
-
name,
|
|
83
|
-
formats: [format],
|
|
84
|
-
fileName: () => fileName,
|
|
85
|
-
entry: resolve(ES_DIR, 'index.bundle.mjs'),
|
|
86
|
-
},
|
|
87
|
-
rollupOptions: {
|
|
88
|
-
external: ['vue'],
|
|
89
|
-
output: {
|
|
90
|
-
dir: output,
|
|
91
|
-
exports: 'named',
|
|
92
|
-
globals: {
|
|
93
|
-
vue: 'Vue',
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
export function getExtensionConfig(mode) {
|
|
101
|
-
return {
|
|
102
|
-
build: {
|
|
103
|
-
sourcemap: mode === 'dev' ? 'inline' : false,
|
|
104
|
-
watch: mode === 'dev' ? {} : null,
|
|
105
|
-
lib: {
|
|
106
|
-
entry: EXTENSION_ENTRY,
|
|
107
|
-
fileName: 'extension',
|
|
108
|
-
formats: ['cjs'],
|
|
109
|
-
},
|
|
110
|
-
rollupOptions: {
|
|
111
|
-
external: ['vscode'],
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
}
|
|
1
|
+
import vue from '@vitejs/plugin-vue';
|
|
2
|
+
import jsx from '@vitejs/plugin-vue-jsx';
|
|
3
|
+
import { markdown, html, inlineCss, copy } from '@varlet/vite-plugins';
|
|
4
|
+
import { ES_DIR, SITE_CONFIG, SITE_DIR, SITE_MOBILE_ROUTES, SITE_OUTPUT_PATH, SITE_PC_ROUTES, SITE_PUBLIC_PATH, VITE_RESOLVE_EXTENSIONS, EXTENSION_ENTRY, } from '../shared/constant.js';
|
|
5
|
+
import { get } from 'lodash-es';
|
|
6
|
+
import { resolve } from 'path';
|
|
7
|
+
export function getDevConfig(varletConfig) {
|
|
8
|
+
const defaultLanguage = get(varletConfig, 'defaultLanguage');
|
|
9
|
+
const host = get(varletConfig, 'host');
|
|
10
|
+
return {
|
|
11
|
+
root: SITE_DIR,
|
|
12
|
+
resolve: {
|
|
13
|
+
extensions: VITE_RESOLVE_EXTENSIONS,
|
|
14
|
+
alias: {
|
|
15
|
+
'@config': SITE_CONFIG,
|
|
16
|
+
'@pc-routes': SITE_PC_ROUTES,
|
|
17
|
+
'@mobile-routes': SITE_MOBILE_ROUTES,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
server: {
|
|
21
|
+
port: get(varletConfig, 'port'),
|
|
22
|
+
host: host === 'localhost' ? '0.0.0.0' : host,
|
|
23
|
+
},
|
|
24
|
+
publicDir: SITE_PUBLIC_PATH,
|
|
25
|
+
plugins: [
|
|
26
|
+
vue({
|
|
27
|
+
include: [/\.vue$/, /\.md$/],
|
|
28
|
+
}),
|
|
29
|
+
jsx(),
|
|
30
|
+
markdown({ style: get(varletConfig, 'highlight.style') }),
|
|
31
|
+
copy({ paths: get(varletConfig, 'copy', []) }),
|
|
32
|
+
html({
|
|
33
|
+
data: {
|
|
34
|
+
logo: get(varletConfig, `logo`),
|
|
35
|
+
baidu: get(varletConfig, `analysis.baidu`, ''),
|
|
36
|
+
pcTitle: get(varletConfig, `pc.title['${defaultLanguage}']`),
|
|
37
|
+
mobileTitle: get(varletConfig, `mobile.title['${defaultLanguage}']`),
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function getBuildConfig(varletConfig) {
|
|
44
|
+
const devConfig = getDevConfig(varletConfig);
|
|
45
|
+
return Object.assign(Object.assign({}, devConfig), { base: './', build: {
|
|
46
|
+
outDir: SITE_OUTPUT_PATH,
|
|
47
|
+
reportCompressedSize: false,
|
|
48
|
+
emptyOutDir: true,
|
|
49
|
+
cssTarget: 'chrome61',
|
|
50
|
+
rollupOptions: {
|
|
51
|
+
input: {
|
|
52
|
+
main: resolve(SITE_DIR, 'index.html'),
|
|
53
|
+
mobile: resolve(SITE_DIR, 'mobile.html'),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
} });
|
|
57
|
+
}
|
|
58
|
+
export function getBundleConfig(varletConfig, buildOptions) {
|
|
59
|
+
const plugins = [];
|
|
60
|
+
const name = get(varletConfig, 'name');
|
|
61
|
+
const { fileName, output, format, emptyOutDir } = buildOptions;
|
|
62
|
+
if (format === 'umd') {
|
|
63
|
+
plugins.push(inlineCss({
|
|
64
|
+
jsFile: resolve(output, fileName),
|
|
65
|
+
cssFile: resolve(output, 'style.css'),
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
const define = format === 'umd'
|
|
69
|
+
? {
|
|
70
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
71
|
+
}
|
|
72
|
+
: undefined;
|
|
73
|
+
return {
|
|
74
|
+
logLevel: 'silent',
|
|
75
|
+
define,
|
|
76
|
+
plugins,
|
|
77
|
+
build: {
|
|
78
|
+
minify: format === 'cjs' ? false : 'esbuild',
|
|
79
|
+
emptyOutDir,
|
|
80
|
+
copyPublicDir: false,
|
|
81
|
+
lib: {
|
|
82
|
+
name,
|
|
83
|
+
formats: [format],
|
|
84
|
+
fileName: () => fileName,
|
|
85
|
+
entry: resolve(ES_DIR, 'index.bundle.mjs'),
|
|
86
|
+
},
|
|
87
|
+
rollupOptions: {
|
|
88
|
+
external: ['vue'],
|
|
89
|
+
output: {
|
|
90
|
+
dir: output,
|
|
91
|
+
exports: 'named',
|
|
92
|
+
globals: {
|
|
93
|
+
vue: 'Vue',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export function getExtensionConfig(mode) {
|
|
101
|
+
return {
|
|
102
|
+
build: {
|
|
103
|
+
sourcemap: mode === 'dev' ? 'inline' : false,
|
|
104
|
+
watch: mode === 'dev' ? {} : null,
|
|
105
|
+
lib: {
|
|
106
|
+
entry: EXTENSION_ENTRY,
|
|
107
|
+
fileName: 'extension',
|
|
108
|
+
formats: ['cjs'],
|
|
109
|
+
},
|
|
110
|
+
rollupOptions: {
|
|
111
|
+
external: ['vscode'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
package/lib/node/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { defineConfig } from './config/varlet.config.js';
|
|
2
|
-
export * from './commands/release.js';
|
|
3
|
-
export * from './commands/dev.js';
|
|
4
|
-
export * from './commands/build.js';
|
|
5
|
-
export * from './commands/compile.js';
|
|
6
|
-
export * from './commands/commitLint.js';
|
|
7
|
-
export * from './commands/gen.js';
|
|
8
|
-
export * from './commands/jest.js';
|
|
9
|
-
export * from './commands/create.js';
|
|
10
|
-
export * from './commands/lint.js';
|
|
11
|
-
export * from './commands/changelog.js';
|
|
12
|
-
export * from './commands/preview.js';
|
|
13
|
-
export * from './commands/vite.js';
|
|
14
|
-
export * from './commands/extension.js';
|
|
15
|
-
export * from './commands/checklist.js';
|
|
1
|
+
export { defineConfig } from './config/varlet.config.js';
|
|
2
|
+
export * from './commands/release.js';
|
|
3
|
+
export * from './commands/dev.js';
|
|
4
|
+
export * from './commands/build.js';
|
|
5
|
+
export * from './commands/compile.js';
|
|
6
|
+
export * from './commands/commitLint.js';
|
|
7
|
+
export * from './commands/gen.js';
|
|
8
|
+
export * from './commands/jest.js';
|
|
9
|
+
export * from './commands/create.js';
|
|
10
|
+
export * from './commands/lint.js';
|
|
11
|
+
export * from './commands/changelog.js';
|
|
12
|
+
export * from './commands/preview.js';
|
|
13
|
+
export * from './commands/vite.js';
|
|
14
|
+
export * from './commands/extension.js';
|
|
15
|
+
export * from './commands/checklist.js';
|
package/lib/node/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { defineConfig } from './config/varlet.config.js';
|
|
2
|
-
export * from './commands/release.js';
|
|
3
|
-
export * from './commands/dev.js';
|
|
4
|
-
export * from './commands/build.js';
|
|
5
|
-
export * from './commands/compile.js';
|
|
6
|
-
export * from './commands/commitLint.js';
|
|
7
|
-
export * from './commands/gen.js';
|
|
8
|
-
export * from './commands/jest.js';
|
|
9
|
-
export * from './commands/create.js';
|
|
10
|
-
export * from './commands/lint.js';
|
|
11
|
-
export * from './commands/changelog.js';
|
|
12
|
-
export * from './commands/preview.js';
|
|
13
|
-
export * from './commands/vite.js';
|
|
14
|
-
export * from './commands/extension.js';
|
|
15
|
-
export * from './commands/checklist.js';
|
|
1
|
+
export { defineConfig } from './config/varlet.config.js';
|
|
2
|
+
export * from './commands/release.js';
|
|
3
|
+
export * from './commands/dev.js';
|
|
4
|
+
export * from './commands/build.js';
|
|
5
|
+
export * from './commands/compile.js';
|
|
6
|
+
export * from './commands/commitLint.js';
|
|
7
|
+
export * from './commands/gen.js';
|
|
8
|
+
export * from './commands/jest.js';
|
|
9
|
+
export * from './commands/create.js';
|
|
10
|
+
export * from './commands/lint.js';
|
|
11
|
+
export * from './commands/changelog.js';
|
|
12
|
+
export * from './commands/preview.js';
|
|
13
|
+
export * from './commands/vite.js';
|
|
14
|
+
export * from './commands/extension.js';
|
|
15
|
+
export * from './commands/checklist.js';
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
export declare const dirname: string;
|
|
2
|
-
export declare const CWD: string;
|
|
3
|
-
export declare const VARLET_CONFIG: string;
|
|
4
|
-
export declare const SRC_DIR: string;
|
|
5
|
-
export declare const ES_DIR: string;
|
|
6
|
-
export declare const LIB_DIR: string;
|
|
7
|
-
export declare const UMD_DIR: string;
|
|
8
|
-
export declare const TYPES_DIR: string;
|
|
9
|
-
export declare const ROOT_DOCS_DIR: string;
|
|
10
|
-
export declare const ROOT_PAGES_DIR: string;
|
|
11
|
-
export declare const ESLINT_EXTENSIONS: string[];
|
|
12
|
-
export declare const VITE_RESOLVE_EXTENSIONS: string[];
|
|
13
|
-
export declare const SCRIPTS_EXTENSIONS: string[];
|
|
14
|
-
export declare const PUBLIC_DIR_INDEXES: string[];
|
|
15
|
-
export declare const STYLE_DIR_NAME = "style";
|
|
16
|
-
export declare const EXAMPLE_DIR_NAME = "example";
|
|
17
|
-
export declare const LOCALE_DIR_NAME = "locale";
|
|
18
|
-
export declare const DOCS_DIR_NAME = "docs";
|
|
19
|
-
export declare const TESTS_DIR_NAME = "__tests__";
|
|
20
|
-
export declare const GENERATORS_DIR: string;
|
|
21
|
-
export declare const UI_PACKAGE_JSON: string;
|
|
22
|
-
export declare const CLI_PACKAGE_JSON: string;
|
|
23
|
-
export declare const CHECKLIST_FILE: string;
|
|
24
|
-
export declare const SITE: string;
|
|
25
|
-
export declare const SITE_OUTPUT_PATH: string;
|
|
26
|
-
export declare const SITE_PUBLIC_PATH: string;
|
|
27
|
-
export declare const SITE_DIR: string;
|
|
28
|
-
export declare const SITE_PC_DIR: string;
|
|
29
|
-
export declare const SITE_PC_ROUTES: string;
|
|
30
|
-
export declare const SITE_MOBILE_ROUTES: string;
|
|
31
|
-
export declare const SITE_CONFIG: string;
|
|
32
|
-
export declare const HL_DIR: string;
|
|
33
|
-
export declare const HL_COMPONENT_NAME_RE: RegExp;
|
|
34
|
-
export declare const HL_API_RE: RegExp;
|
|
35
|
-
export declare const HL_EN_TITLE_ATTRIBUTES_RE: RegExp;
|
|
36
|
-
export declare const HL_EN_TITLE_EVENTS_RE: RegExp;
|
|
37
|
-
export declare const HL_EN_TITLE_SLOTS_RE: RegExp;
|
|
38
|
-
export declare const HL_EN_MD = "en-US.md";
|
|
39
|
-
export declare const HL_EN_WEB_TYPES_JSON: string;
|
|
40
|
-
export declare const HL_ZH_TITLE_ATTRIBUTES_RE: RegExp;
|
|
41
|
-
export declare const HL_ZH_TITLE_EVENTS_RE: RegExp;
|
|
42
|
-
export declare const HL_ZH_TITLE_SLOTS_RE: RegExp;
|
|
43
|
-
export declare const HL_ZH_MD = "zh-CN.md";
|
|
44
|
-
export declare const HL_ZH_WEB_TYPES_JSON: string;
|
|
45
|
-
export declare const ICONS_DIST_DIR: string;
|
|
46
|
-
export declare const ICONS_CSS_DIR: string;
|
|
47
|
-
export declare const ICONS_PNG_DIR: string;
|
|
48
|
-
export declare const ICONS_FONTS_DIR: string;
|
|
49
|
-
export declare const ICONS_SVG_DIR: string;
|
|
50
|
-
export declare const EXTENSION_ENTRY: string;
|
|
51
|
-
export declare const JEST_CONFIG: string;
|
|
1
|
+
export declare const dirname: string;
|
|
2
|
+
export declare const CWD: string;
|
|
3
|
+
export declare const VARLET_CONFIG: string;
|
|
4
|
+
export declare const SRC_DIR: string;
|
|
5
|
+
export declare const ES_DIR: string;
|
|
6
|
+
export declare const LIB_DIR: string;
|
|
7
|
+
export declare const UMD_DIR: string;
|
|
8
|
+
export declare const TYPES_DIR: string;
|
|
9
|
+
export declare const ROOT_DOCS_DIR: string;
|
|
10
|
+
export declare const ROOT_PAGES_DIR: string;
|
|
11
|
+
export declare const ESLINT_EXTENSIONS: string[];
|
|
12
|
+
export declare const VITE_RESOLVE_EXTENSIONS: string[];
|
|
13
|
+
export declare const SCRIPTS_EXTENSIONS: string[];
|
|
14
|
+
export declare const PUBLIC_DIR_INDEXES: string[];
|
|
15
|
+
export declare const STYLE_DIR_NAME = "style";
|
|
16
|
+
export declare const EXAMPLE_DIR_NAME = "example";
|
|
17
|
+
export declare const LOCALE_DIR_NAME = "locale";
|
|
18
|
+
export declare const DOCS_DIR_NAME = "docs";
|
|
19
|
+
export declare const TESTS_DIR_NAME = "__tests__";
|
|
20
|
+
export declare const GENERATORS_DIR: string;
|
|
21
|
+
export declare const UI_PACKAGE_JSON: string;
|
|
22
|
+
export declare const CLI_PACKAGE_JSON: string;
|
|
23
|
+
export declare const CHECKLIST_FILE: string;
|
|
24
|
+
export declare const SITE: string;
|
|
25
|
+
export declare const SITE_OUTPUT_PATH: string;
|
|
26
|
+
export declare const SITE_PUBLIC_PATH: string;
|
|
27
|
+
export declare const SITE_DIR: string;
|
|
28
|
+
export declare const SITE_PC_DIR: string;
|
|
29
|
+
export declare const SITE_PC_ROUTES: string;
|
|
30
|
+
export declare const SITE_MOBILE_ROUTES: string;
|
|
31
|
+
export declare const SITE_CONFIG: string;
|
|
32
|
+
export declare const HL_DIR: string;
|
|
33
|
+
export declare const HL_COMPONENT_NAME_RE: RegExp;
|
|
34
|
+
export declare const HL_API_RE: RegExp;
|
|
35
|
+
export declare const HL_EN_TITLE_ATTRIBUTES_RE: RegExp;
|
|
36
|
+
export declare const HL_EN_TITLE_EVENTS_RE: RegExp;
|
|
37
|
+
export declare const HL_EN_TITLE_SLOTS_RE: RegExp;
|
|
38
|
+
export declare const HL_EN_MD = "en-US.md";
|
|
39
|
+
export declare const HL_EN_WEB_TYPES_JSON: string;
|
|
40
|
+
export declare const HL_ZH_TITLE_ATTRIBUTES_RE: RegExp;
|
|
41
|
+
export declare const HL_ZH_TITLE_EVENTS_RE: RegExp;
|
|
42
|
+
export declare const HL_ZH_TITLE_SLOTS_RE: RegExp;
|
|
43
|
+
export declare const HL_ZH_MD = "zh-CN.md";
|
|
44
|
+
export declare const HL_ZH_WEB_TYPES_JSON: string;
|
|
45
|
+
export declare const ICONS_DIST_DIR: string;
|
|
46
|
+
export declare const ICONS_CSS_DIR: string;
|
|
47
|
+
export declare const ICONS_PNG_DIR: string;
|
|
48
|
+
export declare const ICONS_FONTS_DIR: string;
|
|
49
|
+
export declare const ICONS_SVG_DIR: string;
|
|
50
|
+
export declare const EXTENSION_ENTRY: string;
|
|
51
|
+
export declare const JEST_CONFIG: string;
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { resolve } from 'path';
|
|
2
|
-
import { getDirname } from './fsUtils.js';
|
|
3
|
-
export const dirname = getDirname(import.meta.url);
|
|
4
|
-
export const CWD = process.cwd();
|
|
5
|
-
export const VARLET_CONFIG = resolve(CWD, 'varlet.config.mjs');
|
|
6
|
-
export const SRC_DIR = resolve(CWD, 'src');
|
|
7
|
-
export const ES_DIR = resolve(CWD, 'es');
|
|
8
|
-
export const LIB_DIR = resolve(CWD, 'lib');
|
|
9
|
-
export const UMD_DIR = resolve(CWD, 'umd');
|
|
10
|
-
export const TYPES_DIR = resolve(CWD, 'types');
|
|
11
|
-
export const ROOT_DOCS_DIR = resolve(CWD, 'docs');
|
|
12
|
-
export const ROOT_PAGES_DIR = resolve(CWD, 'pages');
|
|
13
|
-
export const ESLINT_EXTENSIONS = ['.vue', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.cjs'];
|
|
14
|
-
export const VITE_RESOLVE_EXTENSIONS = ['.vue', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.cjs', '.less', '.css'];
|
|
15
|
-
export const SCRIPTS_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.cjs'];
|
|
16
|
-
export const PUBLIC_DIR_INDEXES = ['index.vue', 'index.tsx', 'index.ts', 'index.jsx', 'index.js'];
|
|
17
|
-
export const STYLE_DIR_NAME = 'style';
|
|
18
|
-
export const EXAMPLE_DIR_NAME = 'example';
|
|
19
|
-
export const LOCALE_DIR_NAME = 'locale';
|
|
20
|
-
export const DOCS_DIR_NAME = 'docs';
|
|
21
|
-
export const TESTS_DIR_NAME = '__tests__';
|
|
22
|
-
export const GENERATORS_DIR = resolve(dirname, '../../../template/generators');
|
|
23
|
-
export const UI_PACKAGE_JSON = resolve(CWD, 'package.json');
|
|
24
|
-
export const CLI_PACKAGE_JSON = resolve(dirname, '../../../package.json');
|
|
25
|
-
export const CHECKLIST_FILE = resolve(CWD, 'CHECKLIST.md');
|
|
26
|
-
// site
|
|
27
|
-
export const SITE = resolve(dirname, '../../../site');
|
|
28
|
-
export const SITE_OUTPUT_PATH = resolve(CWD, 'site');
|
|
29
|
-
export const SITE_PUBLIC_PATH = resolve(CWD, 'public');
|
|
30
|
-
export const SITE_DIR = resolve(CWD, '.varlet/site');
|
|
31
|
-
export const SITE_PC_DIR = resolve(CWD, '.varlet/site/pc');
|
|
32
|
-
export const SITE_PC_ROUTES = resolve(CWD, '.varlet/pc.routes.ts');
|
|
33
|
-
export const SITE_MOBILE_ROUTES = resolve(CWD, '.varlet/mobile.routes.ts');
|
|
34
|
-
export const SITE_CONFIG = resolve(CWD, '.varlet/site.config.json');
|
|
35
|
-
// template highlight
|
|
36
|
-
export const HL_DIR = resolve(CWD, 'highlight');
|
|
37
|
-
export const HL_COMPONENT_NAME_RE = /.*(\/|\\)(.+)(\/|\\)docs(\/|\\)/;
|
|
38
|
-
export const HL_API_RE = /##\s*API(?:\r\n|\n)+/;
|
|
39
|
-
export const HL_EN_TITLE_ATTRIBUTES_RE = /###\s*Props(?:\r\n|\n)+/;
|
|
40
|
-
export const HL_EN_TITLE_EVENTS_RE = /###\s*Events(?:\r\n|\n)+/;
|
|
41
|
-
export const HL_EN_TITLE_SLOTS_RE = /###\s*Slots(?:\r\n|\n)+/;
|
|
42
|
-
export const HL_EN_MD = 'en-US.md';
|
|
43
|
-
export const HL_EN_WEB_TYPES_JSON = resolve(HL_DIR, 'web-types.en-US.json');
|
|
44
|
-
export const HL_ZH_TITLE_ATTRIBUTES_RE = /###\s*属性(?:\r\n|\n)+/;
|
|
45
|
-
export const HL_ZH_TITLE_EVENTS_RE = /###\s*事件(?:\r\n|\n)+/;
|
|
46
|
-
export const HL_ZH_TITLE_SLOTS_RE = /###\s*插槽(?:\r\n|\n)+/;
|
|
47
|
-
export const HL_ZH_MD = 'zh-CN.md';
|
|
48
|
-
export const HL_ZH_WEB_TYPES_JSON = resolve(HL_DIR, 'web-types.zh-CN.json');
|
|
49
|
-
// icons
|
|
50
|
-
export const ICONS_DIST_DIR = resolve(CWD, 'dist');
|
|
51
|
-
export const ICONS_CSS_DIR = resolve(ICONS_DIST_DIR, 'css');
|
|
52
|
-
export const ICONS_PNG_DIR = resolve(ICONS_DIST_DIR, 'png');
|
|
53
|
-
export const ICONS_FONTS_DIR = resolve(ICONS_DIST_DIR, 'fonts');
|
|
54
|
-
export const ICONS_SVG_DIR = resolve(CWD, 'svg');
|
|
55
|
-
// extension
|
|
56
|
-
export const EXTENSION_ENTRY = resolve(CWD, 'src/extension.ts');
|
|
57
|
-
// jest
|
|
58
|
-
export const JEST_CONFIG = resolve(dirname, '../../../cjs/jest.config.cjs');
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { getDirname } from './fsUtils.js';
|
|
3
|
+
export const dirname = getDirname(import.meta.url);
|
|
4
|
+
export const CWD = process.cwd();
|
|
5
|
+
export const VARLET_CONFIG = resolve(CWD, 'varlet.config.mjs');
|
|
6
|
+
export const SRC_DIR = resolve(CWD, 'src');
|
|
7
|
+
export const ES_DIR = resolve(CWD, 'es');
|
|
8
|
+
export const LIB_DIR = resolve(CWD, 'lib');
|
|
9
|
+
export const UMD_DIR = resolve(CWD, 'umd');
|
|
10
|
+
export const TYPES_DIR = resolve(CWD, 'types');
|
|
11
|
+
export const ROOT_DOCS_DIR = resolve(CWD, 'docs');
|
|
12
|
+
export const ROOT_PAGES_DIR = resolve(CWD, 'pages');
|
|
13
|
+
export const ESLINT_EXTENSIONS = ['.vue', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.cjs'];
|
|
14
|
+
export const VITE_RESOLVE_EXTENSIONS = ['.vue', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.cjs', '.less', '.css'];
|
|
15
|
+
export const SCRIPTS_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.cjs'];
|
|
16
|
+
export const PUBLIC_DIR_INDEXES = ['index.vue', 'index.tsx', 'index.ts', 'index.jsx', 'index.js'];
|
|
17
|
+
export const STYLE_DIR_NAME = 'style';
|
|
18
|
+
export const EXAMPLE_DIR_NAME = 'example';
|
|
19
|
+
export const LOCALE_DIR_NAME = 'locale';
|
|
20
|
+
export const DOCS_DIR_NAME = 'docs';
|
|
21
|
+
export const TESTS_DIR_NAME = '__tests__';
|
|
22
|
+
export const GENERATORS_DIR = resolve(dirname, '../../../template/generators');
|
|
23
|
+
export const UI_PACKAGE_JSON = resolve(CWD, 'package.json');
|
|
24
|
+
export const CLI_PACKAGE_JSON = resolve(dirname, '../../../package.json');
|
|
25
|
+
export const CHECKLIST_FILE = resolve(CWD, 'CHECKLIST.md');
|
|
26
|
+
// site
|
|
27
|
+
export const SITE = resolve(dirname, '../../../site');
|
|
28
|
+
export const SITE_OUTPUT_PATH = resolve(CWD, 'site');
|
|
29
|
+
export const SITE_PUBLIC_PATH = resolve(CWD, 'public');
|
|
30
|
+
export const SITE_DIR = resolve(CWD, '.varlet/site');
|
|
31
|
+
export const SITE_PC_DIR = resolve(CWD, '.varlet/site/pc');
|
|
32
|
+
export const SITE_PC_ROUTES = resolve(CWD, '.varlet/pc.routes.ts');
|
|
33
|
+
export const SITE_MOBILE_ROUTES = resolve(CWD, '.varlet/mobile.routes.ts');
|
|
34
|
+
export const SITE_CONFIG = resolve(CWD, '.varlet/site.config.json');
|
|
35
|
+
// template highlight
|
|
36
|
+
export const HL_DIR = resolve(CWD, 'highlight');
|
|
37
|
+
export const HL_COMPONENT_NAME_RE = /.*(\/|\\)(.+)(\/|\\)docs(\/|\\)/;
|
|
38
|
+
export const HL_API_RE = /##\s*API(?:\r\n|\n)+/;
|
|
39
|
+
export const HL_EN_TITLE_ATTRIBUTES_RE = /###\s*Props(?:\r\n|\n)+/;
|
|
40
|
+
export const HL_EN_TITLE_EVENTS_RE = /###\s*Events(?:\r\n|\n)+/;
|
|
41
|
+
export const HL_EN_TITLE_SLOTS_RE = /###\s*Slots(?:\r\n|\n)+/;
|
|
42
|
+
export const HL_EN_MD = 'en-US.md';
|
|
43
|
+
export const HL_EN_WEB_TYPES_JSON = resolve(HL_DIR, 'web-types.en-US.json');
|
|
44
|
+
export const HL_ZH_TITLE_ATTRIBUTES_RE = /###\s*属性(?:\r\n|\n)+/;
|
|
45
|
+
export const HL_ZH_TITLE_EVENTS_RE = /###\s*事件(?:\r\n|\n)+/;
|
|
46
|
+
export const HL_ZH_TITLE_SLOTS_RE = /###\s*插槽(?:\r\n|\n)+/;
|
|
47
|
+
export const HL_ZH_MD = 'zh-CN.md';
|
|
48
|
+
export const HL_ZH_WEB_TYPES_JSON = resolve(HL_DIR, 'web-types.zh-CN.json');
|
|
49
|
+
// icons
|
|
50
|
+
export const ICONS_DIST_DIR = resolve(CWD, 'dist');
|
|
51
|
+
export const ICONS_CSS_DIR = resolve(ICONS_DIST_DIR, 'css');
|
|
52
|
+
export const ICONS_PNG_DIR = resolve(ICONS_DIST_DIR, 'png');
|
|
53
|
+
export const ICONS_FONTS_DIR = resolve(ICONS_DIST_DIR, 'fonts');
|
|
54
|
+
export const ICONS_SVG_DIR = resolve(CWD, 'svg');
|
|
55
|
+
// extension
|
|
56
|
+
export const EXTENSION_ENTRY = resolve(CWD, 'src/extension.ts');
|
|
57
|
+
// jest
|
|
58
|
+
export const JEST_CONFIG = resolve(dirname, '../../../cjs/jest.config.cjs');
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export declare function getPublicDirs(): Promise<string[]>;
|
|
2
|
-
export declare const isMD: (file: string) => boolean;
|
|
3
|
-
export declare const isDir: (file: string) => boolean;
|
|
4
|
-
export declare const isSFC: (file: string) => boolean;
|
|
5
|
-
export declare const isDTS: (file: string) => boolean;
|
|
6
|
-
export declare const isScript: (file: string) => boolean;
|
|
7
|
-
export declare const isLess: (file: string) => boolean;
|
|
8
|
-
export declare const isPublicDir: (dir: string) => boolean;
|
|
9
|
-
export declare const replaceExt: (file: string, ext: string) => string;
|
|
10
|
-
export declare function smartAppendFileSync(file: string, code: string): void;
|
|
11
|
-
export declare function outputFileSyncOnChange(path: string, code: string): void;
|
|
12
|
-
export declare function glob(pattern: string): Promise<string[]>;
|
|
13
|
-
export declare function getDirname(url: string): string;
|
|
14
|
-
export declare function getVersion(): any;
|
|
15
|
-
export declare function getCliVersion(): any;
|
|
1
|
+
export declare function getPublicDirs(): Promise<string[]>;
|
|
2
|
+
export declare const isMD: (file: string) => boolean;
|
|
3
|
+
export declare const isDir: (file: string) => boolean;
|
|
4
|
+
export declare const isSFC: (file: string) => boolean;
|
|
5
|
+
export declare const isDTS: (file: string) => boolean;
|
|
6
|
+
export declare const isScript: (file: string) => boolean;
|
|
7
|
+
export declare const isLess: (file: string) => boolean;
|
|
8
|
+
export declare const isPublicDir: (dir: string) => boolean;
|
|
9
|
+
export declare const replaceExt: (file: string, ext: string) => string;
|
|
10
|
+
export declare function smartAppendFileSync(file: string, code: string): void;
|
|
11
|
+
export declare function outputFileSyncOnChange(path: string, code: string): void;
|
|
12
|
+
export declare function glob(pattern: string): Promise<string[]>;
|
|
13
|
+
export declare function getDirname(url: string): string;
|
|
14
|
+
export declare function getVersion(): any;
|
|
15
|
+
export declare function getCliVersion(): any;
|