@ray-js/cli 1.3.99-beta.3 → 1.4.0-alpha.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/lib/build.js +18 -1
- package/lib/start.js +18 -1
- package/package.json +10 -9
package/lib/build.js
CHANGED
|
@@ -14,7 +14,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
const run_builder_1 = require("./run-builder");
|
|
15
15
|
function build(options) {
|
|
16
16
|
const { type = 'app' } = options, restOptions = __rest(options, ["type"]);
|
|
17
|
-
if (
|
|
17
|
+
if (restOptions.target === 'thing') {
|
|
18
|
+
// 使用 raypack 进行构建
|
|
19
|
+
const { build } = require('@ray-js/raypack');
|
|
20
|
+
const opts = {
|
|
21
|
+
cwd: restOptions.cwd,
|
|
22
|
+
watch: false,
|
|
23
|
+
sourceDir: restOptions.source || 'src',
|
|
24
|
+
output: restOptions.output || 'dist/tuya',
|
|
25
|
+
minify: restOptions.mini,
|
|
26
|
+
autoCssModules: false,
|
|
27
|
+
sourcemap: true,
|
|
28
|
+
};
|
|
29
|
+
build(opts).catch((error) => {
|
|
30
|
+
console.log(error);
|
|
31
|
+
process.exit(101);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else if (type === 'component') {
|
|
18
35
|
const { build: buildComponent } = require('@ray-js/builder-component');
|
|
19
36
|
buildComponent(Object.assign(Object.assign({}, restOptions), { watch: false })).catch((error) => {
|
|
20
37
|
console.log(error);
|
package/lib/start.js
CHANGED
|
@@ -14,7 +14,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
const run_builder_1 = require("./run-builder");
|
|
15
15
|
function start(options) {
|
|
16
16
|
const { type = 'app' } = options, restOptions = __rest(options, ["type"]);
|
|
17
|
-
if (
|
|
17
|
+
if (restOptions.target === 'thing') {
|
|
18
|
+
// 使用 raypack 进行构建
|
|
19
|
+
const { build } = require('@ray-js/raypack');
|
|
20
|
+
const opts = {
|
|
21
|
+
cwd: restOptions.cwd,
|
|
22
|
+
watch: true,
|
|
23
|
+
sourceDir: restOptions.source || 'src',
|
|
24
|
+
output: restOptions.output || 'dist/tuya',
|
|
25
|
+
minify: restOptions.mini,
|
|
26
|
+
autoCssModules: false,
|
|
27
|
+
sourcemap: true,
|
|
28
|
+
};
|
|
29
|
+
build(opts).catch((error) => {
|
|
30
|
+
console.log(error);
|
|
31
|
+
process.exit(101);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else if (type === 'component') {
|
|
18
35
|
const { build: buildComponent } = require('@ray-js/builder-component');
|
|
19
36
|
buildComponent(Object.assign(Object.assign({}, restOptions), { watch: true })).catch((error) => {
|
|
20
37
|
console.log(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-alpha.0",
|
|
4
4
|
"description": "Ray cli",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ray": "./bin/ray"
|
|
@@ -24,13 +24,14 @@
|
|
|
24
24
|
"watch": "tsc -p ./tsconfig.build.json --watch"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ray-js/build-plugin-ray": "^1.
|
|
28
|
-
"@ray-js/build-plugin-router": "^1.
|
|
29
|
-
"@ray-js/builder-component": "^1.
|
|
30
|
-
"@ray-js/builder-mp": "^1.
|
|
31
|
-
"@ray-js/builder-web": "^1.
|
|
32
|
-
"@ray-js/
|
|
33
|
-
"@ray-js/
|
|
27
|
+
"@ray-js/build-plugin-ray": "^1.4.0-alpha.0",
|
|
28
|
+
"@ray-js/build-plugin-router": "^1.4.0-alpha.0",
|
|
29
|
+
"@ray-js/builder-component": "^1.4.0-alpha.0",
|
|
30
|
+
"@ray-js/builder-mp": "^1.4.0-alpha.0",
|
|
31
|
+
"@ray-js/builder-web": "^1.4.0-alpha.0",
|
|
32
|
+
"@ray-js/raypack": "^1.4.0-alpha.0",
|
|
33
|
+
"@ray-js/shared": "^1.4.0-alpha.0",
|
|
34
|
+
"@ray-js/types": "^1.4.0-alpha.0",
|
|
34
35
|
"colors": "1.4.0",
|
|
35
36
|
"commander": "^8.2.0",
|
|
36
37
|
"webpack-chain": "^6.5.1"
|
|
@@ -41,6 +42,6 @@
|
|
|
41
42
|
"email": "tuyafe@tuya.com"
|
|
42
43
|
}
|
|
43
44
|
],
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "92a9834964bb74c3a3b0553438b0f0c7a77ad8d0",
|
|
45
46
|
"repository": {}
|
|
46
47
|
}
|