@tarojs/runner-utils 4.0.1-alpha.1 → 4.0.1
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/LICENSE +8 -8
- package/README.md +1 -1
- package/dist/constant.js +1 -5
- package/dist/index.js +9 -18
- package/dist/resolve/MultiPlatformPlugin.js +2 -2
- package/dist/scss.js +7 -7
- package/package.json +5 -13
- package/types/constant.d.ts +0 -4
- package/types/index.d.ts +4 -4
- package/dist/vite.js +0 -35
- package/types/vite.d.ts +0 -5
package/LICENSE
CHANGED
|
@@ -154,8 +154,15 @@ See `/LICENSE` for details of the license.
|
|
|
154
154
|
|
|
155
155
|
==================
|
|
156
156
|
|
|
157
|
+
MIT (stencil-vue2-output-target):
|
|
158
|
+
The following files embed [stencil-vue2-output-target](https://github.com/diondree/stencil-vue2-output-target) MIT:
|
|
159
|
+
`/packages/taro-components-library-vue2/src/vue-component-lib/utils.ts`
|
|
160
|
+
See `/LICENSE` for details of the license.
|
|
161
|
+
|
|
162
|
+
==================
|
|
163
|
+
|
|
157
164
|
MIT (weui):
|
|
158
|
-
The following files embed [
|
|
165
|
+
The following files embed [stencil-vue2-output-target](https://github.com/Tencent/weui) MIT:
|
|
159
166
|
`/packages/taro-components/src/components/*.scss`
|
|
160
167
|
See `/LICENSE.txt` for details of the license.
|
|
161
168
|
|
|
@@ -165,10 +172,3 @@ Apache-2.0 (intersection-observer):
|
|
|
165
172
|
The following files embed [intersection-observer](https://github.com/GoogleChromeLabs/intersection-observer) Apache-2.0:
|
|
166
173
|
`/packages/taro-api/src/polyfill/intersection-observer.ts`
|
|
167
174
|
See `/LICENSE.txt` for details of the license.
|
|
168
|
-
|
|
169
|
-
==================
|
|
170
|
-
|
|
171
|
-
MIT (babel-plugin-jsx-dom-expressions):
|
|
172
|
-
The following files embed [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/blob/main/packages/babel-plugin-jsx-dom-expressions) MIT:
|
|
173
|
-
`/packages/babel-plugin-transform-solid-jsx/src/*`
|
|
174
|
-
See `/LICENSE` for details of the license.
|
package/README.md
CHANGED
package/dist/constant.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_Components = void 0;
|
|
4
4
|
exports.DEFAULT_Components = new Set([
|
|
5
5
|
'view',
|
|
6
6
|
'scroll-view',
|
|
@@ -46,7 +46,3 @@ exports.DEFAULT_Components = new Set([
|
|
|
46
46
|
'official-account',
|
|
47
47
|
'editor'
|
|
48
48
|
]);
|
|
49
|
-
exports.VITE_COMPILER_LABEL = 'taro:compiler';
|
|
50
|
-
exports.IMAGE_LIMIT = 2 * 1024;
|
|
51
|
-
exports.FONT_LIMIT = 10 * 1024;
|
|
52
|
-
exports.MEDIA_LIMIT = 10 * 1024;
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
exports.MultiPlatformPlugin = exports.getSassLoaderOption = exports.getBundleResult = exports.getBundleContent = exports.DEFAULT_Components = void 0;
|
|
4
|
+
const constant_1 = require("./constant");
|
|
5
|
+
Object.defineProperty(exports, "DEFAULT_Components", { enumerable: true, get: function () { return constant_1.DEFAULT_Components; } });
|
|
6
|
+
const MultiPlatformPlugin_1 = require("./resolve/MultiPlatformPlugin");
|
|
7
|
+
Object.defineProperty(exports, "MultiPlatformPlugin", { enumerable: true, get: function () { return MultiPlatformPlugin_1.MultiPlatformPlugin; } });
|
|
8
|
+
const scss_1 = require("./scss");
|
|
9
|
+
Object.defineProperty(exports, "getBundleContent", { enumerable: true, get: function () { return scss_1.getBundleContent; } });
|
|
10
|
+
Object.defineProperty(exports, "getBundleResult", { enumerable: true, get: function () { return scss_1.getBundleResult; } });
|
|
11
|
+
Object.defineProperty(exports, "getSassLoaderOption", { enumerable: true, get: function () { return scss_1.getSassLoaderOption; } });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MultiPlatformPlugin = void 0;
|
|
4
|
-
const path = require("node:path");
|
|
5
4
|
const helper_1 = require("@tarojs/helper");
|
|
5
|
+
const path = require("path");
|
|
6
6
|
/**
|
|
7
7
|
* @description 此 enhance-resolve 插件用于根据当前编译的平台,解析多端文件的后缀
|
|
8
8
|
*
|
|
@@ -46,7 +46,7 @@ class MultiPlatformPlugin {
|
|
|
46
46
|
else {
|
|
47
47
|
return callback();
|
|
48
48
|
}
|
|
49
|
-
if (
|
|
49
|
+
if (/node_modules/.test(srcRequest) && !this.includes(srcRequest)) {
|
|
50
50
|
return callback();
|
|
51
51
|
}
|
|
52
52
|
const extensions = (_c = (_b = (_a = this.options.chain) === null || _a === void 0 ? void 0 : _a.resolve) === null || _b === void 0 ? void 0 : _b.extensions) === null || _c === void 0 ? void 0 : _c.values();
|
package/dist/scss.js
CHANGED
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getSassLoaderOption = exports.getBundleContent = exports.getBundleResult = void 0;
|
|
13
|
-
const path = require("node:path");
|
|
14
13
|
const helper_1 = require("@tarojs/helper");
|
|
14
|
+
const path = require("path");
|
|
15
15
|
const scss_bundle_1 = require("scss-bundle");
|
|
16
16
|
/**
|
|
17
17
|
* Return bundled sass content.
|
|
@@ -21,8 +21,8 @@ const scss_bundle_1 = require("scss-bundle");
|
|
|
21
21
|
* Used for resolving tilde imports.
|
|
22
22
|
* @returns Bundle result.
|
|
23
23
|
*/
|
|
24
|
-
function getBundleResult(
|
|
25
|
-
return __awaiter(this,
|
|
24
|
+
function getBundleResult(url, projectDirectory = undefined) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
let bundler = new scss_bundle_1.Bundler();
|
|
27
27
|
if (projectDirectory) {
|
|
28
28
|
bundler = new scss_bundle_1.Bundler(undefined, projectDirectory);
|
|
@@ -39,8 +39,8 @@ exports.getBundleResult = getBundleResult;
|
|
|
39
39
|
* Used for resolving tilde imports.
|
|
40
40
|
* @returns Bundle result.
|
|
41
41
|
*/
|
|
42
|
-
function getBundleContent(
|
|
43
|
-
return __awaiter(this,
|
|
42
|
+
function getBundleContent(resource, projectDirectory = undefined) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
let result = '';
|
|
45
45
|
try {
|
|
46
46
|
if (typeof resource === 'string') {
|
|
@@ -88,8 +88,8 @@ function checkPath(resource, rootDir) {
|
|
|
88
88
|
* @param {BuildConfig} param0 Build config.
|
|
89
89
|
* @returns Merged sass loader option.
|
|
90
90
|
*/
|
|
91
|
-
function getSassLoaderOption(
|
|
92
|
-
return __awaiter(this,
|
|
91
|
+
function getSassLoaderOption({ sass, sassLoaderOption }) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
93
|
sassLoaderOption = sassLoaderOption || {};
|
|
94
94
|
let bundledContent = '';
|
|
95
95
|
if (!sass) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/runner-utils",
|
|
3
|
-
"version": "4.0.1
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Taro runner utilities.",
|
|
5
|
-
"author": "O2Team",
|
|
6
|
-
"license": "MIT",
|
|
7
5
|
"main": "dist/index.js",
|
|
8
6
|
"types": "types/index.d.ts",
|
|
9
7
|
"files": [
|
|
@@ -17,19 +15,13 @@
|
|
|
17
15
|
"keywords": [
|
|
18
16
|
"taro"
|
|
19
17
|
],
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
},
|
|
18
|
+
"author": "garfield550",
|
|
19
|
+
"license": "MIT",
|
|
23
20
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"@tarojs/helper": "4.0.1-alpha.1"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@tarojs/taro": "4.0.1-alpha.1"
|
|
21
|
+
"scss-bundle": "^3.0.2",
|
|
22
|
+
"@tarojs/helper": "4.0.1"
|
|
30
23
|
},
|
|
31
24
|
"scripts": {
|
|
32
|
-
"prod": "pnpm run build",
|
|
33
25
|
"build": "tsc",
|
|
34
26
|
"dev": "tsc -w"
|
|
35
27
|
}
|
package/types/constant.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import { DEFAULT_Components } from './constant';
|
|
2
|
+
import { MultiPlatformPlugin } from './resolve/MultiPlatformPlugin';
|
|
3
|
+
import { getBundleContent, getBundleResult, getSassLoaderOption } from './scss';
|
|
4
|
+
export { DEFAULT_Components, getBundleContent, getBundleResult, getSassLoaderOption, MultiPlatformPlugin };
|
package/dist/vite.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getViteMiniCompilerContext = exports.getViteHarmonyCompilerContext = exports.getViteH5CompilerContext = void 0;
|
|
13
|
-
const constant_1 = require("./constant");
|
|
14
|
-
function getViteH5CompilerContext(rollupPluginContext) {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const info = process.env.NODE_ENV === 'production'
|
|
17
|
-
? rollupPluginContext.getModuleInfo(constant_1.VITE_COMPILER_LABEL)
|
|
18
|
-
: yield rollupPluginContext.load({ id: constant_1.VITE_COMPILER_LABEL });
|
|
19
|
-
const compiler = info === null || info === void 0 ? void 0 : info.meta.viteCompilerContext;
|
|
20
|
-
return compiler;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.getViteH5CompilerContext = getViteH5CompilerContext;
|
|
24
|
-
function getViteHarmonyCompilerContext(rollupPluginContext) {
|
|
25
|
-
const info = rollupPluginContext.getModuleInfo(constant_1.VITE_COMPILER_LABEL);
|
|
26
|
-
const compiler = info === null || info === void 0 ? void 0 : info.meta.viteCompilerContext;
|
|
27
|
-
return compiler;
|
|
28
|
-
}
|
|
29
|
-
exports.getViteHarmonyCompilerContext = getViteHarmonyCompilerContext;
|
|
30
|
-
function getViteMiniCompilerContext(rollupPluginContext) {
|
|
31
|
-
const info = rollupPluginContext.getModuleInfo(constant_1.VITE_COMPILER_LABEL);
|
|
32
|
-
const compiler = info === null || info === void 0 ? void 0 : info.meta.viteCompilerContext;
|
|
33
|
-
return compiler;
|
|
34
|
-
}
|
|
35
|
-
exports.getViteMiniCompilerContext = getViteMiniCompilerContext;
|
package/types/vite.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ViteH5CompilerContext, ViteHarmonyCompilerContext, ViteMiniCompilerContext } from '@tarojs/taro/types/compile/viteCompilerContext';
|
|
2
|
-
import type { PluginContext } from 'rollup';
|
|
3
|
-
export declare function getViteH5CompilerContext(rollupPluginContext: PluginContext): Promise<ViteH5CompilerContext | void>;
|
|
4
|
-
export declare function getViteHarmonyCompilerContext(rollupPluginContext: PluginContext): ViteHarmonyCompilerContext | void;
|
|
5
|
-
export declare function getViteMiniCompilerContext(rollupPluginContext: PluginContext): ViteMiniCompilerContext | void;
|