zephyr-repack-plugin 0.0.41 → 0.0.43
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/utils/ze-util-verification.d.ts +1 -1
- package/dist/lib/with-zephyr.d.ts +3 -3
- package/dist/lib/with-zephyr.js +30 -25
- package/dist/lib/with-zephyr.js.map +1 -1
- package/dist/lib/ze-repack-plugin.d.ts +4 -4
- package/dist/lib/ze-repack-plugin.js.map +1 -1
- package/dist/package.json +18 -4
- package/dist/type/zephyr-internal-types.d.ts +2 -2
- package/package.json +20 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Configuration } from '@rspack/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Configuration } from '@rspack/core';
|
|
2
|
+
import type { RepackEnv } from '../type/zephyr-internal-types';
|
|
3
|
+
import { type ZephyrRepackPluginOptions } from './ze-repack-plugin';
|
|
4
4
|
export declare function withZephyr(zephyrPluginOptions?: ZephyrRepackPluginOptions): (configFn: (env: RepackEnv) => Configuration) => (config: RepackEnv) => Promise<Configuration>;
|
package/dist/lib/with-zephyr.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withZephyr = withZephyr;
|
|
4
4
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
|
-
const ze_repack_plugin_1 = require("./ze-repack-plugin");
|
|
6
5
|
const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
|
|
7
6
|
const ze_util_verification_1 = require("./utils/ze-util-verification");
|
|
7
|
+
const ze_repack_plugin_1 = require("./ze-repack-plugin");
|
|
8
8
|
function withZephyr(zephyrPluginOptions) {
|
|
9
9
|
// RETURN 1: Function that takes the user's config function
|
|
10
10
|
return (configFn) => {
|
|
@@ -29,31 +29,36 @@ function withZephyr(zephyrPluginOptions) {
|
|
|
29
29
|
async function _zephyr_configuration(config,
|
|
30
30
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
31
|
_zephyrOptions) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
try {
|
|
33
|
+
// create instance of ZephyrEngine to track the application
|
|
34
|
+
const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create({
|
|
35
|
+
builder: 'repack',
|
|
36
|
+
context: config.context,
|
|
37
|
+
});
|
|
38
|
+
(0, zephyr_agent_1.ze_log)('Configuring with Zephyr... \n config: ', config);
|
|
39
|
+
if (!_zephyrOptions?.target) {
|
|
40
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_MISSING_PLATFORM);
|
|
41
|
+
}
|
|
42
|
+
zephyr_engine.env.target = _zephyrOptions?.target;
|
|
43
|
+
const dependency_pairs = (0, zephyr_xpack_internal_1.extractFederatedDependencyPairs)(config);
|
|
44
|
+
(0, zephyr_agent_1.ze_log)('Resolving and building towards target by zephyr_engine.env.target: ', zephyr_engine.env.target);
|
|
45
|
+
const resolved_dependency_pairs = await zephyr_engine.resolve_remote_dependencies(dependency_pairs, zephyr_engine.env.target);
|
|
46
|
+
(0, zephyr_xpack_internal_1.mutWebpackFederatedRemotesConfig)(zephyr_engine, config, resolved_dependency_pairs);
|
|
47
|
+
(0, zephyr_agent_1.ze_log)('dependency resolution completed successfully...or at least trying to...');
|
|
48
|
+
const mf_configs = (0, zephyr_xpack_internal_1.makeCopyOfModuleFederationOptions)(config);
|
|
49
|
+
// const app_config = await zephyr_engine.application_configuration;
|
|
50
|
+
// Verify Module Federation configuration's naming
|
|
51
|
+
await (0, ze_util_verification_1.verify_mf_fastly_config)(mf_configs, zephyr_engine);
|
|
52
|
+
(0, zephyr_agent_1.ze_log)('Application uid created...');
|
|
53
|
+
config.plugins?.push(new ze_repack_plugin_1.ZeRepackPlugin({
|
|
54
|
+
zephyr_engine,
|
|
55
|
+
mfConfig: (0, zephyr_xpack_internal_1.makeCopyOfModuleFederationOptions)(config),
|
|
56
|
+
target: zephyr_engine.env.target,
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
(0, zephyr_agent_1.logFn)('error', zephyr_agent_1.ZephyrError.format(error));
|
|
40
61
|
}
|
|
41
|
-
zephyr_engine.env.target = _zephyrOptions?.target;
|
|
42
|
-
const dependency_pairs = (0, zephyr_xpack_internal_1.extractFederatedDependencyPairs)(config);
|
|
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);
|
|
46
|
-
(0, zephyr_agent_1.ze_log)('dependency resolution completed successfully...or at least trying to...');
|
|
47
|
-
const mf_configs = (0, zephyr_xpack_internal_1.makeCopyOfModuleFederationOptions)(config);
|
|
48
|
-
// const app_config = await zephyr_engine.application_configuration;
|
|
49
|
-
// Verify Module Federation configuration's naming
|
|
50
|
-
await (0, ze_util_verification_1.verify_mf_fastly_config)(mf_configs, zephyr_engine);
|
|
51
|
-
(0, zephyr_agent_1.ze_log)('Application uid created...');
|
|
52
|
-
config.plugins?.push(new ze_repack_plugin_1.ZeRepackPlugin({
|
|
53
|
-
zephyr_engine,
|
|
54
|
-
mfConfig: (0, zephyr_xpack_internal_1.makeCopyOfModuleFederationOptions)(config),
|
|
55
|
-
target: zephyr_engine.env.target,
|
|
56
|
-
}));
|
|
57
62
|
return config;
|
|
58
63
|
}
|
|
59
64
|
//# sourceMappingURL=with-zephyr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/lib/with-zephyr.ts"],"names":[],"mappings":";;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CAAC;QAElD,MAAM,gBAAgB,GAAG,IAAA,uDAA+B,EAAC,MAAM,CAAC,CAAC;QAEjE,IAAA,qBAAM,EACJ,qEAAqE,EACrE,aAAa,CAAC,GAAG,CAAC,MAAM,CACzB,CAAC;QAEF,MAAM,yBAAyB,GAAG,MAAM,aAAa,CAAC,2BAA2B,CAC/E,gBAAgB,EAChB,aAAa,CAAC,GAAG,CAAC,MAAM,CACzB,CAAC;QACF,IAAA,wDAAgC,EAAC,aAAa,EAAE,MAAM,EAAE,yBAAyB,CAAC,CAAC;QAEnF,IAAA,qBAAM,EAAC,yEAAyE,CAAC,CAAC;QAElF,MAAM,UAAU,GAAG,IAAA,yDAAiC,EAAC,MAAM,CAAC,CAAC;QAC7D,oEAAoE;QACpE,kDAAkD;QAClD,MAAM,IAAA,8CAAuB,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAEzD,IAAA,qBAAM,EAAC,4BAA4B,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,EAAE,IAAI,CAClB,IAAI,iCAAc,CAAC;YACjB,aAAa;YACb,QAAQ,EAAE,IAAA,yDAAiC,EAAC,MAAM,CAAC;YACnD,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM;SACjC,CAAC,CACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,oBAAK,EAAC,OAAO,EAAE,0BAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Compiler } from '@rspack/core';
|
|
2
|
-
import { ZephyrEngine } from 'zephyr-agent';
|
|
3
|
-
import { ModuleFederationPlugin } from 'zephyr-xpack-internal';
|
|
4
|
-
import { Platform } from 'zephyr-agent';
|
|
1
|
+
import type { Compiler } from '@rspack/core';
|
|
2
|
+
import type { ZephyrEngine } from 'zephyr-agent';
|
|
3
|
+
import type { ModuleFederationPlugin } from 'zephyr-xpack-internal';
|
|
4
|
+
import type { Platform } from 'zephyr-agent';
|
|
5
5
|
export interface ZephyrRepackPluginOptions {
|
|
6
6
|
zephyr_engine: ZephyrEngine;
|
|
7
7
|
pluginName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;AAGA,iEAAqE;AAErE,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,14 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-repack-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
|
+
"description": "Repack plugin for Zephyr",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/ZephyrCloudIO/zephyr-packages.git",
|
|
8
|
+
"directory": "libs/zephyr-repack-plugin"
|
|
9
|
+
},
|
|
4
10
|
"license": "Apache-2.0",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "ZephyrCloudIO",
|
|
13
|
+
"url": "https://github.com/ZephyrCloudIO"
|
|
14
|
+
},
|
|
15
|
+
"type": "commonjs",
|
|
5
16
|
"main": "dist/index.js",
|
|
6
17
|
"typings": "dist/index.d.ts",
|
|
7
|
-
"type": "commonjs",
|
|
8
18
|
"scripts": {
|
|
9
19
|
"build": "nx build zephyr-repack-plugin",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
20
|
+
"patch-version": "pnpm version",
|
|
21
|
+
"test": "nx test zephyr-repack-plugin"
|
|
12
22
|
},
|
|
13
23
|
"dependencies": {
|
|
14
24
|
"zephyr-agent": "workspace:*",
|
|
@@ -21,5 +31,9 @@
|
|
|
21
31
|
"@typescript-eslint/eslint-plugin": "catalog:eslint",
|
|
22
32
|
"ts-jest": "catalog:typescript"
|
|
23
33
|
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
37
|
+
},
|
|
24
38
|
"types": "./index.d.ts"
|
|
25
39
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-repack-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
|
+
"description": "Repack plugin for Zephyr",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/ZephyrCloudIO/zephyr-packages.git",
|
|
8
|
+
"directory": "libs/zephyr-repack-plugin"
|
|
9
|
+
},
|
|
4
10
|
"license": "Apache-2.0",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "ZephyrCloudIO",
|
|
13
|
+
"url": "https://github.com/ZephyrCloudIO"
|
|
14
|
+
},
|
|
15
|
+
"type": "commonjs",
|
|
5
16
|
"main": "dist/index.js",
|
|
6
17
|
"typings": "dist/index.d.ts",
|
|
7
|
-
"type": "commonjs",
|
|
8
18
|
"dependencies": {
|
|
9
|
-
"zephyr-
|
|
10
|
-
"zephyr-
|
|
19
|
+
"zephyr-agent": "0.0.43",
|
|
20
|
+
"zephyr-xpack-internal": "0.0.43"
|
|
11
21
|
},
|
|
12
22
|
"devDependencies": {
|
|
13
23
|
"@rspack/core": "1.2.8",
|
|
@@ -16,9 +26,13 @@
|
|
|
16
26
|
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
|
17
27
|
"ts-jest": "^29.2.6"
|
|
18
28
|
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"provenance": true
|
|
32
|
+
},
|
|
19
33
|
"scripts": {
|
|
20
34
|
"build": "nx build zephyr-repack-plugin",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
35
|
+
"patch-version": "pnpm version",
|
|
36
|
+
"test": "nx test zephyr-repack-plugin"
|
|
23
37
|
}
|
|
24
38
|
}
|