@ray-js/cli 1.6.13-beta.0 → 1.6.13
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/bin/ray-build.js +3 -3
- package/bin/ray-start.js +3 -3
- package/lib/build.js +25 -30
- package/lib/start.js +11 -29
- package/package.json +10 -10
package/bin/ray-build.js
CHANGED
|
@@ -14,13 +14,13 @@ program
|
|
|
14
14
|
.option('--sourcemap', '启动 sourcemap', true)
|
|
15
15
|
.option('--no-sourcemap', '禁用 sourcemap')
|
|
16
16
|
.option('-t --target <target>', '目标平台')
|
|
17
|
-
.option('-a --analyze', '开启 analyze
|
|
17
|
+
.option('-a --analyze', '开启 analyze 分析')
|
|
18
18
|
.option('--drop', '移除 console debugger 等', false)
|
|
19
|
-
.option('--type <type>', '构建类型 eg: app | component
|
|
19
|
+
.option('--type <type>', '构建类型 eg: app | component', 'app')
|
|
20
20
|
.option('--transform-mode <mode>', '组件转换类型 eg: auto | pure', 'pure')
|
|
21
21
|
.option(
|
|
22
22
|
'--bundler <type>',
|
|
23
|
-
'
|
|
23
|
+
'默认使用 esbuild 极速构建(公测阶段), 如需降级设置为 webpack',
|
|
24
24
|
'esbuild'
|
|
25
25
|
)
|
|
26
26
|
.option('--debug [debug]', '开启运行时日志', (v) => {
|
package/bin/ray-start.js
CHANGED
|
@@ -14,13 +14,13 @@ program
|
|
|
14
14
|
.option('--sourcemap', '启动 sourcemap', true)
|
|
15
15
|
.option('--no-sourcemap', '禁用 sourcemap')
|
|
16
16
|
.option('-t --target <target>', '目标平台')
|
|
17
|
-
.option('-a --analyze', '开启 analyze
|
|
17
|
+
.option('-a --analyze', '开启 analyze 分析')
|
|
18
18
|
.option('--drop', '移除 console debugger 等', false)
|
|
19
|
-
.option('--type <type>', '构建类型 eg: app | component
|
|
19
|
+
.option('--type <type>', '构建类型 eg: app | component', 'app')
|
|
20
20
|
.option('--transform-mode <mode>', '组件转换类型 eg: auto | pure', 'pure')
|
|
21
21
|
.option(
|
|
22
22
|
'--bundler <type>',
|
|
23
|
-
'
|
|
23
|
+
'默认使用 esbuild 极速构建(公测阶段), 如需降级设置为 webpack',
|
|
24
24
|
'esbuild'
|
|
25
25
|
)
|
|
26
26
|
.option('--debug [debug]', '开启运行时日志', (v) => {
|
package/lib/build.js
CHANGED
|
@@ -15,36 +15,25 @@ exports.default = build;
|
|
|
15
15
|
const run_builder_1 = require("./run-builder");
|
|
16
16
|
function build(options) {
|
|
17
17
|
const { type = 'app' } = options, restOptions = __rest(options, ["type"]);
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
build(Object.assign({ sourceDir: restOptions.source || 'src' }, opts)).catch((error) => {
|
|
38
|
-
console.log(error);
|
|
39
|
-
process.exit(101);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
(0, run_builder_1.runBuilder)(Object.assign(Object.assign({}, options), { watch: false })).catch((error) => {
|
|
44
|
-
console.log(error);
|
|
45
|
-
process.exit(1);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
18
|
+
if (restOptions.target === 'thing' && restOptions.bundler === 'esbuild') {
|
|
19
|
+
process.chdir(restOptions.cwd);
|
|
20
|
+
// 使用 raypack 进行构建
|
|
21
|
+
const { build } = require('@ray-js/raypack');
|
|
22
|
+
const opts = {
|
|
23
|
+
cwd: restOptions.cwd,
|
|
24
|
+
watch: false,
|
|
25
|
+
sourceDir: restOptions.source || 'src',
|
|
26
|
+
output: restOptions.output || 'dist/tuya',
|
|
27
|
+
minify: restOptions.mini,
|
|
28
|
+
autoCssModules: false,
|
|
29
|
+
sourcemap: restOptions.sourcemap,
|
|
30
|
+
drop: restOptions.drop,
|
|
31
|
+
analyze: restOptions.analyze,
|
|
32
|
+
};
|
|
33
|
+
build(opts).catch((error) => {
|
|
34
|
+
console.log(error);
|
|
35
|
+
process.exit(101);
|
|
36
|
+
});
|
|
48
37
|
}
|
|
49
38
|
else if (type === 'component') {
|
|
50
39
|
const { build: buildComponent } = require('@ray-js/builder-component');
|
|
@@ -53,4 +42,10 @@ function build(options) {
|
|
|
53
42
|
process.exit(1);
|
|
54
43
|
});
|
|
55
44
|
}
|
|
45
|
+
else {
|
|
46
|
+
(0, run_builder_1.runBuilder)(Object.assign(Object.assign({}, options), { watch: false })).catch((error) => {
|
|
47
|
+
console.log(error);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
56
51
|
}
|
package/lib/start.js
CHANGED
|
@@ -15,11 +15,13 @@ exports.default = start;
|
|
|
15
15
|
const run_builder_1 = require("./run-builder");
|
|
16
16
|
function start(options) {
|
|
17
17
|
const { type = 'app' } = options, restOptions = __rest(options, ["type"]);
|
|
18
|
-
if (
|
|
18
|
+
if (restOptions.target === 'thing' && restOptions.bundler === 'esbuild') {
|
|
19
|
+
// 使用 raypack 进行构建
|
|
19
20
|
const { build } = require('@ray-js/raypack');
|
|
20
21
|
const opts = {
|
|
21
22
|
cwd: restOptions.cwd,
|
|
22
23
|
watch: true,
|
|
24
|
+
sourceDir: restOptions.source || 'src',
|
|
23
25
|
output: restOptions.output || 'dist/tuya',
|
|
24
26
|
minify: restOptions.mini,
|
|
25
27
|
autoCssModules: false,
|
|
@@ -27,37 +29,11 @@ function start(options) {
|
|
|
27
29
|
drop: restOptions.drop,
|
|
28
30
|
analyze: restOptions.analyze,
|
|
29
31
|
};
|
|
30
|
-
build(
|
|
32
|
+
build(opts).catch((error) => {
|
|
31
33
|
console.log(error);
|
|
32
|
-
process.exit(
|
|
34
|
+
process.exit(101);
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
|
-
else if (type === 'app') {
|
|
36
|
-
if (restOptions.target === 'thing' && restOptions.bundler === 'esbuild') {
|
|
37
|
-
// 使用 raypack 进行构建
|
|
38
|
-
const { build } = require('@ray-js/raypack');
|
|
39
|
-
const opts = {
|
|
40
|
-
cwd: restOptions.cwd,
|
|
41
|
-
watch: true,
|
|
42
|
-
output: restOptions.output || 'dist/tuya',
|
|
43
|
-
minify: restOptions.mini,
|
|
44
|
-
autoCssModules: false,
|
|
45
|
-
sourcemap: restOptions.sourcemap,
|
|
46
|
-
drop: restOptions.drop,
|
|
47
|
-
analyze: restOptions.analyze,
|
|
48
|
-
};
|
|
49
|
-
build(Object.assign({ sourceDir: restOptions.source || 'src' }, opts)).catch((error) => {
|
|
50
|
-
console.log(error);
|
|
51
|
-
process.exit(101);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
(0, run_builder_1.runBuilder)(Object.assign(Object.assign({}, options), { watch: true })).catch((error) => {
|
|
56
|
-
console.log(error);
|
|
57
|
-
process.exit(1);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
37
|
else if (type === 'component') {
|
|
62
38
|
const { build: buildComponent } = require('@ray-js/builder-component');
|
|
63
39
|
buildComponent(Object.assign(Object.assign({}, restOptions), { watch: true })).catch((error) => {
|
|
@@ -65,4 +41,10 @@ function start(options) {
|
|
|
65
41
|
process.exit(1);
|
|
66
42
|
});
|
|
67
43
|
}
|
|
44
|
+
else {
|
|
45
|
+
(0, run_builder_1.runBuilder)(Object.assign(Object.assign({}, options), { watch: true })).catch((error) => {
|
|
46
|
+
console.log(error);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
68
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/cli",
|
|
3
|
-
"version": "1.6.13
|
|
3
|
+
"version": "1.6.13",
|
|
4
4
|
"description": "Ray cli",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"watch": "tsc -p ./tsconfig.build.json --watch"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@ray-js/build-plugin-ray": "1.6.13
|
|
31
|
-
"@ray-js/build-plugin-router": "1.6.13
|
|
32
|
-
"@ray-js/builder-component": "1.6.13
|
|
33
|
-
"@ray-js/builder-mp": "1.6.13
|
|
34
|
-
"@ray-js/builder-web": "1.6.13
|
|
35
|
-
"@ray-js/raypack": "1.6.13
|
|
36
|
-
"@ray-js/shared": "1.6.13
|
|
37
|
-
"@ray-js/types": "1.6.13
|
|
30
|
+
"@ray-js/build-plugin-ray": "1.6.13",
|
|
31
|
+
"@ray-js/build-plugin-router": "1.6.13",
|
|
32
|
+
"@ray-js/builder-component": "1.6.13",
|
|
33
|
+
"@ray-js/builder-mp": "1.6.13",
|
|
34
|
+
"@ray-js/builder-web": "1.6.13",
|
|
35
|
+
"@ray-js/raypack": "1.6.13",
|
|
36
|
+
"@ray-js/shared": "1.6.13",
|
|
37
|
+
"@ray-js/types": "1.6.13",
|
|
38
38
|
"colors": "1.4.0",
|
|
39
39
|
"commander": "^8.3.0",
|
|
40
40
|
"webpack-chain": "^6.5.1"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"access": "public",
|
|
44
44
|
"registry": "https://registry.npmjs.com"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "bd8ee04557fc84c1131b8b07c7dbf1d1c6f6ae78",
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"typescript": "^5.7.2"
|
|
49
49
|
}
|