@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.
Files changed (65) hide show
  1. package/lib/client/appType.d.ts +4 -4
  2. package/lib/client/appType.js +7 -7
  3. package/lib/client/index.d.ts +18 -18
  4. package/lib/client/index.js +109 -109
  5. package/lib/node/bin.d.ts +2 -2
  6. package/lib/node/bin.js +148 -148
  7. package/lib/node/commands/build.d.ts +1 -1
  8. package/lib/node/commands/build.js +15 -15
  9. package/lib/node/commands/changelog.d.ts +5 -5
  10. package/lib/node/commands/changelog.js +20 -20
  11. package/lib/node/commands/checklist.d.ts +6 -6
  12. package/lib/node/commands/checklist.js +64 -64
  13. package/lib/node/commands/commitLint.d.ts +4 -4
  14. package/lib/node/commands/commitLint.js +19 -19
  15. package/lib/node/commands/compile.d.ts +3 -3
  16. package/lib/node/commands/compile.js +31 -31
  17. package/lib/node/commands/create.d.ts +7 -7
  18. package/lib/node/commands/create.js +91 -91
  19. package/lib/node/commands/dev.d.ts +6 -6
  20. package/lib/node/commands/dev.js +42 -42
  21. package/lib/node/commands/extension.d.ts +3 -3
  22. package/lib/node/commands/extension.js +5 -5
  23. package/lib/node/commands/gen.d.ts +7 -7
  24. package/lib/node/commands/gen.js +68 -68
  25. package/lib/node/commands/icons.d.ts +1 -1
  26. package/lib/node/commands/icons.js +82 -82
  27. package/lib/node/commands/jest.d.ts +7 -7
  28. package/lib/node/commands/jest.js +27 -27
  29. package/lib/node/commands/lint.d.ts +1 -1
  30. package/lib/node/commands/lint.js +42 -42
  31. package/lib/node/commands/preview.d.ts +1 -1
  32. package/lib/node/commands/preview.js +18 -18
  33. package/lib/node/commands/release.d.ts +5 -5
  34. package/lib/node/commands/release.js +150 -150
  35. package/lib/node/commands/vite.d.ts +2 -2
  36. package/lib/node/commands/vite.js +14 -14
  37. package/lib/node/compiler/compileModule.d.ts +4 -4
  38. package/lib/node/compiler/compileModule.js +71 -71
  39. package/lib/node/compiler/compileSFC.d.ts +6 -6
  40. package/lib/node/compiler/compileSFC.js +97 -96
  41. package/lib/node/compiler/compileScript.d.ts +13 -13
  42. package/lib/node/compiler/compileScript.js +126 -126
  43. package/lib/node/compiler/compileSiteEntry.d.ts +18 -18
  44. package/lib/node/compiler/compileSiteEntry.js +121 -121
  45. package/lib/node/compiler/compileStyle.d.ts +10 -10
  46. package/lib/node/compiler/compileStyle.js +41 -41
  47. package/lib/node/compiler/compileTemplateHighlight.d.ts +18 -18
  48. package/lib/node/compiler/compileTemplateHighlight.js +128 -128
  49. package/lib/node/compiler/compileTypes.d.ts +2 -2
  50. package/lib/node/compiler/compileTypes.js +40 -40
  51. package/lib/node/config/varlet.config.d.ts +73 -73
  52. package/lib/node/config/varlet.config.js +27 -27
  53. package/lib/node/config/varlet.default.config.d.ts +2 -2
  54. package/lib/node/config/varlet.default.config.js +271 -271
  55. package/lib/node/config/vite.config.d.ts +13 -13
  56. package/lib/node/config/vite.config.js +115 -115
  57. package/lib/node/index.d.ts +15 -15
  58. package/lib/node/index.js +15 -15
  59. package/lib/node/shared/constant.d.ts +51 -51
  60. package/lib/node/shared/constant.js +58 -58
  61. package/lib/node/shared/fsUtils.d.ts +15 -15
  62. package/lib/node/shared/fsUtils.js +54 -54
  63. package/lib/node/shared/logger.d.ts +8 -8
  64. package/lib/node/shared/logger.js +18 -18
  65. package/package.json +7 -7
@@ -1,54 +1,54 @@
1
- import globSync from 'glob';
2
- import fse from 'fs-extra';
3
- import { extname, resolve } from 'path';
4
- import { CLI_PACKAGE_JSON, PUBLIC_DIR_INDEXES, SCRIPTS_EXTENSIONS, SRC_DIR, UI_PACKAGE_JSON } from './constant.js';
5
- import { fileURLToPath } from 'url';
6
- const { appendFileSync, ensureFileSync, lstatSync, outputFileSync, pathExistsSync, readdir, readFileSync, readJSONSync, } = fse;
7
- export async function getPublicDirs() {
8
- const srcDir = await readdir(SRC_DIR);
9
- return srcDir.filter((filename) => isPublicDir(resolve(SRC_DIR, filename)));
10
- }
11
- export const isMD = (file) => pathExistsSync(file) && extname(file) === '.md';
12
- export const isDir = (file) => pathExistsSync(file) && lstatSync(file).isDirectory();
13
- export const isSFC = (file) => pathExistsSync(file) && extname(file) === '.vue';
14
- export const isDTS = (file) => pathExistsSync(file) && file.endsWith('.d.ts');
15
- export const isScript = (file) => pathExistsSync(file) && SCRIPTS_EXTENSIONS.includes(extname(file));
16
- export const isLess = (file) => pathExistsSync(file) && extname(file) === '.less';
17
- export const isPublicDir = (dir) => PUBLIC_DIR_INDEXES.some((index) => pathExistsSync(resolve(dir, index)));
18
- export const replaceExt = (file, ext) => file.replace(extname(file), ext);
19
- export function smartAppendFileSync(file, code) {
20
- if (pathExistsSync(file)) {
21
- const content = readFileSync(file, 'utf-8');
22
- if (!content.includes(code)) {
23
- appendFileSync(file, code);
24
- }
25
- }
26
- }
27
- export function outputFileSyncOnChange(path, code) {
28
- ensureFileSync(path);
29
- const content = readFileSync(path, 'utf-8');
30
- if (content !== code) {
31
- outputFileSync(path, code);
32
- }
33
- }
34
- export function glob(pattern) {
35
- return new Promise((resolve, reject) => {
36
- globSync(pattern, (err, files) => {
37
- if (err) {
38
- reject(err);
39
- }
40
- else {
41
- resolve(files);
42
- }
43
- });
44
- });
45
- }
46
- export function getDirname(url) {
47
- return fileURLToPath(new URL('.', url));
48
- }
49
- export function getVersion() {
50
- return readJSONSync(UI_PACKAGE_JSON).version;
51
- }
52
- export function getCliVersion() {
53
- return readJSONSync(CLI_PACKAGE_JSON).version;
54
- }
1
+ import globSync from 'glob';
2
+ import fse from 'fs-extra';
3
+ import { extname, resolve } from 'path';
4
+ import { CLI_PACKAGE_JSON, PUBLIC_DIR_INDEXES, SCRIPTS_EXTENSIONS, SRC_DIR, UI_PACKAGE_JSON } from './constant.js';
5
+ import { fileURLToPath } from 'url';
6
+ const { appendFileSync, ensureFileSync, lstatSync, outputFileSync, pathExistsSync, readdir, readFileSync, readJSONSync, } = fse;
7
+ export async function getPublicDirs() {
8
+ const srcDir = await readdir(SRC_DIR);
9
+ return srcDir.filter((filename) => isPublicDir(resolve(SRC_DIR, filename)));
10
+ }
11
+ export const isMD = (file) => pathExistsSync(file) && extname(file) === '.md';
12
+ export const isDir = (file) => pathExistsSync(file) && lstatSync(file).isDirectory();
13
+ export const isSFC = (file) => pathExistsSync(file) && extname(file) === '.vue';
14
+ export const isDTS = (file) => pathExistsSync(file) && file.endsWith('.d.ts');
15
+ export const isScript = (file) => pathExistsSync(file) && SCRIPTS_EXTENSIONS.includes(extname(file));
16
+ export const isLess = (file) => pathExistsSync(file) && extname(file) === '.less';
17
+ export const isPublicDir = (dir) => PUBLIC_DIR_INDEXES.some((index) => pathExistsSync(resolve(dir, index)));
18
+ export const replaceExt = (file, ext) => file.replace(extname(file), ext);
19
+ export function smartAppendFileSync(file, code) {
20
+ if (pathExistsSync(file)) {
21
+ const content = readFileSync(file, 'utf-8');
22
+ if (!content.includes(code)) {
23
+ appendFileSync(file, code);
24
+ }
25
+ }
26
+ }
27
+ export function outputFileSyncOnChange(path, code) {
28
+ ensureFileSync(path);
29
+ const content = readFileSync(path, 'utf-8');
30
+ if (content !== code) {
31
+ outputFileSync(path, code);
32
+ }
33
+ }
34
+ export function glob(pattern) {
35
+ return new Promise((resolve, reject) => {
36
+ globSync(pattern, (err, files) => {
37
+ if (err) {
38
+ reject(err);
39
+ }
40
+ else {
41
+ resolve(files);
42
+ }
43
+ });
44
+ });
45
+ }
46
+ export function getDirname(url) {
47
+ return fileURLToPath(new URL('.', url));
48
+ }
49
+ export function getVersion() {
50
+ return readJSONSync(UI_PACKAGE_JSON).version;
51
+ }
52
+ export function getCliVersion() {
53
+ return readJSONSync(CLI_PACKAGE_JSON).version;
54
+ }
@@ -1,8 +1,8 @@
1
- declare const _default: {
2
- info(text: string): void;
3
- success(text: string): void;
4
- warning(text: string): void;
5
- error(text: string): void;
6
- title(text: string): void;
7
- };
8
- export default _default;
1
+ declare const _default: {
2
+ info(text: string): void;
3
+ success(text: string): void;
4
+ warning(text: string): void;
5
+ error(text: string): void;
6
+ title(text: string): void;
7
+ };
8
+ export default _default;
@@ -1,18 +1,18 @@
1
- import pico from 'picocolors';
2
- export default {
3
- info(text) {
4
- console.log(text);
5
- },
6
- success(text) {
7
- console.log(pico.green(text));
8
- },
9
- warning(text) {
10
- console.log(pico.yellow(text));
11
- },
12
- error(text) {
13
- console.log(pico.red(text));
14
- },
15
- title(text) {
16
- console.log(pico.cyan(text));
17
- },
18
- };
1
+ import pico from 'picocolors';
2
+ export default {
3
+ info(text) {
4
+ console.log(text);
5
+ },
6
+ success(text) {
7
+ console.log(pico.green(text));
8
+ },
9
+ warning(text) {
10
+ console.log(pico.yellow(text));
11
+ },
12
+ error(text) {
13
+ console.log(pico.red(text));
14
+ },
15
+ title(text) {
16
+ console.log(pico.cyan(text));
17
+ },
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "2.10.0",
3
+ "version": "2.10.1-alpha.1682608027166",
4
4
  "type": "module",
5
5
  "description": "cli of varlet",
6
6
  "bin": {
@@ -70,8 +70,8 @@
70
70
  "vite": "4.0.4",
71
71
  "vue": "3.2.25",
72
72
  "webfont": "^9.0.0",
73
- "@varlet/vite-plugins": "2.10.0",
74
- "@varlet/shared": "2.10.0"
73
+ "@varlet/shared": "2.10.1-alpha.1682608027166",
74
+ "@varlet/vite-plugins": "2.10.1-alpha.1682608027166"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/babel__core": "^7.1.12",
@@ -85,8 +85,8 @@
85
85
  "@types/node": "^18.7.20",
86
86
  "@types/semver": "^7.3.9",
87
87
  "@types/sharp": "0.31.1",
88
- "@varlet/icons": "2.10.0",
89
- "@varlet/touch-emulator": "2.10.0"
88
+ "@varlet/icons": "2.10.1-alpha.1682608027166",
89
+ "@varlet/touch-emulator": "2.10.1-alpha.1682608027166"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@vue/runtime-core": "3.2.47",
@@ -96,8 +96,8 @@
96
96
  "lodash-es": "^4.17.21",
97
97
  "vue": "3.2.47",
98
98
  "vue-router": "4.1.6",
99
- "@varlet/touch-emulator": "2.10.0",
100
- "@varlet/icons": "2.10.0"
99
+ "@varlet/touch-emulator": "2.10.1-alpha.1682608027166",
100
+ "@varlet/icons": "2.10.1-alpha.1682608027166"
101
101
  },
102
102
  "scripts": {
103
103
  "dev": "tsc --watch",