@tarojs/cli 4.1.8-beta.0 → 4.1.8-beta.2
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/presets/commands/build.js +2 -9
- package/dist/presets/commands/build.js.map +1 -1
- package/package.json +10 -10
- package/src/presets/commands/build.ts +4 -11
- package/dist/util/jdWidget.d.ts +0 -2
- package/dist/util/jdWidget.js +0 -29
- package/dist/util/jdWidget.js.map +0 -1
- package/src/util/jdWidget.ts +0 -33
|
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const plugin_doctor_1 = require("@tarojs/plugin-doctor");
|
|
13
13
|
const appConfig_1 = require("../../util/appConfig");
|
|
14
|
-
const jdWidget_1 = require("../../util/jdWidget");
|
|
15
14
|
const hooks = require("../constant");
|
|
16
15
|
exports.default = (ctx) => {
|
|
17
16
|
ctx.registerCommand({
|
|
@@ -40,7 +39,6 @@ exports.default = (ctx) => {
|
|
|
40
39
|
'--env-prefix [envPrefix]': "Provide the dotEnv varables's prefix",
|
|
41
40
|
'--no-inject-global-style': '[H5] Do not inject global style',
|
|
42
41
|
'--no-check': 'Do not check config is valid or not',
|
|
43
|
-
'--widgetRoot': '[jd] Build specific page or component as a jd widget',
|
|
44
42
|
},
|
|
45
43
|
synopsisList: [
|
|
46
44
|
'taro build --type weapp',
|
|
@@ -50,7 +48,6 @@ exports.default = (ctx) => {
|
|
|
50
48
|
'taro build --type weapp --blended',
|
|
51
49
|
'taro build --type weapp --no-build',
|
|
52
50
|
'taro build native-components --type weapp',
|
|
53
|
-
'taro build native-components --type jd --widget --widgetRoot pages/index/index',
|
|
54
51
|
'taro build --type weapp --new-blended',
|
|
55
52
|
'taro build --plugin weapp --watch',
|
|
56
53
|
'taro build --plugin weapp',
|
|
@@ -107,14 +104,10 @@ exports.default = (ctx) => {
|
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
106
|
const isProduction = process.env.NODE_ENV === 'production' || !isWatch;
|
|
110
|
-
// is build native components mode?
|
|
111
|
-
const isBuildNativeComp = _[1] === 'native-components';
|
|
112
|
-
const isBuildJDWidget = isBuildNativeComp && platform === 'jd' && Boolean(args.widget);
|
|
113
|
-
if (isBuildJDWidget) {
|
|
114
|
-
(0, jdWidget_1.buildJDWidget)(ctx);
|
|
115
|
-
}
|
|
116
107
|
// dist folder
|
|
117
108
|
fs.ensureDirSync(outputPath);
|
|
109
|
+
// is build native components mode?
|
|
110
|
+
const isBuildNativeComp = _[1] === 'native-components';
|
|
118
111
|
yield ctx.applyPlugins(hooks.ON_BUILD_START);
|
|
119
112
|
yield ctx.applyPlugins({
|
|
120
113
|
name: platform,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/presets/commands/build.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yDAG8B;AAE9B,oDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/presets/commands/build.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yDAG8B;AAE9B,oDAA0D;AAC1D,qCAAoC;AAIpC,kBAAe,CAAC,GAAmB,EAAE,EAAE;IACrC,GAAG,CAAC,eAAe,CAAC;QAClB,IAAI,EAAE,OAAO;QACb,UAAU,EAAE;YACV,mBAAmB,EAAE,8CAA8C;YACnE,SAAS,EAAE,YAAY;YACvB,aAAa,EAAE,gCAAgC;YAC/C,SAAS,EAAE,8DAA8D;YACzE,cAAc,EAAE,mEAAmE;YACnF,eAAe,EAAE,yBAAyB;YAC1C,mBAAmB,EAAE,gBAAgB;YACrC,YAAY,EAAE,sBAAsB;YACpC,YAAY,EAAE,kFAAkF;YAChG,eAAe,EAAE,4BAA4B;YAC7C,eAAe,EAAE,yBAAyB;YAC1C,iBAAiB,EAAE,oDAAoD;YACvE,oBAAoB,EAAE,uE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CACR,MAAM;yCACP;qCACF,CAAC,CAAA;gCACJ,CAAC;6BAAA;4BACK,oBAAoB,CAAC,QAAQ,EAAE,eAAe;;oCAClD,MAAM,GAAG,CAAC,YAAY,CAAC;wCACrB,IAAI,EAAE,KAAK,CAAC,uBAAuB;wCACnC,IAAI,EAAE;4CACJ,QAAQ;4CACR,eAAe;yCAChB;qCACF,CAAC,CAAA;gCACJ,CAAC;6BAAA;4BACK,aAAa;qFAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;oCAC3C,MAAM,GAAG,CAAC,YAAY,CAAC;wCACrB,IAAI,EAAE,KAAK,CAAC,eAAe;wCAC3B,IAAI,EAAE;4CACJ,KAAK;4CACL,KAAK;4CACL,OAAO;yCACR;qCACF,CAAC,CAAA;gCACJ,CAAC;6BAAA,GACF;qBACF;iBACF,CAAC,CAAA;gBACF,MAAM,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;YACjD,CAAC;SAAA;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAe,WAAW;yDAAE,EAAE,aAAa,EAAE,MAAM,EAAE;QACnD,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAc,EAAC,aAAa,EAAE,MAAM,CAAC,CAAA;QAC1D,OAAO,MAAM,CAAA;IACf,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/cli",
|
|
3
|
-
"version": "4.1.8-beta.
|
|
3
|
+
"version": "4.1.8-beta.2",
|
|
4
4
|
"description": "cli tool for taro",
|
|
5
5
|
"author": "O2Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,21 +42,21 @@
|
|
|
42
42
|
"ora": "^5.4.1",
|
|
43
43
|
"semver": "^7.6.0",
|
|
44
44
|
"validate-npm-package-name": "^5.0.0",
|
|
45
|
-
"@tarojs/
|
|
46
|
-
"@tarojs/
|
|
47
|
-
"@tarojs/
|
|
48
|
-
"@tarojs/
|
|
45
|
+
"@tarojs/helper": "4.1.8-beta.2",
|
|
46
|
+
"@tarojs/binding": "4.1.8-beta.2",
|
|
47
|
+
"@tarojs/shared": "4.1.8-beta.2",
|
|
48
|
+
"@tarojs/service": "4.1.8-beta.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/types": "^7.24.0",
|
|
52
52
|
"@types/babel__traverse": "^7.20.6",
|
|
53
53
|
"eslint-plugin-react": "^7.34.1",
|
|
54
54
|
"eslint-plugin-react-hooks": "^4.4.0",
|
|
55
|
-
"@tarojs/plugin-platform-
|
|
56
|
-
"@tarojs/plugin-platform-
|
|
57
|
-
"@tarojs/taro": "4.1.8-beta.
|
|
58
|
-
"@tarojs/webpack5-runner": "4.1.8-beta.
|
|
59
|
-
"babel-preset-taro": "4.1.8-beta.
|
|
55
|
+
"@tarojs/plugin-platform-h5": "4.1.8-beta.2",
|
|
56
|
+
"@tarojs/plugin-platform-weapp": "4.1.8-beta.2",
|
|
57
|
+
"@tarojs/taro": "4.1.8-beta.2",
|
|
58
|
+
"@tarojs/webpack5-runner": "4.1.8-beta.2",
|
|
59
|
+
"babel-preset-taro": "4.1.8-beta.2"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"prod": "pnpm run build",
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
} from '@tarojs/plugin-doctor'
|
|
5
5
|
|
|
6
6
|
import { extractCompileEntry } from '../../util/appConfig'
|
|
7
|
-
import { buildJDWidget } from '../../util/jdWidget'
|
|
8
7
|
import * as hooks from '../constant'
|
|
9
8
|
|
|
10
9
|
import type { IPluginContext } from '@tarojs/service'
|
|
@@ -36,7 +35,6 @@ export default (ctx: IPluginContext) => {
|
|
|
36
35
|
'--env-prefix [envPrefix]': "Provide the dotEnv varables's prefix",
|
|
37
36
|
'--no-inject-global-style': '[H5] Do not inject global style',
|
|
38
37
|
'--no-check': 'Do not check config is valid or not',
|
|
39
|
-
'--widgetRoot': '[jd] Build specific page or component as a jd widget',
|
|
40
38
|
},
|
|
41
39
|
synopsisList: [
|
|
42
40
|
'taro build --type weapp',
|
|
@@ -46,7 +44,6 @@ export default (ctx: IPluginContext) => {
|
|
|
46
44
|
'taro build --type weapp --blended',
|
|
47
45
|
'taro build --type weapp --no-build',
|
|
48
46
|
'taro build native-components --type weapp',
|
|
49
|
-
'taro build native-components --type jd --widget --widgetRoot pages/index/index',
|
|
50
47
|
'taro build --type weapp --new-blended',
|
|
51
48
|
'taro build --plugin weapp --watch',
|
|
52
49
|
'taro build --plugin weapp',
|
|
@@ -108,16 +105,12 @@ export default (ctx: IPluginContext) => {
|
|
|
108
105
|
|
|
109
106
|
const isProduction = process.env.NODE_ENV === 'production' || !isWatch
|
|
110
107
|
|
|
111
|
-
// is build native components mode?
|
|
112
|
-
const isBuildNativeComp = _[1] === 'native-components'
|
|
113
|
-
|
|
114
|
-
const isBuildJDWidget = isBuildNativeComp && platform === 'jd' && Boolean(args.widget)
|
|
115
|
-
if (isBuildJDWidget) {
|
|
116
|
-
buildJDWidget(ctx)
|
|
117
|
-
}
|
|
118
108
|
// dist folder
|
|
119
109
|
fs.ensureDirSync(outputPath)
|
|
120
110
|
|
|
111
|
+
// is build native components mode?
|
|
112
|
+
const isBuildNativeComp = _[1] === 'native-components'
|
|
113
|
+
|
|
121
114
|
await ctx.applyPlugins(hooks.ON_BUILD_START)
|
|
122
115
|
await ctx.applyPlugins({
|
|
123
116
|
name: platform,
|
|
@@ -228,7 +221,7 @@ export default (ctx: IPluginContext) => {
|
|
|
228
221
|
})
|
|
229
222
|
}
|
|
230
223
|
|
|
231
|
-
async function checkConfig({ projectConfig, helper }) {
|
|
224
|
+
async function checkConfig ({ projectConfig, helper }) {
|
|
232
225
|
const result = await validateConfig(projectConfig, helper)
|
|
233
226
|
return result
|
|
234
227
|
}
|
package/dist/util/jdWidget.d.ts
DELETED
package/dist/util/jdWidget.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildJDWidget = void 0;
|
|
4
|
-
const path = require("node:path");
|
|
5
|
-
function buildJDWidget(ctx) {
|
|
6
|
-
const { paths } = ctx;
|
|
7
|
-
const { outputPath } = paths;
|
|
8
|
-
const { config, options } = ctx.runOpts;
|
|
9
|
-
const { args } = options;
|
|
10
|
-
if (!args.widgetRoot) {
|
|
11
|
-
console.log(ctx.helper.chalk.red('请传入 --widgetRoot 指定需要编译为京东小部件的页面或组件的路径'));
|
|
12
|
-
process.exit(0);
|
|
13
|
-
}
|
|
14
|
-
ctx.modifyAppConfig(({ appConfig }) => {
|
|
15
|
-
appConfig.components = [args.widgetRoot];
|
|
16
|
-
});
|
|
17
|
-
config.outputRoot = path.join(outputPath, 'widget');
|
|
18
|
-
ctx.onBuildComplete(() => {
|
|
19
|
-
ctx.helper.fs.writeJSONSync(path.join(config.outputRoot, 'project.config.json'), {
|
|
20
|
-
compileType: 'widget',
|
|
21
|
-
widgetRoot: args.widgetRoot,
|
|
22
|
-
}, {
|
|
23
|
-
encoding: 'utf-8',
|
|
24
|
-
spaces: 2,
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.buildJDWidget = buildJDWidget;
|
|
29
|
-
//# sourceMappingURL=jdWidget.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jdWidget.js","sourceRoot":"","sources":["../../src/util/jdWidget.ts"],"names":[],"mappings":";;;AAAA,kCAAiC;AAIjC,SAAgB,aAAa,CAAC,GAAmB;IAC/C,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAA;IACrB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,CAAA;IACvC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC,CAAA;QAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,GAAG,CAAC,eAAe,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACpC,SAAS,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAEnD,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE;QACvB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,CACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,qBAAqB,CAAC,EACnD;YACE,WAAW,EAAE,QAAQ;YACrB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,EACD;YACE,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,CAAC;SACV,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AA5BD,sCA4BC"}
|
package/src/util/jdWidget.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as path from 'node:path'
|
|
2
|
-
|
|
3
|
-
import type { IPluginContext } from '@tarojs/service'
|
|
4
|
-
|
|
5
|
-
export function buildJDWidget(ctx: IPluginContext) {
|
|
6
|
-
const { paths } = ctx
|
|
7
|
-
const { outputPath } = paths
|
|
8
|
-
const { config, options } = ctx.runOpts
|
|
9
|
-
const { args } = options
|
|
10
|
-
if (!args.widgetRoot) {
|
|
11
|
-
console.log(ctx.helper.chalk.red('请传入 --widgetRoot 指定需要编译为京东小部件的页面或组件的路径'))
|
|
12
|
-
process.exit(0)
|
|
13
|
-
}
|
|
14
|
-
ctx.modifyAppConfig(({ appConfig }) => {
|
|
15
|
-
appConfig.components = [args.widgetRoot]
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
config.outputRoot = path.join(outputPath, 'widget')
|
|
19
|
-
|
|
20
|
-
ctx.onBuildComplete(() => {
|
|
21
|
-
ctx.helper.fs.writeJSONSync(
|
|
22
|
-
path.join(config.outputRoot, 'project.config.json'),
|
|
23
|
-
{
|
|
24
|
-
compileType: 'widget',
|
|
25
|
-
widgetRoot: args.widgetRoot,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
encoding: 'utf-8',
|
|
29
|
-
spaces: 2,
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
})
|
|
33
|
-
}
|