@ray-js/cli 1.6.12 → 1.6.13-beta.1

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 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
- '默认使用 esbuild 极速构建(公测阶段), 如需降级设置为 webpack',
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
- '默认使用 esbuild 极速构建(公测阶段), 如需降级设置为 webpack',
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 (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
- });
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 (restOptions.target === 'thing' && restOptions.bundler === 'esbuild') {
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(101);
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.12",
3
+ "version": "1.6.13-beta.1",
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.12",
31
- "@ray-js/build-plugin-router": "1.6.12",
32
- "@ray-js/builder-component": "1.6.12",
33
- "@ray-js/builder-mp": "1.6.12",
34
- "@ray-js/builder-web": "1.6.12",
35
- "@ray-js/raypack": "1.6.12",
36
- "@ray-js/shared": "1.6.12",
37
- "@ray-js/types": "1.6.12",
30
+ "@ray-js/build-plugin-ray": "1.6.13-beta.1",
31
+ "@ray-js/build-plugin-router": "1.6.13-beta.1",
32
+ "@ray-js/builder-component": "1.6.13-beta.1",
33
+ "@ray-js/builder-mp": "1.6.13-beta.1",
34
+ "@ray-js/builder-web": "1.6.13-beta.1",
35
+ "@ray-js/raypack": "1.6.13-beta.1",
36
+ "@ray-js/shared": "1.6.13-beta.1",
37
+ "@ray-js/types": "1.6.13-beta.1",
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": "fff5d64de5adddf835edafb9556ed54b814e661a",
46
+ "gitHead": "f121e8497fdf3e095f15852a47664abad25d74bb",
47
47
  "devDependencies": {
48
48
  "typescript": "^5.7.2"
49
49
  }