@varlet/cli 2.0.0-alpha.1663742071515 → 2.0.0-alpha.1664032365126
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/README.en-US.md +1 -1
- package/README.md +1 -1
- package/lib/commands/create.js +58 -73
- package/lib/commands/gen.js +5 -10
- package/package.json +6 -7
- package/template/create/{tsx.ejs → [ComponentName].tsx.ejs} +2 -2
- package/template/create/{vue.ejs → [ComponentName].vue.ejs} +2 -2
- package/template/create/{less.ejs → [componentName].less.ejs} +0 -0
- package/template/create/__tests__/{index.spec.ejs → index.spec.js.ejs} +6 -1
- package/template/create/example/{index.ejs → index.vue.ejs} +0 -0
- package/template/create/{index.ejs → index.ts.ejs} +0 -1
- package/template/generators/base/.prettierignore +6 -1
- package/template/generators/base/README.md +1 -1
- package/template/generators/base/public/logo.svg +30 -1
- package/template/generators/config/default/base/docs/home.zh-CN.md +0 -8
- package/template/generators/config/default/base/package.json +12 -5
- package/template/generators/config/default/base/varlet.config.js +0 -65
- package/template/generators/config/default/sfc/src/button/Button.vue +3 -2
- package/template/generators/config/default/sfc/src/button/button.less +2 -2
- package/template/generators/config/default/sfc/src/button/docs/zh-CN.md +2 -11
- package/template/generators/config/default/sfc/src/button/example/BasicUse.vue +2 -2
- package/template/generators/config/default/sfc/src/button/example/ModifyColor.vue +2 -2
- package/template/generators/config/default/sfc/src/button/example/index.vue +3 -4
- package/template/generators/config/default/tsx/src/button/Button.tsx +2 -2
- package/template/generators/config/default/tsx/src/button/button.less +2 -2
- package/template/generators/config/default/tsx/src/button/docs/zh-CN.md +2 -11
- package/template/generators/config/default/tsx/src/button/example/BasicUse.vue +2 -2
- package/template/generators/config/default/tsx/src/button/example/ModifyColor.vue +2 -2
- package/template/generators/config/default/tsx/src/button/example/index.vue +3 -4
- package/template/generators/config/i18n/base/docs/home.en-US.md +0 -8
- package/template/generators/config/i18n/base/docs/home.zh-CN.md +0 -8
- package/template/generators/config/i18n/base/package.json +11 -4
- package/template/generators/config/i18n/base/varlet.config.js +0 -75
- package/template/generators/config/i18n/sfc/src/button/Button.vue +6 -5
- package/template/generators/config/i18n/sfc/src/button/button.less +2 -2
- package/template/generators/config/i18n/sfc/src/button/docs/en-US.md +7 -3
- package/template/generators/config/i18n/sfc/src/button/docs/zh-CN.md +6 -2
- package/template/generators/config/i18n/sfc/src/button/example/BasicUse.vue +2 -2
- package/template/generators/config/i18n/sfc/src/button/example/ModifyColor.vue +2 -2
- package/template/generators/config/i18n/sfc/src/button/example/index.vue +5 -2
- package/template/generators/config/i18n/tsx/src/button/Button.tsx +6 -8
- package/template/generators/config/i18n/tsx/src/button/button.less +2 -2
- package/template/generators/config/i18n/tsx/src/button/docs/en-US.md +7 -3
- package/template/generators/config/i18n/tsx/src/button/docs/zh-CN.md +6 -2
- package/template/generators/config/i18n/tsx/src/button/example/BasicUse.vue +3 -3
- package/template/generators/config/i18n/tsx/src/button/example/ModifyColor.vue +2 -2
- package/template/generators/config/i18n/tsx/src/button/example/index.vue +5 -2
- package/template/generators/config/i18n/tsx/src/button/index.ts +1 -1
- package/lib/commands/test.d.ts +0 -7
- package/lib/commands/test.js +0 -26
- package/lib/commands/useVite.d.ts +0 -1
- package/lib/commands/useVite.js +0 -70
- package/lib/config/vitest.config.d.ts +0 -2
- package/lib/config/vitest.config.js +0 -28
- package/template/generators/base/public/highlight.css +0 -1
package/lib/commands/useVite.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.useVite = void 0;
|
|
43
|
-
var vite_1 = require("vite");
|
|
44
|
-
var plugin_vue_1 = __importDefault(require("@vitejs/plugin-vue"));
|
|
45
|
-
var constant_1 = require("../shared/constant");
|
|
46
|
-
function useVite(mode) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
-
var action, result;
|
|
49
|
-
return __generator(this, function (_a) {
|
|
50
|
-
switch (_a.label) {
|
|
51
|
-
case 0:
|
|
52
|
-
action = mode === 'build' ? vite_1.build : vite_1.createServer;
|
|
53
|
-
return [4 /*yield*/, action({
|
|
54
|
-
root: constant_1.CWD,
|
|
55
|
-
plugins: [(0, plugin_vue_1.default)()],
|
|
56
|
-
})];
|
|
57
|
-
case 1:
|
|
58
|
-
result = _a.sent();
|
|
59
|
-
if (!(mode === 'dev')) return [3 /*break*/, 3];
|
|
60
|
-
return [4 /*yield*/, result.listen()];
|
|
61
|
-
case 2:
|
|
62
|
-
_a.sent();
|
|
63
|
-
result.printUrls();
|
|
64
|
-
_a.label = 3;
|
|
65
|
-
case 3: return [2 /*return*/];
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
exports.useVite = useVite;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const plugin_vue_1 = __importDefault(require("@vitejs/plugin-vue"));
|
|
7
|
-
const plugin_vue_jsx_1 = __importDefault(require("@vitejs/plugin-vue-jsx"));
|
|
8
|
-
const config_1 = require("vitest/config");
|
|
9
|
-
const constant_1 = require("../shared/constant");
|
|
10
|
-
exports.default = (0, config_1.defineConfig)({
|
|
11
|
-
resolve: {
|
|
12
|
-
alias: {
|
|
13
|
-
'@config': constant_1.SITE_CONFIG,
|
|
14
|
-
},
|
|
15
|
-
extensions: constant_1.VITE_RESOLVE_EXTENSIONS,
|
|
16
|
-
},
|
|
17
|
-
plugins: [(0, plugin_vue_1.default)(), (0, plugin_vue_jsx_1.default)()],
|
|
18
|
-
test: {
|
|
19
|
-
environment: 'jsdom',
|
|
20
|
-
coverage: {
|
|
21
|
-
provider: 'istanbul',
|
|
22
|
-
},
|
|
23
|
-
globals: true,
|
|
24
|
-
transformMode: {
|
|
25
|
-
web: [/\.[jt]sx$/],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.hljs{display:block;overflow-x:auto;padding:.5em;background:#011627;color:#d6deeb}.hljs-keyword{color:#c792ea;font-style:italic}.hljs-built_in{color:#addb67;font-style:italic}.hljs-type{color:#82aaff}.hljs-literal{color:#ff5874}.hljs-number{color:#f78c6c}.hljs-regexp{color:#5ca7e4}.hljs-string{color:#ecc48d}.hljs-subst{color:#d3423e}.hljs-symbol{color:#82aaff}.hljs-class{color:#ffcb8b}.hljs-function{color:#82aaff}.hljs-title{color:#dcdcaa;font-style:italic}.hljs-params{color:#7fdbca}.hljs-comment{color:#637777;font-style:italic}.hljs-doctag{color:#7fdbca}.hljs-meta{color:#82aaff}.hljs-meta-keyword{color:#82aaff}.hljs-meta-string{color:#ecc48d}.hljs-section{color:#82b1ff}.hljs-builtin-name,.hljs-name,.hljs-tag{color:#7fdbca}.hljs-attr{color:#7fdbca}.hljs-attribute{color:#80cbc4}.hljs-variable{color:#addb67}.hljs-bullet{color:#d9f5dd}.hljs-code{color:#80cbc4}.hljs-emphasis{color:#c792ea;font-style:italic}.hljs-strong{color:#addb67;font-weight:700}.hljs-formula{color:#c792ea}.hljs-link{color:#ff869a}.hljs-quote{color:#697098;font-style:italic}.hljs-selector-tag{color:#ff6363}.hljs-selector-id{color:#fad430}.hljs-selector-class{color:#addb67;font-style:italic}.hljs-selector-attr,.hljs-selector-pseudo{color:#c792ea;font-style:italic}.hljs-template-tag{color:#c792ea}.hljs-template-variable{color:#addb67}.hljs-addition{color:#addb67ff;font-style:italic}.hljs-deletion{color:#ef535090;font-style:italic}
|