zephyr-xpack-internal 0.0.0-canary-20250414122517 → 0.0.0-canary-20250508121326

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.d.ts CHANGED
@@ -7,4 +7,3 @@ export { getBuildStats } from './federation-dashboard-legacy/get-build-stats';
7
7
  export { setupZeDeploy } from './hooks/ze-setup-ze-deploy';
8
8
  export { logBuildSteps } from './hooks/ze-setup-build-steps-logging';
9
9
  export { xpack_zephyr_agent } from './xpack-extract/ze-xpack-upload-agent';
10
- export { detectAndStoreBaseHref } from './basehref/basehref-integration';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.detectAndStoreBaseHref = exports.xpack_zephyr_agent = exports.logBuildSteps = exports.setupZeDeploy = exports.getBuildStats = exports.buildWebpackAssetMap = exports.xpack_delegate_module_template = exports.mutWebpackFederatedRemotesConfig = exports.makeCopyOfModuleFederationOptions = exports.extractFederatedDependencyPairs = exports.isModuleFederationPlugin = exports.emitDeploymentDone = exports.onDeploymentDone = void 0;
3
+ exports.xpack_zephyr_agent = exports.logBuildSteps = exports.setupZeDeploy = exports.getBuildStats = exports.buildWebpackAssetMap = exports.xpack_delegate_module_template = exports.mutWebpackFederatedRemotesConfig = exports.makeCopyOfModuleFederationOptions = exports.extractFederatedDependencyPairs = exports.isModuleFederationPlugin = exports.emitDeploymentDone = exports.onDeploymentDone = void 0;
4
4
  var lifecycle_events_1 = require("./lifecycle-events");
5
5
  Object.defineProperty(exports, "onDeploymentDone", { enumerable: true, get: function () { return lifecycle_events_1.onDeploymentDone; } });
6
6
  Object.defineProperty(exports, "emitDeploymentDone", { enumerable: true, get: function () { return lifecycle_events_1.emitDeploymentDone; } });
@@ -21,6 +21,4 @@ var ze_setup_build_steps_logging_1 = require("./hooks/ze-setup-build-steps-loggi
21
21
  Object.defineProperty(exports, "logBuildSteps", { enumerable: true, get: function () { return ze_setup_build_steps_logging_1.logBuildSteps; } });
22
22
  var ze_xpack_upload_agent_1 = require("./xpack-extract/ze-xpack-upload-agent");
23
23
  Object.defineProperty(exports, "xpack_zephyr_agent", { enumerable: true, get: function () { return ze_xpack_upload_agent_1.xpack_zephyr_agent; } });
24
- var basehref_integration_1 = require("./basehref/basehref-integration");
25
- Object.defineProperty(exports, "detectAndStoreBaseHref", { enumerable: true, get: function () { return basehref_integration_1.detectAndStoreBaseHref; } });
26
24
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA0E;AAAjE,oHAAA,gBAAgB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAE7C,2FAAuF;AAA9E,uIAAA,wBAAwB,OAAA;AACjC,iDAKyB;AAJvB,gIAAA,+BAA+B,OAAA;AAC/B,kIAAA,iCAAiC,OAAA;AACjC,iIAAA,gCAAgC,OAAA;AAChC,+HAAA,8BAA8B,OAAA;AAEhC,qFAAgF;AAAvE,gIAAA,oBAAoB,OAAA;AAS7B,iFAA8E;AAArE,gHAAA,aAAa,OAAA;AAEtB,iEAA2D;AAAlD,mHAAA,aAAa,OAAA;AACtB,qFAAqE;AAA5D,6HAAA,aAAa,OAAA;AAEtB,+EAA2E;AAAlE,2HAAA,kBAAkB,OAAA;AAE3B,wEAAyE;AAAhE,8HAAA,sBAAsB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA0E;AAAjE,oHAAA,gBAAgB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAE7C,2FAAuF;AAA9E,uIAAA,wBAAwB,OAAA;AACjC,iDAKyB;AAJvB,gIAAA,+BAA+B,OAAA;AAC/B,kIAAA,iCAAiC,OAAA;AACjC,iIAAA,gCAAgC,OAAA;AAChC,+HAAA,8BAA8B,OAAA;AAEhC,qFAAgF;AAAvE,gIAAA,oBAAoB,OAAA;AAS7B,iFAA8E;AAArE,gHAAA,aAAa,OAAA;AAEtB,iEAA2D;AAAlD,mHAAA,aAAa,OAAA;AACtB,qFAAqE;AAA5D,6HAAA,aAAa,OAAA;AAEtB,+EAA2E;AAAlE,2HAAA,kBAAkB,OAAA"}
package/dist/package.json CHANGED
@@ -1,10 +1,20 @@
1
1
  {
2
2
  "name": "zephyr-xpack-internal",
3
- "version": "0.0.38",
3
+ "version": "0.0.42",
4
+ "description": "Xpack internals for Zephyr",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/ZephyrCloudIO/zephyr-packages.git",
8
+ "directory": "libs/zephyr-xpack-internal"
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
  "types": "dist/index.d.ts",
7
- "type": "commonjs",
8
18
  "scripts": {
9
19
  "build": "nx run zephyr-xpack-internal:build",
10
20
  "patch-version": "pnpm version"
@@ -17,10 +27,14 @@
17
27
  "zephyr-edge-contract": "workspace:*"
18
28
  },
19
29
  "devDependencies": {
20
- "@typescript-eslint/eslint-plugin": "catalog:eslint",
21
30
  "@types/is-ci": "catalog:typescript",
31
+ "@types/jest": "catalog:typescript",
22
32
  "@types/node-persist": "catalog:typescript",
23
- "ts-jest": "catalog:typescript",
24
- "@types/jest": "catalog:typescript"
33
+ "@typescript-eslint/eslint-plugin": "catalog:eslint",
34
+ "ts-jest": "catalog:typescript"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public",
38
+ "provenance": true
25
39
  }
26
40
  }
@@ -1,9 +1,6 @@
1
1
  export interface XPackConfiguration<Compiler> {
2
2
  context?: string;
3
3
  plugins?: (undefined | null | false | '' | 0 | ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance<Compiler>)[];
4
- output?: {
5
- publicPath?: string;
6
- } | any;
7
4
  }
8
5
  interface WebpackPluginInstance<Compiler> {
9
6
  [index: string]: any;
package/package.json CHANGED
@@ -1,23 +1,37 @@
1
1
  {
2
2
  "name": "zephyr-xpack-internal",
3
- "version": "0.0.0-canary-20250414122517",
3
+ "version": "0.0.0-canary-20250508121326",
4
+ "description": "Xpack internals for Zephyr",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/ZephyrCloudIO/zephyr-packages.git",
8
+ "directory": "libs/zephyr-xpack-internal"
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
  "types": "dist/index.d.ts",
7
- "type": "commonjs",
8
18
  "dependencies": {
9
19
  "@module-federation/automatic-vendor-federation": "^1.2.1",
10
20
  "is-ci": "^4.1.0",
11
21
  "tslib": "^2.8.1",
12
- "zephyr-agent": "0.0.0-canary-20250414122517",
13
- "zephyr-edge-contract": "0.0.0-canary-20250414122517"
22
+ "zephyr-agent": "0.0.0-canary-20250508121326",
23
+ "zephyr-edge-contract": "0.0.0-canary-20250508121326"
14
24
  },
15
25
  "devDependencies": {
16
- "@typescript-eslint/eslint-plugin": "^8.27.0",
17
26
  "@types/is-ci": "3.0.4",
27
+ "@types/jest": "29.5.14",
18
28
  "@types/node-persist": "^3.1.8",
19
- "ts-jest": "^29.2.6",
20
- "@types/jest": "29.5.14"
29
+ "@typescript-eslint/eslint-plugin": "^8.27.0",
30
+ "ts-jest": "^29.2.6"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public",
34
+ "provenance": true
21
35
  },
22
36
  "scripts": {
23
37
  "build": "nx run zephyr-xpack-internal:build",
@@ -1,34 +0,0 @@
1
- import { ZephyrEngine } from 'zephyr-agent';
2
- /** Interface for options that might contain baseHref settings */
3
- export interface BaseHrefOptions {
4
- baseHref?: string;
5
- publicPath?: string;
6
- }
7
- /** Options that might be passed to HTML Webpack Plugin */
8
- export interface HtmlPluginOptions {
9
- base?: string | {
10
- href?: string;
11
- target?: string;
12
- };
13
- }
14
- /** Interface for webpack/rspack compiler */
15
- export interface WebpackLikeCompiler {
16
- options: {
17
- output?: {
18
- publicPath?: any;
19
- };
20
- plugins?: any[];
21
- };
22
- }
23
- /**
24
- * Extracts baseHref from available sources with priority:
25
- *
26
- * 1. Plugin options
27
- * 2. HTML Plugin
28
- * 3. Output.publicPath
29
- *
30
- * @param zephyr_engine - ZephyrEngine instance
31
- * @param compiler - The webpack/rspack compiler object
32
- * @param pluginOptions - Options passed to the plugin
33
- */
34
- export declare function detectAndStoreBaseHref(zephyr_engine: ZephyrEngine, compiler: WebpackLikeCompiler, pluginOptions?: BaseHrefOptions): void;
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.detectAndStoreBaseHref = detectAndStoreBaseHref;
4
- /**
5
- * Extract baseHref from plugin options
6
- *
7
- * @param options - Plugin options that might contain baseHref
8
- * @returns The baseHref value or undefined if not found
9
- */
10
- function extractBaseHrefFromPluginOptions(options) {
11
- return options?.baseHref;
12
- }
13
- /**
14
- * Extract baseHref from HTML plugin options
15
- *
16
- * @param plugins - Array of plugins
17
- * @returns The baseHref value or undefined if not found
18
- */
19
- function extractBaseHrefFromHtmlPlugin(plugins) {
20
- // Find HTML plugin
21
- const htmlPlugin = plugins.find((plugin) => plugin?.constructor?.name === 'HtmlWebpackPlugin' ||
22
- plugin?.constructor?.name === 'HtmlRspackPlugin');
23
- if (!htmlPlugin || !htmlPlugin.options) {
24
- return undefined;
25
- }
26
- // Extract base from HTML plugin options
27
- const { base } = htmlPlugin.options;
28
- if (typeof base === 'string') {
29
- return base;
30
- }
31
- else if (typeof base === 'object' && base?.href) {
32
- return base.href;
33
- }
34
- return undefined;
35
- }
36
- /**
37
- * Extract baseHref from output.publicPath
38
- *
39
- * @param compiler - The webpack/rspack compiler object
40
- * @returns The publicPath value or undefined if not found
41
- */
42
- function extractBaseHrefFromPublicPath(compiler) {
43
- const publicPath = compiler.options.output?.publicPath;
44
- // Skip 'auto' value which is a special case in webpack
45
- if (publicPath === 'auto' || publicPath === undefined) {
46
- return undefined;
47
- }
48
- // Handle string publicPath directly
49
- if (typeof publicPath === 'string') {
50
- return publicPath;
51
- }
52
- // If publicPath is a function, we can't evaluate it here
53
- // Just log a warning and return undefined
54
- if (typeof publicPath === 'function') {
55
- console.warn('Warning: publicPath is a function, cannot extract baseHref automatically.');
56
- return undefined;
57
- }
58
- return undefined;
59
- }
60
- /**
61
- * Extracts baseHref from available sources with priority:
62
- *
63
- * 1. Plugin options
64
- * 2. HTML Plugin
65
- * 3. Output.publicPath
66
- *
67
- * @param zephyr_engine - ZephyrEngine instance
68
- * @param compiler - The webpack/rspack compiler object
69
- * @param pluginOptions - Options passed to the plugin
70
- */
71
- function detectAndStoreBaseHref(zephyr_engine, compiler, pluginOptions) {
72
- // Check for baseHref in plugin options (highest priority)
73
- let baseHref = extractBaseHrefFromPluginOptions(pluginOptions);
74
- // Check for baseHref in HTML plugin options (medium priority)
75
- if (!baseHref && compiler.options?.plugins) {
76
- baseHref = extractBaseHrefFromHtmlPlugin(compiler.options.plugins);
77
- }
78
- // Check for baseHref in output.publicPath (lowest priority)
79
- if (!baseHref) {
80
- baseHref = extractBaseHrefFromPublicPath(compiler);
81
- }
82
- // Store the baseHref in ZephyrEngine.buildProperties
83
- if (baseHref !== undefined) {
84
- zephyr_engine.buildProperties.baseHref = baseHref;
85
- }
86
- }
87
- //# sourceMappingURL=basehref-integration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basehref-integration.js","sourceRoot":"","sources":["../../src/basehref/basehref-integration.ts"],"names":[],"mappings":";;AA4GA,wDAsBC;AA1GD;;;;;GAKG;AACH,SAAS,gCAAgC,CAAC,OAAyB;IACjE,OAAO,OAAO,EAAE,QAAQ,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH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