zephyr-repack-plugin 0.0.33 → 0.0.35
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 +126 -2
- package/dist/README.md +126 -2
- package/dist/delegate-module/delegate-module-template.js +1 -2
- package/dist/delegate-module/delegate-module-template.js.map +1 -1
- package/dist/lib/utils/get-platform.js +2 -3
- package/dist/lib/utils/get-platform.js.map +1 -1
- package/dist/lib/utils/ze-util-verification.js +2 -4
- package/dist/lib/utils/ze-util-verification.js.map +1 -1
- package/dist/lib/with-zephyr.js +4 -6
- package/dist/lib/with-zephyr.js.map +1 -1
- package/dist/lib/ze-repack-plugin.d.ts +0 -1
- package/dist/lib/ze-repack-plugin.js.map +1 -1
- package/dist/package.json +3 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,3 +1,127 @@
|
|
|
1
|
-
# Zephyr
|
|
1
|
+
# Zephyr Repack Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`zephyr-repack-plugin` is a plugin to deploy cross-platform application built with [React Native](https://reactnative.dev), [Rspack](https://rspack.dev) and [Re.Pack](https://re-pack.dev) and enable Over-The-Air updates capablities for federated applications.
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[Zephyr Cloud](https://zephyr-cloud.io) | [Zephyr Docs](https://docs.zephyr-cloud.io/recipes/repack-mf) | [Rspack Docs](https://rspack.dev) | [Re.Pack Docs](https://re-pack.dev) | [Discord](https://zephyr-cloud.io/discord) | [Twitter](https://x.com/ZephyrCloudIO) | [LinkedIn](https://www.linkedin.com/company/zephyr-cloud/)
|
|
8
|
+
|
|
9
|
+
<hr/>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Installing the `zephyr-repack-plugin` for your cross-platform application:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
# npm
|
|
18
|
+
npm install --save-dev zephyr-repack-plugin
|
|
19
|
+
# yarn
|
|
20
|
+
yarn add --dev zephyr-repack-plugin
|
|
21
|
+
# pnpm
|
|
22
|
+
pnpm add --dev zephyr-repack-plugin
|
|
23
|
+
# bun
|
|
24
|
+
bun add --dev zephyr-repack-plugin
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
Using `zephyr-repack-plugin` by wrapping the Rspack configuration:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const { withZephyr } = require('zephyr-repack-plugin');
|
|
33
|
+
|
|
34
|
+
const config = {
|
|
35
|
+
/** ...rspack configuration */
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
module.exports = withZephyr()(config);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
With `zephyr-repack-plugin` you can continue to use the previous configuration from [Module Federation configuration](https://module-federation.io) (note that just the configuration, not the plugin). We recommend using the new [Re.Pack Module Federation](https://re-pack.dev/docs/module-federation) as it has better runtime support for cross-platform applications for usage with rspack and react native.
|
|
42
|
+
|
|
43
|
+
### Using Re.Pack
|
|
44
|
+
|
|
45
|
+
For usage with Re.Pack you can check out [Re.Pack's docs](https://re-pack.dev/docs/getting-started) - another reference of how to use it is [Callstack's Super App Showcase](https://github.com/callstack/super-app-showcase) and our [Repack Example](https://github.com/ZephyrCloudIO/zephyr-repack-example).
|
|
46
|
+
|
|
47
|
+
### Configuration for Module Federation
|
|
48
|
+
|
|
49
|
+
#### Continuation
|
|
50
|
+
|
|
51
|
+
1. You can continue to use previous configuration from [Module Federation configuration](https://module-federation.io) (note that just the configuration, not the plugin). We recommend using the new [Re.Pack Module Federation](https://re-pack.dev/docs/module-federation) as it has better runtime support for cross-platform applications for usage with rspack and react native.
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
// rspack.config.js
|
|
55
|
+
plugins: [
|
|
56
|
+
new Repack.plugins.ModuleFederationPluginV2({
|
|
57
|
+
// your configuration
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### Host app/Consumer example
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
// rspack.config.js
|
|
66
|
+
...
|
|
67
|
+
new Repack.plugins.ModuleFederationPluginV2({
|
|
68
|
+
/**
|
|
69
|
+
* The name of the module is used to identify the module in URLs resolver and imports.
|
|
70
|
+
*/
|
|
71
|
+
name: 'MobileHost',
|
|
72
|
+
dts: false,
|
|
73
|
+
remotes: {
|
|
74
|
+
MobileCart: `MobileCart@http://localhost:9000/${platform}/MobileCart.container.js.bundle`,
|
|
75
|
+
MobileInventory: `MobileInventory@http://localhost:9001/${platform}/MobileInventory.container.js.bundle`,
|
|
76
|
+
MobileCheckout: `MobileCheckout@http://localhost:9002/${platform}/MobileCheckout.container.js.bundle`,
|
|
77
|
+
MobileOrders: `MobileOrders@http://localhost:9003/${platform}/MobileOrders.container.js.bundle`,
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Shared modules are shared in the share scope.
|
|
81
|
+
* React, React Native and React Navigation should be provided here because there should be only one instance of these modules.
|
|
82
|
+
* Their names are used to match requested modules in this compilation.
|
|
83
|
+
*/
|
|
84
|
+
shared: getSharedDependencies({eager: true}),
|
|
85
|
+
}),
|
|
86
|
+
...
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### MiniApp/Provider example
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
// rspack.config.js
|
|
94
|
+
...
|
|
95
|
+
new Repack.plugins.ModuleFederationPluginV2({
|
|
96
|
+
/**
|
|
97
|
+
* The name of the module is used to identify the module in URLs resolver and imports.
|
|
98
|
+
*/
|
|
99
|
+
name: 'MobileCheckout',
|
|
100
|
+
filename: 'MobileCheckout.container.js.bundle',
|
|
101
|
+
dts: false,
|
|
102
|
+
/**
|
|
103
|
+
* This is a list of modules that will be shared between remote containers.
|
|
104
|
+
*/
|
|
105
|
+
exposes: {
|
|
106
|
+
'./CheckoutSection': './src/components/CheckoutSection',
|
|
107
|
+
'./CheckoutSuccessScreen': './src/screens/CheckoutSuccessScreen',
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* Shared modules are shared in the share scope.
|
|
111
|
+
* React, React Native and React Navigation should be provided here because there should be only one instance of these modules.
|
|
112
|
+
* Their names are used to match requested modules in this compilation.
|
|
113
|
+
*/
|
|
114
|
+
shared: getSharedDependencies({eager: STANDALONE}),
|
|
115
|
+
}),
|
|
116
|
+
...
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Creation command
|
|
120
|
+
|
|
121
|
+
To create a complete example of a React Native application, with Zephyr enabled, configured, you can use our creation command where you can find most of our examples.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx create-zephyr-apps@latest
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This will create a new React Native application with Zephyr enabled, configured, and ready to use. [Read more about what this command would create here](https://docs.zephyr-cloud.io/recipes/repack-mf).
|
package/dist/README.md
CHANGED
|
@@ -1,3 +1,127 @@
|
|
|
1
|
-
# Zephyr
|
|
1
|
+
# Zephyr Repack Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`zephyr-repack-plugin` is a plugin to deploy cross-platform application built with [React Native](https://reactnative.dev), [Rspack](https://rspack.dev) and [Re.Pack](https://re-pack.dev) and enable Over-The-Air updates capablities for federated applications.
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[Zephyr Cloud](https://zephyr-cloud.io) | [Zephyr Docs](https://docs.zephyr-cloud.io/recipes/repack-mf) | [Rspack Docs](https://rspack.dev) | [Re.Pack Docs](https://re-pack.dev) | [Discord](https://zephyr-cloud.io/discord) | [Twitter](https://x.com/ZephyrCloudIO) | [LinkedIn](https://www.linkedin.com/company/zephyr-cloud/)
|
|
8
|
+
|
|
9
|
+
<hr/>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Installing the `zephyr-repack-plugin` for your cross-platform application:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
# npm
|
|
18
|
+
npm install --save-dev zephyr-repack-plugin
|
|
19
|
+
# yarn
|
|
20
|
+
yarn add --dev zephyr-repack-plugin
|
|
21
|
+
# pnpm
|
|
22
|
+
pnpm add --dev zephyr-repack-plugin
|
|
23
|
+
# bun
|
|
24
|
+
bun add --dev zephyr-repack-plugin
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
Using `zephyr-repack-plugin` by wrapping the Rspack configuration:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const { withZephyr } = require('zephyr-repack-plugin');
|
|
33
|
+
|
|
34
|
+
const config = {
|
|
35
|
+
/** ...rspack configuration */
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
module.exports = withZephyr()(config);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
With `zephyr-repack-plugin` you can continue to use the previous configuration from [Module Federation configuration](https://module-federation.io) (note that just the configuration, not the plugin). We recommend using the new [Re.Pack Module Federation](https://re-pack.dev/docs/module-federation) as it has better runtime support for cross-platform applications for usage with rspack and react native.
|
|
42
|
+
|
|
43
|
+
### Using Re.Pack
|
|
44
|
+
|
|
45
|
+
For usage with Re.Pack you can check out [Re.Pack's docs](https://re-pack.dev/docs/getting-started) - another reference of how to use it is [Callstack's Super App Showcase](https://github.com/callstack/super-app-showcase) and our [Repack Example](https://github.com/ZephyrCloudIO/zephyr-repack-example).
|
|
46
|
+
|
|
47
|
+
### Configuration for Module Federation
|
|
48
|
+
|
|
49
|
+
#### Continuation
|
|
50
|
+
|
|
51
|
+
1. You can continue to use previous configuration from [Module Federation configuration](https://module-federation.io) (note that just the configuration, not the plugin). We recommend using the new [Re.Pack Module Federation](https://re-pack.dev/docs/module-federation) as it has better runtime support for cross-platform applications for usage with rspack and react native.
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
// rspack.config.js
|
|
55
|
+
plugins: [
|
|
56
|
+
new Repack.plugins.ModuleFederationPluginV2({
|
|
57
|
+
// your configuration
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### Host app/Consumer example
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
// rspack.config.js
|
|
66
|
+
...
|
|
67
|
+
new Repack.plugins.ModuleFederationPluginV2({
|
|
68
|
+
/**
|
|
69
|
+
* The name of the module is used to identify the module in URLs resolver and imports.
|
|
70
|
+
*/
|
|
71
|
+
name: 'MobileHost',
|
|
72
|
+
dts: false,
|
|
73
|
+
remotes: {
|
|
74
|
+
MobileCart: `MobileCart@http://localhost:9000/${platform}/MobileCart.container.js.bundle`,
|
|
75
|
+
MobileInventory: `MobileInventory@http://localhost:9001/${platform}/MobileInventory.container.js.bundle`,
|
|
76
|
+
MobileCheckout: `MobileCheckout@http://localhost:9002/${platform}/MobileCheckout.container.js.bundle`,
|
|
77
|
+
MobileOrders: `MobileOrders@http://localhost:9003/${platform}/MobileOrders.container.js.bundle`,
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Shared modules are shared in the share scope.
|
|
81
|
+
* React, React Native and React Navigation should be provided here because there should be only one instance of these modules.
|
|
82
|
+
* Their names are used to match requested modules in this compilation.
|
|
83
|
+
*/
|
|
84
|
+
shared: getSharedDependencies({eager: true}),
|
|
85
|
+
}),
|
|
86
|
+
...
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### MiniApp/Provider example
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
// rspack.config.js
|
|
94
|
+
...
|
|
95
|
+
new Repack.plugins.ModuleFederationPluginV2({
|
|
96
|
+
/**
|
|
97
|
+
* The name of the module is used to identify the module in URLs resolver and imports.
|
|
98
|
+
*/
|
|
99
|
+
name: 'MobileCheckout',
|
|
100
|
+
filename: 'MobileCheckout.container.js.bundle',
|
|
101
|
+
dts: false,
|
|
102
|
+
/**
|
|
103
|
+
* This is a list of modules that will be shared between remote containers.
|
|
104
|
+
*/
|
|
105
|
+
exposes: {
|
|
106
|
+
'./CheckoutSection': './src/components/CheckoutSection',
|
|
107
|
+
'./CheckoutSuccessScreen': './src/screens/CheckoutSuccessScreen',
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* Shared modules are shared in the share scope.
|
|
111
|
+
* React, React Native and React Navigation should be provided here because there should be only one instance of these modules.
|
|
112
|
+
* Their names are used to match requested modules in this compilation.
|
|
113
|
+
*/
|
|
114
|
+
shared: getSharedDependencies({eager: STANDALONE}),
|
|
115
|
+
}),
|
|
116
|
+
...
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Creation command
|
|
120
|
+
|
|
121
|
+
To create a complete example of a React Native application, with Zephyr enabled, configured, you can use our creation command where you can find most of our examples.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx create-zephyr-apps@latest
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This will create a new React Native application with Zephyr enabled, configured, and ready to use. [Read more about what this command would create here](https://docs.zephyr-cloud.io/recipes/repack-mf).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.repack_delegate_module_template =
|
|
3
|
+
exports.repack_delegate_module_template = repack_delegate_module_template;
|
|
4
4
|
function repack_delegate_module_template() {
|
|
5
5
|
return new Promise((resolve, reject) => {
|
|
6
6
|
const remote_entry_url = '__REMOTE_ENTRY_URL__';
|
|
@@ -74,5 +74,4 @@ function repack_delegate_module_template() {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
exports.repack_delegate_module_template = repack_delegate_module_template;
|
|
78
77
|
//# sourceMappingURL=delegate-module-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-module-template.js","sourceRoot":"","sources":["../../src/delegate-module/delegate-module-template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delegate-module-template.js","sourceRoot":"","sources":["../../src/delegate-module/delegate-module-template.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.is_repack_plugin = is_repack_plugin;
|
|
4
|
+
exports.get_platform_from_repack = get_platform_from_repack;
|
|
4
5
|
function is_repack_plugin(plugin) {
|
|
5
6
|
if (!plugin || typeof plugin !== 'object') {
|
|
6
7
|
return false;
|
|
@@ -8,11 +9,9 @@ function is_repack_plugin(plugin) {
|
|
|
8
9
|
return (plugin.constructor.name.includes('RepackPlugin') ||
|
|
9
10
|
plugin['name']?.includes('RepackPlugin'));
|
|
10
11
|
}
|
|
11
|
-
exports.is_repack_plugin = is_repack_plugin;
|
|
12
12
|
function get_platform_from_repack(config) {
|
|
13
13
|
return config.plugins
|
|
14
14
|
?.filter(is_repack_plugin)
|
|
15
15
|
?.map((plugin) => plugin.config.platform)[0];
|
|
16
16
|
}
|
|
17
|
-
exports.get_platform_from_repack = get_platform_from_repack;
|
|
18
17
|
//# sourceMappingURL=get-platform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-platform.js","sourceRoot":"","sources":["../../../src/lib/utils/get-platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-platform.js","sourceRoot":"","sources":["../../../src/lib/utils/get-platform.ts"],"names":[],"mappings":";;AAMA,4CAQC;AAID,4DAIC;AAhBD,SAAgB,gBAAgB,CAAC,MAAe;IAC9C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CACL,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CACzC,CAAC;AACJ,CAAC;AAID,SAAgB,wBAAwB,CAAC,MAAqB;IAC5D,OAAO,MAAM,CAAC,OAAO;QACnB,EAAE,MAAM,CAAC,gBAAgB,CAAC;QAC1B,EAAE,GAAG,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verify_mf_fastly_config =
|
|
4
|
-
// import { UploadProviderType } from '../../../../zephyr-agent/src/lib/node-persist/upload-provider-options';
|
|
3
|
+
exports.verify_mf_fastly_config = verify_mf_fastly_config;
|
|
5
4
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
6
5
|
const valid_identifiers = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
7
6
|
// Fastly doesn't allow underscore in domains, reference: https://datatracker.ietf.org/doc/html/rfc1035#:~:text=The%20labels%20must%20follow%20the%20rules%20for%20ARPANET%20host%20names.%20%20They%20must%0Astart%20with%20a%20letter%2C%20end%20with%20a%20letter%20or%20digit%2C%20and%20have%20as%20interior%0Acharacters%20only%20letters%2C%20digits%2C%20and%20hyphen.%20%20There%20are%20also%20some%0Arestrictions%20on%20the%20length.%20%20Labels%20must%20be%2063%20characters%20or%20less.
|
|
@@ -9,7 +8,7 @@ const valid_identifier_fastly = /^[a-zA-Z$][a-zA-Z0-9$]*$/;
|
|
|
9
8
|
async function verify_mf_fastly_config(mf_configs, zephyr_engine) {
|
|
10
9
|
if (!mf_configs)
|
|
11
10
|
return;
|
|
12
|
-
|
|
11
|
+
await zephyr_engine.application_configuration;
|
|
13
12
|
for (const mf_config of mf_configs) {
|
|
14
13
|
const mfConfig = mf_config.config;
|
|
15
14
|
if (!mfConfig)
|
|
@@ -36,5 +35,4 @@ async function verify_mf_fastly_config(mf_configs, zephyr_engine) {
|
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
exports.verify_mf_fastly_config = verify_mf_fastly_config;
|
|
40
38
|
//# sourceMappingURL=ze-util-verification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-util-verification.js","sourceRoot":"","sources":["../../../src/lib/utils/ze-util-verification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ze-util-verification.js","sourceRoot":"","sources":["../../../src/lib/utils/ze-util-verification.ts"],"names":[],"mappings":";;AA2BA,0DAgDC;AA3ED,+CAAqD;AAGrD,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AACvD,weAAwe;AACxe,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAsBpD,KAAK,UAAU,uBAAuB,CAC3C,UAAuC,EACvC,aAA2B;IAE3B,IAAI,CAAC,UAAU;QAAE,OAAO;IAExB,MAAM,aAAa,CAAC,yBAAyB,CAAC;IAE9C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC;QAElC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEtB,MAAM,SAAS,GACb,QAAQ,EAAE,OAAO,EAAE,IAAI,KAAK,KAAK,IAAI,OAAO,QAAQ,EAAE,OAAO,EAAE,IAAI,KAAK,WAAW,CAAC;QAEtF,IACE,SAAS;YACT,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;QACvC,4CAA4C;UAC5C,CAAC;YACD,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,qBAAqB,EAAE;gBACpD,KAAK,EAAE,uBAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,OAAO,CACnD,kBAAkB,EAClB,QAAQ,CAAC,IAAI,CACd;aACF,CAAC,CAAC;QACL,CAAC;QAED,uBAAuB;QAEvB,MAAM,gBAAgB,GACpB,CAAC,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC5C,CAAC,uBAAuB,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QAE/D,IACE,SAAS;YACT,CAAC,gBAAgB;QACjB,4CAA4C;UAC5C,CAAC;YACD,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,kBAAkB,EAAE;gBACjD,KAAK,EAAE,uBAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAChD,qBAAqB,EACrB,aAAa,CAAC,eAAe,CAC9B;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/lib/with-zephyr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withZephyr =
|
|
3
|
+
exports.withZephyr = withZephyr;
|
|
4
4
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
5
|
const ze_repack_plugin_1 = require("./ze-repack-plugin");
|
|
6
6
|
const get_platform_1 = require("./utils/get-platform");
|
|
@@ -10,8 +10,9 @@ const ze_util_verification_1 = require("./utils/ze-util-verification");
|
|
|
10
10
|
function withZephyr(zephyrPluginOptions) {
|
|
11
11
|
return (config) => _zephyr_configuration(config, zephyrPluginOptions);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
async function _zephyr_configuration(config,
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
_zephyrOptions) {
|
|
15
16
|
// create instance of ZephyrEngine to track the application
|
|
16
17
|
const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create({
|
|
17
18
|
builder: 'repack',
|
|
@@ -22,9 +23,6 @@ async function _zephyr_configuration(config, _zephyrOptions) {
|
|
|
22
23
|
(0, zephyr_agent_1.ze_log)('Deploy build target: ', target);
|
|
23
24
|
const dependency_pairs = (0, zephyr_xpack_internal_1.extractFederatedDependencyPairs)(config);
|
|
24
25
|
const resolved_dependency_pairs = await zephyr_engine.resolve_remote_dependencies(dependency_pairs, target);
|
|
25
|
-
zephyr_engine.upload_file = _zephyrOptions?.upload_file
|
|
26
|
-
? _zephyrOptions.upload_file
|
|
27
|
-
: true;
|
|
28
26
|
(0, zephyr_xpack_internal_1.mutWebpackFederatedRemotesConfig)(zephyr_engine, config, resolved_dependency_pairs, delegate_module_template_1.repack_delegate_module_template);
|
|
29
27
|
(0, zephyr_agent_1.ze_log)('dependency resolution completed successfully...or at least trying to...');
|
|
30
28
|
const mf_configs = (0, zephyr_xpack_internal_1.makeCopyOfModuleFederationOptions)(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/lib/with-zephyr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/lib/with-zephyr.ts"],"names":[],"mappings":";;AAaA,gCAIC;AAhBD,+CAAoD;AAEpD,yDAA+E;AAC/E,uDAAgE;AAChE,iEAI+B;AAC/B,0FAA8F;AAC9F,uEAAuE;AAEvE,SAAgB,UAAU,CACxB,mBAA+C;IAE/C,OAAO,CAAC,MAAqB,EAAE,EAAE,CAAC,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AACvF,CAAC;AACD,KAAK,UAAU,qBAAqB,CAClC,MAAqB;AACrB,6DAA6D;AAC7D,cAA0C;IAE1C,2DAA2D;IAC3D,MAAM,aAAa,GAAG,MAAM,2BAAY,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;IACH,IAAA,qBAAM,EAAC,4BAA4B,CAAC,CAAC;IAErC,MAAM,MAAM,GAAG,IAAA,uCAAwB,EAAC,MAAM,CAAC,CAAC;IAChD,IAAA,qBAAM,EAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;IAExC,MAAM,gBAAgB,GAAG,IAAA,uDAA+B,EAAC,MAAM,CAAC,CAAC;IAEjE,MAAM,yBAAyB,GAAG,MAAM,aAAa,CAAC,2BAA2B,CAC/E,gBAAgB,EAChB,MAAM,CACP,CAAC;IACF,IAAA,wDAAgC,EAC9B,aAAa,EACb,MAAM,EACN,yBAAyB,EACzB,0DAA+B,CAChC,CAAC;IAEF,IAAA,qBAAM,EAAC,yEAAyE,CAAC,CAAC;IAElF,MAAM,UAAU,GAAG,IAAA,yDAAiC,EAAC,MAAM,CAAC,CAAC;IAC7D,oEAAoE;IACpE,kDAAkD;IAClD,MAAM,IAAA,8CAAuB,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAEzD,IAAA,qBAAM,EAAC,4BAA4B,CAAC,CAAC;IACrC,MAAM,CAAC,OAAO,EAAE,IAAI,CAClB,IAAI,iCAAc,CAAC;QACjB,aAAa;QACb,MAAM;QACN,QAAQ,EAAE,IAAA,yDAAiC,EAAC,MAAM,CAAC;KACpD,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -6,7 +6,6 @@ export interface ZephyrRepackPluginOptions {
|
|
|
6
6
|
pluginName: string;
|
|
7
7
|
mfConfig: ModuleFederationPlugin[] | ModuleFederationPlugin | undefined;
|
|
8
8
|
target: 'ios' | 'android' | 'web' | undefined;
|
|
9
|
-
upload_file?: boolean;
|
|
10
9
|
}
|
|
11
10
|
export declare class ZeRepackPlugin {
|
|
12
11
|
_options: ZephyrRepackPluginOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;AAEA,iEAI+B;AAE/B,MAAM,UAAU,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;AAEA,iEAI+B;AAE/B,MAAM,UAAU,GAAG,oBAAoB,CAAC;AASxC,MAAa,cAAc;IAGzB,YAAY,OAAsD;QAChE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC;QACzE,IAAA,qCAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvC,IAAA,qCAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AAZD,wCAYC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-repack-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -19,5 +19,6 @@
|
|
|
19
19
|
"@rspack/core": "1.0.8",
|
|
20
20
|
"@types/find-package-json": "^1.2.6",
|
|
21
21
|
"@types/is-ci": "^3.0.4"
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
|
+
"types": "./index.d.ts"
|
|
23
24
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-repack-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"zephyr-agent": "0.0.
|
|
10
|
-
"zephyr-xpack-internal": "0.0.
|
|
9
|
+
"zephyr-agent": "0.0.35",
|
|
10
|
+
"zephyr-xpack-internal": "0.0.35"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@callstack/repack": "5.0.0-rc.0",
|