@codemoreira/esad 1.3.8 → 1.3.11

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/README.md CHANGED
@@ -30,7 +30,14 @@ npx esad host dev # Run the Host App
30
30
  npx esad dev --id module-name --port 9000 # Run a Module
31
31
  ```
32
32
 
33
- ### 5. Deployment
33
+ ### 5. Build for Production
34
+ Prepares the bundle and chunks for deployment, generating a standardized `./build` directory.
35
+ ```bash
36
+ npx esad build --id module-name --platform android
37
+ ```
38
+
39
+ ### 6. Deployment
40
+ Packages the `./build` folder and uploads it to your configured Registry/CDN via multipart POST.
34
41
  ```bash
35
42
  npx esad deploy --id module-name --version 1.0.0
36
43
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "1.3.8",
3
+ "version": "1.3.11",
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",
@@ -36,15 +36,20 @@ module.exports = async (options) => {
36
36
  console.log(`\nšŸ—ļø Building production bundle for ${path.basename(cwd)} (${platform})...\n`);
37
37
 
38
38
  try {
39
+ const bundleOutput = path.join(cwd, 'build', platform, 'index.bundle');
40
+ fs.ensureDirSync(path.dirname(bundleOutput));
41
+
39
42
  // Run Re.Pack production build
40
43
  await runProcess('npx', [
41
44
  'react-native',
42
45
  'webpack-bundle',
43
46
  '--platform', platform,
44
- '--dev', 'false'
47
+ '--dev', 'false',
48
+ '--bundle-output', bundleOutput,
49
+ '--assets-dest', path.dirname(bundleOutput)
45
50
  ], cwd);
46
51
 
47
- console.log(chalk.green(`\nāœ… Build complete! Assets generated in dist/ directory.`));
52
+ console.log(chalk.green(`\nāœ… Build complete! Assets generated in build/ directory.`));
48
53
  console.log(`šŸ‘‰ You can now run: esad deploy ${options.id ? `--id ${options.id}` : ''}\n`);
49
54
  } catch (err) {
50
55
  console.error(chalk.red(`\nāŒ Build failed: ${err.message}`));
@@ -60,9 +60,9 @@ module.exports = async (options) => {
60
60
  const deployUrl = config.deployEndpoint.replace('{{moduleId}}', moduleId);
61
61
  console.log(`šŸ“” Deployment Endpoint Resolved: ${deployUrl}`);
62
62
 
63
- const distPath = path.join(cwd, 'dist');
63
+ const distPath = path.join(cwd, 'build');
64
64
  if (!fs.existsSync(distPath)) {
65
- console.error(`āŒ Error: dist/ directory not found in ${cwd}. Did you run the build command?`);
65
+ console.error(`āŒ Error: build/ directory not found in ${cwd}. Did you run the build command?`);
66
66
  process.exit(1);
67
67
  }
68
68
 
@@ -31,6 +31,11 @@ function withESAD(env, options) {
31
31
  mode: isDev ? 'development' : 'production',
32
32
  context: dirname,
33
33
  entry: options.entry || './index.js',
34
+ output: {
35
+ path: path.resolve(dirname, 'build', platform),
36
+ filename: 'index.bundle',
37
+ clean: true,
38
+ },
34
39
  resolve: {
35
40
  ...Repack.getResolveOptions(),
36
41
  alias: {