@tarojs/helper 3.4.4 → 3.4.7
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/index.js +1 -3
- package/dist/npm.js +3 -2
- package/dist/utils.js +7 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.helper = void 0;
|
|
|
4
4
|
const fs = require("fs-extra");
|
|
5
5
|
const chalk = require("chalk");
|
|
6
6
|
const chokidar = require("chokidar");
|
|
7
|
-
const debug_1 = require("debug");
|
|
8
7
|
const constants = require("./constants");
|
|
9
8
|
const utils = require("./utils");
|
|
10
9
|
const npm = require("./npm");
|
|
@@ -14,6 +13,5 @@ exports.helper = Object.assign(Object.assign(Object.assign({}, constants), utils
|
|
|
14
13
|
injectDefineConfigHeader: babelRegister_1.injectDefineConfigHeader,
|
|
15
14
|
fs,
|
|
16
15
|
chalk,
|
|
17
|
-
chokidar,
|
|
18
|
-
createDebug: debug_1.default });
|
|
16
|
+
chokidar, createDebug: id => require('debug')(id) });
|
|
19
17
|
exports.default = exports.helper;
|
package/dist/npm.js
CHANGED
|
@@ -10,8 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getNpmPkg = exports.getNpmPkgSync = exports.callPluginSync = exports.callPlugin = exports.installNpmPkg = exports.resolveNpmSync = exports.resolveNpm = exports.taroPluginPrefix = void 0;
|
|
13
|
-
const resolvePath = require("resolve");
|
|
14
|
-
const spawn = require("cross-spawn");
|
|
15
13
|
const chalk = require("chalk");
|
|
16
14
|
const Util = require("./utils");
|
|
17
15
|
const PEERS = /UNMET PEER DEPENDENCY ([a-z\-0-9.]+)@(.+)/gm;
|
|
@@ -23,6 +21,7 @@ const defaultInstallOptions = {
|
|
|
23
21
|
};
|
|
24
22
|
exports.taroPluginPrefix = '@tarojs/plugin-';
|
|
25
23
|
function resolveNpm(pluginName, root) {
|
|
24
|
+
const resolvePath = require('resolve');
|
|
26
25
|
if (!npmCached[pluginName]) {
|
|
27
26
|
return new Promise((resolve, reject) => {
|
|
28
27
|
resolvePath(`${pluginName}`, { basedir: root }, (err, res) => {
|
|
@@ -38,6 +37,7 @@ function resolveNpm(pluginName, root) {
|
|
|
38
37
|
}
|
|
39
38
|
exports.resolveNpm = resolveNpm;
|
|
40
39
|
function resolveNpmSync(pluginName, root) {
|
|
40
|
+
const resolvePath = require('resolve');
|
|
41
41
|
try {
|
|
42
42
|
if (!npmCached[pluginName]) {
|
|
43
43
|
const res = resolvePath.sync(pluginName, { basedir: root });
|
|
@@ -103,6 +103,7 @@ function installNpmPkg(pkgList, options) {
|
|
|
103
103
|
args.push('--save');
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
const spawn = require('cross-spawn');
|
|
106
107
|
const output = spawn.sync(installer, args, {
|
|
107
108
|
stdio: ['ignore', 'pipe', 'inherit']
|
|
108
109
|
});
|
package/dist/utils.js
CHANGED
|
@@ -13,14 +13,9 @@ exports.readConfig = exports.readPageConfig = exports.removeHeadSlash = exports.
|
|
|
13
13
|
const fs = require("fs-extra");
|
|
14
14
|
const path = require("path");
|
|
15
15
|
const os = require("os");
|
|
16
|
-
const stream_1 = require("stream");
|
|
17
16
|
const child_process = require("child_process");
|
|
18
|
-
const parser = require("@babel/parser");
|
|
19
|
-
const traverse_1 = require("@babel/traverse");
|
|
20
17
|
const chalk = require("chalk");
|
|
21
|
-
const findWorkspaceRoot = require("find-yarn-workspace-root");
|
|
22
18
|
const lodash_1 = require("lodash");
|
|
23
|
-
const yauzl = require("yauzl");
|
|
24
19
|
const constants_1 = require("./constants");
|
|
25
20
|
const babelRegister_1 = require("./babelRegister");
|
|
26
21
|
const execSync = child_process.execSync;
|
|
@@ -121,6 +116,7 @@ function printLog(type, tag, filePath) {
|
|
|
121
116
|
}
|
|
122
117
|
exports.printLog = printLog;
|
|
123
118
|
function recursiveFindNodeModules(filePath, lastFindPath) {
|
|
119
|
+
const findWorkspaceRoot = require('find-yarn-workspace-root');
|
|
124
120
|
if (lastFindPath && (normalizePath(filePath) === normalizePath(lastFindPath))) {
|
|
125
121
|
return filePath;
|
|
126
122
|
}
|
|
@@ -397,6 +393,8 @@ const applyArrayedVisitors = obj => {
|
|
|
397
393
|
};
|
|
398
394
|
exports.applyArrayedVisitors = applyArrayedVisitors;
|
|
399
395
|
function unzip(zipPath) {
|
|
396
|
+
const Transform = require('stream').Transform;
|
|
397
|
+
const yauzl = require('yauzl');
|
|
400
398
|
return new Promise((resolve, reject) => {
|
|
401
399
|
yauzl.open(zipPath, { lazyEntries: true }, (err, zipfile) => {
|
|
402
400
|
if (err || !zipfile)
|
|
@@ -421,7 +419,7 @@ function unzip(zipPath) {
|
|
|
421
419
|
zipfile.openReadStream(entry, (err, readStream) => {
|
|
422
420
|
if (err || !readStream)
|
|
423
421
|
throw err;
|
|
424
|
-
const filter = new
|
|
422
|
+
const filter = new Transform();
|
|
425
423
|
filter._transform = function (chunk, _encoding, cb) {
|
|
426
424
|
cb(undefined, chunk);
|
|
427
425
|
};
|
|
@@ -492,6 +490,8 @@ function removeHeadSlash(str) {
|
|
|
492
490
|
}
|
|
493
491
|
exports.removeHeadSlash = removeHeadSlash;
|
|
494
492
|
function analyzeImport(filePath) {
|
|
493
|
+
const parser = require('@babel/parser');
|
|
494
|
+
const traverse = require('@babel/traverse').default;
|
|
495
495
|
const code = fs.readFileSync(filePath).toString();
|
|
496
496
|
let importPaths = [];
|
|
497
497
|
filePath = path.dirname(filePath);
|
|
@@ -504,7 +504,7 @@ function analyzeImport(filePath) {
|
|
|
504
504
|
'optionalChaining'
|
|
505
505
|
]
|
|
506
506
|
});
|
|
507
|
-
|
|
507
|
+
traverse(ast, {
|
|
508
508
|
ImportDeclaration({ node }) {
|
|
509
509
|
const list = [];
|
|
510
510
|
const source = node.source.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/helper",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.7",
|
|
4
4
|
"description": "Taro Helper",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@babel/preset-typescript": "^7.14.5",
|
|
41
41
|
"@babel/register": "^7.14.5",
|
|
42
42
|
"@babel/runtime": "^7.14.5",
|
|
43
|
-
"@tarojs/taro": "3.4.
|
|
43
|
+
"@tarojs/taro": "3.4.7",
|
|
44
44
|
"chalk": "3.0.0",
|
|
45
45
|
"chokidar": "^3.3.1",
|
|
46
46
|
"cross-spawn": "^7.0.3",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"resolve": "^1.6.0",
|
|
52
52
|
"yauzl": "2.10.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "bb62ad5d4f099940c8c4d6dfcba9b743bc3d2acf"
|
|
55
55
|
}
|