@module-federation/metro-plugin-rock 0.0.0-alpha.0 → 0.0.0-main-20260508022256

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/dist/index.cjs ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ pluginMetroModuleFederation: ()=>external_plugin_cjs_namespaceObject.pluginMetroModuleFederation,
28
+ default: ()=>src
29
+ });
30
+ const external_plugin_cjs_namespaceObject = require("./plugin.cjs");
31
+ const src = external_plugin_cjs_namespaceObject.pluginMetroModuleFederation;
32
+ exports["default"] = __webpack_exports__["default"];
33
+ exports.pluginMetroModuleFederation = __webpack_exports__.pluginMetroModuleFederation;
34
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
35
+ "default",
36
+ "pluginMetroModuleFederation"
37
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
38
+ Object.defineProperty(exports, '__esModule', {
39
+ value: true
40
+ });
@@ -0,0 +1,3 @@
1
+ import { pluginMetroModuleFederation } from './plugin.js';
2
+ export { pluginMetroModuleFederation };
3
+ export default pluginMetroModuleFederation;
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { pluginMetroModuleFederation } from "./plugin.js";
2
+ const src = pluginMetroModuleFederation;
3
+ export { src as default, pluginMetroModuleFederation };
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ pluginMetroModuleFederation: ()=>pluginMetroModuleFederation
37
+ });
38
+ const commands_namespaceObject = require("@module-federation/metro/commands");
39
+ var commands_default = /*#__PURE__*/ __webpack_require__.n(commands_namespaceObject);
40
+ const tools_namespaceObject = require("@rock-js/tools");
41
+ const pluginMetroModuleFederation = (pluginConfig = {})=>(api)=>{
42
+ api.registerCommand({
43
+ name: 'bundle-mf-host',
44
+ description: 'Bundles a Module Federation host',
45
+ action: async (args)=>{
46
+ const commandConfig = {
47
+ root: api.getProjectRoot(),
48
+ platforms: api.getPlatforms(),
49
+ reactNativePath: api.getReactNativePath(),
50
+ ...pluginConfig
51
+ };
52
+ tools_namespaceObject.logger.info(`Bundling Module Federation host for platform ${tools_namespaceObject.color.cyan(args.platform)}`);
53
+ await commands_default().bundleFederatedHost([], commandConfig, args);
54
+ tools_namespaceObject.logger.info('Bundle artifacts available at ...');
55
+ (0, tools_namespaceObject.outro)("Success \uD83C\uDF89.");
56
+ },
57
+ options: [
58
+ ...commands_default().bundleFederatedHostOptions,
59
+ {
60
+ name: '--config-cmd [string]',
61
+ description: "[Internal] A hack for Xcode build script pointing to wrong bundle command that recognizes this flag. Do not use."
62
+ }
63
+ ]
64
+ });
65
+ api.registerCommand({
66
+ name: 'bundle-mf-remote',
67
+ description: 'Bundles a Module Federation remote, including its container entry and all exposed modules for consumption by host applications',
68
+ action: async (args)=>{
69
+ const commandConfig = {
70
+ root: api.getProjectRoot(),
71
+ platforms: api.getPlatforms(),
72
+ reactNativePath: api.getReactNativePath(),
73
+ ...pluginConfig
74
+ };
75
+ tools_namespaceObject.logger.info(`Bundling Module Federation remote for platform ${tools_namespaceObject.color.cyan(args.platform)}`);
76
+ await commands_default().bundleFederatedRemote([], commandConfig, args);
77
+ tools_namespaceObject.logger.info('Bundle artifacts available at ...');
78
+ (0, tools_namespaceObject.outro)("Success \uD83C\uDF89.");
79
+ },
80
+ options: commands_default().bundleFederatedRemoteOptions
81
+ });
82
+ return {
83
+ name: '@module-federation/metro-plugin-rock',
84
+ description: 'Rock plugin for Module Federation with Metro'
85
+ };
86
+ };
87
+ exports.pluginMetroModuleFederation = __webpack_exports__.pluginMetroModuleFederation;
88
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
89
+ "pluginMetroModuleFederation"
90
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
91
+ Object.defineProperty(exports, '__esModule', {
92
+ value: true
93
+ });
@@ -0,0 +1,6 @@
1
+ import type { PluginApi, PluginOutput } from '@rock-js/config';
2
+ interface PluginConfig {
3
+ platforms?: Record<string, object>;
4
+ }
5
+ export declare const pluginMetroModuleFederation: (pluginConfig?: PluginConfig) => (api: PluginApi) => PluginOutput;
6
+ export {};
package/dist/plugin.js ADDED
@@ -0,0 +1,49 @@
1
+ import commands from "@module-federation/metro/commands";
2
+ import { color, logger, outro } from "@rock-js/tools";
3
+ const pluginMetroModuleFederation = (pluginConfig = {})=>(api)=>{
4
+ api.registerCommand({
5
+ name: 'bundle-mf-host',
6
+ description: 'Bundles a Module Federation host',
7
+ action: async (args)=>{
8
+ const commandConfig = {
9
+ root: api.getProjectRoot(),
10
+ platforms: api.getPlatforms(),
11
+ reactNativePath: api.getReactNativePath(),
12
+ ...pluginConfig
13
+ };
14
+ logger.info(`Bundling Module Federation host for platform ${color.cyan(args.platform)}`);
15
+ await commands.bundleFederatedHost([], commandConfig, args);
16
+ logger.info('Bundle artifacts available at ...');
17
+ outro("Success \uD83C\uDF89.");
18
+ },
19
+ options: [
20
+ ...commands.bundleFederatedHostOptions,
21
+ {
22
+ name: '--config-cmd [string]',
23
+ description: "[Internal] A hack for Xcode build script pointing to wrong bundle command that recognizes this flag. Do not use."
24
+ }
25
+ ]
26
+ });
27
+ api.registerCommand({
28
+ name: 'bundle-mf-remote',
29
+ description: 'Bundles a Module Federation remote, including its container entry and all exposed modules for consumption by host applications',
30
+ action: async (args)=>{
31
+ const commandConfig = {
32
+ root: api.getProjectRoot(),
33
+ platforms: api.getPlatforms(),
34
+ reactNativePath: api.getReactNativePath(),
35
+ ...pluginConfig
36
+ };
37
+ logger.info(`Bundling Module Federation remote for platform ${color.cyan(args.platform)}`);
38
+ await commands.bundleFederatedRemote([], commandConfig, args);
39
+ logger.info('Bundle artifacts available at ...');
40
+ outro("Success \uD83C\uDF89.");
41
+ },
42
+ options: commands.bundleFederatedRemoteOptions
43
+ });
44
+ return {
45
+ name: '@module-federation/metro-plugin-rock',
46
+ description: 'Rock plugin for Module Federation with Metro'
47
+ };
48
+ };
49
+ export { pluginMetroModuleFederation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/metro-plugin-rock",
3
- "version": "0.0.0-alpha.0",
3
+ "version": "0.0.0-main-20260508022256",
4
4
  "description": "Metro Module Federation plugin for Rock",
5
5
  "keywords": [
6
6
  "rock",
@@ -31,23 +31,23 @@
31
31
  "require": "./dist/index.cjs",
32
32
  "default": "./dist/index.js"
33
33
  },
34
- "scripts": {
35
- "build": "rslib build",
36
- "typecheck": "tsc --noEmit",
37
- "lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.{js,ts}\""
38
- },
39
34
  "peerDependencies": {
40
- "@module-federation/metro": "workspace:*",
41
- "@rock-js/tools": "^0.13.0"
35
+ "@rock-js/tools": "^0.13.0",
36
+ "@module-federation/metro": "0.0.0-main-20260508022256"
42
37
  },
43
38
  "devDependencies": {
44
- "@module-federation/metro": "workspace:*",
45
39
  "@rock-js/config": "^0.13.0",
46
40
  "@rock-js/tools": "^0.13.0",
47
41
  "@rslib/core": "^0.10.0",
48
42
  "@typescript-eslint/eslint-plugin": "8.54.0",
49
43
  "@typescript-eslint/parser": "8.54.0",
50
44
  "@types/node": "^20.0.0",
51
- "typescript": "^5.8.3"
45
+ "typescript": "^5.8.3",
46
+ "@module-federation/metro": "0.0.0-main-20260508022256"
47
+ },
48
+ "scripts": {
49
+ "build": "rslib build",
50
+ "typecheck": "tsc --noEmit",
51
+ "lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.{js,ts}\""
52
52
  }
53
- }
53
+ }