@codemoreira/esad 1.2.6 → 1.2.8
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/package.json +44 -44
- package/src/plugin/index.js +7 -5
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@codemoreira/esad",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation",
|
|
5
|
-
"main": "src/plugin/index.js",
|
|
6
|
-
"types": "./src/plugin/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./src/plugin/index.d.ts",
|
|
10
|
-
"default": "./src/plugin/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./plugin": {
|
|
13
|
-
"types": "./src/plugin/index.d.ts",
|
|
14
|
-
"default": "./src/plugin/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./client": {
|
|
17
|
-
"types": "./src/client/index.d.ts",
|
|
18
|
-
"default": "./src/client/index.js"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"bin": {
|
|
22
|
-
"esad": "./bin/esad.js"
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"bin",
|
|
26
|
-
"src",
|
|
27
|
-
"README.md"
|
|
28
|
-
],
|
|
29
|
-
"scripts": {
|
|
30
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"adm-zip": "^0.5.10",
|
|
34
|
-
"chalk": "^4.1.2",
|
|
35
|
-
"commander": "^11.1.0",
|
|
36
|
-
"cross-spawn": "^7.0.3",
|
|
37
|
-
"fs-extra": "^11.2.0"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@rspack/core": "^1.7.9",
|
|
41
|
-
"@types/react": "^19.2.14",
|
|
42
|
-
"@types/react-native": "^0.72.8"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@codemoreira/esad",
|
|
3
|
+
"version": "1.2.8",
|
|
4
|
+
"description": "Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation",
|
|
5
|
+
"main": "src/plugin/index.js",
|
|
6
|
+
"types": "./src/plugin/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./src/plugin/index.d.ts",
|
|
10
|
+
"default": "./src/plugin/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./plugin": {
|
|
13
|
+
"types": "./src/plugin/index.d.ts",
|
|
14
|
+
"default": "./src/plugin/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./client": {
|
|
17
|
+
"types": "./src/client/index.d.ts",
|
|
18
|
+
"default": "./src/client/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"esad": "./bin/esad.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin",
|
|
26
|
+
"src",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"adm-zip": "^0.5.10",
|
|
34
|
+
"chalk": "^4.1.2",
|
|
35
|
+
"commander": "^11.1.0",
|
|
36
|
+
"cross-spawn": "^7.0.3",
|
|
37
|
+
"fs-extra": "^11.2.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@rspack/core": "^1.7.9",
|
|
41
|
+
"@types/react": "^19.2.14",
|
|
42
|
+
"@types/react-native": "^0.72.8"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/src/plugin/index.js
CHANGED
|
@@ -18,15 +18,17 @@ const { ProvidePlugin, DefinePlugin } = require('@rspack/core');
|
|
|
18
18
|
* @param {Object} [options.remotes] Remote modules (for host)
|
|
19
19
|
*/
|
|
20
20
|
function withESAD(env, options) {
|
|
21
|
-
const
|
|
21
|
+
const { platform, dev } = env;
|
|
22
|
+
const isDev = dev !== false;
|
|
22
23
|
const dirname = options.dirname;
|
|
23
24
|
const pkgPath = path.resolve(dirname, 'package.json');
|
|
24
25
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
25
26
|
const id = options.id.replace(/-/g, '_');
|
|
26
27
|
|
|
27
|
-
console.log(`[ESAD] Applying Mega-Zero-Config profile for ${options.type.toUpperCase()}: ${id}`);
|
|
28
|
+
console.log(`[ESAD] Applying Mega-Zero-Config profile for ${options.type.toUpperCase()} (${platform}): ${id}`);
|
|
28
29
|
|
|
29
30
|
const config = {
|
|
31
|
+
mode: isDev ? 'development' : 'production',
|
|
30
32
|
context: dirname,
|
|
31
33
|
entry: options.entry || './index.js',
|
|
32
34
|
resolve: {
|
|
@@ -42,7 +44,7 @@ function withESAD(env, options) {
|
|
|
42
44
|
'@codemoreira/esad/client': path.resolve(dirname, 'node_modules/@codemoreira/esad/src/client/index.js'),
|
|
43
45
|
|
|
44
46
|
...Repack.getResolveOptions().alias,
|
|
45
|
-
...options.alias,
|
|
47
|
+
...(options.alias || {}),
|
|
46
48
|
}
|
|
47
49
|
},
|
|
48
50
|
module: {
|
|
@@ -84,7 +86,7 @@ function withESAD(env, options) {
|
|
|
84
86
|
name: id,
|
|
85
87
|
filename: `${id}.container.js.bundle`,
|
|
86
88
|
remotes: options.remotes || {},
|
|
87
|
-
exposes: options.exposes || {},
|
|
89
|
+
...(options.type === 'module' ? { exposes: options.exposes || {} } : {}),
|
|
88
90
|
dts: false,
|
|
89
91
|
dev: isDev,
|
|
90
92
|
shared: {
|
|
@@ -93,7 +95,7 @@ function withESAD(env, options) {
|
|
|
93
95
|
'react-native': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native'] },
|
|
94
96
|
'react-native-safe-area-context': { singleton: true, eager: true, requiredVersion: pkg.dependencies['react-native-safe-area-context'] },
|
|
95
97
|
'@codemoreira/esad': { singleton: true, eager: true },
|
|
96
|
-
...options.shared
|
|
98
|
+
...(options.shared || {})
|
|
97
99
|
}
|
|
98
100
|
})
|
|
99
101
|
],
|