zephyr-repack-plugin 0.0.37 → 0.0.38
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/lib/with-zephyr.d.ts +2 -1
- package/dist/lib/with-zephyr.js +28 -9
- package/dist/lib/with-zephyr.js.map +1 -1
- package/dist/lib/ze-repack-plugin.d.ts +2 -1
- package/dist/package.json +5 -4
- package/dist/type/zephyr-internal-types.d.ts +15 -1
- package/package.json +7 -6
- package/dist/delegate-module/delegate-module-template.d.ts +0 -1
- package/dist/delegate-module/delegate-module-template.js +0 -77
- package/dist/delegate-module/delegate-module-template.js.map +0 -1
- package/dist/lib/utils/get-platform.d.ts +0 -9
- package/dist/lib/utils/get-platform.js +0 -17
- package/dist/lib/utils/get-platform.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Configuration } from '@rspack/core';
|
|
2
2
|
import { ZephyrRepackPluginOptions } from './ze-repack-plugin';
|
|
3
|
-
|
|
3
|
+
import { RepackEnv } from '../type/zephyr-internal-types';
|
|
4
|
+
export declare function withZephyr(zephyrPluginOptions?: ZephyrRepackPluginOptions): (configFn: (env: RepackEnv) => Configuration) => (config: RepackEnv) => Promise<Configuration>;
|
package/dist/lib/with-zephyr.js
CHANGED
|
@@ -3,12 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
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
|
-
const get_platform_1 = require("./utils/get-platform");
|
|
7
6
|
const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
|
|
8
|
-
const delegate_module_template_1 = require("../delegate-module/delegate-module-template");
|
|
9
7
|
const ze_util_verification_1 = require("./utils/ze-util-verification");
|
|
10
8
|
function withZephyr(zephyrPluginOptions) {
|
|
11
|
-
|
|
9
|
+
// RETURN 1: Function that takes the user's config function
|
|
10
|
+
return (configFn) => {
|
|
11
|
+
// RETURN 2: Function that takes the base config and returns the final webpack config
|
|
12
|
+
return (config) => {
|
|
13
|
+
// Extract environment from config
|
|
14
|
+
// Generate user config by calling their function with env
|
|
15
|
+
const userConfig = configFn({
|
|
16
|
+
platform: config.platform,
|
|
17
|
+
mode: config.mode,
|
|
18
|
+
});
|
|
19
|
+
const updatedZephyrConfig = {
|
|
20
|
+
...zephyrPluginOptions,
|
|
21
|
+
target: config.platform,
|
|
22
|
+
};
|
|
23
|
+
(0, zephyr_agent_1.ze_log)('updatedZephyrConfig: ', updatedZephyrConfig);
|
|
24
|
+
// Return the final processed configuration
|
|
25
|
+
return _zephyr_configuration(userConfig, updatedZephyrConfig);
|
|
26
|
+
};
|
|
27
|
+
};
|
|
12
28
|
}
|
|
13
29
|
async function _zephyr_configuration(config,
|
|
14
30
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -18,12 +34,15 @@ _zephyrOptions) {
|
|
|
18
34
|
builder: 'repack',
|
|
19
35
|
context: config.context,
|
|
20
36
|
});
|
|
21
|
-
(0, zephyr_agent_1.ze_log)('Configuring with Zephyr...');
|
|
22
|
-
|
|
23
|
-
|
|
37
|
+
(0, zephyr_agent_1.ze_log)('Configuring with Zephyr... \n config: ', config);
|
|
38
|
+
if (!_zephyrOptions?.target) {
|
|
39
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_MISSING_PLATFORM);
|
|
40
|
+
}
|
|
41
|
+
zephyr_engine.env.target = _zephyrOptions?.target;
|
|
24
42
|
const dependency_pairs = (0, zephyr_xpack_internal_1.extractFederatedDependencyPairs)(config);
|
|
25
|
-
|
|
26
|
-
|
|
43
|
+
(0, zephyr_agent_1.ze_log)('Resolving and building towards target by zephyr_engine.env.target: ', zephyr_engine.env.target);
|
|
44
|
+
const resolved_dependency_pairs = await zephyr_engine.resolve_remote_dependencies(dependency_pairs, zephyr_engine.env.target);
|
|
45
|
+
(0, zephyr_xpack_internal_1.mutWebpackFederatedRemotesConfig)(zephyr_engine, config, resolved_dependency_pairs);
|
|
27
46
|
(0, zephyr_agent_1.ze_log)('dependency resolution completed successfully...or at least trying to...');
|
|
28
47
|
const mf_configs = (0, zephyr_xpack_internal_1.makeCopyOfModuleFederationOptions)(config);
|
|
29
48
|
// const app_config = await zephyr_engine.application_configuration;
|
|
@@ -32,8 +51,8 @@ _zephyrOptions) {
|
|
|
32
51
|
(0, zephyr_agent_1.ze_log)('Application uid created...');
|
|
33
52
|
config.plugins?.push(new ze_repack_plugin_1.ZeRepackPlugin({
|
|
34
53
|
zephyr_engine,
|
|
35
|
-
target,
|
|
36
54
|
mfConfig: (0, zephyr_xpack_internal_1.makeCopyOfModuleFederationOptions)(config),
|
|
55
|
+
target: zephyr_engine.env.target,
|
|
37
56
|
}));
|
|
38
57
|
return config;
|
|
39
58
|
}
|
|
@@ -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":";;AAYA,gCA8BC;AAzCD,+CAA2E;AAC3E,yDAA+E;AAC/E,iEAI+B;AAE/B,uEAAuE;AAGvE,SAAgB,UAAU,CAAC,mBAA+C;IAOxE,2DAA2D;IAC3D,OAAO,CAAC,QAA2C,EAAE,EAAE;QACrD,qFAAqF;QACrF,OAAO,CAAC,MAAiB,EAAE,EAAE;YAC3B,kCAAkC;YAElC,0DAA0D;YAC1D,MAAM,UAAU,GAAG,QAAQ,CAAC;gBAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAC;YAEH,MAAM,mBAAmB,GAAG;gBAC1B,GAAG,mBAAmB;gBACtB,MAAM,EAAE,MAAM,CAAC,QAAQ;aACK,CAAC;YAE/B,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ACrC,MAAM,CAAC,OAAO,EAAE,IAAI,CAClB,IAAI,iCAAc,CAAC;QACjB,aAAa;QACb,QAAQ,EAAE,IAAA,yDAAiC,EAAC,MAAM,CAAC;QACnD,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM;KACjC,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Compiler } from '@rspack/core';
|
|
2
2
|
import { ZephyrEngine } from 'zephyr-agent';
|
|
3
3
|
import { ModuleFederationPlugin } from 'zephyr-xpack-internal';
|
|
4
|
+
import { Platform } from 'zephyr-agent';
|
|
4
5
|
export interface ZephyrRepackPluginOptions {
|
|
5
6
|
zephyr_engine: ZephyrEngine;
|
|
6
7
|
pluginName: string;
|
|
7
8
|
mfConfig: ModuleFederationPlugin[] | ModuleFederationPlugin | undefined;
|
|
8
|
-
target:
|
|
9
|
+
target: Platform | undefined;
|
|
9
10
|
}
|
|
10
11
|
export declare class ZeRepackPlugin {
|
|
11
12
|
_options: ZephyrRepackPluginOptions;
|
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.38",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
"zephyr-xpack-internal": "workspace:*"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@rspack/core": "1.0.8",
|
|
18
|
+
"@rspack/core": "catalog:rspack",
|
|
20
19
|
"@types/find-package-json": "^1.2.6",
|
|
21
|
-
"@types/
|
|
20
|
+
"@types/jest": "catalog:typescript",
|
|
21
|
+
"@typescript-eslint/eslint-plugin": "catalog:eslint",
|
|
22
|
+
"ts-jest": "catalog:typescript"
|
|
22
23
|
},
|
|
23
24
|
"types": "./index.d.ts"
|
|
24
25
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
import { Context } from '@rspack/core';
|
|
2
|
+
import { Platform } from 'zephyr-agent';
|
|
1
3
|
export interface DelegateConfig {
|
|
2
4
|
org: string;
|
|
3
5
|
project: string;
|
|
4
6
|
application?: undefined;
|
|
5
|
-
target?:
|
|
7
|
+
target?: Platform;
|
|
8
|
+
}
|
|
9
|
+
export interface RepackEnv {
|
|
10
|
+
context?: Context;
|
|
11
|
+
reactNativePath?: string;
|
|
12
|
+
mode?: 'development' | 'production' | undefined;
|
|
13
|
+
devServer?: {
|
|
14
|
+
port?: number;
|
|
15
|
+
host?: string;
|
|
16
|
+
https?: boolean;
|
|
17
|
+
hmr?: boolean;
|
|
18
|
+
};
|
|
19
|
+
platform: Platform | undefined;
|
|
6
20
|
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-repack-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
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-
|
|
10
|
-
"zephyr-
|
|
9
|
+
"zephyr-xpack-internal": "0.0.38",
|
|
10
|
+
"zephyr-agent": "0.0.38"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@
|
|
14
|
-
"@rspack/core": "1.0.8",
|
|
13
|
+
"@rspack/core": "1.2.8",
|
|
15
14
|
"@types/find-package-json": "^1.2.6",
|
|
16
|
-
"@types/
|
|
15
|
+
"@types/jest": "29.5.14",
|
|
16
|
+
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
|
17
|
+
"ts-jest": "^29.2.6"
|
|
17
18
|
},
|
|
18
19
|
"scripts": {
|
|
19
20
|
"build": "nx build zephyr-repack-plugin",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function repack_delegate_module_template(): unknown;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.repack_delegate_module_template = repack_delegate_module_template;
|
|
4
|
-
function repack_delegate_module_template() {
|
|
5
|
-
return new Promise((resolve, reject) => {
|
|
6
|
-
const remote_entry_url = '__REMOTE_ENTRY_URL__';
|
|
7
|
-
const library_type = '__LIBRARY_TYPE__';
|
|
8
|
-
let edgeUrl = remote_entry_url;
|
|
9
|
-
let remote_name = '__REMOTE_NAME__';
|
|
10
|
-
if (edgeUrl.includes('@')) {
|
|
11
|
-
[remote_name, edgeUrl] = edgeUrl.split('@');
|
|
12
|
-
}
|
|
13
|
-
const resolve_entry = [
|
|
14
|
-
fetch(edgeUrl, {
|
|
15
|
-
method: 'HEAD',
|
|
16
|
-
headers: {
|
|
17
|
-
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
.then(() => edgeUrl)
|
|
21
|
-
.catch(() => false),
|
|
22
|
-
];
|
|
23
|
-
Promise.race(resolve_entry)
|
|
24
|
-
.then((remoteUrl) => {
|
|
25
|
-
if (typeof remoteUrl !== 'string')
|
|
26
|
-
return;
|
|
27
|
-
let _win = {};
|
|
28
|
-
_win =
|
|
29
|
-
globalThis !== undefined
|
|
30
|
-
? globalThis
|
|
31
|
-
: global;
|
|
32
|
-
const ScriptManager = __webpack_require__.repack.shared.scriptManager;
|
|
33
|
-
ScriptManager.addResolver(
|
|
34
|
-
// @ts-expect-error TODO fix await
|
|
35
|
-
(scriptId, caller, referenceUrl) => {
|
|
36
|
-
if (scriptId === remote_name) {
|
|
37
|
-
return { url: remoteUrl };
|
|
38
|
-
}
|
|
39
|
-
if (referenceUrl && caller === remote_name) {
|
|
40
|
-
const publicPath = remoteUrl.split('/').slice(0, -1).join('/');
|
|
41
|
-
const bundlePath = scriptId + referenceUrl.split(scriptId)[1];
|
|
42
|
-
return { url: publicPath + '/' + bundlePath };
|
|
43
|
-
}
|
|
44
|
-
return;
|
|
45
|
-
}, { key: remote_name });
|
|
46
|
-
if (typeof _win[remote_name] !== 'undefined') {
|
|
47
|
-
return resolve(_win[remote_name]);
|
|
48
|
-
}
|
|
49
|
-
if (typeof __webpack_require__ !== 'undefined' &&
|
|
50
|
-
typeof __webpack_require__.l === 'function' &&
|
|
51
|
-
// @ts-expect-error - library_type is inherited enum type instead of string
|
|
52
|
-
library_type !== 'self') {
|
|
53
|
-
// @ts-expect-error temp
|
|
54
|
-
__webpack_require__.l(remote_entry_url, () => {
|
|
55
|
-
resolve(_win[remote_name]);
|
|
56
|
-
}, remote_name
|
|
57
|
-
// remote_name
|
|
58
|
-
);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
return new Function(`return import("${remoteUrl}")`)()
|
|
62
|
-
.then((mod) => {
|
|
63
|
-
if (typeof _win[remote_name] !== 'undefined') {
|
|
64
|
-
return resolve(_win[remote_name]);
|
|
65
|
-
}
|
|
66
|
-
return resolve(mod);
|
|
67
|
-
})
|
|
68
|
-
.catch((err) => {
|
|
69
|
-
reject(err);
|
|
70
|
-
});
|
|
71
|
-
})
|
|
72
|
-
.catch((err) => {
|
|
73
|
-
console.error(`Zephyr: error loading remote entry ${remote_entry_url}`, err);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=delegate-module-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delegate-module-template.js","sourceRoot":"","sources":["../../src/delegate-module/delegate-module-template.ts"],"names":[],"mappings":";;AAAA,0EAwFC;AAxFD,SAAgB,+BAA+B;IAC7C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC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QACP,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,sCAAsC,gBAAgB,EAAE,EAAE,GAAG,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/core';
|
|
2
|
-
import { DelegateConfig } from '../../type/zephyr-internal-types';
|
|
3
|
-
import { XPackConfiguration } from 'zephyr-xpack-internal';
|
|
4
|
-
import { Compiler } from '@rspack/core';
|
|
5
|
-
type Plugin = NonNullable<XPackConfiguration<Compiler>['plugins']>[number];
|
|
6
|
-
export declare function is_repack_plugin(plugin?: Plugin): any;
|
|
7
|
-
type Platform = DelegateConfig['target'];
|
|
8
|
-
export declare function get_platform_from_repack(config: Configuration): Platform;
|
|
9
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.is_repack_plugin = is_repack_plugin;
|
|
4
|
-
exports.get_platform_from_repack = get_platform_from_repack;
|
|
5
|
-
function is_repack_plugin(plugin) {
|
|
6
|
-
if (!plugin || typeof plugin !== 'object') {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
return (plugin.constructor.name.includes('RepackPlugin') ||
|
|
10
|
-
plugin['name']?.includes('RepackPlugin'));
|
|
11
|
-
}
|
|
12
|
-
function get_platform_from_repack(config) {
|
|
13
|
-
return config.plugins
|
|
14
|
-
?.filter(is_repack_plugin)
|
|
15
|
-
?.map((plugin) => plugin.config.platform)[0];
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=get-platform.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|