@ray-js/cli 1.6.12 → 1.6.13-beta.0
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 +30 -25
- package/lib/start.js +29 -11
- 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', 'app')
|
|
19
|
+
.option('--type <type>', '构建类型 eg: app | component | material', 'app')
|
|
20
20
|
.option('--transform-mode <mode>', '组件转换类型 eg: auto | pure', 'pure')
|
|
21
21
|
.option(
|
|
22
22
|
'--bundler <type>',
|
|
23
|
-
'
|
|
23
|
+
'1.4.x 开始默认使用 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', 'app')
|
|
19
|
+
.option('--type <type>', '构建类型 eg: app | component | material', 'app')
|
|
20
20
|
.option('--transform-mode <mode>', '组件转换类型 eg: auto | pure', 'pure')
|
|
21
21
|
.option(
|
|
22
22
|
'--bundler <type>',
|
|
23
|
-
'
|
|
23
|
+
'1.4.x 开始默认使用 esbuild 极速构建(公测阶段), 如需降级设置为 webpack',
|
|
24
24
|
'esbuild'
|
|
25
25
|
)
|
|
26
26
|
.option('--debug [debug]', '开启运行时日志', (v) => {
|
package/lib/build.js
CHANGED
|
@@ -15,25 +15,36 @@ 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
|
-
|
|
18
|
+
if (type === 'material') {
|
|
19
|
+
console.warn('物料暂不支持构建');
|
|
20
|
+
}
|
|
21
|
+
else if (type === 'app') {
|
|
22
|
+
if (restOptions.target === 'thing' && restOptions.bundler === 'esbuild') {
|
|
23
|
+
process.chdir(restOptions.cwd);
|
|
24
|
+
// 使用 raypack 进行构建
|
|
25
|
+
const { build } = require('@ray-js/raypack');
|
|
26
|
+
const opts = {
|
|
27
|
+
cwd: restOptions.cwd,
|
|
28
|
+
watch: false,
|
|
29
|
+
sourceDir: restOptions.source || 'src',
|
|
30
|
+
output: restOptions.output || 'dist/tuya',
|
|
31
|
+
minify: restOptions.mini,
|
|
32
|
+
autoCssModules: false,
|
|
33
|
+
sourcemap: restOptions.sourcemap,
|
|
34
|
+
drop: restOptions.drop,
|
|
35
|
+
analyze: restOptions.analyze,
|
|
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
|
+
}
|
|
37
48
|
}
|
|
38
49
|
else if (type === 'component') {
|
|
39
50
|
const { build: buildComponent } = require('@ray-js/builder-component');
|
|
@@ -42,10 +53,4 @@ function build(options) {
|
|
|
42
53
|
process.exit(1);
|
|
43
54
|
});
|
|
44
55
|
}
|
|
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
|
-
}
|
|
51
56
|
}
|
package/lib/start.js
CHANGED
|
@@ -15,13 +15,11 @@ 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 (
|
|
19
|
-
// 使用 raypack 进行构建
|
|
18
|
+
if (type === 'material') {
|
|
20
19
|
const { build } = require('@ray-js/raypack');
|
|
21
20
|
const opts = {
|
|
22
21
|
cwd: restOptions.cwd,
|
|
23
22
|
watch: true,
|
|
24
|
-
sourceDir: restOptions.source || 'src',
|
|
25
23
|
output: restOptions.output || 'dist/tuya',
|
|
26
24
|
minify: restOptions.mini,
|
|
27
25
|
autoCssModules: false,
|
|
@@ -29,11 +27,37 @@ function start(options) {
|
|
|
29
27
|
drop: restOptions.drop,
|
|
30
28
|
analyze: restOptions.analyze,
|
|
31
29
|
};
|
|
32
|
-
build(opts).catch((error) => {
|
|
30
|
+
build(Object.assign({ sourceDir: restOptions.source || 'src', type: 'material' }, opts)).catch((error) => {
|
|
33
31
|
console.log(error);
|
|
34
|
-
process.exit(
|
|
32
|
+
process.exit(1011);
|
|
35
33
|
});
|
|
36
34
|
}
|
|
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
|
+
}
|
|
37
61
|
else if (type === 'component') {
|
|
38
62
|
const { build: buildComponent } = require('@ray-js/builder-component');
|
|
39
63
|
buildComponent(Object.assign(Object.assign({}, restOptions), { watch: true })).catch((error) => {
|
|
@@ -41,10 +65,4 @@ function start(options) {
|
|
|
41
65
|
process.exit(1);
|
|
42
66
|
});
|
|
43
67
|
}
|
|
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
|
-
}
|
|
50
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.13-beta.0",
|
|
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.
|
|
31
|
-
"@ray-js/build-plugin-router": "1.6.
|
|
32
|
-
"@ray-js/builder-component": "1.6.
|
|
33
|
-
"@ray-js/builder-mp": "1.6.
|
|
34
|
-
"@ray-js/builder-web": "1.6.
|
|
35
|
-
"@ray-js/raypack": "1.6.
|
|
36
|
-
"@ray-js/shared": "1.6.
|
|
37
|
-
"@ray-js/types": "1.6.
|
|
30
|
+
"@ray-js/build-plugin-ray": "1.6.13-beta.0",
|
|
31
|
+
"@ray-js/build-plugin-router": "1.6.13-beta.0",
|
|
32
|
+
"@ray-js/builder-component": "1.6.13-beta.0",
|
|
33
|
+
"@ray-js/builder-mp": "1.6.13-beta.0",
|
|
34
|
+
"@ray-js/builder-web": "1.6.13-beta.0",
|
|
35
|
+
"@ray-js/raypack": "1.6.13-beta.0",
|
|
36
|
+
"@ray-js/shared": "1.6.13-beta.0",
|
|
37
|
+
"@ray-js/types": "1.6.13-beta.0",
|
|
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": "fc9a900b018f61d0b7ce37ac9db633f402ba9044",
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"typescript": "^5.7.2"
|
|
49
49
|
}
|