@codemoreira/esad 2.0.1-32 → 2.0.1-33

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.
Files changed (2) hide show
  1. package/package.json +7 -11
  2. package/src/plugin/index.js +7 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "2.0.1-32",
3
+ "version": "2.0.1-33",
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",
@@ -37,15 +37,8 @@
37
37
  "@xmldom/xmldom": "0.9.9"
38
38
  },
39
39
  "dependencies": {
40
- "@babel/core": "^7.20.0",
41
- "@callstack/repack": "^5.2.5",
42
40
  "@callstack/repack-plugin-expo-modules": "^5.2.5",
43
- "@module-federation/enhanced": "^2.4.0",
44
- "@rspack/core": "^1.7.8",
45
- "@swc/core": "^1.7.0",
46
- "@swc/helpers": "^0.5.11",
47
41
  "adm-zip": "^0.5.10",
48
- "babel-preset-expo": "~12.0.0",
49
42
  "chalk": "^4.1.2",
50
43
  "commander": "^11.1.0",
51
44
  "cross-spawn": "^7.0.3",
@@ -56,8 +49,11 @@
56
49
  "process": "^0.11.10"
57
50
  },
58
51
  "devDependencies": {
59
- "@rspack/core": "^1.7.9",
60
- "@types/react": "^19.2.14",
61
- "@types/react-native": "^0.72.8"
52
+ "@babel/core": "^7.25.2",
53
+ "@callstack/repack": "^5.2.5",
54
+ "@module-federation/enhanced": "^2.4.0",
55
+ "@rspack/core": "^1.7.8",
56
+ "babel-preset-expo": "~12.0.0",
57
+ "@types/react": "~18.3.12"
62
58
  }
63
59
  }
@@ -2,7 +2,6 @@ const path = require('node:path');
2
2
  const fs = require('node:fs');
3
3
  const Repack = require('@callstack/repack');
4
4
  const { ExpoModulesPlugin } = require('@callstack/repack-plugin-expo-modules');
5
- const rspack = require('@rspack/core');
6
5
 
7
6
  /**
8
7
  * ESAD Re.Pack Plugin Wrapper (v2.0 - POC Mirror)
@@ -19,7 +18,7 @@ function withESAD(env, options) {
19
18
  const pkgPath = path.resolve(dirname, 'package.json');
20
19
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
21
20
  const id = options.id.replace(/-/g, '_');
22
-
21
+
23
22
  const sdkPkgPath = path.resolve(__dirname, '..', '..', 'package.json');
24
23
  const sdkPkg = JSON.parse(fs.readFileSync(sdkPkgPath, 'utf8'));
25
24
  const clientPath = path.resolve(__dirname, '..', 'client', 'index.js');
@@ -40,29 +39,22 @@ function withESAD(env, options) {
40
39
  type: 'javascript/auto',
41
40
  use: {
42
41
  loader: '@callstack/repack/babel-swc-loader',
43
- options: {
44
- parallel: true,
45
- hideParallelModeWarning: true,
46
- },
42
+ options: {},
47
43
  },
48
44
  },
49
45
  ...Repack.getAssetTransformRules(),
50
46
  ],
51
47
  },
52
48
  plugins: [
53
- new rspack.DefinePlugin({
54
- 'process.env.EXPO_OS': JSON.stringify(platform),
55
- 'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production'),
56
- }),
57
49
  new Repack.RepackPlugin(),
58
50
  new Repack.plugins.ModuleFederationPluginV2({
59
51
  name: id,
60
52
  filename: `${id}.container.js.bundle`,
61
53
  remotes: options.remotes || {},
62
- ...(options.type === 'module' ? {
54
+ ...(options.type === 'module' ? {
63
55
  exposes: options.exposes || {
64
56
  './Main': options.entry || './index.js'
65
- }
57
+ }
66
58
  } : {}),
67
59
  dts: false,
68
60
  dev: isDev,
@@ -71,12 +63,12 @@ function withESAD(env, options) {
71
63
  'react/jsx-runtime': { singleton: true, eager: true, requiredVersion: pkg.dependencies.react },
72
64
  'react-native': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native'] },
73
65
  'react-native-safe-area-context': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native-safe-area-context'] },
74
- '@codemoreira/esad/client': {
75
- singleton: true,
66
+ '@codemoreira/esad/client': {
67
+ singleton: true,
76
68
  eager: options.type === 'host',
77
69
  version: sdkPkg.version,
78
70
  requiredVersion: sdkPkg.version,
79
- import: clientPath
71
+ import: clientPath
80
72
  },
81
73
  ...(options.shared || {})
82
74
  }