zephyr-rspack-plugin 0.0.31 → 0.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zephyr-rspack-plugin",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,6 @@
15
15
  "is-ci": "^3.0.1",
16
16
  "tslib": "^2.3.0",
17
17
  "zephyr-agent": "workspace:*",
18
- "zephyr-edge-contract": "workspace:*",
19
18
  "zephyr-xpack-internal": "workspace:*"
20
19
  },
21
20
  "devDependencies": {
@@ -10,11 +10,14 @@ function withZephyr(zephyrPluginOptions) {
10
10
  exports.withZephyr = withZephyr;
11
11
  async function _zephyr_configuration(config, _zephyrOptions) {
12
12
  // create instance of ZephyrEngine to track the application
13
- const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create(config.context);
13
+ const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create({
14
+ builder: 'rspack',
15
+ context: config.context,
16
+ });
14
17
  // Resolve dependencies and update the config
15
18
  const dependencyPairs = (0, zephyr_xpack_internal_1.extractFederatedDependencyPairs)(config);
16
19
  const resolved_dependency_pairs = await zephyr_engine.resolve_remote_dependencies(dependencyPairs);
17
- (0, zephyr_xpack_internal_1.mutWebpackFederatedRemotesConfig)(config, resolved_dependency_pairs);
20
+ (0, zephyr_xpack_internal_1.mutWebpackFederatedRemotesConfig)(zephyr_engine, config, resolved_dependency_pairs);
18
21
  // inject the ZephyrRspackPlugin
19
22
  config.plugins?.push(new ze_rspack_plugin_1.ZeRspackPlugin({
20
23
  zephyr_engine,
@@ -1 +1 @@
1
- {"version":3,"file":"with-zephyr.js","sourceRoot":"","sources":["../../src/rspack-plugin/with-zephyr.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAC5C,yDAAoD;AAEpD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C,OAAO;KACxB,CAAC,CAAC;IAEH,6CAA6C;IAC7C,MAAM,eAAe,GAAG,IAAA,uDAA+B,EAAC,MAAM,CAAC,CAAC;IAEhE,MAAM,yBAAyB,GAC7B,MAAM,aAAa,CAAC,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAEnE,IAAA,wDAAgC,EAAC,aAAa,EAAE,MAAM,EAAE,yBAAyB,CAAC,CAAC;IAEnF,gCAAgC;IAChC,MAAM,CAAC,OAAO,EAAE,IAAI,CAClB,IAAI,iCAAc,CAAC;QACjB,aAAa;QACb,QAAQ,EAAE,IAAA,yDAAiC,EAAC,MAAM,CAAC;QACnD,mBAAmB,EAAE,cAAc,EAAE,mBAAmB;KACzD,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZeRspackPlugin = void 0;
4
- const ze_setup_ze_deploy_1 = require("./ze-setup-ze-deploy");
5
- const ze_setup_build_steps_logging_1 = require("./ze-setup-build-steps-logging");
4
+ const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
6
5
  const pluginName = 'ZeRspackPlugin';
7
6
  class ZeRspackPlugin {
8
7
  constructor(options) {
@@ -10,8 +9,8 @@ class ZeRspackPlugin {
10
9
  }
11
10
  apply(compiler) {
12
11
  this._options.zephyr_engine.buildProperties.output = compiler.outputPath;
13
- (0, ze_setup_build_steps_logging_1.logBuildSteps)(this._options, compiler);
14
- (0, ze_setup_ze_deploy_1.setupZeDeploy)(this._options, compiler);
12
+ (0, zephyr_xpack_internal_1.logBuildSteps)(this._options, compiler);
13
+ (0, zephyr_xpack_internal_1.setupZeDeploy)(this._options, compiler);
15
14
  }
16
15
  }
17
16
  exports.ZeRspackPlugin = ZeRspackPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"ze-rspack-plugin.js","sourceRoot":"","sources":["../../src/rspack-plugin/ze-rspack-plugin.ts"],"names":[],"mappings":";;;AAEA,6DAAqD;AACrD,iFAA+D;AAI/D,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAapC,MAAa,cAAc;IAGzB,YAAY,OAA8D;QACxE,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;QAEzE,IAAA,4CAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvC,IAAA,kCAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AAbD,wCAaC"}
1
+ {"version":3,"file":"ze-rspack-plugin.js","sourceRoot":"","sources":["../../src/rspack-plugin/ze-rspack-plugin.ts"],"names":[],"mappings":";;;AAEA,iEAI+B;AAG/B,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAapC,MAAa,cAAc;IAGzB,YAAY,OAA8D;QACxE,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;QAEzE,IAAA,qCAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvC,IAAA,qCAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AAbD,wCAaC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zephyr-rspack-plugin",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,9 +10,8 @@
10
10
  "@rspack/core": "^1.1.3",
11
11
  "is-ci": "^3.0.1",
12
12
  "tslib": "^2.3.0",
13
- "zephyr-agent": "0.0.31",
14
- "zephyr-edge-contract": "0.0.31",
15
- "zephyr-xpack-internal": "0.0.31"
13
+ "zephyr-agent": "0.0.32",
14
+ "zephyr-xpack-internal": "0.0.32"
16
15
  },
17
16
  "devDependencies": {
18
17
  "@types/is-ci": "^3.0.4",
@@ -1,10 +0,0 @@
1
- import { type Source } from 'zephyr-edge-contract';
2
- import { Stats, StatsCompilation } from '@rspack/core';
3
- import { ZephyrRspackInternalPluginOptions } from './ze-rspack-plugin';
4
- export interface ZephyrAgentProps {
5
- stats: Stats;
6
- stats_json: StatsCompilation;
7
- pluginOptions: ZephyrRspackInternalPluginOptions;
8
- assets: Record<string, Source>;
9
- }
10
- export declare function rspack_zephyr_agent({ stats, stats_json, assets, pluginOptions, }: ZephyrAgentProps): Promise<void>;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rspack_zephyr_agent = void 0;
4
- const zephyr_agent_1 = require("zephyr-agent");
5
- const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
6
- async function rspack_zephyr_agent({ stats, stats_json, assets, pluginOptions, }) {
7
- (0, zephyr_agent_1.ze_log)('Initiating: Zephyr Rspack Upload Agent');
8
- const zeStart = Date.now();
9
- const { wait_for_index_html, zephyr_engine } = pluginOptions;
10
- try {
11
- const assetsMap = await (0, zephyr_xpack_internal_1.buildWebpackAssetMap)(assets, {
12
- wait_for_index_html,
13
- });
14
- // rspack dash data
15
- const { EDGE_URL, PLATFORM } = await zephyr_engine.application_configuration;
16
- const dashData = await (0, zephyr_xpack_internal_1.getBuildStats)({
17
- stats,
18
- stats_json,
19
- assets,
20
- pluginOptions,
21
- EDGE_URL,
22
- PLATFORM,
23
- });
24
- await zephyr_engine.upload_assets({
25
- assetsMap,
26
- mfConfig: pluginOptions.mfConfig,
27
- buildStats: dashData,
28
- });
29
- }
30
- catch (err) {
31
- (0, zephyr_agent_1.logFn)('error', zephyr_agent_1.ZephyrError.format(err));
32
- }
33
- finally {
34
- (0, zephyr_xpack_internal_1.emitDeploymentDone)();
35
- // todo: log end
36
- (0, zephyr_agent_1.ze_log)('Zephyr Rspack Upload Agent: Done in', Date.now() - zeStart, 'ms');
37
- }
38
- }
39
- exports.rspack_zephyr_agent = rspack_zephyr_agent;
40
- //# sourceMappingURL=ze-rspack-upload-agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ze-rspack-upload-agent.js","sourceRoot":"","sources":["../../src/rspack-plugin/ze-rspack-upload-agent.ts"],"names":[],"mappings":";;;AAAA,+CAA0D;AAQ1D,iEAI+B;AASxB,KAAK,UAAU,mBAAmB,CAAC,EACxC,KAAK,EACL,UAAU,EACV,MAAM,EACN,aAAa,GACI;IACjB,IAAA,qBAAM,EAAC,wCAAwC,CAAC,CAAC;IAEjD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAC7D,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,IAAA,4CAAoB,EAAC,MAAM,EAAE;YACnD,mBAAmB;SACpB,CAAC,CAAC;QAEH,mBAAmB;QACnB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,aAAa,CAAC,yBAAyB,CAAC;QAE7E,MAAM,QAAQ,GAAG,MAAM,IAAA,qCAAa,EAAC;YACnC,KAAK;YACL,UAAU;YACV,MAAM;YACN,aAAa;YACb,QAAQ;YACR,QAAQ;SACT,CAAC,CAAC;QAEH,MAAM,aAAa,CAAC,aAAa,CAAC;YAChC,SAAS;YACT,QAAQ,EAAE,aAAa,CAAC,QAGX;YACb,UAAU,EAAE,QAAuC;SACpD,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAA,oBAAK,EAAC,OAAO,EAAE,0BAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;YAAS,CAAC;QACT,IAAA,0CAAkB,GAAE,CAAC;QACrB,gBAAgB;QAChB,IAAA,qBAAM,EAAC,qCAAqC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AA1CD,kDA0CC"}
@@ -1,5 +0,0 @@
1
- import { ZephyrRspackInternalPluginOptions } from './ze-rspack-plugin';
2
- import { Compiler } from '@rspack/core';
3
- export declare function logBuildSteps(pluginOptions: ZephyrRspackInternalPluginOptions, compiler: Compiler): {
4
- buildStartedAt: number;
5
- };
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logBuildSteps = void 0;
4
- const zephyr_agent_1 = require("zephyr-agent");
5
- function logBuildSteps(pluginOptions, compiler) {
6
- const { pluginName } = pluginOptions;
7
- let buildStartedAt = Date.now();
8
- compiler.hooks.beforeCompile.tapAsync(pluginName, async (params, cb) => {
9
- buildStartedAt = Date.now();
10
- (0, zephyr_agent_1.ze_log)('build started at', buildStartedAt);
11
- cb();
12
- });
13
- compiler.hooks.failed.tap(pluginName, (err) => {
14
- (0, zephyr_agent_1.ze_log)(`build failed in ${Date.now() - buildStartedAt}ms`);
15
- pluginOptions.zephyr_engine.logger.then((logger) => {
16
- logger({
17
- level: 'error',
18
- action: 'build:failed',
19
- message: zephyr_agent_1.ZephyrError.format(err),
20
- });
21
- });
22
- });
23
- return { buildStartedAt };
24
- }
25
- exports.logBuildSteps = logBuildSteps;
26
- //# sourceMappingURL=ze-setup-build-steps-logging.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ze-setup-build-steps-logging.js","sourceRoot":"","sources":["../../src/rspack-plugin/ze-setup-build-steps-logging.ts"],"names":[],"mappings":";;;AACA,+CAAmD;AAGnD,SAAgB,aAAa,CAC3B,aAAgD,EAChD,QAAkB;IAIlB,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAErC,IAAI,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEhC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE;QACrE,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC5B,IAAA,qBAAM,EAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;QAC3C,EAAE,EAAE,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;QAC5C,IAAA,qBAAM,EAAC,mBAAmB,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,IAAI,CAAC,CAAC;QAE3D,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACjD,MAAM,CAAC;gBACL,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,0BAAW,CAAC,MAAM,CAAC,GAAG,CAAC;aACjC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,cAAc,EAAE,CAAC;AAC5B,CAAC;AA7BD,sCA6BC"}
@@ -1,3 +0,0 @@
1
- import { ZephyrRspackInternalPluginOptions } from './ze-rspack-plugin';
2
- import { Compiler } from '@rspack/core';
3
- export declare function setupZeDeploy(pluginOptions: ZephyrRspackInternalPluginOptions, compiler: Compiler): void;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupZeDeploy = void 0;
4
- const tslib_1 = require("tslib");
5
- const process = tslib_1.__importStar(require("node:process"));
6
- const ze_rspack_upload_agent_1 = require("./ze-rspack-upload-agent");
7
- const zephyr_xpack_internal_1 = require("zephyr-xpack-internal");
8
- function setupZeDeploy(pluginOptions, compiler) {
9
- const { pluginName } = pluginOptions;
10
- compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
11
- compilation.hooks.processAssets.tapPromise({
12
- name: pluginName,
13
- stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT,
14
- }, async (assets) => {
15
- const stats = compilation.getStats();
16
- const stats_json = compilation.getStats().toJson();
17
- await pluginOptions.zephyr_engine.start_new_build();
18
- process.nextTick(ze_rspack_upload_agent_1.rspack_zephyr_agent, {
19
- stats,
20
- stats_json,
21
- assets,
22
- pluginOptions,
23
- });
24
- if (!pluginOptions.wait_for_index_html) {
25
- await (0, zephyr_xpack_internal_1.onDeploymentDone)();
26
- }
27
- // empty line to separate logs from other plugins
28
- console.log();
29
- });
30
- });
31
- }
32
- exports.setupZeDeploy = setupZeDeploy;
33
- //# sourceMappingURL=ze-setup-ze-deploy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ze-setup-ze-deploy.js","sourceRoot":"","sources":["../../src/rspack-plugin/ze-setup-ze-deploy.ts"],"names":[],"mappings":";;;;AAAA,8DAAwC;AAExC,qEAA+D;AAG/D,iEAAyD;AAEzD,SAAgB,aAAa,CAC3B,aAAgD,EAChD,QAAkB;IAElB,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE,EAAE;QAC7D,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CACxC;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,2BAA2B;SAChE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;YAEnD,MAAM,aAAa,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC;YAEpD,OAAO,CAAC,QAAQ,CAAC,4CAAmB,EAAE;gBACpC,KAAK;gBACL,UAAU;gBACV,MAAM;gBACN,aAAa;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC;gBACvC,MAAM,IAAA,wCAAgB,GAAE,CAAC;YAC3B,CAAC;YAED,iDAAiD;YACjD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAjCD,sCAiCC"}