@dcloudio/uni-cli-shared 3.0.0-alpha-3021220211102002 → 3.0.0-alpha-3021220211105011
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/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/easycom.d.ts +4 -1
- package/dist/easycom.js +3 -4
- package/dist/hbx/index.js +0 -7
- package/dist/hbx/log.d.ts +2 -0
- package/dist/hbx/log.js +36 -2
- package/dist/json/app/manifest/nvue.d.ts +3 -3
- package/dist/json/app/pages/index.d.ts +0 -1
- package/dist/json/app/pages/index.js +0 -11
- package/dist/json/mp/pages.js +7 -3
- package/dist/json/mp/types.d.ts +1 -1
- package/dist/json/pages.js +0 -4
- package/dist/logs/console.js +5 -2
- package/dist/logs/format.js +6 -0
- package/dist/mp/template.d.ts +6 -0
- package/dist/postcss/plugins/stylePluginScoped.d.ts +1 -1
- package/dist/postcss/plugins/uniapp.d.ts +1 -1
- package/dist/postcss/plugins/uniapp.js +2 -2
- package/dist/preprocess/context.js +1 -0
- package/dist/utils.d.ts +3 -1
- package/dist/utils.js +37 -5
- package/dist/vite/features.d.ts +1 -1
- package/dist/vite/plugins/copy.d.ts +1 -1
- package/dist/vite/plugins/cssScoped.d.ts +1 -1
- package/dist/vite/plugins/inject.d.ts +1 -1
- package/dist/vite/plugins/inject.js +2 -2
- package/dist/vite/plugins/vitejs/config.d.ts +1 -1
- package/dist/vite/plugins/vitejs/index.d.ts +1 -1
- package/dist/vite/plugins/vitejs/plugin.d.ts +1 -1
- package/dist/vite/plugins/vitejs/plugins/css.d.ts +1 -1
- package/dist/vite/plugins/vitejs/plugins/css.js +2 -2
- package/dist/vite/plugins/vitejs/server/moduleGraph.d.ts +1 -1
- package/dist/vite/plugins/vitejs/server/moduleGraph.js +0 -3
- package/dist/vite/utils/ast.d.ts +1 -1
- package/dist/vite/utils/index.d.ts +1 -1
- package/dist/vite/utils/plugin.d.ts +1 -1
- package/dist/vue/transforms/index.d.ts +2 -0
- package/dist/vue/transforms/index.js +8 -1
- package/dist/vue/transforms/vModel.d.ts +12 -0
- package/dist/vue/transforms/vModel.js +33 -0
- package/dist/vue/transforms/vOn.d.ts +15 -0
- package/dist/vue/transforms/vOn.js +88 -0
- package/dist/vue/utils.d.ts +3 -3
- package/dist/vue/utils.js +2 -1
- package/lib/nvue.css +34 -1
- package/package.json +16 -5
- package/LICENSE +0 -202
- package/dist/json/app/pages/nvue.d.ts +0 -1
- package/dist/json/app/pages/nvue.js +0 -88
package/dist/constants.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const EXTNAME_JS: string[];
|
|
|
3
3
|
export declare const EXTNAME_VUE: string[];
|
|
4
4
|
export declare const EXTNAME_VUE_RE: RegExp;
|
|
5
5
|
export declare const EXTNAME_JS_RE: RegExp;
|
|
6
|
+
export declare const ASSETS_INLINE_LIMIT: number;
|
|
6
7
|
export declare const BINDING_COMPONENTS = "__BINDING_COMPONENTS__";
|
|
7
8
|
export declare const PAGE_EXTNAME_APP: string[];
|
|
8
9
|
export declare const PAGE_EXTNAME: string[];
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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.EXTNAME_JS_RE = exports.EXTNAME_VUE_RE = exports.EXTNAME_VUE = 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.ASSETS_INLINE_LIMIT = exports.EXTNAME_JS_RE = exports.EXTNAME_VUE_RE = exports.EXTNAME_VUE = 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_VUE = ['.vue', '.nvue'];
|
|
7
7
|
exports.EXTNAME_VUE_RE = /\.(vue|nvue)$/;
|
|
8
8
|
exports.EXTNAME_JS_RE = /\.[jt]sx?$/;
|
|
9
|
+
exports.ASSETS_INLINE_LIMIT = 40 * 1024;
|
|
9
10
|
exports.BINDING_COMPONENTS = '__BINDING_COMPONENTS__';
|
|
10
11
|
// APP 平台解析页面后缀的优先级
|
|
11
12
|
exports.PAGE_EXTNAME_APP = ['.nvue', '.vue', '.tsx', '.jsx', '.js'];
|
package/dist/easycom.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ interface EasycomMatcher {
|
|
|
12
12
|
interface EasycomCustom {
|
|
13
13
|
[key: string]: string;
|
|
14
14
|
}
|
|
15
|
-
export declare function initEasycoms(inputDir: string, platform
|
|
15
|
+
export declare function initEasycoms(inputDir: string, { dirs, platform }: {
|
|
16
|
+
dirs: string[];
|
|
17
|
+
platform: UniApp.PLATFORM;
|
|
18
|
+
}): {
|
|
16
19
|
options: EasycomOption;
|
|
17
20
|
filter: (id: unknown) => boolean;
|
|
18
21
|
refresh(): void;
|
package/dist/easycom.js
CHANGED
|
@@ -23,8 +23,7 @@ function clearEasycom() {
|
|
|
23
23
|
easycomsCache.clear();
|
|
24
24
|
easycomsInvalidCache.clear();
|
|
25
25
|
}
|
|
26
|
-
function initEasycoms(inputDir, platform) {
|
|
27
|
-
const buildInComponentsDir = path_1.default.resolve(require.resolve('@dcloudio/uni-components'), '../lib');
|
|
26
|
+
function initEasycoms(inputDir, { dirs, platform }) {
|
|
28
27
|
const componentsDir = path_1.default.resolve(inputDir, 'components');
|
|
29
28
|
const uniModulesDir = path_1.default.resolve(inputDir, 'uni_modules');
|
|
30
29
|
const initEasycomOptions = (pagesJson) => {
|
|
@@ -32,9 +31,9 @@ function initEasycoms(inputDir, platform) {
|
|
|
32
31
|
const { easycom } = pagesJson || (0, pages_1.parsePagesJson)(inputDir, platform, false);
|
|
33
32
|
const easycomOptions = {
|
|
34
33
|
dirs: easycom && easycom.autoscan === false
|
|
35
|
-
? [
|
|
34
|
+
? [...dirs] // 禁止自动扫描
|
|
36
35
|
: [
|
|
37
|
-
|
|
36
|
+
...dirs,
|
|
38
37
|
componentsDir,
|
|
39
38
|
...initUniModulesEasycomDirs(uniModulesDir),
|
|
40
39
|
],
|
package/dist/hbx/index.js
CHANGED
|
@@ -9,15 +9,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
-
};
|
|
15
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
13
|
exports.initModuleAlias = void 0;
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
process.env.UNI_HBUILDERX_PLUGINS =
|
|
19
|
-
process.env.UNI_HBUILDERX_PLUGINS ||
|
|
20
|
-
path_1.default.resolve(__dirname, '../../../../../../');
|
|
21
14
|
__exportStar(require("./env"), exports);
|
|
22
15
|
var alias_1 = require("./alias");
|
|
23
16
|
Object.defineProperty(exports, "initModuleAlias", { enumerable: true, get: function () { return alias_1.initModuleAlias; } });
|
package/dist/hbx/log.d.ts
CHANGED
|
@@ -2,3 +2,5 @@ import { Formatter } from '../logs/format';
|
|
|
2
2
|
export declare const h5ServeFormatter: Formatter;
|
|
3
3
|
export declare const removeInfoFormatter: Formatter;
|
|
4
4
|
export declare const removeWarnFormatter: Formatter;
|
|
5
|
+
export declare const FilenameFormatter: Formatter;
|
|
6
|
+
export declare const HBuilderXFileFormatter: Formatter;
|
package/dist/hbx/log.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = void 0;
|
|
6
|
+
exports.HBuilderXFileFormatter = exports.FilenameFormatter = exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
4
9
|
const SIGNAL_H5_LOCAL = ' > Local:';
|
|
5
10
|
const SIGNAL_H5_NETWORK = ' > Network:';
|
|
6
11
|
const networkLogs = [];
|
|
@@ -40,7 +45,7 @@ exports.removeInfoFormatter = {
|
|
|
40
45
|
return '';
|
|
41
46
|
},
|
|
42
47
|
};
|
|
43
|
-
const REMOVED_WARN_MSGS = [
|
|
48
|
+
const REMOVED_WARN_MSGS = [];
|
|
44
49
|
exports.removeWarnFormatter = {
|
|
45
50
|
test(msg) {
|
|
46
51
|
return !!REMOVED_WARN_MSGS.find((m) => msg.includes(m));
|
|
@@ -49,3 +54,32 @@ exports.removeWarnFormatter = {
|
|
|
49
54
|
return '';
|
|
50
55
|
},
|
|
51
56
|
};
|
|
57
|
+
const fileRE = /file:\s(.*):(\d+):(\d+)/;
|
|
58
|
+
exports.FilenameFormatter = {
|
|
59
|
+
test(msg) {
|
|
60
|
+
return fileRE.test(msg);
|
|
61
|
+
},
|
|
62
|
+
format(msg) {
|
|
63
|
+
return msg.replace(fileRE, (_, filename, line, column) => {
|
|
64
|
+
return `file: ${filename.split('?')[0]}:${line}:${column}`;
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
exports.HBuilderXFileFormatter = {
|
|
69
|
+
test(msg) {
|
|
70
|
+
return fileRE.test(msg);
|
|
71
|
+
},
|
|
72
|
+
format(msg) {
|
|
73
|
+
return (msg
|
|
74
|
+
// remove color
|
|
75
|
+
.replace(/\x1B[[(?);]{0,2}(;?\d)*./g, '')
|
|
76
|
+
.replace(fileRE, (_, filename, line, column) => {
|
|
77
|
+
return ('at ' +
|
|
78
|
+
(0, utils_1.normalizePath)(path_1.default.relative(process.env.UNI_INPUT_DIR, filename.split('?')[0])) +
|
|
79
|
+
':' +
|
|
80
|
+
line +
|
|
81
|
+
':' +
|
|
82
|
+
column);
|
|
83
|
+
}));
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function initNVue(manifestJson: Record<string, any>, pagesJson: UniApp.PagesJson): void;
|
|
2
|
-
export declare function getNVueCompiler(manifestJson: Record<string, any>): "
|
|
3
|
-
export declare function getNVueStyleCompiler(manifestJson: Record<string, any>): "
|
|
4
|
-
export declare function getNVueFlexDirection(manifestJson: Record<string, any>): "
|
|
2
|
+
export declare function getNVueCompiler(manifestJson: Record<string, any>): "uni-app" | "weex" | "vue";
|
|
3
|
+
export declare function getNVueStyleCompiler(manifestJson: Record<string, any>): "uni-app" | "weex";
|
|
4
|
+
export declare function getNVueFlexDirection(manifestJson: Record<string, any>): "row" | "row-reverse" | "column" | "column-reverse";
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
3
|
exports.normalizeAppConfigService = exports.normalizeAppPagesJson = void 0;
|
|
14
4
|
const code_1 = require("./code");
|
|
15
5
|
const definePage_1 = require("./definePage");
|
|
16
6
|
const uniConfig_1 = require("./uniConfig");
|
|
17
7
|
const uniRoutes_1 = require("./uniRoutes");
|
|
18
|
-
__exportStar(require("./nvue"), exports);
|
|
19
8
|
function normalizeAppPagesJson(pagesJson) {
|
|
20
9
|
return code_1.polyfillCode + code_1.restoreGlobalCode + (0, definePage_1.definePageCode)(pagesJson);
|
|
21
10
|
}
|
package/dist/json/mp/pages.js
CHANGED
|
@@ -34,9 +34,13 @@ function parsePagesJson(jsonStr, platform, { debug, darkmode, networkTimeout, su
|
|
|
34
34
|
!fs_1.default.existsSync(filename + '.vue')) {
|
|
35
35
|
nvuePages.push(pagePath);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const windowOptions = {};
|
|
38
|
+
if (platform === 'mp-baidu') {
|
|
39
|
+
// 仅百度小程序需要页面配置 component:true
|
|
40
|
+
// 快手小程序反而不能配置 component:true,故不能统一添加,目前硬编码处理
|
|
41
|
+
windowOptions.component = true;
|
|
42
|
+
}
|
|
43
|
+
pageJsons[pagePath] = (0, shared_1.extend)(windowOptions, (0, utils_1.parseWindowOptions)(style, platform, windowOptionsMap));
|
|
40
44
|
}
|
|
41
45
|
// pages
|
|
42
46
|
(0, pages_1.validatePages)(pagesJson, jsonStr);
|
package/dist/json/mp/types.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface ShareWindowOptions {
|
|
|
18
18
|
declare type Style = 'v2' | string;
|
|
19
19
|
declare type RestartStrategy = 'homePage' | 'homePageAndLatestPage' | string;
|
|
20
20
|
export interface PageWindowOptions extends ShareWindowOptions {
|
|
21
|
-
component
|
|
21
|
+
component?: true;
|
|
22
22
|
disableScroll?: boolean;
|
|
23
23
|
usingComponents?: UsingComponents;
|
|
24
24
|
initialRenderingCache?: 'static' | string;
|
package/dist/json/pages.js
CHANGED
|
@@ -10,7 +10,6 @@ const shared_1 = require("@vue/shared");
|
|
|
10
10
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
11
11
|
const utils_1 = require("../utils");
|
|
12
12
|
const json_1 = require("./json");
|
|
13
|
-
const pages_1 = require("./app/pages");
|
|
14
13
|
const parsePagesJson = (inputDir, platform, normalize = true) => {
|
|
15
14
|
const jsonStr = fs_1.default.readFileSync(path_1.default.join(inputDir, 'pages.json'), 'utf8');
|
|
16
15
|
if (normalize) {
|
|
@@ -55,9 +54,6 @@ function normalizePagesJson(jsonStr, platform, { subpackages, } = { subpackages:
|
|
|
55
54
|
}
|
|
56
55
|
// pageStyle
|
|
57
56
|
normalizePages(pagesJson.pages, platform);
|
|
58
|
-
if (platform === 'app' && process.env.UNI_NVUE_COMPILER !== 'vue') {
|
|
59
|
-
(0, pages_1.initWebpackNVueEntry)(pagesJson.pages);
|
|
60
|
-
}
|
|
61
57
|
// globalStyle
|
|
62
58
|
pagesJson.globalStyle = normalizePageStyle(null, pagesJson.globalStyle, platform);
|
|
63
59
|
// tabBar
|
package/dist/logs/console.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.rewriteConsoleExpr = void 0;
|
|
4
|
-
const
|
|
7
|
+
const magic_string_1 = __importDefault(require("magic-string"));
|
|
5
8
|
const utils_1 = require("../utils");
|
|
6
9
|
const F = '__f__';
|
|
7
10
|
function rewriteConsoleExpr(filename, code) {
|
|
8
11
|
filename = (0, utils_1.normalizePath)(filename);
|
|
9
12
|
const re = /(console\.(log|info|debug|warn|error))\(([^)]+)\)/g;
|
|
10
13
|
const locate = getLocator(code);
|
|
11
|
-
const s = new
|
|
14
|
+
const s = new magic_string_1.default(code);
|
|
12
15
|
let match;
|
|
13
16
|
while ((match = re.exec(code))) {
|
|
14
17
|
const [, expr, type] = match;
|
package/dist/logs/format.js
CHANGED
|
@@ -12,6 +12,12 @@ const initErrFormattersOnce = (0, uni_shared_1.once)(() => {
|
|
|
12
12
|
if ((0, env_1.isInHBuilderX)()) {
|
|
13
13
|
errFormatters.push(alias_1.moduleAliasFormatter);
|
|
14
14
|
}
|
|
15
|
+
if ((0, env_1.runByHBuilderX)()) {
|
|
16
|
+
errFormatters.push(log_1.HBuilderXFileFormatter);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
errFormatters.push(log_1.FilenameFormatter);
|
|
20
|
+
}
|
|
15
21
|
});
|
|
16
22
|
const initInfoFormattersOnce = (0, uni_shared_1.once)(() => {
|
|
17
23
|
if ((0, env_1.isInHBuilderX)()) {
|
package/dist/mp/template.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { EmittedAsset } from 'rollup';
|
|
2
2
|
export interface MiniProgramCompilerOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 需要延迟渲染的组件,通常是某个组件的某个事件会立刻触发,需要延迟到首次 render 之后,比如微信 editor 的 ready 事件,快手 switch 的 change
|
|
5
|
+
*/
|
|
6
|
+
lazyElement?: {
|
|
7
|
+
[name: string]: string[];
|
|
8
|
+
};
|
|
3
9
|
event?: {
|
|
4
10
|
format(name: string, opts: {
|
|
5
11
|
isCatch?: boolean;
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const shared_1 = require("@vue/shared");
|
|
7
|
-
const postcss_1 = require("postcss");
|
|
8
7
|
const postcss_selector_parser_1 = __importDefault(require("postcss-selector-parser"));
|
|
9
8
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
10
9
|
const manifest_1 = require("../../json/manifest");
|
|
@@ -38,7 +37,8 @@ function createBodyBackgroundRule(origRule) {
|
|
|
38
37
|
}
|
|
39
38
|
});
|
|
40
39
|
if (bgDecls.length) {
|
|
41
|
-
|
|
40
|
+
const { rule } = require('postcss');
|
|
41
|
+
origRule.after(rule({ selector: 'body' }).append(bgDecls));
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
function walkRules(options) {
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { default as hash } from 'hash-sum';
|
|
2
|
-
import { SFCTemplateCompileOptions } from '@vue/compiler-sfc';
|
|
2
|
+
import type { SFCTemplateCompileOptions } from '@vue/compiler-sfc';
|
|
3
3
|
import { ElementNode, RootNode, TemplateChildNode } from '@vue/compiler-core';
|
|
4
4
|
export declare const isWindows: boolean;
|
|
5
5
|
export declare function normalizePath(id: string): string;
|
|
6
6
|
export declare function checkElementNodeTag(node: RootNode | TemplateChildNode | null | undefined, tag: string): node is ElementNode;
|
|
7
7
|
export declare const resolveMainPathOnce: (inputDir: string) => string;
|
|
8
|
+
export declare function resolveComponentsLibPath(): string;
|
|
9
|
+
export declare function getBuiltInPaths(): string[];
|
|
8
10
|
export declare function resolveBuiltIn(path: string): string;
|
|
9
11
|
export declare function normalizeIdentifier(str: string): string;
|
|
10
12
|
export declare function normalizePagePath(pagePath: string, platform: UniApp.PLATFORM): string | undefined;
|
package/dist/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createUniVueTransformAssetUrls = exports.normalizeMiniProgramFilename = exports.normalizeNodeModules = exports.removeExt = exports.normalizePagePath = exports.normalizeIdentifier = exports.resolveBuiltIn = exports.resolveMainPathOnce = exports.checkElementNodeTag = exports.normalizePath = exports.isWindows = exports.hash = void 0;
|
|
6
|
+
exports.createUniVueTransformAssetUrls = exports.normalizeMiniProgramFilename = exports.normalizeNodeModules = exports.removeExt = exports.normalizePagePath = exports.normalizeIdentifier = exports.resolveBuiltIn = exports.getBuiltInPaths = exports.resolveComponentsLibPath = exports.resolveMainPathOnce = exports.checkElementNodeTag = exports.normalizePath = exports.isWindows = exports.hash = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const os_1 = __importDefault(require("os"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -11,6 +11,7 @@ const shared_1 = require("@vue/shared");
|
|
|
11
11
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
12
12
|
var hash_sum_1 = require("hash-sum");
|
|
13
13
|
Object.defineProperty(exports, "hash", { enumerable: true, get: function () { return __importDefault(hash_sum_1).default; } });
|
|
14
|
+
const debug_1 = __importDefault(require("debug"));
|
|
14
15
|
const constants_1 = require("./constants");
|
|
15
16
|
exports.isWindows = os_1.default.platform() === 'win32';
|
|
16
17
|
function normalizePath(id) {
|
|
@@ -28,11 +29,42 @@ exports.resolveMainPathOnce = (0, uni_shared_1.once)((inputDir) => {
|
|
|
28
29
|
}
|
|
29
30
|
return normalizePath(path_1.default.resolve(inputDir, 'main.js'));
|
|
30
31
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
let componentsLibPath = '';
|
|
33
|
+
function resolveComponentsLibPath() {
|
|
34
|
+
if (!componentsLibPath) {
|
|
35
|
+
componentsLibPath = path_1.default.resolve(resolveBuiltIn('@dcloudio/uni-components/package.json'), '../lib');
|
|
36
|
+
}
|
|
37
|
+
return componentsLibPath;
|
|
38
|
+
}
|
|
39
|
+
exports.resolveComponentsLibPath = resolveComponentsLibPath;
|
|
40
|
+
const ownerModules = ['@dcloudio/uni-app', '@dcloudio/vite-plugin-uni'];
|
|
41
|
+
const paths = [];
|
|
42
|
+
function initPaths() {
|
|
43
|
+
const cliContext = process.env.UNI_CLI_CONTEXT;
|
|
44
|
+
if (cliContext) {
|
|
45
|
+
const pathSet = new Set();
|
|
46
|
+
pathSet.add(path_1.default.join(cliContext, 'node_modules'));
|
|
47
|
+
[`@dcloudio/uni-` + process.env.UNI_PLATFORM, ...ownerModules].forEach((ownerModule) => {
|
|
48
|
+
try {
|
|
49
|
+
pathSet.add(path_1.default.resolve(require.resolve(ownerModule + '/package.json', {
|
|
50
|
+
paths: [cliContext],
|
|
51
|
+
}), '../node_modules'));
|
|
52
|
+
}
|
|
53
|
+
catch (e) { }
|
|
54
|
+
});
|
|
55
|
+
paths.push(...pathSet);
|
|
56
|
+
(0, debug_1.default)('uni-paths')(paths);
|
|
34
57
|
}
|
|
35
|
-
|
|
58
|
+
}
|
|
59
|
+
function getBuiltInPaths() {
|
|
60
|
+
if (!paths.length) {
|
|
61
|
+
initPaths();
|
|
62
|
+
}
|
|
63
|
+
return paths;
|
|
64
|
+
}
|
|
65
|
+
exports.getBuiltInPaths = getBuiltInPaths;
|
|
66
|
+
function resolveBuiltIn(path) {
|
|
67
|
+
return require.resolve(path, { paths: getBuiltInPaths() });
|
|
36
68
|
}
|
|
37
69
|
exports.resolveBuiltIn = resolveBuiltIn;
|
|
38
70
|
function normalizeIdentifier(str) {
|
package/dist/vite/features.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ const debug_1 = __importDefault(require("debug"));
|
|
|
9
9
|
const pluginutils_1 = require("@rollup/pluginutils");
|
|
10
10
|
const estree_walker_1 = require("estree-walker");
|
|
11
11
|
const shared_1 = require("@vue/shared");
|
|
12
|
-
const
|
|
12
|
+
const magic_string_1 = __importDefault(require("magic-string"));
|
|
13
13
|
const utils_1 = require("../utils");
|
|
14
14
|
const debugInject = (0, debug_1.default)('vite:uni:inject');
|
|
15
15
|
const debugInjectTry = (0, debug_1.default)('vite:uni:inject-try');
|
|
@@ -74,7 +74,7 @@ function uniViteInjectPlugin(options) {
|
|
|
74
74
|
});
|
|
75
75
|
// analyse scopes
|
|
76
76
|
let scope = (0, pluginutils_1.attachScopes)(ast, 'scope');
|
|
77
|
-
const magicString = new
|
|
77
|
+
const magicString = new magic_string_1.default(code);
|
|
78
78
|
const newImports = new Map();
|
|
79
79
|
function handleReference(node, name, keypath) {
|
|
80
80
|
let mod = modulesMap.get(keypath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ResolvedConfig } from 'vite';
|
|
1
|
+
export type { ResolvedConfig } from 'vite';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ResolveFn, ViteDevServer } from 'vite';
|
|
1
|
+
export type { ResolveFn, ViteDevServer } from 'vite';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Plugin } from 'vite';
|
|
1
|
+
export type { Plugin } from 'vite';
|
|
@@ -26,9 +26,9 @@ exports.cssUrlRE = exports.cssPostPlugin = exports.cssPlugin = exports.isDirectC
|
|
|
26
26
|
const fs_1 = __importDefault(require("fs"));
|
|
27
27
|
const path_1 = __importDefault(require("path"));
|
|
28
28
|
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
29
|
-
const utils_1 = require("../utils");
|
|
30
|
-
const postcss_load_config_1 = __importDefault(require("postcss-load-config"));
|
|
31
29
|
const chalk_1 = __importDefault(require("chalk"));
|
|
30
|
+
const postcss_load_config_1 = __importDefault(require("postcss-load-config"));
|
|
31
|
+
const utils_1 = require("../utils");
|
|
32
32
|
const asset_1 = require("./asset");
|
|
33
33
|
const esbuild_1 = require("esbuild");
|
|
34
34
|
const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ModuleNode } from 'vite';
|
|
1
|
+
export type { ModuleNode } from 'vite';
|
package/dist/vite/utils/ast.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Literal, BaseNode, Property, Identifier, CallExpression, MemberExpression, MethodDefinition, ExportSpecifier } from 'estree';
|
|
1
|
+
import type { Literal, BaseNode, Property, Identifier, CallExpression, MemberExpression, MethodDefinition, ExportSpecifier } from 'estree';
|
|
2
2
|
import { Node, ElementNode, DirectiveNode, SimpleExpressionNode } from '@vue/compiler-core';
|
|
3
3
|
export declare const isProperty: (node: BaseNode) => node is Property;
|
|
4
4
|
export declare const isIdentifier: (node: BaseNode) => node is Identifier;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin, ResolvedConfig } from 'vite';
|
|
1
|
+
import type { Plugin, ResolvedConfig } from 'vite';
|
|
2
2
|
export declare type CreateUniViteFilterPlugin = (opts: UniViteFilterPluginOptions) => Plugin;
|
|
3
3
|
export interface UniViteFilterPluginOptions {
|
|
4
4
|
resolvedConfig: ResolvedConfig;
|
|
@@ -3,6 +3,8 @@ export * from './transformPageHead';
|
|
|
3
3
|
export * from './transformComponent';
|
|
4
4
|
export * from './transformEvent';
|
|
5
5
|
export * from './transformTag';
|
|
6
|
+
export { ATTR_DATASET_EVENT_OPTS, createTransformOn, defaultMatch as matchTransformOn, } from './vOn';
|
|
7
|
+
export { createTransformModel, defaultMatch as matchTransformModel, } from './vModel';
|
|
6
8
|
export declare const transformMatchMedia: import("@vue/compiler-core").NodeTransform;
|
|
7
9
|
export declare const transformTapToClick: import("@vue/compiler-core").NodeTransform;
|
|
8
10
|
export declare const transformComponentLink: (node: import("@vue/compiler-core").RootNode | import("@vue/compiler-core").TemplateChildNode, context: import("@vue/compiler-core").TransformContext) => void;
|
|
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.transformComponentLink = exports.transformTapToClick = exports.transformMatchMedia = void 0;
|
|
13
|
+
exports.transformComponentLink = exports.transformTapToClick = exports.transformMatchMedia = exports.matchTransformModel = exports.createTransformModel = exports.matchTransformOn = exports.createTransformOn = exports.ATTR_DATASET_EVENT_OPTS = void 0;
|
|
14
14
|
const transformTag_1 = require("./transformTag");
|
|
15
15
|
const transformEvent_1 = require("./transformEvent");
|
|
16
16
|
const transformComponent_1 = require("./transformComponent");
|
|
@@ -20,6 +20,13 @@ __exportStar(require("./transformPageHead"), exports);
|
|
|
20
20
|
__exportStar(require("./transformComponent"), exports);
|
|
21
21
|
__exportStar(require("./transformEvent"), exports);
|
|
22
22
|
__exportStar(require("./transformTag"), exports);
|
|
23
|
+
var vOn_1 = require("./vOn");
|
|
24
|
+
Object.defineProperty(exports, "ATTR_DATASET_EVENT_OPTS", { enumerable: true, get: function () { return vOn_1.ATTR_DATASET_EVENT_OPTS; } });
|
|
25
|
+
Object.defineProperty(exports, "createTransformOn", { enumerable: true, get: function () { return vOn_1.createTransformOn; } });
|
|
26
|
+
Object.defineProperty(exports, "matchTransformOn", { enumerable: true, get: function () { return vOn_1.defaultMatch; } });
|
|
27
|
+
var vModel_1 = require("./vModel");
|
|
28
|
+
Object.defineProperty(exports, "createTransformModel", { enumerable: true, get: function () { return vModel_1.createTransformModel; } });
|
|
29
|
+
Object.defineProperty(exports, "matchTransformModel", { enumerable: true, get: function () { return vModel_1.defaultMatch; } });
|
|
23
30
|
exports.transformMatchMedia = (0, transformTag_1.createTransformTag)({
|
|
24
31
|
'match-media': 'uni-match-media',
|
|
25
32
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DirectiveTransform, ElementNode, TransformContext } from '@vue/compiler-core';
|
|
2
|
+
export declare function defaultMatch(node: ElementNode, context: TransformContext): boolean;
|
|
3
|
+
interface CreateTransformModelOptions {
|
|
4
|
+
match: typeof defaultMatch;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 百度、快手小程序的自定义组件,不支持动态事件绑定,故 v-model 也需要调整
|
|
8
|
+
* @param baseTransformModel
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function createTransformModel(baseTransformModel: DirectiveTransform, { match }?: CreateTransformModelOptions): DirectiveTransform;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTransformModel = exports.defaultMatch = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const vOn_1 = require("./vOn");
|
|
6
|
+
function defaultMatch(node, context) {
|
|
7
|
+
return (0, utils_1.isUserComponent)(node, context);
|
|
8
|
+
}
|
|
9
|
+
exports.defaultMatch = defaultMatch;
|
|
10
|
+
/**
|
|
11
|
+
* 百度、快手小程序的自定义组件,不支持动态事件绑定,故 v-model 也需要调整
|
|
12
|
+
* @param baseTransformModel
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
function createTransformModel(baseTransformModel, { match } = {
|
|
16
|
+
match: defaultMatch,
|
|
17
|
+
}) {
|
|
18
|
+
return (dir, node, context, augmentor) => {
|
|
19
|
+
const res = baseTransformModel(dir, node, context, augmentor);
|
|
20
|
+
if (!match(node, context)) {
|
|
21
|
+
return res;
|
|
22
|
+
}
|
|
23
|
+
const props = res.props;
|
|
24
|
+
if (props[1]) {
|
|
25
|
+
// input,textarea 的 v-model 事件可能会被合并到已有的 input 中
|
|
26
|
+
const { arg, exp } = props[1];
|
|
27
|
+
(0, vOn_1.addEventOpts)(arg.content, exp, node);
|
|
28
|
+
props[1].exp = (0, vOn_1.createCustomEventExpr)();
|
|
29
|
+
}
|
|
30
|
+
return res;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.createTransformModel = createTransformModel;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExpressionNode, DirectiveTransform, ElementNode, TransformContext } from '@vue/compiler-core';
|
|
2
|
+
export declare function defaultMatch(name: string, node: ElementNode, context: TransformContext): boolean;
|
|
3
|
+
interface CreateTransformOnOptions {
|
|
4
|
+
match: typeof defaultMatch;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 百度、快手小程序的自定义组件,不支持动态事件绑定,故转换为静态事件 + dataset
|
|
8
|
+
* @param baseTransformOn
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function createTransformOn(baseTransformOn: DirectiveTransform, { match }?: CreateTransformOnOptions): DirectiveTransform;
|
|
12
|
+
export declare function createCustomEventExpr(): import("@vue/compiler-core").SimpleExpressionNode;
|
|
13
|
+
export declare function addEventOpts(event: string, value: ExpressionNode, node: ElementNode): void;
|
|
14
|
+
export declare const ATTR_DATASET_EVENT_OPTS = "data-e-o";
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ATTR_DATASET_EVENT_OPTS = exports.addEventOpts = exports.createCustomEventExpr = exports.createTransformOn = exports.defaultMatch = void 0;
|
|
4
|
+
const compiler_core_1 = require("@vue/compiler-core");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
function defaultMatch(name, node, context) {
|
|
7
|
+
return isCustomEvent(name) && (0, utils_1.isUserComponent)(node, context);
|
|
8
|
+
}
|
|
9
|
+
exports.defaultMatch = defaultMatch;
|
|
10
|
+
/**
|
|
11
|
+
* 百度、快手小程序的自定义组件,不支持动态事件绑定,故转换为静态事件 + dataset
|
|
12
|
+
* @param baseTransformOn
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
function createTransformOn(baseTransformOn, { match } = {
|
|
16
|
+
match: defaultMatch,
|
|
17
|
+
}) {
|
|
18
|
+
return (dir, node, context, augmentor) => {
|
|
19
|
+
const res = baseTransformOn(dir, node, context, augmentor);
|
|
20
|
+
const { name, arg, exp } = dir;
|
|
21
|
+
if (name !== 'on' || !arg || !exp || !(0, compiler_core_1.isStaticExp)(arg)) {
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
if (!match(arg.content, node, context)) {
|
|
25
|
+
return res;
|
|
26
|
+
}
|
|
27
|
+
const value = res.props[0].value;
|
|
28
|
+
res.props[0].value = createCustomEventExpr();
|
|
29
|
+
addEventOpts(arg.content, value, node);
|
|
30
|
+
return res;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.createTransformOn = createTransformOn;
|
|
34
|
+
function createCustomEventExpr() {
|
|
35
|
+
return (0, compiler_core_1.createSimpleExpression)('__e', true);
|
|
36
|
+
}
|
|
37
|
+
exports.createCustomEventExpr = createCustomEventExpr;
|
|
38
|
+
function addEventOpts(event, value, node) {
|
|
39
|
+
const attrName = node.tagType === 1 /* COMPONENT */
|
|
40
|
+
? ATTR_DATA_EVENT_OPTS
|
|
41
|
+
: exports.ATTR_DATASET_EVENT_OPTS;
|
|
42
|
+
const opts = (0, compiler_core_1.findProp)(node, attrName, true);
|
|
43
|
+
if (!opts) {
|
|
44
|
+
node.props.push(createDataEventOptsProp(attrName, event, value));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const children = opts.exp.children;
|
|
48
|
+
children.splice(children.length - 2, 0, createDataEventOptsProperty(event, value));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.addEventOpts = addEventOpts;
|
|
52
|
+
const ATTR_DATA_EVENT_OPTS = 'eO';
|
|
53
|
+
exports.ATTR_DATASET_EVENT_OPTS = 'data-e-o';
|
|
54
|
+
function createDataEventOptsProperty(event, exp) {
|
|
55
|
+
return (0, compiler_core_1.createCompoundExpression)([`'${event}'`, ': ', exp, ',']);
|
|
56
|
+
}
|
|
57
|
+
function createDataEventOptsProp(name, event, exp) {
|
|
58
|
+
return {
|
|
59
|
+
type: 7 /* DIRECTIVE */,
|
|
60
|
+
name: 'bind',
|
|
61
|
+
loc: compiler_core_1.locStub,
|
|
62
|
+
modifiers: [],
|
|
63
|
+
arg: (0, compiler_core_1.createSimpleExpression)(name, true),
|
|
64
|
+
exp: (0, compiler_core_1.createCompoundExpression)([
|
|
65
|
+
'{',
|
|
66
|
+
createDataEventOptsProperty(event, exp),
|
|
67
|
+
'}',
|
|
68
|
+
]),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const builtInEvents = [
|
|
72
|
+
'__l',
|
|
73
|
+
'tap',
|
|
74
|
+
'longtap',
|
|
75
|
+
'longpress',
|
|
76
|
+
'touchstart',
|
|
77
|
+
'touchmove',
|
|
78
|
+
'touchcancel',
|
|
79
|
+
'touchend',
|
|
80
|
+
'touchforcechange',
|
|
81
|
+
'transitionend',
|
|
82
|
+
'animationstart',
|
|
83
|
+
'animationiteration',
|
|
84
|
+
'animationend',
|
|
85
|
+
];
|
|
86
|
+
function isCustomEvent(name) {
|
|
87
|
+
return !builtInEvents.includes(name);
|
|
88
|
+
}
|
package/dist/vue/utils.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AttributeNode, ComponentNode, DirectiveNode, ElementNode, RootNode, TemplateChildNode, TransformContext } from '@vue/compiler-core';
|
|
1
|
+
import { AttributeNode, ComponentNode, DirectiveNode, ElementNode, RootNode, ExpressionNode, TemplateChildNode, TransformContext } from '@vue/compiler-core';
|
|
2
2
|
export declare const VUE_REF = "r";
|
|
3
3
|
export declare const VUE_REF_IN_FOR = "r-i-f";
|
|
4
4
|
export declare function isUserComponent(node: RootNode | TemplateChildNode, context: TransformContext): node is ComponentNode;
|
|
5
5
|
export declare function createAttributeNode(name: string, content: string): AttributeNode;
|
|
6
6
|
export declare function addStaticClass(node: ElementNode, clazz: string): string | number | undefined;
|
|
7
|
-
export declare function createDirectiveNode(name: string, arg: string, exp: string): DirectiveNode;
|
|
7
|
+
export declare function createDirectiveNode(name: string, arg: string, exp: string | ExpressionNode): DirectiveNode;
|
|
8
8
|
export declare function createOnDirectiveNode(name: string, value: string): DirectiveNode;
|
|
9
|
-
export declare function createBindDirectiveNode(name: string, value: string): DirectiveNode;
|
|
9
|
+
export declare function createBindDirectiveNode(name: string, value: string | ExpressionNode): DirectiveNode;
|
package/dist/vue/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBindDirectiveNode = exports.createOnDirectiveNode = exports.createDirectiveNode = exports.addStaticClass = exports.createAttributeNode = exports.isUserComponent = exports.VUE_REF_IN_FOR = exports.VUE_REF = void 0;
|
|
4
|
+
const shared_1 = require("@vue/shared");
|
|
4
5
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
5
6
|
const compiler_core_1 = require("@vue/compiler-core");
|
|
6
7
|
exports.VUE_REF = 'r';
|
|
@@ -51,7 +52,7 @@ function createDirectiveNode(name, arg, exp) {
|
|
|
51
52
|
modifiers: [],
|
|
52
53
|
loc: compiler_core_1.locStub,
|
|
53
54
|
arg: (0, compiler_core_1.createSimpleExpression)(arg, true),
|
|
54
|
-
exp: (0, compiler_core_1.createSimpleExpression)(exp, false),
|
|
55
|
+
exp: (0, shared_1.isString)(exp) ? (0, compiler_core_1.createSimpleExpression)(exp, false) : exp,
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
exports.createDirectiveNode = createDirectiveNode;
|
package/lib/nvue.css
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
label,
|
|
1
|
+
label,
|
|
2
|
+
scroll-view,
|
|
3
|
+
swiper-item,
|
|
4
|
+
view {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
flex-grow: 0;
|
|
9
|
+
flex-basis: auto;
|
|
10
|
+
align-items: stretch;
|
|
11
|
+
align-content: flex-start;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
image,
|
|
15
|
+
input,
|
|
16
|
+
scroll-view,
|
|
17
|
+
swiper,
|
|
18
|
+
swiper-item,
|
|
19
|
+
text,
|
|
20
|
+
textarea,
|
|
21
|
+
video,
|
|
22
|
+
view {
|
|
23
|
+
position: relative;
|
|
24
|
+
border: 0 solid #000;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
swiper-item {
|
|
29
|
+
position: absolute;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
button {
|
|
33
|
+
margin: 0;
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3021220211105011",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,25 +20,36 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/parser": "^7.15.0",
|
|
22
22
|
"@babel/types": "^7.15.0",
|
|
23
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3021220211105011",
|
|
24
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3021220211105011",
|
|
23
25
|
"@rollup/pluginutils": "^4.1.1",
|
|
24
|
-
"@vue/compiler-core": "^3.2.
|
|
26
|
+
"@vue/compiler-core": "^3.2.21",
|
|
27
|
+
"@vue/compiler-dom": "^3.2.21",
|
|
25
28
|
"chokidar": "^3.5.2",
|
|
26
29
|
"compare-versions": "^3.6.0",
|
|
27
|
-
"debug": "^4.3.
|
|
30
|
+
"debug": "^4.3.2",
|
|
28
31
|
"es-module-lexer": "^0.9.3",
|
|
32
|
+
"esbuild": "^0.13.12",
|
|
29
33
|
"estree-walker": "^2.0.2",
|
|
30
34
|
"fast-glob": "^3.2.7",
|
|
31
35
|
"fs-extra": "^10.0.0",
|
|
32
36
|
"hash-sum": "^2.0.0",
|
|
33
37
|
"jsonc-parser": "^3.0.0",
|
|
38
|
+
"magic-string": "^0.25.7",
|
|
34
39
|
"merge": "^2.1.1",
|
|
40
|
+
"postcss-import": "^14.0.2",
|
|
41
|
+
"postcss-load-config": "^3.1.0",
|
|
35
42
|
"postcss-selector-parser": "^6.0.6",
|
|
36
43
|
"rollup-plugin-copy": "^3.4.0",
|
|
37
44
|
"tapable": "^2.2.0",
|
|
38
45
|
"xregexp": "3.1.0"
|
|
39
46
|
},
|
|
40
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
|
41
48
|
"devDependencies": {
|
|
42
|
-
"@types/hash-sum": "^1.0.0"
|
|
49
|
+
"@types/hash-sum": "^1.0.0",
|
|
50
|
+
"@types/less": "^3.0.3",
|
|
51
|
+
"@types/stylus": "^0.48.36",
|
|
52
|
+
"@vue/compiler-sfc": "^3.2.21",
|
|
53
|
+
"postcss": "^8.3.11"
|
|
43
54
|
}
|
|
44
55
|
}
|
package/LICENSE
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Apache License
|
|
3
|
-
Version 2.0, January 2004
|
|
4
|
-
http://www.apache.org/licenses/
|
|
5
|
-
|
|
6
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
-
|
|
8
|
-
1. Definitions.
|
|
9
|
-
|
|
10
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
-
|
|
13
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
-
the copyright owner that is granting the License.
|
|
15
|
-
|
|
16
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
-
other entities that control, are controlled by, or are under common
|
|
18
|
-
control with that entity. For the purposes of this definition,
|
|
19
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
-
direction or management of such entity, whether by contract or
|
|
21
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
-
|
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
-
exercising permissions granted by this License.
|
|
26
|
-
|
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
-
including but not limited to software source code, documentation
|
|
29
|
-
source, and configuration files.
|
|
30
|
-
|
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
|
32
|
-
transformation or translation of a Source form, including but
|
|
33
|
-
not limited to compiled object code, generated documentation,
|
|
34
|
-
and conversions to other media types.
|
|
35
|
-
|
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
-
Object form, made available under the License, as indicated by a
|
|
38
|
-
copyright notice that is included in or attached to the work
|
|
39
|
-
(an example is provided in the Appendix below).
|
|
40
|
-
|
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
-
the Work and Derivative Works thereof.
|
|
48
|
-
|
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
|
50
|
-
the original version of the Work and any modifications or additions
|
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
-
|
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
-
subsequently incorporated within the Work.
|
|
66
|
-
|
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
|
73
|
-
|
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
-
where such license applies only to those patent claims licensable
|
|
80
|
-
by such Contributor that are necessarily infringed by their
|
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
-
institute patent litigation against any entity (including a
|
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
-
or contributory patent infringement, then any patent licenses
|
|
87
|
-
granted to You under this License for that Work shall terminate
|
|
88
|
-
as of the date such litigation is filed.
|
|
89
|
-
|
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
-
modifications, and in Source or Object form, provided that You
|
|
93
|
-
meet the following conditions:
|
|
94
|
-
|
|
95
|
-
(a) You must give any other recipients of the Work or
|
|
96
|
-
Derivative Works a copy of this License; and
|
|
97
|
-
|
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
|
99
|
-
stating that You changed the files; and
|
|
100
|
-
|
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
|
103
|
-
attribution notices from the Source form of the Work,
|
|
104
|
-
excluding those notices that do not pertain to any part of
|
|
105
|
-
the Derivative Works; and
|
|
106
|
-
|
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
|
109
|
-
include a readable copy of the attribution notices contained
|
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
|
112
|
-
of the following places: within a NOTICE text file distributed
|
|
113
|
-
as part of the Derivative Works; within the Source form or
|
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
|
115
|
-
within a display generated by the Derivative Works, if and
|
|
116
|
-
wherever such third-party notices normally appear. The contents
|
|
117
|
-
of the NOTICE file are for informational purposes only and
|
|
118
|
-
do not modify the License. You may add Your own attribution
|
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
-
that such additional attribution notices cannot be construed
|
|
122
|
-
as modifying the License.
|
|
123
|
-
|
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
|
125
|
-
may provide additional or different license terms and conditions
|
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
-
the conditions stated in this License.
|
|
130
|
-
|
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
-
this License, without any additional terms or conditions.
|
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
-
the terms of any separate license agreement you may have executed
|
|
137
|
-
with Licensor regarding such Contributions.
|
|
138
|
-
|
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
-
except as required for reasonable and customary use in describing the
|
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
-
|
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
|
153
|
-
|
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
|
159
|
-
incidental, or consequential damages of any character arising as a
|
|
160
|
-
result of this License or out of the use or inability to use the
|
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
-
other commercial damages or losses), even if such Contributor
|
|
164
|
-
has been advised of the possibility of such damages.
|
|
165
|
-
|
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
-
or other liability obligations and/or rights consistent with this
|
|
170
|
-
License. However, in accepting such obligations, You may act only
|
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
-
of your accepting any such warranty or additional liability.
|
|
176
|
-
|
|
177
|
-
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
-
|
|
181
|
-
To apply the Apache License to your work, attach the following
|
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
-
replaced with your own identifying information. (Don't include
|
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
-
comment syntax for the file format. We also recommend that a
|
|
186
|
-
file or class name and description of purpose be included on the
|
|
187
|
-
same "printed page" as the copyright notice for easier
|
|
188
|
-
identification within third-party archives.
|
|
189
|
-
|
|
190
|
-
Copyright [yyyy] [name of copyright owner]
|
|
191
|
-
|
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
-
you may not use this file except in compliance with the License.
|
|
194
|
-
You may obtain a copy of the License at
|
|
195
|
-
|
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
-
|
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
-
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function initWebpackNVueEntry(pages: UniApp.PagesJsonPageOptions[]): void;
|
|
@@ -1,88 +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
|
-
exports.initWebpackNVueEntry = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const utils_1 = require("../../../utils");
|
|
10
|
-
function initWebpackNVueEntry(pages) {
|
|
11
|
-
process.UNI_NVUE_ENTRY = {};
|
|
12
|
-
pages.forEach(({ path, style: { isNVue, subNVues } }) => {
|
|
13
|
-
if (isNVue) {
|
|
14
|
-
process.UNI_NVUE_ENTRY[path] = genWebpackBase64Code(genNVueEntryCode(path));
|
|
15
|
-
}
|
|
16
|
-
if (!Array.isArray(subNVues)) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
subNVues.forEach(({ path }) => {
|
|
20
|
-
if (!path) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const subNVuePath = (0, utils_1.removeExt)((0, utils_1.normalizePath)(path.split('?')[0]));
|
|
24
|
-
process.UNI_NVUE_ENTRY[subNVuePath] = genWebpackBase64Code(genNVueEntryCode(subNVuePath));
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.initWebpackNVueEntry = initWebpackNVueEntry;
|
|
29
|
-
function genWebpackBase64Code(code) {
|
|
30
|
-
return `data:text/javascript;base64,${Buffer.from(code).toString('base64')}`;
|
|
31
|
-
}
|
|
32
|
-
function genNVueEntryCode(route) {
|
|
33
|
-
return `import '${genWebpackBase64Code(genNVueAppStyle())}'
|
|
34
|
-
import App from '${(0, utils_1.normalizePath)(path_1.default.resolve(process.env.UNI_INPUT_DIR, route))}.nvue?mpType=page'
|
|
35
|
-
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
|
36
|
-
Promise.prototype.finally = function(callback) {
|
|
37
|
-
var promise = this.constructor
|
|
38
|
-
return this.then(function(value) {
|
|
39
|
-
return promise.resolve(callback()).then(function() {
|
|
40
|
-
return value
|
|
41
|
-
})
|
|
42
|
-
}, function(reason) {
|
|
43
|
-
return promise.resolve(callback()).then(function() {
|
|
44
|
-
throw reason
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
App.mpType = 'page'
|
|
50
|
-
App.route = '${route}'
|
|
51
|
-
App.el = '#root'
|
|
52
|
-
new Vue(App)
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
function genNVueAppStyle() {
|
|
56
|
-
if (process.env.UNI_NVUE_COMPILER !== 'uni-app') {
|
|
57
|
-
return '';
|
|
58
|
-
}
|
|
59
|
-
const appVuePath = path_1.default.resolve(process.env.UNI_INPUT_DIR, 'App.vue');
|
|
60
|
-
let code = 'Vue.prototype.__$appStyle__ = {}\n';
|
|
61
|
-
let styles = [];
|
|
62
|
-
try {
|
|
63
|
-
if (fs_1.default.existsSync(appVuePath)) {
|
|
64
|
-
const { parseComponent, } = require('@dcloudio/uni-cli-nvue/lib/weex-template-compiler');
|
|
65
|
-
styles = parseComponent(fs_1.default.readFileSync(appVuePath, 'utf8')).styles;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch (e) { }
|
|
69
|
-
const loaderUtils = require('loader-utils');
|
|
70
|
-
const stringifyRequest = (r) => loaderUtils.stringifyRequest({}, r);
|
|
71
|
-
styles.forEach((style, index) => {
|
|
72
|
-
if (!style.src) {
|
|
73
|
-
style.src = (0, utils_1.normalizePath)(appVuePath);
|
|
74
|
-
}
|
|
75
|
-
code =
|
|
76
|
-
code +
|
|
77
|
-
`import __style${index} from ${genStyleRequest(style, index, stringifyRequest)}
|
|
78
|
-
Vue.prototype.__merge_style(__style${index},Vue.prototype.__$appStyle__)\n`;
|
|
79
|
-
});
|
|
80
|
-
return code;
|
|
81
|
-
}
|
|
82
|
-
function genStyleRequest(style, i, stringifyRequest) {
|
|
83
|
-
const { attrsToQuery, } = require('@dcloudio/uni-cli-nvue/lib/vue-loader/lib/codegen/utils');
|
|
84
|
-
const src = style.src;
|
|
85
|
-
const attrsQuery = attrsToQuery(style.attrs, 'css');
|
|
86
|
-
const query = `?vue&type=style&index=${i}${attrsQuery}`;
|
|
87
|
-
return stringifyRequest(src + query);
|
|
88
|
-
}
|