@varlet/cli 1.23.4-alpha.8 → 1.23.5

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 CHANGED
@@ -3,6 +3,24 @@
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.23.5](https://github.com/haoziqaq/varlet/compare/v1.23.4...v1.23.5) (2021-11-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cli:** add module moduleCompatible option in varlet.config.js ([0b1d95f](https://github.com/haoziqaq/varlet/commit/0b1d95fc740a225240ee3f28e06015f4538b2304))
12
+ * **cli:** expose lib folder ([2a8848a](https://github.com/haoziqaq/varlet/commit/2a8848a6f064aa91d56875ba467c46da79589a79))
13
+ * **cli:** fix commonjs compiler ([c5c2b12](https://github.com/haoziqaq/varlet/commit/c5c2b12f163bed130b3c6c0ee0eb805fe4a015f1))
14
+ * **cli:** fix inline css plugin ([3e8b7b4](https://github.com/haoziqaq/varlet/commit/3e8b7b4e5489bc67dd38f8787477f07e2a13e7ac))
15
+ * **cli/compile:** add commonjs bundle ([4a424d4](https://github.com/haoziqaq/varlet/commit/4a424d4c066f7de69cbf561a5bc9279862739637))
16
+ * **cli/compile:** add match commonjs script extname function ([2b5b1bd](https://github.com/haoziqaq/varlet/commit/2b5b1bde5e1c16d4e58ce2a100ae4a1a3cc428ce))
17
+ * **cli/compile:** fix compile module readdir ([9c3ad08](https://github.com/haoziqaq/varlet/commit/9c3ad08410009e50b288f033b8fdbe10a8c01160))
18
+ * **ui/popup,input:** support nuxt ([def81ef](https://github.com/haoziqaq/varlet/commit/def81ef821a8ce679287702316bd98ca363bc7f4))
19
+
20
+
21
+
22
+
23
+
6
24
  ## [1.23.3](https://github.com/haoziqaq/varlet/compare/v1.23.2...v1.23.3) (2021-11-20)
7
25
 
8
26
 
@@ -47,6 +47,7 @@ var compileScript_1 = require("./compileScript");
47
47
  var compileStyle_1 = require("./compileStyle");
48
48
  var vite_config_1 = require("../config/vite.config");
49
49
  var varlet_config_1 = require("../config/varlet.config");
50
+ var compileTypes_1 = require("./compileTypes");
50
51
  function compileUMD() {
51
52
  return new Promise(function (resolve, reject) {
52
53
  var config = (0, vite_config_1.getUMDConfig)((0, varlet_config_1.getVarletConfig)());
@@ -161,6 +162,7 @@ function compileModule(modules) {
161
162
  return [4 /*yield*/, (modules === 'commonjs' ? (0, compileScript_1.compileCommonJSEntry)(dest, publicDirs) : (0, compileScript_1.compileESEntry)(dest, publicDirs))];
162
163
  case 7:
163
164
  _a.sent();
165
+ (0, compileTypes_1.generateReference)(dest);
164
166
  return [2 /*return*/];
165
167
  }
166
168
  });
@@ -1 +1,2 @@
1
+ export declare function generateReference(moduleDir: string): void;
1
2
  export declare function compileTypes(): Promise<void>;
@@ -36,13 +36,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.compileTypes = void 0;
39
+ exports.compileTypes = exports.generateReference = void 0;
40
40
  var fs_extra_1 = require("fs-extra");
41
41
  var constant_1 = require("../shared/constant");
42
42
  var fsUtils_1 = require("../shared/fsUtils");
43
43
  var path_1 = require("path");
44
44
  var varlet_config_1 = require("../config/varlet.config");
45
45
  var lodash_1 = require("lodash");
46
+ function generateReference(moduleDir) {
47
+ (0, fs_extra_1.writeFileSync)((0, path_1.resolve)(moduleDir, 'index.d.ts'), "export * from '" + (0, path_1.relative)(moduleDir, constant_1.TYPES_DIR) + "'\n");
48
+ }
49
+ exports.generateReference = generateReference;
46
50
  function compileTypes() {
47
51
  return __awaiter(this, void 0, void 0, function () {
48
52
  var varletConfig, namespace, name, dir, ignoreEntryDir, exports, declares, template, globalTemplate;
@@ -80,13 +80,16 @@ function inlineCSS(fileName, dir) {
80
80
  apply: 'build',
81
81
  closeBundle: function () {
82
82
  var cssFile = (0, path_1.resolve)(dir, 'style.css');
83
+ if (!(0, fs_extra_1.pathExistsSync)(cssFile)) {
84
+ return;
85
+ }
83
86
  var jsFile = (0, path_1.resolve)(dir, fileName);
84
87
  var cssCode = (0, fs_extra_1.readFileSync)(cssFile, 'utf-8');
85
88
  var jsCode = (0, fs_extra_1.readFileSync)(jsFile, 'utf-8');
86
89
  var injectCode = ";(function(){var style=document.createElement('style');style.type='text/css';style.rel='stylesheet';style.appendChild(document.createTextNode(`" + cssCode.replace(/\\/g, '\\\\') + "`));var head=document.querySelector('head');head.appendChild(style)})();";
90
+ (0, fs_extra_1.writeFileSync)(jsFile, "" + injectCode + jsCode);
87
91
  (0, fs_extra_1.copyFileSync)(cssFile, (0, path_1.resolve)(constant_1.LIB_DIR, 'style.css'));
88
92
  (0, fs_extra_1.removeSync)(cssFile);
89
- (0, fs_extra_1.writeFileSync)(jsFile, "" + injectCode + jsCode);
90
93
  },
91
94
  };
92
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "1.23.4-alpha.8+c5c2b12f",
3
+ "version": "1.23.5",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/index.js"
@@ -31,7 +31,7 @@
31
31
  "dev": "tsc --watch",
32
32
  "build": "tsc"
33
33
  },
34
- "gitHead": "c5c2b12f163bed130b3c6c0ee0eb805fe4a015f1",
34
+ "gitHead": "013da06688feb68a175e31dc8d91a16071dba461",
35
35
  "dependencies": {
36
36
  "@babel/core": "^7.14.8",
37
37
  "@babel/preset-env": "^7.14.8",
@@ -47,7 +47,7 @@
47
47
  "@vitejs/plugin-vue": "1.9.2",
48
48
  "@vitejs/plugin-vue-jsx": "1.1.8",
49
49
  "@vue/babel-plugin-jsx": "^1.0.7",
50
- "@vue/compiler-sfc": "3.2.16",
50
+ "@vue/compiler-sfc": "3.2.22",
51
51
  "@vue/test-utils": "^2.0.0-rc.6",
52
52
  "babel-jest": "26.6.3",
53
53
  "chalk": "^4.1.0",