@codemoreira/esad 1.4.6-5 → 1.4.6-6

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/esad.js CHANGED
@@ -16,7 +16,7 @@ program
16
16
  .version(pkg.version)
17
17
  .description('esad - Easy Super App Development Toolkit');
18
18
 
19
- // --- COMMMAND: esad init ---
19
+ // --- COMMAND: esad init ---
20
20
  program
21
21
  .command('init <project-name>')
22
22
  .description('Scaffold a new ESAD workspace containing the Host App')
@@ -34,19 +34,19 @@ program
34
34
  process.exit(0);
35
35
  });
36
36
 
37
- // --- COMMAND: esad host ---
37
+ // --- COMMAND: esad dev ---
38
38
  program
39
- .command('host [subcommand]')
40
- .description('Manage the Host App (subcommands: dev, android, ios)')
41
- .action(async (sub) => {
42
- await hostCommand(sub);
39
+ .command('dev [platform]')
40
+ .description('Start the development environment for the Host App (platform: android, ios)')
41
+ .action(async (platform) => {
42
+ await hostCommand(platform);
43
43
  process.exit(0);
44
44
  });
45
45
 
46
46
  // --- COMMAND: esad android ---
47
47
  program
48
48
  .command('android')
49
- .description('Run the Host App on Android')
49
+ .description('Run Host on Android (alias for esad dev android)')
50
50
  .action(async () => {
51
51
  await hostCommand('android');
52
52
  process.exit(0);
@@ -55,7 +55,7 @@ program
55
55
  // --- COMMAND: esad ios ---
56
56
  program
57
57
  .command('ios')
58
- .description('Run the Host App on iOS')
58
+ .description('Run Host on iOS (alias for esad dev ios)')
59
59
  .action(async () => {
60
60
  await hostCommand('ios');
61
61
  process.exit(0);
@@ -64,12 +64,22 @@ program
64
64
  // --- COMMAND: esad start ---
65
65
  program
66
66
  .command('start')
67
- .description('Alias for esad host dev')
67
+ .description('Alias for esad dev')
68
68
  .action(async () => {
69
69
  await hostCommand('dev');
70
70
  process.exit(0);
71
71
  });
72
72
 
73
+ // --- COMMAND: esad push ---
74
+ program
75
+ .command('push')
76
+ .option('-i, --id <moduleId>', 'The Module ID to sync to Dev-Cloud')
77
+ .option('-p, --platform <platform>', 'Platform (android, ios)', 'android')
78
+ .description('Build and Push the module bundle to the Dev-Cloud for global previewing')
79
+ .action(async (options) => {
80
+ await devCommand(options);
81
+ });
82
+
73
83
  // --- COMMAND: esad create-module ---
74
84
  program
75
85
  .command('create-module <module-name>')
@@ -102,15 +112,4 @@ program
102
112
  process.exit(0);
103
113
  });
104
114
 
105
- // --- COMMAND: esad dev ---
106
- program
107
- .command('dev')
108
- .option('-i, --id <moduleId>', 'The Module ID to sync to Dev-Cloud')
109
- .option('-p, --platform <platform>', 'Platform (android, ios)', 'android')
110
- .description('Build and Push the module bundle to the Dev-Cloud for global previewing')
111
- .action(async (options) => {
112
- await devCommand(options);
113
- // Note: dev command has its own shutdown logic with SIGINT/SIGTERM
114
- });
115
-
116
115
  program.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "1.4.6-5",
3
+ "version": "1.4.6-6",
4
4
  "description": "Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation",
5
5
  "main": "src/plugin/index.js",
6
6
  "types": "./src/plugin/index.d.ts",
@@ -16,7 +16,8 @@
16
16
  "./client": {
17
17
  "types": "./src/client/index.d.ts",
18
18
  "default": "./src/client/index.js"
19
- }
19
+ },
20
+ "./config-plugin": "./src/plugin/config-plugin.js"
20
21
  },
21
22
  "bin": {
22
23
  "esad": "./bin/esad.js"
@@ -8,8 +8,9 @@ const { spawn } = require('cross-spawn');
8
8
  * @returns {Promise<void>}
9
9
  */
10
10
  const runProcess = (cmd, args, cwd = process.cwd()) => {
11
+ const executable = (process.platform === 'win32' && cmd === 'npx') ? 'npx.cmd' : cmd;
11
12
  return new Promise((resolve, reject) => {
12
- const child = spawn(cmd, args, { stdio: 'inherit', cwd, shell: true });
13
+ const child = spawn(executable, args, { stdio: 'inherit', cwd, shell: true });
13
14
  child.on('close', code => {
14
15
  if (code !== 0) reject(new Error(`Command ${cmd} ${args.join(' ')} failed`));
15
16
  else resolve();
@@ -76,7 +76,7 @@ async function prepareNative(cwd, platform = 'android') {
76
76
  const appJson = await fs.readJson(appJsonPath);
77
77
  if (appJson.expo) {
78
78
  const plugins = appJson.expo.plugins || [];
79
- const pluginName = '@codemoreira/esad/plugin/config-plugin';
79
+ const pluginName = '@codemoreira/esad/config-plugin';
80
80
 
81
81
  if (!plugins.includes(pluginName) && !plugins.some(p => Array.isArray(p) && p[0] === pluginName)) {
82
82
  appJson.expo.plugins = [...plugins, pluginName];