@dcloudio/uni-cli-shared 3.0.0-alpha-3030820220114008 → 3.0.0-alpha-3031120220216001

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.
@@ -7,6 +7,12 @@ export declare const EXTNAME_VUE_RE: RegExp;
7
7
  export declare const EXTNAME_JS_RE: RegExp;
8
8
  export declare const EXTNAME_TS_RE: RegExp;
9
9
  export declare const extensions: string[];
10
+ export declare const PAGES_JSON_JS = "pages-json-js";
11
+ export declare const MANIFEST_JSON_JS = "manifest-json-js";
12
+ export declare const JSON_JS_MAP: {
13
+ readonly 'pages.json': "pages-json-js";
14
+ readonly 'manifest.json': "manifest-json-js";
15
+ };
10
16
  export declare const ASSETS_INLINE_LIMIT: number;
11
17
  export declare const APP_SERVICE_FILENAME = "app-service.js";
12
18
  export declare const BINDING_COMPONENTS = "__BINDING_COMPONENTS__";
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMMON_EXCLUDE = exports.BASE_COMPONENTS_STYLE_PATH = exports.H5_COMPONENTS_STYLE_PATH = exports.H5_FRAMEWORK_STYLE_PATH = exports.H5_API_STYLE_PATH = exports.PAGE_EXTNAME = exports.PAGE_EXTNAME_APP = exports.BINDING_COMPONENTS = exports.APP_SERVICE_FILENAME = exports.ASSETS_INLINE_LIMIT = exports.extensions = exports.EXTNAME_TS_RE = exports.EXTNAME_JS_RE = exports.EXTNAME_VUE_RE = exports.EXTNAME_VUE_TEMPLATE = exports.EXTNAME_VUE = exports.EXTNAME_TS = exports.EXTNAME_JS = exports.PUBLIC_DIR = void 0;
3
+ exports.COMMON_EXCLUDE = exports.BASE_COMPONENTS_STYLE_PATH = exports.H5_COMPONENTS_STYLE_PATH = exports.H5_FRAMEWORK_STYLE_PATH = exports.H5_API_STYLE_PATH = exports.PAGE_EXTNAME = exports.PAGE_EXTNAME_APP = exports.BINDING_COMPONENTS = exports.APP_SERVICE_FILENAME = exports.ASSETS_INLINE_LIMIT = exports.JSON_JS_MAP = exports.MANIFEST_JSON_JS = exports.PAGES_JSON_JS = exports.extensions = exports.EXTNAME_TS_RE = exports.EXTNAME_JS_RE = exports.EXTNAME_VUE_RE = exports.EXTNAME_VUE_TEMPLATE = exports.EXTNAME_VUE = exports.EXTNAME_TS = exports.EXTNAME_JS = exports.PUBLIC_DIR = void 0;
4
4
  exports.PUBLIC_DIR = 'static';
5
5
  exports.EXTNAME_JS = ['.js', '.ts', '.jsx', '.tsx'];
6
6
  exports.EXTNAME_TS = ['.ts', '.tsx'];
@@ -17,6 +17,12 @@ exports.extensions = [
17
17
  '.tsx',
18
18
  '.json',
19
19
  ].concat(exports.EXTNAME_VUE);
20
+ exports.PAGES_JSON_JS = 'pages-json-js';
21
+ exports.MANIFEST_JSON_JS = 'manifest-json-js';
22
+ exports.JSON_JS_MAP = {
23
+ 'pages.json': exports.PAGES_JSON_JS,
24
+ 'manifest.json': exports.MANIFEST_JSON_JS,
25
+ };
20
26
  exports.ASSETS_INLINE_LIMIT = 40 * 1024;
21
27
  exports.APP_SERVICE_FILENAME = 'app-service.js';
22
28
  exports.BINDING_COMPONENTS = '__BINDING_COMPONENTS__';
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.defineUniManifestJsonPlugin = exports.defineUniPagesJsonPlugin = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
+ const constants_1 = require("../../constants");
9
10
  const utils_1 = require("../../utils");
10
11
  exports.defineUniPagesJsonPlugin = createDefineJsonJsPlugin('pages.json');
11
12
  exports.defineUniManifestJsonPlugin = createDefineJsonJsPlugin('manifest.json');
12
13
  function createDefineJsonJsPlugin(name) {
13
- const JSON_JS = name + '.js';
14
+ const JSON_JS = constants_1.JSON_JS_MAP[name];
14
15
  return function (createVitePlugin) {
15
16
  const opts = {
16
17
  resolvedConfig: {},
@@ -23,18 +24,20 @@ function createDefineJsonJsPlugin(name) {
23
24
  const origResolveId = plugin.resolveId;
24
25
  const origConfigResolved = plugin.configResolved;
25
26
  let jsonPath = '';
27
+ let jsonJsPath = '';
26
28
  plugin.resolveId = function (id, importer, options) {
27
29
  const res = origResolveId && origResolveId.call(this, id, importer, options);
28
30
  if (res) {
29
31
  return res;
30
32
  }
31
33
  if (id.endsWith(JSON_JS)) {
32
- return jsonPath + '.js';
34
+ return jsonJsPath;
33
35
  }
34
36
  };
35
37
  plugin.configResolved = function (config) {
36
38
  opts.resolvedConfig = config;
37
39
  jsonPath = (0, utils_1.normalizePath)(path_1.default.join(process.env.UNI_INPUT_DIR, name));
40
+ jsonJsPath = (0, utils_1.normalizePath)(path_1.default.join(process.env.UNI_INPUT_DIR, JSON_JS));
38
41
  return origConfigResolved && origConfigResolved(config);
39
42
  };
40
43
  plugin.load = function (id, ssr) {
@@ -33,6 +33,7 @@ const utils_1 = require("../utils");
33
33
  const asset_1 = require("./asset");
34
34
  const esbuild_1 = require("esbuild");
35
35
  const preprocess_1 = require("../../../../preprocess");
36
+ const constants_1 = require("../../../../constants");
36
37
  const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
37
38
  exports.cssLangRE = new RegExp(cssLangs);
38
39
  const cssModuleRE = new RegExp(`\\.module${cssLangs}`);
@@ -114,7 +115,7 @@ function findCssModuleIds(moduleId, cssModuleIds, seen) {
114
115
  const moduleInfo = this.getModuleInfo(moduleId);
115
116
  if (moduleInfo) {
116
117
  moduleInfo.importedIds.forEach((id) => {
117
- if (id.includes('pages.json.js')) {
118
+ if (id.includes(constants_1.PAGES_JSON_JS)) {
118
119
  // 查询main.js时,需要忽略pages.json.js,否则会把所有页面样式加进来
119
120
  return;
120
121
  }
package/dist/watcher.d.ts CHANGED
@@ -18,8 +18,8 @@ export declare class FileWatcher {
18
18
  watch(watchOptions: WatchOptions & {
19
19
  cwd: string;
20
20
  }, onReady?: (watcher: FSWatcher) => void, onChange?: () => void): FSWatcher;
21
- add(paths: string | ReadonlyArray<string>): void;
22
- unwatch(paths: string | ReadonlyArray<string>): void;
21
+ add(paths: string | ReadonlyArray<string>): FSWatcher;
22
+ unwatch(paths: string | ReadonlyArray<string>): FSWatcher;
23
23
  close(): Promise<void>;
24
24
  copy(from: string): Promise<void | undefined>;
25
25
  remove(from: string): Promise<void | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "3.0.0-alpha-3030820220114008",
3
+ "version": "3.0.0-alpha-3031120220216001",
4
4
  "description": "@dcloudio/uni-cli-shared",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,11 +18,11 @@
18
18
  "url": "https://github.com/dcloudio/uni-app/issues"
19
19
  },
20
20
  "dependencies": {
21
- "@babel/core": "^7.16.5",
21
+ "@babel/core": "^7.17.2",
22
22
  "@babel/parser": "^7.16.4",
23
- "@babel/types": "^7.16.0",
24
- "@dcloudio/uni-i18n": "3.0.0-alpha-3030820220114008",
25
- "@dcloudio/uni-shared": "3.0.0-alpha-3030820220114008",
23
+ "@babel/types": "^7.16.8",
24
+ "@dcloudio/uni-i18n": "3.0.0-alpha-3031120220216001",
25
+ "@dcloudio/uni-shared": "3.0.0-alpha-3031120220216001",
26
26
  "@rollup/pluginutils": "^4.1.2",
27
27
  "@vue/compiler-core": "3.2.30",
28
28
  "@vue/compiler-dom": "3.2.30",
@@ -31,13 +31,13 @@
31
31
  "@vue/shared": "3.2.30",
32
32
  "autoprefixer": "^10.4.2",
33
33
  "base64url": "^3.0.1",
34
- "chokidar": "^3.5.2",
34
+ "chokidar": "^3.5.3",
35
35
  "compare-versions": "^3.6.0",
36
- "debug": "^4.3.2",
36
+ "debug": "^4.3.3",
37
37
  "es-module-lexer": "^0.9.3",
38
- "esbuild": "^0.13.12",
38
+ "esbuild": "^0.14.14",
39
39
  "estree-walker": "^2.0.2",
40
- "fast-glob": "^3.2.7",
40
+ "fast-glob": "^3.2.11",
41
41
  "fs-extra": "^10.0.0",
42
42
  "hash-sum": "^2.0.0",
43
43
  "jsonc-parser": "^3.0.0",
@@ -47,10 +47,10 @@
47
47
  "module-alias": "^2.2.2",
48
48
  "picocolors": "^1.0.0",
49
49
  "postcss-import": "^14.0.2",
50
- "postcss-load-config": "^3.1.0",
51
- "postcss-modules": "^4.2.2",
50
+ "postcss-load-config": "^3.1.1",
51
+ "postcss-modules": "^4.3.0",
52
52
  "postcss-selector-parser": "^6.0.6",
53
- "resolve": "^1.20.0",
53
+ "resolve": "^1.22.0",
54
54
  "tapable": "^2.2.0",
55
55
  "xregexp": "3.1.0"
56
56
  },
@@ -63,6 +63,6 @@
63
63
  "@types/mime": "^2.0.3",
64
64
  "@types/module-alias": "^2.0.1",
65
65
  "@types/stylus": "^0.48.36",
66
- "postcss": "^8.4.5"
66
+ "postcss": "^8.4.6"
67
67
  }
68
68
  }