zephyr-repack-plugin 0.0.0-canary-20241118144314
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/LICENSE +39 -0
- package/README.md +3 -0
- package/dist/README.md +3 -0
- package/dist/delegate-module/delegate-module-template.d.ts +1 -0
- package/dist/delegate-module/delegate-module-template.js +74 -0
- package/dist/delegate-module/delegate-module-template.js.map +1 -0
- package/dist/delegate-module/replace-remote-with-delegate.d.ts +2 -0
- package/dist/delegate-module/replace-remote-with-delegate.js +29 -0
- package/dist/delegate-module/replace-remote-with-delegate.js.map +1 -0
- package/dist/delegate-module/zephyr-delegate.d.ts +7 -0
- package/dist/delegate-module/zephyr-delegate.js +103 -0
- package/dist/delegate-module/zephyr-delegate.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/build-stats/get-build-stats.d.ts +6 -0
- package/dist/lib/build-stats/get-build-stats.js +55 -0
- package/dist/lib/build-stats/get-build-stats.js.map +1 -0
- package/dist/lib/dependency-resolution/replace-remote-with-delegates.d.ts +3 -0
- package/dist/lib/dependency-resolution/replace-remote-with-delegates.js +21 -0
- package/dist/lib/dependency-resolution/replace-remote-with-delegates.js.map +1 -0
- package/dist/lib/federation-graph/compute-dependencies.d.ts +10 -0
- package/dist/lib/federation-graph/compute-dependencies.js +69 -0
- package/dist/lib/federation-graph/compute-dependencies.js.map +1 -0
- package/dist/lib/federation-graph/compute-shared-module.d.ts +1 -0
- package/dist/lib/federation-graph/compute-shared-module.js +3 -0
- package/dist/lib/federation-graph/compute-shared-module.js.map +1 -0
- package/dist/lib/federation-graph/compute-version.d.ts +4 -0
- package/dist/lib/federation-graph/compute-version.js +22 -0
- package/dist/lib/federation-graph/compute-version.js.map +1 -0
- package/dist/lib/federation-graph/federation-plugin.d.ts +49 -0
- package/dist/lib/federation-graph/federation-plugin.js +223 -0
- package/dist/lib/federation-graph/federation-plugin.js.map +1 -0
- package/dist/lib/federation-graph/runtime-requirement.d.ts +4 -0
- package/dist/lib/federation-graph/runtime-requirement.js +28 -0
- package/dist/lib/federation-graph/runtime-requirement.js.map +1 -0
- package/dist/lib/federation-graph/utils/convert-dependencies.d.ts +12 -0
- package/dist/lib/federation-graph/utils/convert-dependencies.js +31 -0
- package/dist/lib/federation-graph/utils/convert-dependencies.js.map +1 -0
- package/dist/lib/federation-graph/utils/convert-to-graph.d.ts +3 -0
- package/dist/lib/federation-graph/utils/convert-to-graph.js +53 -0
- package/dist/lib/federation-graph/utils/convert-to-graph.js.map +1 -0
- package/dist/lib/federation-graph/utils/converted-dependencies.d.ts +12 -0
- package/dist/lib/federation-graph/utils/converted-dependencies.js +31 -0
- package/dist/lib/federation-graph/utils/converted-dependencies.js.map +1 -0
- package/dist/lib/federation-graph/utils/get-licenses.d.ts +2 -0
- package/dist/lib/federation-graph/utils/get-licenses.js +23 -0
- package/dist/lib/federation-graph/utils/get-licenses.js.map +1 -0
- package/dist/lib/federation-graph/utils/module-part-one.d.ts +31 -0
- package/dist/lib/federation-graph/utils/module-part-one.js +133 -0
- package/dist/lib/federation-graph/utils/module-part-one.js.map +1 -0
- package/dist/lib/federation-graph/utils/module-part-two.d.ts +50 -0
- package/dist/lib/federation-graph/utils/module-part-two.js +134 -0
- package/dist/lib/federation-graph/utils/module-part-two.js.map +1 -0
- package/dist/lib/federation-graph/utils/process-function-remotes.d.ts +22 -0
- package/dist/lib/federation-graph/utils/process-function-remotes.js +35 -0
- package/dist/lib/federation-graph/utils/process-function-remotes.js.map +1 -0
- package/dist/lib/federation-graph/validate-params.d.ts +0 -0
- package/dist/lib/federation-graph/validate-params.js +2 -0
- package/dist/lib/federation-graph/validate-params.js.map +1 -0
- package/dist/lib/set-up-build-id.d.ts +3 -0
- package/dist/lib/set-up-build-id.js +43 -0
- package/dist/lib/set-up-build-id.js.map +1 -0
- package/dist/lib/set-up-build-stats-logging.d.ts +5 -0
- package/dist/lib/set-up-build-stats-logging.js +26 -0
- package/dist/lib/set-up-build-stats-logging.js.map +1 -0
- package/dist/lib/set-up-deploy.d.ts +3 -0
- package/dist/lib/set-up-deploy.js +35 -0
- package/dist/lib/set-up-deploy.js.map +1 -0
- package/dist/lib/utils/federation-plugin-get-package-json.d.ts +1 -0
- package/dist/lib/utils/federation-plugin-get-package-json.js +23 -0
- package/dist/lib/utils/federation-plugin-get-package-json.js.map +1 -0
- package/dist/lib/utils/get-mf-config.d.ts +6 -0
- package/dist/lib/utils/get-mf-config.js +26 -0
- package/dist/lib/utils/get-mf-config.js.map +1 -0
- package/dist/lib/utils/get-platform.d.ts +5 -0
- package/dist/lib/utils/get-platform.js +9 -0
- package/dist/lib/utils/get-platform.js.map +1 -0
- package/dist/lib/utils/plugin-search.d.ts +5 -0
- package/dist/lib/utils/plugin-search.js +17 -0
- package/dist/lib/utils/plugin-search.js.map +1 -0
- package/dist/lib/with-zephyr.d.ts +3 -0
- package/dist/lib/with-zephyr.js +50 -0
- package/dist/lib/with-zephyr.js.map +1 -0
- package/dist/lib/ze-agent/index.d.ts +9 -0
- package/dist/lib/ze-agent/index.js +53 -0
- package/dist/lib/ze-agent/index.js.map +1 -0
- package/dist/lib/ze-agent/lifecycle-events.d.ts +2 -0
- package/dist/lib/ze-agent/lifecycle-events.js +20 -0
- package/dist/lib/ze-agent/lifecycle-events.js.map +1 -0
- package/dist/lib/ze-repack-plugin.d.ts +7 -0
- package/dist/lib/ze-repack-plugin.js +30 -0
- package/dist/lib/ze-repack-plugin.js.map +1 -0
- package/dist/package.json +26 -0
- package/dist/type/convert-graph-params.d.ts +48 -0
- package/dist/type/convert-graph-params.js +3 -0
- package/dist/type/convert-graph-params.js.map +1 -0
- package/dist/type/federation-plugin-options.d.ts +62 -0
- package/dist/type/federation-plugin-options.js +3 -0
- package/dist/type/federation-plugin-options.js.map +1 -0
- package/dist/type/zephyr-internal-types.d.ts +23 -0
- package/dist/type/zephyr-internal-types.js +3 -0
- package/dist/type/zephyr-internal-types.js.map +1 -0
- package/package.json +26 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.repack_zephyr_agent = void 0;
|
|
4
|
+
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
|
+
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
6
|
+
const get_build_stats_1 = require("../build-stats/get-build-stats");
|
|
7
|
+
const lifecycle_events_1 = require("./lifecycle-events");
|
|
8
|
+
const zephyr_agent_2 = require("zephyr-agent");
|
|
9
|
+
async function repack_zephyr_agent({ stats, stats_json, assets, pluginOptions }) {
|
|
10
|
+
(0, zephyr_edge_contract_1.ze_log)('zephyr agent started.');
|
|
11
|
+
if (!pluginOptions.application_uid || !pluginOptions.zeConfig.buildId) {
|
|
12
|
+
(0, lifecycle_events_1.emitDeploymentDone)();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const application_uid = pluginOptions.application_uid;
|
|
16
|
+
const [appConfig, hash_set] = await Promise.all([(0, zephyr_agent_1.getApplicationConfiguration)({ application_uid }), (0, zephyr_agent_1.get_hash_list)(application_uid)]);
|
|
17
|
+
const { EDGE_URL, PLATFORM } = appConfig;
|
|
18
|
+
const zeStart = Date.now();
|
|
19
|
+
const assetsMap = await (0, zephyr_agent_1.zeBuildAssetsMap)(pluginOptions, assets);
|
|
20
|
+
const missingAssets = (0, zephyr_agent_1.get_missing_assets)({ assetsMap, hash_set });
|
|
21
|
+
try {
|
|
22
|
+
(0, zephyr_edge_contract_1.ze_log)('Started uploading...');
|
|
23
|
+
await (0, zephyr_agent_1.upload)({
|
|
24
|
+
pluginOptions,
|
|
25
|
+
assets: {
|
|
26
|
+
assetsMap,
|
|
27
|
+
missingAssets,
|
|
28
|
+
outputPath: pluginOptions.outputPath,
|
|
29
|
+
count: Object.keys(assets).length,
|
|
30
|
+
},
|
|
31
|
+
getDashData: () => (0, get_build_stats_1.getBuildStats)({
|
|
32
|
+
stats,
|
|
33
|
+
stats_json,
|
|
34
|
+
assets,
|
|
35
|
+
pluginOptions,
|
|
36
|
+
// DOMAIN,
|
|
37
|
+
EDGE_URL,
|
|
38
|
+
PLATFORM,
|
|
39
|
+
//TYPE,
|
|
40
|
+
}),
|
|
41
|
+
appConfig,
|
|
42
|
+
zeStart,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
(0, zephyr_agent_2.logFn)('error', zephyr_edge_contract_1.ZephyrError.format(err));
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
(0, lifecycle_events_1.emitDeploymentDone)();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.repack_zephyr_agent = repack_zephyr_agent;
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ze-agent/index.ts"],"names":[],"mappings":";;;AACA,+CAAwH;AACxH,+DAAwH;AACxH,oEAA+D;AAC/D,yDAAwD;AACxD,+CAAqC;AAS9B,KAAK,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAoB;IACtG,IAAA,6BAAM,EAAC,uBAAuB,CAAC,CAAC;IAEhC,IAAI,CAAC,aAAa,CAAC,eAAe,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtE,IAAA,qCAAkB,GAAE,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAEtD,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,0CAA2B,EAAC,EAAE,eAAe,EAAE,CAAC,EAAE,IAAA,4BAAa,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACpI,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,MAAM,IAAA,+BAAgB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,IAAA,iCAAkB,EAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;IAElE,IAAI,CAAC;QACH,IAAA,6BAAM,EAAC,sBAAsB,CAAC,CAAC;QAC/B,MAAM,IAAA,qBAAM,EAAC;YACX,aAAa;YACb,MAAM,EAAE;gBACN,SAAS;gBACT,aAAa;gBACb,UAAU,EAAE,aAAa,CAAC,UAAoB;gBAC9C,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;aAClC;YACD,WAAW,EAAE,GAAG,EAAE,CAChB,IAAA,+BAAa,EAAC;gBACZ,KAAK;gBACL,UAAU;gBACV,MAAM;gBACN,aAAa;gBACb,UAAU;gBACV,QAAQ;gBACR,QAAQ;gBACR,OAAO;aACR,CAAC;YACJ,SAAS;YACT,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAA,oBAAK,EAAC,OAAO,EAAE,kCAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;YAAS,CAAC;QACT,IAAA,qCAAkB,GAAE,CAAC;IACvB,CAAC;AACH,CAAC;AA9CD,kDA8CC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onDeploymentDone = exports.emitDeploymentDone = void 0;
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
|
+
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
6
|
+
const _lifecycle_events = new node_events_1.EventEmitter();
|
|
7
|
+
const _deployment_done = 'deployment-done';
|
|
8
|
+
function emitDeploymentDone() {
|
|
9
|
+
(0, zephyr_edge_contract_1.ze_log)('Deployment done');
|
|
10
|
+
_lifecycle_events.emit(_deployment_done);
|
|
11
|
+
}
|
|
12
|
+
exports.emitDeploymentDone = emitDeploymentDone;
|
|
13
|
+
async function onDeploymentDone() {
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
(0, zephyr_edge_contract_1.ze_log)('Waiting for deployment done');
|
|
16
|
+
_lifecycle_events.once(_deployment_done, resolve);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.onDeploymentDone = onDeploymentDone;
|
|
20
|
+
//# sourceMappingURL=lifecycle-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-events.js","sourceRoot":"","sources":["../../../src/lib/ze-agent/lifecycle-events.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,+DAA8C;AAE9C,MAAM,iBAAiB,GAAG,IAAI,0BAAY,EAAE,CAAC;AAE7C,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C,SAAgB,kBAAkB;IAChC,IAAA,6BAAM,EAAC,iBAAiB,CAAC,CAAC;IAC1B,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAC3C,CAAC;AAHD,gDAGC;AAEM,KAAK,UAAU,gBAAgB;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAA,6BAAM,EAAC,6BAA6B,CAAC,CAAC;QACtC,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC;AALD,4CAKC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZeRepackPlugin = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const isCI = tslib_1.__importStar(require("is-ci"));
|
|
6
|
+
const set_up_build_id_1 = require("./set-up-build-id");
|
|
7
|
+
const set_up_build_stats_logging_1 = require("./set-up-build-stats-logging");
|
|
8
|
+
const set_up_deploy_1 = require("./set-up-deploy");
|
|
9
|
+
const pluginName = 'ZephyrRepackPlugin';
|
|
10
|
+
const default_zephyr_repack_options = {
|
|
11
|
+
pluginName,
|
|
12
|
+
isCI,
|
|
13
|
+
buildEnv: isCI ? 'ci' : 'local',
|
|
14
|
+
zeConfig: {},
|
|
15
|
+
app: {},
|
|
16
|
+
git: {},
|
|
17
|
+
};
|
|
18
|
+
class ZeRepackPlugin {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = default_zephyr_repack_options;
|
|
21
|
+
this._options = Object.assign(this._options, options ?? {});
|
|
22
|
+
}
|
|
23
|
+
apply(compiler) {
|
|
24
|
+
(0, set_up_build_id_1.setupZephyrConfig)(this._options, compiler);
|
|
25
|
+
(0, set_up_build_stats_logging_1.log_build_steps)(this._options, compiler);
|
|
26
|
+
(0, set_up_deploy_1.setup_deploy)(this._options, compiler);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ZeRepackPlugin = ZeRepackPlugin;
|
|
30
|
+
//# sourceMappingURL=ze-repack-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ze-repack-plugin.js","sourceRoot":"","sources":["../../src/lib/ze-repack-plugin.ts"],"names":[],"mappings":";;;;AAAA,oDAA8B;AAG9B,uDAA+D;AAC/D,6EAA+D;AAC/D,mDAA+C;AAC/C,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,MAAM,6BAA6B,GAAG;IACpC,UAAU;IACV,IAAI;IACJ,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;IAC/B,QAAQ,EAAE,EAAE;IACZ,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,EAAE;CACR,CAAC;AAEF,MAAa,cAAc;IAGzB,YAAY,OAAO,GAAG,EAAE;QAFxB,aAAQ,GAAG,6BAAoD,CAAC;QAG9D,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,IAAA,mCAAK,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC/B,IAAA,4CAAe,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzC,IAAA,4BAAY,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACF;AAZD,wCAYC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zephyr-repack-plugin",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "nx build zephyr-repack-plugin",
|
|
10
|
+
"test": "nx test zephyr-repack-plugin",
|
|
11
|
+
"patch-version": "pnpm version"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"find-package-json": "^1.2.0",
|
|
15
|
+
"is-ci": "^3.0.1",
|
|
16
|
+
"zephyr-agent": "0.0.26",
|
|
17
|
+
"zephyr-edge-contract": "0.0.26"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@callstack/repack": "5.0.0-rc.0",
|
|
21
|
+
"@rspack/core": "1.0.8",
|
|
22
|
+
"@types/find-package-json": "^1.2.6",
|
|
23
|
+
"@types/is-ci": "^3.0.4",
|
|
24
|
+
"webpack": "^5.94.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { StatsChunk, StatsModule } from '@rspack/core';
|
|
2
|
+
import { TopLevelPackage } from './federation-plugin-options';
|
|
3
|
+
export interface ConvertToGraphParams {
|
|
4
|
+
/** Application name in module federation config */
|
|
5
|
+
name?: string;
|
|
6
|
+
/** Required filename in React Native actual output js.bundle */
|
|
7
|
+
filename?: string;
|
|
8
|
+
/** Key of remotes as a string of arrays */
|
|
9
|
+
remotes?: unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Chunk of the remote entry,
|
|
12
|
+
*
|
|
13
|
+
* // TODO: in MF2 should it be js.bundle or mf-manifest.json?
|
|
14
|
+
*/
|
|
15
|
+
federationRemoteEntry: StatsChunk | undefined;
|
|
16
|
+
/** Module compilation results return from getStats(), typically includes all chunks and modules needed for the build */
|
|
17
|
+
modules?: StatsModule[];
|
|
18
|
+
/** Shared packages in package.json, an Object of Record<string, any>, could be `dependencies`, `devDependencies` or `optionalDependencies` */
|
|
19
|
+
topLevelPackage: TopLevelPackage;
|
|
20
|
+
/** PublicPath from getStats().toJson() */
|
|
21
|
+
publicPath?: string;
|
|
22
|
+
metadata: {
|
|
23
|
+
remote?: string;
|
|
24
|
+
/** //TODO */
|
|
25
|
+
source?: {
|
|
26
|
+
url?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
versionData?: never;
|
|
30
|
+
/** Either `development` or other development enviornment (`production`), default to `development` if not specified */
|
|
31
|
+
environment?: string;
|
|
32
|
+
/** Computed version based on file hash and _options.versionStrategy //TODO: this is git sha atm need to fix and whink what would be here */
|
|
33
|
+
version?: string;
|
|
34
|
+
/** Date.now() if not specified */
|
|
35
|
+
posted?: Date;
|
|
36
|
+
/** 'default' if not specified, not sure what it does and what it's supposed to do */
|
|
37
|
+
group?: string;
|
|
38
|
+
/** //TODO: unsure what it does */
|
|
39
|
+
functionRemotes: [file: string, applicationID: string, name: string][];
|
|
40
|
+
/** Git sha */
|
|
41
|
+
sha?: string;
|
|
42
|
+
/** GetStats()'s hash */
|
|
43
|
+
buildHash?: string;
|
|
44
|
+
/** Include referenced chunks in a remote, if the host app doesn't expose anything it will be empty */
|
|
45
|
+
chunkDependencies: unknown;
|
|
46
|
+
/** 'ios' | 'android' | 'web' | undefined */
|
|
47
|
+
target?: 'ios' | 'android' | 'web' | undefined;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-graph-params.js","sourceRoot":"","sources":["../../src/type/convert-graph-params.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Stats, StatsCompilation } from '@rspack/core';
|
|
3
|
+
import { ZephyrPluginOptions } from 'zephyr-edge-contract';
|
|
4
|
+
export interface FederationDashboardPluginOptions {
|
|
5
|
+
app?: {
|
|
6
|
+
org: string;
|
|
7
|
+
project: string;
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
};
|
|
11
|
+
git?: {
|
|
12
|
+
name?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
branch: string;
|
|
15
|
+
commit: string;
|
|
16
|
+
};
|
|
17
|
+
context: {
|
|
18
|
+
isCI: boolean;
|
|
19
|
+
};
|
|
20
|
+
target: 'ios' | 'android' | 'web' | undefined;
|
|
21
|
+
debug: boolean;
|
|
22
|
+
filename: string;
|
|
23
|
+
useAST: boolean;
|
|
24
|
+
standalone?: boolean;
|
|
25
|
+
dashboardURL?: string;
|
|
26
|
+
metadata?: Record<string, string | {
|
|
27
|
+
url: string;
|
|
28
|
+
}>;
|
|
29
|
+
environment?: string;
|
|
30
|
+
versionStrategy?: string;
|
|
31
|
+
posted?: Date;
|
|
32
|
+
group?: string;
|
|
33
|
+
nextjs?: string;
|
|
34
|
+
packageJsonPath?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface Source {
|
|
37
|
+
source: () => Buffer;
|
|
38
|
+
size: () => number;
|
|
39
|
+
}
|
|
40
|
+
export type Exposes = (string | ExposesObject)[] | ExposesObject;
|
|
41
|
+
interface ExposesObject {
|
|
42
|
+
[index: string]: string | ExposesConfig | string[];
|
|
43
|
+
}
|
|
44
|
+
/** Advanced configuration for modules that should be exposed by this container. */
|
|
45
|
+
interface ExposesConfig {
|
|
46
|
+
/** Request to a module that should be exposed by this container. */
|
|
47
|
+
import: string | string[];
|
|
48
|
+
/** Custom chunk name for the exposed module. */
|
|
49
|
+
name?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ProcessRspackGraphParams {
|
|
52
|
+
stats: Stats;
|
|
53
|
+
stats_json: StatsCompilation;
|
|
54
|
+
pluginOptions: ZephyrPluginOptions;
|
|
55
|
+
}
|
|
56
|
+
export interface TopLevelPackage {
|
|
57
|
+
dependencies?: Record<string, string>;
|
|
58
|
+
devDependencies?: Record<string, string>;
|
|
59
|
+
optionalDependencies?: Record<string, string>;
|
|
60
|
+
[key: string]: TopLevelPackage[keyof TopLevelPackage];
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federation-plugin-options.js","sourceRoot":"","sources":["../../src/type/federation-plugin-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Configuration } from '@rspack/core';
|
|
2
|
+
import type { Stats, StatsCompilation } from '@rspack/core';
|
|
3
|
+
import { ZephyrPluginOptions, Source } from 'zephyr-edge-contract';
|
|
4
|
+
export interface DelegateConfig {
|
|
5
|
+
org: string;
|
|
6
|
+
project: string;
|
|
7
|
+
application?: undefined;
|
|
8
|
+
target?: 'ios' | 'android' | 'web' | undefined;
|
|
9
|
+
}
|
|
10
|
+
export type RepackRspackConfig = Configuration;
|
|
11
|
+
export interface ResolvedDependency {
|
|
12
|
+
remote_name: string;
|
|
13
|
+
default_url: string;
|
|
14
|
+
application_uid: string;
|
|
15
|
+
remote_entry_url: string;
|
|
16
|
+
library_type: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ZephyrAgentProps {
|
|
19
|
+
stats: Stats;
|
|
20
|
+
stats_json: StatsCompilation;
|
|
21
|
+
pluginOptions: ZephyrPluginOptions;
|
|
22
|
+
assets: Record<string, Source>;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zephyr-internal-types.js","sourceRoot":"","sources":["../../src/type/zephyr-internal-types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zephyr-repack-plugin",
|
|
3
|
+
"version": "0.0.0-canary-20241118144314",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"find-package-json": "^1.2.0",
|
|
10
|
+
"is-ci": "^3.0.1",
|
|
11
|
+
"zephyr-agent": "0.0.26",
|
|
12
|
+
"zephyr-edge-contract": "0.0.26"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@callstack/repack": "5.0.0-rc.0",
|
|
16
|
+
"@rspack/core": "1.0.8",
|
|
17
|
+
"@types/find-package-json": "^1.2.6",
|
|
18
|
+
"@types/is-ci": "^3.0.4",
|
|
19
|
+
"webpack": "^5.94.0"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "nx build zephyr-repack-plugin",
|
|
23
|
+
"test": "nx test zephyr-repack-plugin",
|
|
24
|
+
"patch-version": "pnpm version"
|
|
25
|
+
}
|
|
26
|
+
}
|