@dcloudio/uni-cli-shared 3.0.0-alpha-3021020211025001 → 3.0.0-alpha-3021020211027001
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/filter.d.ts +7 -8
- package/dist/filter.js +8 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/json/mp/types.d.ts +1 -0
- package/dist/json/mp/utils.js +6 -2
- package/dist/mp/template.d.ts +1 -3
- package/dist/mp/template.js +1 -22
- package/dist/vue/transforms/index.d.ts +2 -0
- package/dist/vue/transforms/index.js +14 -0
- package/dist/vue/transforms/transformComponent.d.ts +2 -0
- package/dist/vue/transforms/transformComponent.js +25 -0
- package/dist/vue/transforms/transformPageHead.d.ts +2 -0
- package/dist/vue/transforms/transformPageHead.js +7 -0
- package/package.json +3 -4
package/dist/filter.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
export declare function isWxs(id: string): boolean;
|
|
2
|
+
export declare function isSjs(id: string): boolean;
|
|
2
3
|
export declare function isRenderjs(id: string): boolean;
|
|
4
|
+
declare type FilterType = 'wxs' | 'renderjs' | 'sjs';
|
|
3
5
|
export declare function parseRenderjs(id: string): {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} | {
|
|
8
|
-
readonly type: "renderjs";
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly filename: string;
|
|
6
|
+
type: FilterType;
|
|
7
|
+
name: string;
|
|
8
|
+
filename: string;
|
|
11
9
|
} | {
|
|
12
10
|
readonly type: "";
|
|
13
11
|
readonly name: "";
|
|
14
12
|
readonly filename: "";
|
|
15
13
|
};
|
|
16
|
-
export declare function missingModuleName(type:
|
|
14
|
+
export declare function missingModuleName(type: FilterType, code: string): string;
|
|
17
15
|
export declare function parseFilterNames(lang: string, code: string): string[];
|
|
16
|
+
export {};
|
package/dist/filter.js
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseFilterNames = exports.missingModuleName = exports.parseRenderjs = exports.isRenderjs = exports.isWxs = void 0;
|
|
3
|
+
exports.parseFilterNames = exports.missingModuleName = exports.parseRenderjs = exports.isRenderjs = exports.isSjs = exports.isWxs = void 0;
|
|
4
4
|
const url_1 = require("./vite/utils/url");
|
|
5
5
|
const WXS_RE = /vue&type=wxs/;
|
|
6
6
|
function isWxs(id) {
|
|
7
7
|
return WXS_RE.test(id);
|
|
8
8
|
}
|
|
9
9
|
exports.isWxs = isWxs;
|
|
10
|
+
const SJS_RE = /vue&type=sjs/;
|
|
11
|
+
function isSjs(id) {
|
|
12
|
+
return SJS_RE.test(id);
|
|
13
|
+
}
|
|
14
|
+
exports.isSjs = isSjs;
|
|
10
15
|
const RENDERJS_RE = /vue&type=renderjs/;
|
|
11
16
|
function isRenderjs(id) {
|
|
12
17
|
return RENDERJS_RE.test(id);
|
|
13
18
|
}
|
|
14
19
|
exports.isRenderjs = isRenderjs;
|
|
15
20
|
function parseRenderjs(id) {
|
|
16
|
-
if (isWxs(id)) {
|
|
17
|
-
const { query, filename } = (0, url_1.parseVueRequest)(id);
|
|
18
|
-
return {
|
|
19
|
-
type: 'wxs',
|
|
20
|
-
name: query.name,
|
|
21
|
-
filename,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
if (isRenderjs(id)) {
|
|
21
|
+
if (isWxs(id) || isRenderjs(id) || isSjs(id)) {
|
|
25
22
|
const { query, filename } = (0, url_1.parseVueRequest)(id);
|
|
26
23
|
return {
|
|
27
|
-
type:
|
|
24
|
+
type: query.type,
|
|
28
25
|
name: query.name,
|
|
29
26
|
filename,
|
|
30
27
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './preprocess';
|
|
|
15
15
|
export * from './postcss';
|
|
16
16
|
export * from './filter';
|
|
17
17
|
export * from './esbuild';
|
|
18
|
+
export * from './vue/transforms';
|
|
18
19
|
export { M } from './messages';
|
|
19
20
|
export * from './exports';
|
|
20
21
|
export { checkUpdate } from './checkUpdate';
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./preprocess"), exports);
|
|
|
28
28
|
__exportStar(require("./postcss"), exports);
|
|
29
29
|
__exportStar(require("./filter"), exports);
|
|
30
30
|
__exportStar(require("./esbuild"), exports);
|
|
31
|
+
__exportStar(require("./vue/transforms"), exports);
|
|
31
32
|
var messages_1 = require("./messages");
|
|
32
33
|
Object.defineProperty(exports, "M", { enumerable: true, get: function () { return messages_1.M; } });
|
|
33
34
|
__exportStar(require("./exports"), exports);
|
package/dist/json/mp/types.d.ts
CHANGED
|
@@ -18,6 +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: true;
|
|
21
22
|
disableScroll?: boolean;
|
|
22
23
|
usingComponents?: UsingComponents;
|
|
23
24
|
initialRenderingCache?: 'static' | string;
|
package/dist/json/mp/utils.js
CHANGED
|
@@ -23,11 +23,15 @@ function convert(to, from, map) {
|
|
|
23
23
|
}
|
|
24
24
|
function parseWindowOptions(style, platform, windowOptionsMap) {
|
|
25
25
|
if (!style) {
|
|
26
|
-
return {
|
|
26
|
+
return {
|
|
27
|
+
component: true,
|
|
28
|
+
};
|
|
27
29
|
}
|
|
28
30
|
const platformStyle = style[platform] || {};
|
|
29
31
|
(0, pages_1.removePlatformStyle)(trimJson(style));
|
|
30
|
-
const res = {
|
|
32
|
+
const res = {
|
|
33
|
+
component: true,
|
|
34
|
+
};
|
|
31
35
|
if (windowOptionsMap) {
|
|
32
36
|
return (0, shared_1.extend)(convert(res, style, windowOptionsMap), platformStyle);
|
|
33
37
|
}
|
package/dist/mp/template.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EmittedAsset } from 'rollup';
|
|
2
|
-
import { RootNode, TemplateChildNode, TransformContext } from '@vue/compiler-core';
|
|
3
2
|
export interface MiniProgramCompilerOptions {
|
|
4
3
|
slot: {
|
|
5
4
|
fallback: boolean;
|
|
@@ -12,7 +11,7 @@ export interface MiniProgramCompilerOptions {
|
|
|
12
11
|
}
|
|
13
12
|
export interface MiniProgramFilterOptions {
|
|
14
13
|
id: string;
|
|
15
|
-
type:
|
|
14
|
+
type: string;
|
|
16
15
|
name: string;
|
|
17
16
|
src?: string;
|
|
18
17
|
code: string;
|
|
@@ -23,5 +22,4 @@ export declare function clearMiniProgramTemplateFiles(): void;
|
|
|
23
22
|
export declare function addMiniProgramTemplateFile(filename: string, code: string): void;
|
|
24
23
|
export declare function clearMiniProgramTemplateFilter(filename: string): void;
|
|
25
24
|
export declare function addMiniProgramTemplateFilter(filename: string, filter: MiniProgramFilterOptions): void;
|
|
26
|
-
export declare function addComponentBindLink(node: RootNode | TemplateChildNode, context: TransformContext): void;
|
|
27
25
|
export {};
|
package/dist/mp/template.js
CHANGED
|
@@ -3,10 +3,9 @@ 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.
|
|
6
|
+
exports.addMiniProgramTemplateFilter = exports.clearMiniProgramTemplateFilter = exports.addMiniProgramTemplateFile = exports.clearMiniProgramTemplateFiles = exports.findMiniProgramTemplateFiles = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
9
|
-
const compiler_core_1 = require("@vue/compiler-core");
|
|
10
9
|
const utils_1 = require("../utils");
|
|
11
10
|
const templateFilesCache = new Map();
|
|
12
11
|
const templateFiltersCache = new Map();
|
|
@@ -72,23 +71,3 @@ function addMiniProgramTemplateFilter(filename, filter) {
|
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
exports.addMiniProgramTemplateFilter = addMiniProgramTemplateFilter;
|
|
75
|
-
function addComponentBindLink(node, context) {
|
|
76
|
-
if (node.type === 1 /* ELEMENT */ &&
|
|
77
|
-
node.tagType === 1 /* COMPONENT */) {
|
|
78
|
-
const { tag } = node;
|
|
79
|
-
if ((0, uni_shared_1.isComponentTag)(tag) ||
|
|
80
|
-
(0, compiler_core_1.isCoreComponent)(tag) ||
|
|
81
|
-
context.isBuiltInComponent(tag)) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
node.props.push({
|
|
85
|
-
type: 7 /* DIRECTIVE */,
|
|
86
|
-
name: 'on',
|
|
87
|
-
modifiers: [],
|
|
88
|
-
loc: compiler_core_1.locStub,
|
|
89
|
-
arg: (0, compiler_core_1.createSimpleExpression)('__l', true),
|
|
90
|
-
exp: (0, compiler_core_1.createSimpleExpression)('__l', true),
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.addComponentBindLink = addComponentBindLink;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./transformComponent"), exports);
|
|
14
|
+
__exportStar(require("./transformPageHead"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addComponentBindLink = void 0;
|
|
4
|
+
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
5
|
+
const compiler_core_1 = require("@vue/compiler-core");
|
|
6
|
+
function addComponentBindLink(node, context) {
|
|
7
|
+
if (node.type === 1 /* ELEMENT */ &&
|
|
8
|
+
node.tagType === 1 /* COMPONENT */) {
|
|
9
|
+
const { tag } = node;
|
|
10
|
+
if ((0, uni_shared_1.isComponentTag)(tag) ||
|
|
11
|
+
(0, compiler_core_1.isCoreComponent)(tag) ||
|
|
12
|
+
context.isBuiltInComponent(tag)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
node.props.push({
|
|
16
|
+
type: 7 /* DIRECTIVE */,
|
|
17
|
+
name: 'on',
|
|
18
|
+
modifiers: [],
|
|
19
|
+
loc: compiler_core_1.locStub,
|
|
20
|
+
arg: (0, compiler_core_1.createSimpleExpression)('__l', true),
|
|
21
|
+
exp: (0, compiler_core_1.createSimpleExpression)('__l', true),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.addComponentBindLink = addComponentBindLink;
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3021020211027001",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist
|
|
9
|
-
"dist/**/*.d.ts",
|
|
8
|
+
"dist",
|
|
10
9
|
"lib"
|
|
11
10
|
],
|
|
12
11
|
"repository": {
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"tapable": "^2.2.0",
|
|
38
37
|
"xregexp": "3.1.0"
|
|
39
38
|
},
|
|
40
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "7c3b865969ba3bb0ffe06e0664b14bc96dfccfc6",
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@types/hash-sum": "^1.0.0"
|
|
43
42
|
}
|