@varlet/cli 3.6.3 → 3.6.4
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ejs from 'ejs';
|
|
2
2
|
import fse from 'fs-extra';
|
|
3
3
|
import logger from '../shared/logger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { pascalCase, camelize, kebabCase } from '@varlet/shared';
|
|
5
5
|
import { input, confirm, select } from '@inquirer/prompts';
|
|
6
6
|
import { resolve } from 'path';
|
|
7
7
|
import { glob } from '../shared/fsUtils.js';
|
|
@@ -15,7 +15,7 @@ async function renderTemplates(componentFolder, componentFolderName, renderData)
|
|
|
15
15
|
const code = ejs.render(templateCode, renderData);
|
|
16
16
|
const file = template
|
|
17
17
|
.replace('[componentName]', camelize(componentFolderName))
|
|
18
|
-
.replace('[ComponentName]',
|
|
18
|
+
.replace('[ComponentName]', pascalCase(componentFolderName))
|
|
19
19
|
.replace('.ejs', '');
|
|
20
20
|
writeFileSync(file, code);
|
|
21
21
|
removeSync(template);
|
|
@@ -26,7 +26,7 @@ export async function create(options) {
|
|
|
26
26
|
const { namespace } = await getVarletConfig();
|
|
27
27
|
const renderData = {
|
|
28
28
|
namespace,
|
|
29
|
-
bigCamelizeNamespace:
|
|
29
|
+
bigCamelizeNamespace: pascalCase(namespace),
|
|
30
30
|
kebabCaseName: 'component-name',
|
|
31
31
|
bigCamelizeName: 'ComponentName',
|
|
32
32
|
camelizeName: 'componentName',
|
|
@@ -40,7 +40,7 @@ export async function create(options) {
|
|
|
40
40
|
});
|
|
41
41
|
renderData.kebabCaseName = kebabCase(name);
|
|
42
42
|
renderData.camelizeName = camelize(name);
|
|
43
|
-
renderData.bigCamelizeName =
|
|
43
|
+
renderData.bigCamelizeName = pascalCase(name);
|
|
44
44
|
const componentFolder = resolve(SRC_DIR, renderData.kebabCaseName);
|
|
45
45
|
const componentFolderName = renderData.kebabCaseName;
|
|
46
46
|
if (pathExistsSync(componentFolder)) {
|
|
@@ -21,6 +21,9 @@ export async function lint() {
|
|
|
21
21
|
'./packages/varlet-vscode-extension/src',
|
|
22
22
|
'./packages/varlet-ui-playground/src',
|
|
23
23
|
'./packages/varlet-import-resolver/src',
|
|
24
|
+
'./packages/varlet-vite-plugins/src',
|
|
25
|
+
'./packages/varlet-preset-unocss/src',
|
|
26
|
+
'./packages/varlet-preset-tailwindcss/src',
|
|
24
27
|
];
|
|
25
28
|
const { stdout } = await x('eslint', [
|
|
26
29
|
...eslintPatterns.filter((pattern) => isDir(resolve(CWD, pattern))),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ES_DIR } from '../shared/constant.js';
|
|
2
2
|
import { transformAsync } from '@babel/core';
|
|
3
|
-
import {
|
|
3
|
+
import { pascalCase } from '@varlet/shared';
|
|
4
4
|
import { getVersion, isDir, isJsx, isTsx, replaceExt } from '../shared/fsUtils.js';
|
|
5
5
|
import { extractStyleDependencies, IMPORT_CSS_RE, IMPORT_LESS_RE, IMPORT_SCSS_RE } from './compileStyle.js';
|
|
6
6
|
import { resolve, relative, extname, dirname } from 'path';
|
|
@@ -152,7 +152,7 @@ export function generateEsEntryTemplate(options) {
|
|
|
152
152
|
const cssImports = [];
|
|
153
153
|
const publicComponents = [];
|
|
154
154
|
publicDirs.forEach((dirname) => {
|
|
155
|
-
const publicComponent =
|
|
155
|
+
const publicComponent = pascalCase(dirname);
|
|
156
156
|
const module = `'${root}${dirname}/index${scriptExtname}'`;
|
|
157
157
|
publicComponents.push(publicComponent);
|
|
158
158
|
imports.push(`import ${publicComponent} from ${module}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fse from 'fs-extra';
|
|
2
2
|
import { TYPES_DIR, UI_PACKAGE_JSON } from '../shared/constant.js';
|
|
3
|
-
import {
|
|
3
|
+
import { pascalCase } from '@varlet/shared';
|
|
4
4
|
import { resolve, relative } from 'path';
|
|
5
5
|
import { getVarletConfig } from '../config/varlet.config.js';
|
|
6
6
|
import { compileStyleVars } from './compileStyleVars.js';
|
|
@@ -22,7 +22,7 @@ export async function compileTypes() {
|
|
|
22
22
|
const directiveDeclares = [];
|
|
23
23
|
includeFilenames.forEach((filename) => {
|
|
24
24
|
const folder = filename.replace('.d.ts', '');
|
|
25
|
-
const name =
|
|
25
|
+
const name = pascalCase(folder);
|
|
26
26
|
exports.push(`export * from './${folder}'`);
|
|
27
27
|
if (filename.startsWith(namespace)) {
|
|
28
28
|
// ignore prefix with namespace e.g. varComponent
|
|
@@ -32,7 +32,7 @@ export async function compileTypes() {
|
|
|
32
32
|
directiveDeclares.push(`v${name}: typeof import('${libraryName}')['_${name}Component']`);
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
componentDeclares.push(`${
|
|
35
|
+
componentDeclares.push(`${pascalCase(namespace)}${name}: typeof import('${libraryName}')['_${name}Component']`);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
const vueDeclares = `\
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "cli of varlet",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@babel/preset-typescript": "^7.24.7",
|
|
38
38
|
"@inquirer/prompts": "^6.0.1",
|
|
39
39
|
"@varlet/icon-builder": "0.2.14",
|
|
40
|
-
"@varlet/release": "^0.
|
|
40
|
+
"@varlet/release": "^0.3.1",
|
|
41
41
|
"@vitejs/plugin-vue": "5.1.4",
|
|
42
42
|
"@vitejs/plugin-vue-jsx": "4.0.1",
|
|
43
43
|
"@vue/babel-plugin-jsx": "1.2.5",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"vite": "5.4.6",
|
|
62
62
|
"vitest": "2.1.1",
|
|
63
63
|
"vue": "3.4.21",
|
|
64
|
-
"@varlet/shared": "3.6.
|
|
65
|
-
"@varlet/vite-plugins": "3.6.
|
|
64
|
+
"@varlet/shared": "3.6.4",
|
|
65
|
+
"@varlet/vite-plugins": "3.6.4"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/babel__core": "^7.20.1",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"@types/node": "^18.7.20",
|
|
75
75
|
"@types/sharp": "0.31.1",
|
|
76
76
|
"rimraf": "^5.0.1",
|
|
77
|
-
"@varlet/icons": "3.6.
|
|
78
|
-
"@varlet/
|
|
79
|
-
"@varlet/
|
|
77
|
+
"@varlet/icons": "3.6.4",
|
|
78
|
+
"@varlet/ui": "3.6.4",
|
|
79
|
+
"@varlet/touch-emulator": "3.6.4"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@vitest/coverage-istanbul": "2.0.5",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"live-server": "^1.2.1",
|
|
88
88
|
"vue": "3.4.21",
|
|
89
89
|
"vue-router": "4.2.0",
|
|
90
|
-
"@varlet/
|
|
91
|
-
"@varlet/
|
|
92
|
-
"@varlet/
|
|
90
|
+
"@varlet/icons": "3.6.4",
|
|
91
|
+
"@varlet/ui": "3.6.4",
|
|
92
|
+
"@varlet/touch-emulator": "3.6.4"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"dev": "tsc --watch",
|
package/site/mobile/App.vue
CHANGED
|
@@ -94,7 +94,7 @@ import { computed, defineComponent, ref, watch, type Ref, type ComputedRef } fro
|
|
|
94
94
|
import { useRoute } from 'vue-router'
|
|
95
95
|
import { getBrowserTheme, watchLang, watchTheme, setTheme, getMobileIndex, type Theme } from '@varlet/cli/client'
|
|
96
96
|
import { removeEmpty, inIframe, isPhone } from '../utils'
|
|
97
|
-
import {
|
|
97
|
+
import { pascalCase } from '@varlet/shared'
|
|
98
98
|
|
|
99
99
|
export default defineComponent({
|
|
100
100
|
setup() {
|
|
@@ -147,8 +147,8 @@ export default defineComponent({
|
|
|
147
147
|
watch(
|
|
148
148
|
() => route.path,
|
|
149
149
|
(to: string) => {
|
|
150
|
-
const componentName =
|
|
151
|
-
const redirectName =
|
|
150
|
+
const componentName = pascalCase(to.slice(1))
|
|
151
|
+
const redirectName = pascalCase(redirect.slice(1))
|
|
152
152
|
bigCamelizeComponentName.value = componentName === redirectName ? '' : componentName
|
|
153
153
|
showBackIcon.value = componentName !== redirectName
|
|
154
154
|
}
|