@varlet/cli 1.23.11 → 1.24.2-alpha.1640861757955
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/CHANGELOG.md +26 -0
- package/generators/base/package.json +2 -2
- package/lib/commands/changelog.d.ts +6 -0
- package/lib/commands/changelog.js +27 -0
- package/lib/commands/commitLint.d.ts +1 -0
- package/lib/commands/commitLint.js +21 -0
- package/lib/commands/compile.js +3 -3
- package/lib/commands/create.js +8 -8
- package/lib/commands/dev.js +2 -2
- package/lib/commands/gen.js +3 -3
- package/lib/commands/jest.js +1 -1
- package/lib/commands/release.d.ts +1 -0
- package/lib/commands/release.js +197 -0
- package/lib/compiler/compileSFC.js +5 -5
- package/lib/compiler/compileScript.js +19 -19
- package/lib/compiler/compileSiteEntry.js +7 -7
- package/lib/compiler/compileStyle.js +6 -6
- package/lib/compiler/compileTemplateHighlight.js +4 -4
- package/lib/compiler/compileTypes.js +5 -5
- package/lib/config/jest.config.js +3 -3
- package/lib/config/vite.config.js +5 -5
- package/lib/index.js +13 -2
- package/package.json +30 -37
- package/site/components/code-example/CodeExample.vue +107 -0
- package/site/components/code-example/codeExample.less +23 -0
- package/site/components/code-example/index.ts +10 -0
- package/site/components/icon/icon.less +1 -0
- package/site/components/loading/props.ts +2 -2
- package/site/components/snackbar/Snackbar.vue +38 -0
- package/site/components/snackbar/core.vue +117 -0
- package/site/components/snackbar/index.tsx +270 -0
- package/site/components/snackbar/props.ts +94 -0
- package/site/components/snackbar/snackbar.less +135 -0
- package/site/components/utils/elements.ts +8 -0
- package/site/components/utils/shared.ts +3 -0
- package/site/mobile/App.vue +6 -6
- package/site/module.d.ts +4 -0
- package/site/pc/App.vue +8 -10
- package/site/pc/components/AppHeader.vue +8 -9
- package/site/pc/components/AppSidebar.vue +6 -6
- package/site/pc/main.ts +8 -2
- package/site/tsconfig.json +1 -6
- package/site/useProgress.ts +6 -2
- package/site/utils.ts +4 -3
- package/tsconfig.json +0 -2
- package/varlet.default.config.js +13 -0
- package/generators/base/.gitignore +0 -14
- package/site/.DS_Store +0 -0
- package/site/components/.DS_Store +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.24.0](https://github.com/haoziqaq/varlet/compare/v1.23.11...v1.24.0) (2021-12-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **cli/site:** adjust z-index of the sidebar and code toolbar for site ([5b81918](https://github.com/haoziqaq/varlet/commit/5b8191822305e5a485003223d3109a6554b33251))
|
|
12
|
+
* **site:** modify code example style ([bb33910](https://github.com/haoziqaq/varlet/commit/bb3391008bdafbf052b8485b79bb54270ca27771))
|
|
13
|
+
* fix test fail ([78f20ec](https://github.com/haoziqaq/varlet/commit/78f20ec46bea357fd12c1da68b02ce7dc9cc2918))
|
|
14
|
+
* **cli:** fix icon vertical-align ([f015092](https://github.com/haoziqaq/varlet/commit/f0150923b9d33c6f61c9810887ea294015a35621))
|
|
15
|
+
* **site:** add types ([6520984](https://github.com/haoziqaq/varlet/commit/6520984af6eb13b772783540aa72427cf1e4403e))
|
|
16
|
+
* **site:** fix mobile style ([3189225](https://github.com/haoziqaq/varlet/commit/31892257a3611e2c6fa39d01cd0d87d4cc2d5ebb))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **cli:** add clipboard and fold tool for site ([5298c99](https://github.com/haoziqaq/varlet/commit/5298c996a6ea890ee29c01c254704f06d157df4c))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Reverts
|
|
25
|
+
|
|
26
|
+
* revert fix mobile style ([22d9da9](https://github.com/haoziqaq/varlet/commit/22d9da9beaf88fa1a29394bc07141e5ec3355c42))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
6
32
|
## [1.23.11](https://github.com/haoziqaq/varlet/compare/v1.23.10...v1.23.11) (2021-12-10)
|
|
7
33
|
|
|
8
34
|
**Note:** Version bump only for package @varlet/cli
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lint": "varlet-cli lint",
|
|
27
27
|
"genlog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
28
28
|
"genAllLog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
29
|
-
"release": "
|
|
29
|
+
"release": "pnpm compile && release-it",
|
|
30
30
|
"test": "varlet-cli jest",
|
|
31
31
|
"test:watch": "varlet-cli jest -w",
|
|
32
32
|
"test:watchAll": "varlet-cli jest -wa"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"vue": "^3.2.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@varlet/cli": "
|
|
38
|
+
"@varlet/cli": "workspace:*",
|
|
39
39
|
"vue": "3.2.16"
|
|
40
40
|
},
|
|
41
41
|
"release-it": {
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
exports.changelog = void 0;
|
|
7
|
+
var ora_1 = __importDefault(require("ora"));
|
|
8
|
+
var conventional_changelog_1 = __importDefault(require("conventional-changelog"));
|
|
9
|
+
var fs_extra_1 = require("fs-extra");
|
|
10
|
+
var path_1 = require("path");
|
|
11
|
+
var constant_1 = require("../shared/constant");
|
|
12
|
+
function changelog(_a) {
|
|
13
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.releaseCount, releaseCount = _c === void 0 ? 0 : _c, _d = _b.file, file = _d === void 0 ? 'CHANGELOG.md' : _d;
|
|
14
|
+
var s = (0, ora_1.default)().start("Generating changelog");
|
|
15
|
+
return new Promise(function (resolve) {
|
|
16
|
+
(0, conventional_changelog_1.default)({
|
|
17
|
+
preset: 'angular',
|
|
18
|
+
releaseCount: releaseCount,
|
|
19
|
+
})
|
|
20
|
+
.pipe((0, fs_extra_1.createWriteStream)((0, path_1.resolve)(constant_1.CWD, file)))
|
|
21
|
+
.on('close', function () {
|
|
22
|
+
s.succeed("Changelog generated success!");
|
|
23
|
+
resolve();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.changelog = changelog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function commitLint(gitParams: string): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
exports.commitLint = void 0;
|
|
7
|
+
var logger_1 = __importDefault(require("../shared/logger"));
|
|
8
|
+
var semver_1 = __importDefault(require("semver"));
|
|
9
|
+
function isVersion(message) {
|
|
10
|
+
return message.startsWith('v') && semver_1.default.valid(message.slice(1));
|
|
11
|
+
}
|
|
12
|
+
function commitLint(gitParams) {
|
|
13
|
+
var message = require('fs').readFileSync(gitParams, 'utf-8').trim();
|
|
14
|
+
var COMMIT_MESSAGE_RE = /^(revert|fix|feat|docs|perf|test|types|style|build|chore|release|refactor)(\(.+\))?: (.|\n)+/;
|
|
15
|
+
if (!isVersion(message) && !COMMIT_MESSAGE_RE.test(message)) {
|
|
16
|
+
logger_1.default.error("Commit message invalid");
|
|
17
|
+
logger_1.default.warning("The rules for commit messages are as follows\n\nExample:\n\nfeat: added a new feature\nfeat(ui/button): added a new feature in the ui/button scope\n\nfix: fixed a bug\nfix(ui/button): fixed a bug in the ui/button scope\n\ndocs: fixed an error in the documentation\ndocs(ui/button): fixed a documentation error in the ui/button scope\n\nAllowed types:\n- fix\n- feat\n- docs\n- perf\n- test\n- types\n- style\n- build\n- chore\n- release\n- refactor\n\nCommit message reference: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y\n\u53C2\u8003\u962E\u4E00\u5CF0Commit message\u7F16\u5199\u6307\u5357: https://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html");
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.commitLint = commitLint;
|
package/lib/commands/compile.js
CHANGED
|
@@ -57,18 +57,18 @@ function runTask(taskName, task) {
|
|
|
57
57
|
return __generator(this, function (_a) {
|
|
58
58
|
switch (_a.label) {
|
|
59
59
|
case 0:
|
|
60
|
-
s = (0, ora_1.default)().start("Compiling "
|
|
60
|
+
s = (0, ora_1.default)().start("Compiling ".concat(taskName));
|
|
61
61
|
_a.label = 1;
|
|
62
62
|
case 1:
|
|
63
63
|
_a.trys.push([1, 3, , 4]);
|
|
64
64
|
return [4 /*yield*/, task()];
|
|
65
65
|
case 2:
|
|
66
66
|
_a.sent();
|
|
67
|
-
s.succeed("Compilation "
|
|
67
|
+
s.succeed("Compilation ".concat(taskName, " completed!"));
|
|
68
68
|
return [3 /*break*/, 4];
|
|
69
69
|
case 3:
|
|
70
70
|
e_1 = _a.sent();
|
|
71
|
-
s.fail("Compilation "
|
|
71
|
+
s.fail("Compilation ".concat(taskName, " failed!"));
|
|
72
72
|
logger_1.default.error(e_1.toString());
|
|
73
73
|
return [3 /*break*/, 4];
|
|
74
74
|
case 4: return [2 /*return*/];
|
package/lib/commands/create.js
CHANGED
|
@@ -56,10 +56,10 @@ function create(name) {
|
|
|
56
56
|
case 0:
|
|
57
57
|
namespace = (0, lodash_1.get)(varletConfig, 'namespace');
|
|
58
58
|
bigCamelizeName = (0, fsUtils_1.bigCamelize)(name);
|
|
59
|
-
vueTemplate = "<template>\n <div class=\""
|
|
60
|
-
indexTemplate = "import "
|
|
61
|
-
testsTemplate = "import example from '../example'\nimport "
|
|
62
|
-
exampleTemplate = "<template>\n <app-type></app-type>\n <"
|
|
59
|
+
vueTemplate = "<template>\n <div class=\"".concat(namespace, "-").concat(name, "\"></div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n name: '").concat((0, fsUtils_1.bigCamelize)(namespace)).concat(bigCamelizeName, "'\n})\n</script>\n\n<style lang=\"less\">\n.").concat(namespace, "-").concat(name, " {\n display: flex;\n}\n</style>\n");
|
|
60
|
+
indexTemplate = "import ".concat(bigCamelizeName, " from './").concat(bigCamelizeName, ".vue'\nimport type { App } from 'vue'\n\n").concat(bigCamelizeName, ".install = function(app: App) {\n app.component(").concat(bigCamelizeName, ".name, ").concat(bigCamelizeName, ")\n}\n\nexport const _").concat(bigCamelizeName, "Component = ").concat(bigCamelizeName, "\n\nexport default ").concat(bigCamelizeName, "\n");
|
|
61
|
+
testsTemplate = "import example from '../example'\nimport ".concat(bigCamelizeName, " from '..'\nimport { createApp } from 'vue'\nimport { mount } from '@vue/test-utils'\n\ntest('test ").concat(name, " example', () => {\n const wrapper = mount(example)\n expect(wrapper.html()).toMatchSnapshot()\n})\n\ntest('test ").concat(name, " plugin', () => {\n const app = createApp({}).use(").concat(bigCamelizeName, ")\n expect(app.component(").concat(bigCamelizeName, ".name)).toBeTruthy()\n})\n");
|
|
62
|
+
exampleTemplate = "<template>\n <app-type></app-type>\n <".concat(namespace, "-").concat(name, "/>\n</template>\n\n<script>\nimport ").concat(bigCamelizeName, " from '..'\nimport AppType from '@varlet/cli/site/mobile/components/AppType'\nimport { watchLang } from '@varlet/cli/site/utils'\nimport { use, pack } from './locale'\n\nexport default {\n name: '").concat(bigCamelizeName, "Example',\n components: {\n [").concat(bigCamelizeName, ".name]: ").concat(bigCamelizeName, ",\n AppType\n },\n setup() {\n\n watchLang(use)\n\n return {\n pack\n }\n }\n}\n</script>\n");
|
|
63
63
|
localeIndexTemplate = "// lib\nimport _zhCN from '../../../locale/zh-CN'\nimport _enCN from '../../../locale/en-US'\n// mobile example doc\nimport zhCN from './zh-CN'\nimport enUS from './en-US'\nimport { useLocale, add as _add, use as _use } from '../../../locale'\n\nconst { add, use: exampleUse, pack, packs, merge } = useLocale()\n\nconst use = (lang: string) => {\n _use(lang)\n exampleUse(lang)\n}\n\nexport { add, pack, packs, merge, use }\n\n// lib\n_add('zh-CN', _zhCN)\n_add('en-US', _enCN)\n// mobile example doc\nadd('zh-CN', zhCN as any)\nadd('en-US', enUS as any)\n";
|
|
64
64
|
localTemplate = "export default {\n\n}\n";
|
|
65
65
|
componentDir = (0, path_1.resolve)(constant_1.SRC_DIR, name);
|
|
@@ -72,7 +72,7 @@ function create(name) {
|
|
|
72
72
|
return [2 /*return*/];
|
|
73
73
|
}
|
|
74
74
|
return [4 /*yield*/, Promise.all([
|
|
75
|
-
(0, fs_extra_1.outputFile)((0, path_1.resolve)(componentDir, bigCamelizeName
|
|
75
|
+
(0, fs_extra_1.outputFile)((0, path_1.resolve)(componentDir, "".concat(bigCamelizeName, ".vue")), vueTemplate),
|
|
76
76
|
(0, fs_extra_1.outputFile)((0, path_1.resolve)(componentDir, 'index.ts'), indexTemplate),
|
|
77
77
|
(0, fs_extra_1.outputFile)((0, path_1.resolve)(testsDir, 'index.spec.js'), testsTemplate),
|
|
78
78
|
(0, fs_extra_1.outputFile)((0, path_1.resolve)(exampleDir, 'index.vue'), exampleTemplate),
|
|
@@ -84,14 +84,14 @@ function create(name) {
|
|
|
84
84
|
])];
|
|
85
85
|
case 1:
|
|
86
86
|
_a.sent();
|
|
87
|
-
logger_1.default.success("Create "
|
|
87
|
+
logger_1.default.success("Create ".concat(name, " success!"));
|
|
88
88
|
logger_1.default.success("----------------------------");
|
|
89
|
-
logger_1.default.success(name
|
|
89
|
+
logger_1.default.success("".concat(name, "/"));
|
|
90
90
|
logger_1.default.success("|- __tests__/ # Unit test folder");
|
|
91
91
|
logger_1.default.success("|- docs/ # Internationalized document folder");
|
|
92
92
|
logger_1.default.success("|- example/ # Mobile phone example code");
|
|
93
93
|
logger_1.default.success("|- example/locale # Example locale");
|
|
94
|
-
logger_1.default.success("|- "
|
|
94
|
+
logger_1.default.success("|- ".concat(bigCamelizeName, ".vue # Sfc component, You can also use jsx or tsx"));
|
|
95
95
|
logger_1.default.success("|- index.ts # Component entry, the folder where the file exists will be exposed to the user");
|
|
96
96
|
return [2 /*return*/];
|
|
97
97
|
}
|
package/lib/commands/dev.js
CHANGED
|
@@ -58,7 +58,7 @@ function startServer(force) {
|
|
|
58
58
|
switch (_c.label) {
|
|
59
59
|
case 0:
|
|
60
60
|
isRestart = Boolean(server);
|
|
61
|
-
logger_1.default.info((isRestart ? 'Res' : 'S'
|
|
61
|
+
logger_1.default.info("".concat(isRestart ? 'Res' : 'S', "tarting server..."));
|
|
62
62
|
// close all instance
|
|
63
63
|
_a = server;
|
|
64
64
|
if (!_a)
|
|
@@ -99,7 +99,7 @@ function startServer(force) {
|
|
|
99
99
|
watcher = chokidar_1.default.watch(constant_1.VARLET_CONFIG);
|
|
100
100
|
watcher.on('change', function () { return startServer(force); });
|
|
101
101
|
}
|
|
102
|
-
logger_1.default.success("\n"
|
|
102
|
+
logger_1.default.success("\n".concat(isRestart ? 'Res' : 'S', "tart successfully!!!"));
|
|
103
103
|
return [2 /*return*/];
|
|
104
104
|
}
|
|
105
105
|
});
|
package/lib/commands/gen.js
CHANGED
|
@@ -53,7 +53,7 @@ function syncVersion(name) {
|
|
|
53
53
|
var file = (0, path_1.resolve)(constant_1.CWD, name, 'package.json');
|
|
54
54
|
var pkg = JSON.parse((0, fs_extra_1.readFileSync)(file, 'utf-8'));
|
|
55
55
|
var cliPkg = JSON.parse((0, fs_extra_1.readFileSync)(constant_1.CLI_PACKAGE_JSON, 'utf-8'));
|
|
56
|
-
pkg.devDependencies['@varlet/cli'] = "^"
|
|
56
|
+
pkg.devDependencies['@varlet/cli'] = "^".concat(cliPkg.version);
|
|
57
57
|
pkg.files = ['es', 'lib', 'umd', 'highlight', 'types', 'README.md'];
|
|
58
58
|
(0, fs_extra_1.writeFileSync)(file, JSON.stringify(pkg, null, 2));
|
|
59
59
|
}
|
|
@@ -65,7 +65,7 @@ function gen(name) {
|
|
|
65
65
|
case 0:
|
|
66
66
|
dest = (0, path_1.resolve)(constant_1.CWD, name);
|
|
67
67
|
if ((0, fs_extra_1.pathExistsSync)(dest)) {
|
|
68
|
-
logger_1.default.warning(name
|
|
68
|
+
logger_1.default.warning("".concat(name, " already exists and cannot be recreated..."));
|
|
69
69
|
return [2 /*return*/];
|
|
70
70
|
}
|
|
71
71
|
return [4 /*yield*/, inquirer_1.default.prompt([
|
|
@@ -89,7 +89,7 @@ function gen(name) {
|
|
|
89
89
|
removeFiles(dest);
|
|
90
90
|
syncVersion(name);
|
|
91
91
|
logger_1.default.success('Application generated successfully!');
|
|
92
|
-
logger_1.default.info(" cd "
|
|
92
|
+
logger_1.default.info(" cd ".concat(name, "\n yarn\n yarn dev"));
|
|
93
93
|
logger_1.default.success("=======================\n Good luck have fun\n======================= ");
|
|
94
94
|
return [2 /*return*/];
|
|
95
95
|
}
|
package/lib/commands/jest.js
CHANGED
|
@@ -56,7 +56,7 @@ function jest(cmd) {
|
|
|
56
56
|
watchAll: cmd.watchAll,
|
|
57
57
|
clearCache: cmd.clearCache,
|
|
58
58
|
config: constant_1.JEST_CONFIG,
|
|
59
|
-
testRegex: cmd.component && cmd.component
|
|
59
|
+
testRegex: cmd.component && "".concat(cmd.component, "/__tests__/.*.spec.[jt]s?$"),
|
|
60
60
|
};
|
|
61
61
|
_a.label = 1;
|
|
62
62
|
case 1:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function release(): Promise<void>;
|
|
@@ -0,0 +1,197 @@
|
|
|
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.release = void 0;
|
|
43
|
+
var inquirer_1 = __importDefault(require("inquirer"));
|
|
44
|
+
var ora_1 = __importDefault(require("ora"));
|
|
45
|
+
var execa_1 = __importDefault(require("execa"));
|
|
46
|
+
var logger_1 = __importDefault(require("../shared/logger"));
|
|
47
|
+
var semver_1 = __importDefault(require("semver"));
|
|
48
|
+
var glob_1 = __importDefault(require("glob"));
|
|
49
|
+
var constant_1 = require("../shared/constant");
|
|
50
|
+
var path_1 = require("path");
|
|
51
|
+
var fs_extra_1 = require("fs-extra");
|
|
52
|
+
var changelog_1 = require("./changelog");
|
|
53
|
+
var releaseTypes = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch'];
|
|
54
|
+
function isWorktreeEmpty() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
+
var ret;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0: return [4 /*yield*/, (0, execa_1.default)('git', ['status', '--porcelain'])];
|
|
60
|
+
case 1:
|
|
61
|
+
ret = _a.sent();
|
|
62
|
+
return [2 /*return*/, !ret.stdout];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function publish() {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
var s, ret;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
switch (_a.label) {
|
|
72
|
+
case 0:
|
|
73
|
+
s = (0, ora_1.default)().start('Publishing all packages');
|
|
74
|
+
return [4 /*yield*/, (0, execa_1.default)('pnpm', ['-r', 'publish', '--no-git-checks', '--access', 'public'])];
|
|
75
|
+
case 1:
|
|
76
|
+
ret = _a.sent();
|
|
77
|
+
s.succeed('Publish all packages successfully');
|
|
78
|
+
ret.stdout && logger_1.default.info(ret.stdout);
|
|
79
|
+
return [2 /*return*/];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function pushGit(version, message) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
+
var s, ret;
|
|
87
|
+
return __generator(this, function (_a) {
|
|
88
|
+
switch (_a.label) {
|
|
89
|
+
case 0:
|
|
90
|
+
s = (0, ora_1.default)().start('Pushing to remote git repository');
|
|
91
|
+
return [4 /*yield*/, (0, execa_1.default)('git', ['add', '.'])];
|
|
92
|
+
case 1:
|
|
93
|
+
_a.sent();
|
|
94
|
+
return [4 /*yield*/, (0, execa_1.default)('git', ['commit', '-m', message])];
|
|
95
|
+
case 2:
|
|
96
|
+
_a.sent();
|
|
97
|
+
return [4 /*yield*/, (0, execa_1.default)('git', ['tag', version])];
|
|
98
|
+
case 3:
|
|
99
|
+
_a.sent();
|
|
100
|
+
return [4 /*yield*/, (0, execa_1.default)('git', ['push'])];
|
|
101
|
+
case 4:
|
|
102
|
+
ret = _a.sent();
|
|
103
|
+
s.succeed('Push remote repository successfully');
|
|
104
|
+
ret.stdout && logger_1.default.info(ret.stdout);
|
|
105
|
+
return [2 /*return*/];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function updateVersion(version) {
|
|
111
|
+
var packageJsons = glob_1.default.sync('packages/*/package.json');
|
|
112
|
+
packageJsons.push('package.json');
|
|
113
|
+
return packageJsons.map(function (path) {
|
|
114
|
+
var file = (0, path_1.resolve)(constant_1.CWD, path);
|
|
115
|
+
var config = require(file);
|
|
116
|
+
var currentVersion = config.version;
|
|
117
|
+
config.version = version;
|
|
118
|
+
(0, fs_extra_1.writeFileSync)(file, JSON.stringify(config, null, 2));
|
|
119
|
+
config.version = currentVersion;
|
|
120
|
+
return { file: file, content: JSON.stringify(config, null, 2) };
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function release() {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
+
var currentVersion, name_1, ret, type, isPreRelease, expectVersion, confirm_1, packageJsonMaps, error_1;
|
|
126
|
+
return __generator(this, function (_a) {
|
|
127
|
+
switch (_a.label) {
|
|
128
|
+
case 0:
|
|
129
|
+
_a.trys.push([0, 8, , 9]);
|
|
130
|
+
currentVersion = require((0, path_1.resolve)(constant_1.CWD, 'package.json')).version;
|
|
131
|
+
if (!currentVersion) {
|
|
132
|
+
logger_1.default.error('Your package is missing the version field');
|
|
133
|
+
return [2 /*return*/];
|
|
134
|
+
}
|
|
135
|
+
return [4 /*yield*/, isWorktreeEmpty()];
|
|
136
|
+
case 1:
|
|
137
|
+
if (!(_a.sent())) {
|
|
138
|
+
logger_1.default.error('Git worktree is not empty, please commit changed');
|
|
139
|
+
return [2 /*return*/];
|
|
140
|
+
}
|
|
141
|
+
name_1 = 'Please select release type';
|
|
142
|
+
return [4 /*yield*/, inquirer_1.default.prompt([
|
|
143
|
+
{
|
|
144
|
+
name: name_1,
|
|
145
|
+
type: 'list',
|
|
146
|
+
choices: releaseTypes,
|
|
147
|
+
},
|
|
148
|
+
])];
|
|
149
|
+
case 2:
|
|
150
|
+
ret = _a.sent();
|
|
151
|
+
type = ret[name_1];
|
|
152
|
+
isPreRelease = type.startsWith('pre');
|
|
153
|
+
expectVersion = semver_1.default.inc(currentVersion, type, "alpha.".concat(Date.now()));
|
|
154
|
+
expectVersion = isPreRelease ? expectVersion.slice(0, -2) : expectVersion;
|
|
155
|
+
name_1 = 'version confirm';
|
|
156
|
+
return [4 /*yield*/, inquirer_1.default.prompt([
|
|
157
|
+
{
|
|
158
|
+
name: name_1,
|
|
159
|
+
type: 'confirm',
|
|
160
|
+
message: "All packages version ".concat(currentVersion, " -> ").concat(expectVersion, ":"),
|
|
161
|
+
},
|
|
162
|
+
])];
|
|
163
|
+
case 3:
|
|
164
|
+
confirm_1 = _a.sent();
|
|
165
|
+
if (!confirm_1[name_1]) {
|
|
166
|
+
return [2 /*return*/];
|
|
167
|
+
}
|
|
168
|
+
packageJsonMaps = updateVersion(expectVersion);
|
|
169
|
+
if (!!isPreRelease) return [3 /*break*/, 6];
|
|
170
|
+
return [4 /*yield*/, (0, changelog_1.changelog)()];
|
|
171
|
+
case 4:
|
|
172
|
+
_a.sent();
|
|
173
|
+
return [4 /*yield*/, pushGit(expectVersion, "v".concat(expectVersion))];
|
|
174
|
+
case 5:
|
|
175
|
+
_a.sent();
|
|
176
|
+
_a.label = 6;
|
|
177
|
+
case 6: return [4 /*yield*/, publish()];
|
|
178
|
+
case 7:
|
|
179
|
+
_a.sent();
|
|
180
|
+
if (isPreRelease) {
|
|
181
|
+
packageJsonMaps.forEach(function (_a) {
|
|
182
|
+
var file = _a.file, content = _a.content;
|
|
183
|
+
return (0, fs_extra_1.writeFileSync)(file, content);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
logger_1.default.success("Release version ".concat(expectVersion, " successfully!"));
|
|
187
|
+
return [3 /*break*/, 9];
|
|
188
|
+
case 8:
|
|
189
|
+
error_1 = _a.sent();
|
|
190
|
+
logger_1.default.error(error_1.toString());
|
|
191
|
+
return [3 /*break*/, 9];
|
|
192
|
+
case 9: return [2 /*return*/];
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
exports.release = release;
|
|
@@ -51,10 +51,10 @@ var NORMAL_EXPORT_START_RE = /export\s+default\s+{/;
|
|
|
51
51
|
var DEFINE_EXPORT_START_RE = /export\s+default\s+defineComponent\s*\(\s*{/;
|
|
52
52
|
function injectRender(script, render) {
|
|
53
53
|
if (DEFINE_EXPORT_START_RE.test(script.trim())) {
|
|
54
|
-
return script.trim().replace(DEFINE_EXPORT_START_RE, render
|
|
54
|
+
return script.trim().replace(DEFINE_EXPORT_START_RE, "".concat(render, "\nexport default defineComponent({\n render, "));
|
|
55
55
|
}
|
|
56
56
|
if (NORMAL_EXPORT_START_RE.test(script.trim())) {
|
|
57
|
-
return script.trim().replace(NORMAL_EXPORT_START_RE, render
|
|
57
|
+
return script.trim().replace(NORMAL_EXPORT_START_RE, "".concat(render, "\nexport default {\n render, "));
|
|
58
58
|
}
|
|
59
59
|
return script;
|
|
60
60
|
}
|
|
@@ -70,12 +70,12 @@ function compileSFC(sfc) {
|
|
|
70
70
|
descriptor = (0, compiler_sfc_1.parse)(sources, { sourceMap: false }).descriptor;
|
|
71
71
|
script = descriptor.script, scriptSetup = descriptor.scriptSetup, template = descriptor.template, styles = descriptor.styles;
|
|
72
72
|
if (scriptSetup) {
|
|
73
|
-
logger_1.default.warning("\n Varlet Cli does not support compiling script setup syntax \n The error in "
|
|
73
|
+
logger_1.default.warning("\n Varlet Cli does not support compiling script setup syntax \n The error in ".concat(sfc));
|
|
74
74
|
return [2 /*return*/];
|
|
75
75
|
}
|
|
76
76
|
hasScope = styles.some(function (style) { return style.scoped; });
|
|
77
77
|
id = (0, hash_sum_1.default)(sources);
|
|
78
|
-
scopeId = hasScope ? "data-v-"
|
|
78
|
+
scopeId = hasScope ? "data-v-".concat(id) : '';
|
|
79
79
|
if (!script) return [3 /*break*/, 7];
|
|
80
80
|
render = template &&
|
|
81
81
|
(0, compiler_sfc_1.compileTemplate)({
|
|
@@ -103,7 +103,7 @@ function compileSFC(sfc) {
|
|
|
103
103
|
case 3:
|
|
104
104
|
if (!(index < styles.length)) return [3 /*break*/, 7];
|
|
105
105
|
style = styles[index];
|
|
106
|
-
file = (0, fsUtils_1.replaceExt)(sfc, "Sfc"
|
|
106
|
+
file = (0, fsUtils_1.replaceExt)(sfc, "Sfc".concat(index || '', ".").concat(style.lang || 'css'));
|
|
107
107
|
code = (0, compiler_sfc_1.compileStyle)({
|
|
108
108
|
source: style.content,
|
|
109
109
|
filename: file,
|
|
@@ -52,7 +52,7 @@ exports.REQUIRE_VUE_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\
|
|
|
52
52
|
exports.REQUIRE_TS_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\.ts(\s*['"`]\))(?!\s*['"`])/g;
|
|
53
53
|
exports.REQUIRE_JSX_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\.jsx(\s*['"`]\))(?!\s*['"`])/g;
|
|
54
54
|
exports.REQUIRE_TSX_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\.tsx(\s*['"`]\))(?!\s*['"`])/g;
|
|
55
|
-
var scriptReplacer = function (_, p1, p2) { return p1
|
|
55
|
+
var scriptReplacer = function (_, p1, p2) { return "".concat(p1, ".js").concat(p2); };
|
|
56
56
|
var replaceVueExt = function (script) {
|
|
57
57
|
return script.replace(exports.IMPORT_VUE_PATH_RE, scriptReplacer).replace(exports.REQUIRE_VUE_PATH_RE, scriptReplacer);
|
|
58
58
|
};
|
|
@@ -138,17 +138,17 @@ function compileESEntry(dir, publicDirs) {
|
|
|
138
138
|
publicDirs.forEach(function (dirname) {
|
|
139
139
|
var publicComponent = (0, fsUtils_1.bigCamelize)(dirname);
|
|
140
140
|
publicComponents.push(publicComponent);
|
|
141
|
-
imports.push("import "
|
|
142
|
-
constInternalComponents.push("export const _"
|
|
143
|
-
plugins.push(publicComponent
|
|
144
|
-
cssImports.push("import './"
|
|
145
|
-
lessImports.push("import './"
|
|
141
|
+
imports.push("import ".concat(publicComponent, ", * as ").concat(publicComponent, "Module from './").concat(dirname, "'"));
|
|
142
|
+
constInternalComponents.push("export const _".concat(publicComponent, "Component = ").concat(publicComponent, "Module._").concat(publicComponent, "Component || {}"));
|
|
143
|
+
plugins.push("".concat(publicComponent, ".install && app.use(").concat(publicComponent, ")"));
|
|
144
|
+
cssImports.push("import './".concat(dirname, "/style'"));
|
|
145
|
+
lessImports.push("import './".concat(dirname, "/style/less'"));
|
|
146
146
|
});
|
|
147
|
-
install = "\nfunction install(app) {\n "
|
|
148
|
-
indexTemplate = imports.join('\n')
|
|
149
|
-
styleTemplate = cssImports.join('\n')
|
|
150
|
-
umdTemplate = imports.join('\n')
|
|
151
|
-
lessTemplate = lessImports.join('\n')
|
|
147
|
+
install = "\nfunction install(app) {\n ".concat(plugins.join('\n '), "\n}\n");
|
|
148
|
+
indexTemplate = "".concat(imports.join('\n'), "\n\n").concat(constInternalComponents.join('\n'), "\n\n").concat(install, "\nexport {\n install,\n ").concat(publicComponents.join(',\n '), "\n}\n\nexport default {\n install,\n ").concat(publicComponents.join(',\n '), "\n}\n");
|
|
149
|
+
styleTemplate = "".concat(cssImports.join('\n'), "\n");
|
|
150
|
+
umdTemplate = "".concat(imports.join('\n'), "\n\n").concat(cssImports.join('\n'), "\n\n").concat(install, "\nexport {\n install,\n ").concat(publicComponents.join(',\n '), "\n}\n\nexport default {\n install,\n ").concat(publicComponents.join(',\n '), "\n}\n");
|
|
151
|
+
lessTemplate = "".concat(lessImports.join('\n'), "\n");
|
|
152
152
|
return [4 /*yield*/, Promise.all([
|
|
153
153
|
(0, fs_extra_1.writeFile)((0, path_1.resolve)(dir, 'index.js'), indexTemplate, 'utf-8'),
|
|
154
154
|
(0, fs_extra_1.writeFile)((0, path_1.resolve)(dir, 'umdIndex.js'), umdTemplate, 'utf-8'),
|
|
@@ -177,15 +177,15 @@ function compileCommonJSEntry(dir, publicDirs) {
|
|
|
177
177
|
publicDirs.forEach(function (dirname) {
|
|
178
178
|
var publicComponent = (0, fsUtils_1.bigCamelize)(dirname);
|
|
179
179
|
publicComponents.push(publicComponent);
|
|
180
|
-
requires.push("var "
|
|
181
|
-
plugins.push(publicComponent
|
|
182
|
-
cssRequires.push("require('./"
|
|
183
|
-
lessRequires.push("require('./"
|
|
180
|
+
requires.push("var ".concat(publicComponent, " = require('./").concat(dirname, "')['default']"));
|
|
181
|
+
plugins.push("".concat(publicComponent, ".install && app.use(").concat(publicComponent, ")"));
|
|
182
|
+
cssRequires.push("require('./".concat(dirname, "/style')"));
|
|
183
|
+
lessRequires.push("require('./".concat(dirname, "/style/less')"));
|
|
184
184
|
});
|
|
185
|
-
install = "\nfunction install(app) {\n "
|
|
186
|
-
indexTemplate = requires.join('\n')
|
|
187
|
-
styleTemplate = cssRequires.join('\n')
|
|
188
|
-
lessTemplate = lessRequires.join('\n')
|
|
185
|
+
install = "\nfunction install(app) {\n ".concat(plugins.join('\n '), "\n}\n");
|
|
186
|
+
indexTemplate = "".concat(requires.join('\n'), "\n\n").concat(install, "\n\nmodule.exports = {\n install,\n ").concat(publicComponents.join(',\n '), "\n}\n");
|
|
187
|
+
styleTemplate = "".concat(cssRequires.join('\n'), "\n");
|
|
188
|
+
lessTemplate = "".concat(lessRequires.join('\n'), "\n");
|
|
189
189
|
return [4 /*yield*/, Promise.all([
|
|
190
190
|
(0, fs_extra_1.writeFile)((0, path_1.resolve)(dir, 'index.js'), indexTemplate, 'utf-8'),
|
|
191
191
|
(0, fs_extra_1.writeFile)((0, path_1.resolve)(dir, 'style.js'), styleTemplate, 'utf-8'),
|
|
@@ -82,13 +82,13 @@ exports.getExampleRoutePath = getExampleRoutePath;
|
|
|
82
82
|
function getComponentDocsRoutePath(componentDocsPath) {
|
|
83
83
|
var _a;
|
|
84
84
|
var _b = __read((_a = componentDocsPath.match(COMPONENT_DOCS_RE)) !== null && _a !== void 0 ? _a : [], 3), routePath = _b[1], language = _b[2];
|
|
85
|
-
return "/"
|
|
85
|
+
return "/".concat(language, "/").concat(routePath);
|
|
86
86
|
}
|
|
87
87
|
exports.getComponentDocsRoutePath = getComponentDocsRoutePath;
|
|
88
88
|
function getRootDocsRoutePath(rootDocsPath) {
|
|
89
89
|
var _a;
|
|
90
90
|
var _b = __read((_a = rootDocsPath.match(ROOT_DOCS_RE)) !== null && _a !== void 0 ? _a : [], 3), routePath = _b[1], language = _b[2];
|
|
91
|
-
return "/"
|
|
91
|
+
return "/".concat(language, "/").concat(routePath);
|
|
92
92
|
}
|
|
93
93
|
exports.getRootDocsRoutePath = getRootDocsRoutePath;
|
|
94
94
|
function findExamplePaths() {
|
|
@@ -161,8 +161,8 @@ function buildMobileSiteRoutes() {
|
|
|
161
161
|
case 0: return [4 /*yield*/, findExamplePaths()];
|
|
162
162
|
case 1:
|
|
163
163
|
examplePaths = _a.sent();
|
|
164
|
-
routes = examplePaths.map(function (examplePath) { return "\n {\n path: '"
|
|
165
|
-
source = "export default [ "
|
|
164
|
+
routes = examplePaths.map(function (examplePath) { return "\n {\n path: '".concat(getExampleRoutePath(examplePath), "',\n // @ts-ignore\n component: () => import('").concat(examplePath, "')\n }"); });
|
|
165
|
+
source = "export default [ ".concat(routes.join(','), "\n]");
|
|
166
166
|
return [4 /*yield*/, (0, fsUtils_1.outputFileSyncOnChange)(constant_1.SITE_MOBILE_ROUTES, source)];
|
|
167
167
|
case 2:
|
|
168
168
|
_a.sent();
|
|
@@ -180,9 +180,9 @@ function buildPcSiteRoutes() {
|
|
|
180
180
|
case 0: return [4 /*yield*/, Promise.all([findComponentDocsPaths(), findRootDocsPaths()])];
|
|
181
181
|
case 1:
|
|
182
182
|
_a = __read.apply(void 0, [_b.sent(), 2]), componentDocsPaths = _a[0], rootDocsPaths = _a[1];
|
|
183
|
-
componentDocsRoutes = componentDocsPaths.map(function (componentDocsPath) { return "\n {\n path: '"
|
|
184
|
-
rootDocsRoutes = rootDocsPaths.map(function (rootDocsPath) { return "\n {\n path: '"
|
|
185
|
-
source = "export default [ "
|
|
183
|
+
componentDocsRoutes = componentDocsPaths.map(function (componentDocsPath) { return "\n {\n path: '".concat(getComponentDocsRoutePath(componentDocsPath), "',\n // @ts-ignore\n component: () => import('").concat(componentDocsPath, "')\n }"); });
|
|
184
|
+
rootDocsRoutes = rootDocsPaths.map(function (rootDocsPath) { return "\n {\n path: '".concat(getRootDocsRoutePath(rootDocsPath), "',\n // @ts-ignore\n component: () => import('").concat(rootDocsPath, "')\n }"); });
|
|
185
|
+
source = "export default [ ".concat(__spreadArray(__spreadArray([], __read(componentDocsRoutes), false), [rootDocsRoutes], false).join(','), "\n]");
|
|
186
186
|
(0, fsUtils_1.outputFileSyncOnChange)(constant_1.SITE_PC_ROUTES, source);
|
|
187
187
|
return [2 /*return*/];
|
|
188
188
|
}
|
|
@@ -68,16 +68,16 @@ function extractStyleDependencies(file, code, reg, expect, self) {
|
|
|
68
68
|
var modules = process.env.BABEL_MODULE;
|
|
69
69
|
styleImports.forEach(function (styleImport) {
|
|
70
70
|
var normalizedPath = normalizeStyleDependency(styleImport, reg);
|
|
71
|
-
(0, fsUtils_1.smartAppendFileSync)(cssFile, modules === 'commonjs' ? "require('"
|
|
72
|
-
(0, fsUtils_1.smartAppendFileSync)(lessFile, modules === 'commonjs' ? "require('"
|
|
71
|
+
(0, fsUtils_1.smartAppendFileSync)(cssFile, modules === 'commonjs' ? "require('".concat(normalizedPath, ".css')\n") : "import '".concat(normalizedPath, ".css'\n"));
|
|
72
|
+
(0, fsUtils_1.smartAppendFileSync)(lessFile, modules === 'commonjs' ? "require('".concat(normalizedPath, ".").concat(expect, "')\n") : "import '".concat(normalizedPath, ".").concat(expect, "'\n"));
|
|
73
73
|
});
|
|
74
74
|
if (self) {
|
|
75
75
|
(0, fsUtils_1.smartAppendFileSync)(cssFile, modules === 'commonjs'
|
|
76
|
-
? "require('"
|
|
77
|
-
: "import '"
|
|
76
|
+
? "require('".concat(normalizeStyleDependency(base, reg), ".css')\n")
|
|
77
|
+
: "import '".concat(normalizeStyleDependency(base, reg), ".css'\n"));
|
|
78
78
|
(0, fsUtils_1.smartAppendFileSync)(lessFile, modules === 'commonjs'
|
|
79
|
-
? "require('"
|
|
80
|
-
: "import '"
|
|
79
|
+
? "require('".concat(normalizeStyleDependency(base, reg), ".").concat(expect, "')\n")
|
|
80
|
+
: "import '".concat(normalizeStyleDependency(base, reg), ".").concat(expect, "'\n"));
|
|
81
81
|
}
|
|
82
82
|
return code.replace(reg, '');
|
|
83
83
|
}
|