vite-plugin-zephyr 1.1.2 → 1.2.0

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.
Files changed (91) hide show
  1. package/README.md +45 -1
  2. package/dist/index.d.mts +7 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.js +44 -6
  5. package/dist/index.mjs +3 -0
  6. package/dist/lib/internal/extract/extract-entrypoint.d.mts +11 -0
  7. package/dist/lib/internal/extract/extract-entrypoint.d.ts +2 -1
  8. package/dist/lib/internal/extract/extract-entrypoint.js +53 -38
  9. package/dist/lib/internal/extract/extract-entrypoint.mjs +32 -0
  10. package/dist/lib/internal/extract/extract_mf_plugin.d.mts +10 -0
  11. package/dist/lib/internal/extract/extract_mf_plugin.d.ts +6 -2
  12. package/dist/lib/internal/extract/extract_mf_plugin.js +48 -5
  13. package/dist/lib/internal/extract/extract_mf_plugin.mjs +17 -0
  14. package/dist/lib/internal/extract/extract_vite_assets_map.d.mts +4 -0
  15. package/dist/lib/internal/extract/extract_vite_assets_map.d.ts +2 -1
  16. package/dist/lib/internal/extract/extract_vite_assets_map.js +65 -35
  17. package/dist/lib/internal/extract/extract_vite_assets_map.mjs +49 -0
  18. package/dist/lib/internal/extract/load_public_dir.d.mts +10 -0
  19. package/dist/lib/internal/extract/load_public_dir.d.ts +5 -2
  20. package/dist/lib/internal/extract/load_public_dir.js +57 -19
  21. package/dist/lib/internal/extract/load_public_dir.mjs +31 -0
  22. package/dist/lib/internal/extract/load_static_assets.d.mts +4 -0
  23. package/dist/lib/internal/extract/load_static_assets.d.ts +3 -2
  24. package/dist/lib/internal/extract/load_static_assets.js +60 -35
  25. package/dist/lib/internal/extract/load_static_assets.mjs +29 -0
  26. package/dist/lib/internal/extract/load_static_entries.d.mts +10 -0
  27. package/dist/lib/internal/extract/load_static_entries.d.ts +5 -2
  28. package/dist/lib/internal/extract/load_static_entries.js +56 -14
  29. package/dist/lib/internal/extract/load_static_entries.mjs +31 -0
  30. package/dist/lib/internal/extract/merge_vite_output_assets.d.mts +13 -0
  31. package/dist/lib/internal/extract/merge_vite_output_assets.d.ts +13 -0
  32. package/dist/lib/internal/extract/merge_vite_output_assets.js +68 -0
  33. package/dist/lib/internal/extract/merge_vite_output_assets.mjs +31 -0
  34. package/dist/lib/internal/mf-vite-etl/ensure_runtime_plugin.d.mts +31 -0
  35. package/dist/lib/internal/mf-vite-etl/ensure_runtime_plugin.d.ts +11 -0
  36. package/dist/lib/internal/mf-vite-etl/ensure_runtime_plugin.js +56 -15
  37. package/dist/lib/internal/mf-vite-etl/ensure_runtime_plugin.mjs +21 -0
  38. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.d.mts +13 -0
  39. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.d.ts +1 -0
  40. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.js +55 -19
  41. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.mjs +24 -0
  42. package/dist/lib/internal/mf-vite-etl/federation-metadata.d.mts +38 -0
  43. package/dist/lib/internal/mf-vite-etl/federation-metadata.d.ts +38 -0
  44. package/dist/lib/internal/mf-vite-etl/federation-metadata.js +154 -0
  45. package/dist/lib/internal/mf-vite-etl/federation-metadata.mjs +111 -0
  46. package/dist/lib/internal/mf-vite-etl/runtime_plugin.mjs +68 -159
  47. package/dist/lib/internal/partial-build-scope.d.mts +12 -0
  48. package/dist/lib/internal/partial-build-scope.d.ts +12 -0
  49. package/dist/lib/internal/partial-build-scope.js +83 -0
  50. package/dist/lib/internal/partial-build-scope.mjs +43 -0
  51. package/dist/lib/internal/types/zephyr-internal-options.d.mts +13 -0
  52. package/dist/lib/internal/types/zephyr-internal-options.d.ts +6 -2
  53. package/dist/lib/internal/types/zephyr-internal-options.js +18 -1
  54. package/dist/lib/internal/types/zephyr-internal-options.mjs +1 -0
  55. package/dist/lib/internal/types/zephyr-output.d.mts +23 -0
  56. package/dist/lib/internal/types/zephyr-output.d.ts +23 -0
  57. package/dist/lib/internal/types/zephyr-output.js +20 -0
  58. package/dist/lib/internal/types/zephyr-output.mjs +1 -0
  59. package/dist/lib/internal/utils/normalize-entrypoint.d.mts +11 -0
  60. package/dist/lib/internal/utils/normalize-entrypoint.d.ts +1 -0
  61. package/dist/lib/internal/utils/normalize-entrypoint.js +42 -24
  62. package/dist/lib/internal/utils/normalize-entrypoint.mjs +12 -0
  63. package/dist/lib/internal/utils/normalize-vite-path.d.mts +10 -0
  64. package/dist/lib/internal/utils/normalize-vite-path.d.ts +10 -0
  65. package/dist/lib/internal/utils/normalize-vite-path.js +51 -0
  66. package/dist/lib/internal/utils/normalize-vite-path.mjs +11 -0
  67. package/dist/lib/vite-plugin-zephyr-partial.d.mts +6 -0
  68. package/dist/lib/vite-plugin-zephyr-partial.d.ts +5 -8
  69. package/dist/lib/vite-plugin-zephyr-partial.js +75 -27
  70. package/dist/lib/vite-plugin-zephyr-partial.mjs +64 -0
  71. package/dist/lib/vite-plugin-zephyr.d.mts +21 -0
  72. package/dist/lib/vite-plugin-zephyr.d.ts +16 -3
  73. package/dist/lib/vite-plugin-zephyr.js +685 -239
  74. package/dist/lib/vite-plugin-zephyr.mjs +662 -0
  75. package/dist/rslib-runtime.mjs +21 -0
  76. package/package.json +53 -44
  77. package/dist/index.js.map +0 -1
  78. package/dist/lib/internal/extract/extract-entrypoint.js.map +0 -1
  79. package/dist/lib/internal/extract/extract_mf_plugin.js.map +0 -1
  80. package/dist/lib/internal/extract/extract_vite_assets_map.js.map +0 -1
  81. package/dist/lib/internal/extract/load_public_dir.js.map +0 -1
  82. package/dist/lib/internal/extract/load_static_assets.js.map +0 -1
  83. package/dist/lib/internal/extract/load_static_entries.js.map +0 -1
  84. package/dist/lib/internal/mf-vite-etl/ensure_runtime_plugin.js.map +0 -1
  85. package/dist/lib/internal/mf-vite-etl/extract-mf-vite-remotes.js.map +0 -1
  86. package/dist/lib/internal/types/zephyr-internal-options.js.map +0 -1
  87. package/dist/lib/internal/utils/normalize-entrypoint.js.map +0 -1
  88. package/dist/lib/vite-plugin-zephyr-partial.js.map +0 -1
  89. package/dist/lib/vite-plugin-zephyr.js.map +0 -1
  90. package/dist/package.json +0 -85
  91. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,176 +1,85 @@
1
- /**
2
- * Zephyr Runtime Plugin for Module Federation. This file MUST stay in ESM
3
- * format (.mjs) for Vite/Rollup compatibility.
4
- *
5
- * Keep this runtime logic aligned with the xpack runtime plugin at
6
- * `libs/zephyr-xpack-internal/src/xpack-extract/runtime-plugin.ts`.
7
- *
8
- * We intentionally duplicate logic in both plugins for now. Once zephyr-agent
9
- * supports ESM runtime exports, we can move to a shared runtime
10
- * implementation.
11
- */
12
-
13
1
  const globalCacheKey = '__ZEPHYR_MANIFEST_CACHE__';
14
- const _global = typeof window !== 'undefined' ? window : globalThis;
15
-
2
+ const _global = "u" > typeof window ? window : globalThis;
16
3
  function getGlobalManifestCache() {
17
- if (!_global[globalCacheKey]) {
18
- _global[globalCacheKey] = new Map();
19
- }
20
- return _global[globalCacheKey];
4
+ if (!_global[globalCacheKey]) _global[globalCacheKey] = new Map();
5
+ return _global[globalCacheKey];
21
6
  }
22
-
23
7
  function getScriptBaseUrl() {
24
- if (typeof document !== 'undefined' && document.currentScript) {
25
- try {
26
- const src = document.currentScript.src;
27
- if (src) {
28
- const url = new URL(src);
29
- return `${url.protocol}//${url.host}`;
30
- }
31
- } catch {
32
- // Failed to parse URL, fall through to default.
33
- }
34
- }
35
-
36
- return '';
8
+ if ("u" > typeof document && document.currentScript) try {
9
+ const src = document.currentScript.src;
10
+ if (src) {
11
+ const url = new URL(src);
12
+ const routeBase = /^\/__zephyr\/v1\/[vte]\/[^/]+/.exec(url.pathname);
13
+ return routeBase ? `${url.origin}${routeBase[0]}` : url.origin;
14
+ }
15
+ } catch {}
16
+ return '';
37
17
  }
38
-
39
18
  function getRemotes(args) {
40
- if (Array.isArray(args?.options?.remotes)) {
41
- return args.options.remotes;
42
- }
43
-
44
- if (Array.isArray(args?.userOptions?.remotes)) {
45
- return args.userOptions.remotes;
46
- }
47
-
48
- return [];
19
+ if (Array.isArray(args?.options?.remotes)) return args.options.remotes;
20
+ if (Array.isArray(args?.userOptions?.remotes)) return args.userOptions.remotes;
21
+ return [];
49
22
  }
50
-
51
23
  export default function createZephyrRuntimePlugin(options = {}) {
52
- const defaultManifestUrl = `${getScriptBaseUrl()}/zephyr-manifest.json`;
53
- const { manifestUrl = defaultManifestUrl } = options;
54
-
55
- let processedRemotes;
56
-
57
- async function fetchManifest(url) {
58
- try {
59
- const response = await fetch(url);
60
-
61
- if (!response.ok) {
62
- return;
63
- }
64
-
65
- const manifest = await response.json().catch(() => undefined);
66
-
67
- if (!manifest) {
68
- console.error('[Zephyr] Failed to parse manifest JSON');
69
- return;
70
- }
71
-
72
- return manifest;
73
- } catch (error) {
74
- console.error('[Zephyr] Unexpected error fetching manifest:', error);
75
- return;
24
+ const defaultManifestUrl = `${getScriptBaseUrl()}/zephyr-manifest.json`;
25
+ const { manifestUrl = defaultManifestUrl } = options;
26
+ let processedRemotes;
27
+ async function fetchManifest(url) {
28
+ try {
29
+ const response = await fetch(url);
30
+ if (!response.ok) return;
31
+ const manifest = await response.json().catch(()=>void 0);
32
+ if (!manifest) return void console.error('[Zephyr] Failed to parse manifest JSON');
33
+ return manifest;
34
+ } catch (error) {
35
+ console.error('[Zephyr] Unexpected error fetching manifest:', error);
36
+ return;
37
+ }
76
38
  }
77
- }
78
-
79
- const manifestCache = getGlobalManifestCache();
80
-
81
- if (!manifestCache.has(manifestUrl)) {
82
- manifestCache.set(manifestUrl, fetchManifest(manifestUrl));
83
- }
84
-
85
- const zephyrManifestPromise = manifestCache.get(manifestUrl);
86
-
87
- return {
88
- name: 'zephyr-runtime-remote-resolver',
89
- async beforeRequest(args) {
90
- const zephyrManifest = await zephyrManifestPromise;
91
-
92
- if (!processedRemotes) {
93
- processedRemotes = identifyRemotes(args, zephyrManifest);
94
- }
95
-
96
- const remoteName =
97
- typeof args?.id === 'string' ? args.id.split('/')[0] : undefined;
98
-
99
- if (!remoteName || !processedRemotes[remoteName]) {
100
- return args;
101
- }
102
-
103
- const resolvedUrl = getResolvedRemoteUrl(processedRemotes[remoteName]);
104
- const remotes = getRemotes(args);
105
-
106
- const targetRemote = remotes.find(
107
- (remote) =>
108
- hasEntry(remote) &&
109
- (remote.name === remoteName || remote.alias === remoteName)
110
- );
111
-
112
- if (!targetRemote) {
113
- return args;
114
- }
115
-
116
- targetRemote.entry = resolvedUrl;
117
-
118
- return args;
119
- },
120
- };
39
+ const manifestCache = getGlobalManifestCache();
40
+ if (!manifestCache.has(manifestUrl)) manifestCache.set(manifestUrl, fetchManifest(manifestUrl));
41
+ const zephyrManifestPromise = manifestCache.get(manifestUrl);
42
+ return {
43
+ name: 'zephyr-runtime-remote-resolver',
44
+ async beforeRequest (args) {
45
+ const zephyrManifest = await zephyrManifestPromise;
46
+ if (!processedRemotes) processedRemotes = identifyRemotes(args, zephyrManifest);
47
+ const remoteName = 'string' == typeof args?.id ? args.id.split('/')[0] : void 0;
48
+ if (!remoteName || !processedRemotes[remoteName]) return args;
49
+ const resolvedUrl = getResolvedRemoteUrl(processedRemotes[remoteName]);
50
+ const remotes = getRemotes(args);
51
+ const targetRemote = remotes.find((remote)=>hasEntry(remote) && (remote.name === remoteName || remote.alias === remoteName));
52
+ if (!targetRemote) return args;
53
+ targetRemote.entry = resolvedUrl;
54
+ return args;
55
+ }
56
+ };
121
57
  }
122
-
123
58
  function identifyRemotes(args, zephyrManifest) {
124
- const identifiedRemotes = {};
125
-
126
- if (!zephyrManifest) {
127
- return identifiedRemotes;
128
- }
129
-
130
- const remotes = getRemotes(args);
131
- if (!remotes.length) {
59
+ const identifiedRemotes = {};
60
+ if (!zephyrManifest) return identifiedRemotes;
61
+ const remotes = getRemotes(args);
62
+ if (!remotes.length) return identifiedRemotes;
63
+ const dependencies = zephyrManifest.dependencies ?? {};
64
+ remotes.forEach((remote)=>{
65
+ const resolvedRemote = dependencies[remote.name] ?? dependencies[remote.alias ?? ''];
66
+ if (resolvedRemote) {
67
+ identifiedRemotes[remote.name] = resolvedRemote;
68
+ if (remote.alias && remote.alias !== remote.name) identifiedRemotes[remote.alias] = resolvedRemote;
69
+ }
70
+ });
132
71
  return identifiedRemotes;
133
- }
134
-
135
- const dependencies = zephyrManifest.dependencies ?? {};
136
-
137
- remotes.forEach((remote) => {
138
- const resolvedRemote =
139
- dependencies[remote.name] ?? dependencies[remote.alias ?? ''];
140
- if (resolvedRemote) {
141
- identifiedRemotes[remote.name] = resolvedRemote;
142
- if (remote.alias && remote.alias !== remote.name) {
143
- identifiedRemotes[remote.alias] = resolvedRemote;
144
- }
145
- }
146
- });
147
-
148
- return identifiedRemotes;
149
72
  }
150
-
151
73
  function hasEntry(remote) {
152
- return (
153
- remote !== null &&
154
- remote !== undefined &&
155
- typeof remote === 'object' &&
156
- 'entry' in remote &&
157
- typeof remote.entry === 'string'
158
- );
74
+ return null != remote && 'object' == typeof remote && 'entry' in remote && 'string' == typeof remote.entry;
159
75
  }
160
-
161
76
  function getResolvedRemoteUrl(resolvedRemote) {
162
- const _window = typeof window !== 'undefined' ? window : globalThis;
163
-
164
- const sessionEdgeURL = _window.sessionStorage?.getItem?.(
165
- resolvedRemote.application_uid
166
- );
167
-
168
- let edgeUrl = sessionEdgeURL ?? resolvedRemote.remote_entry_url;
169
-
170
- if (edgeUrl.indexOf('@') !== -1) {
171
- const [, url] = edgeUrl.split('@');
172
- edgeUrl = url;
173
- }
174
-
175
- return edgeUrl;
77
+ const _window = "u" > typeof window ? window : globalThis;
78
+ const sessionEdgeURL = _window.sessionStorage?.getItem?.(resolvedRemote.application_uid);
79
+ let edgeUrl = sessionEdgeURL ?? resolvedRemote.remote_entry_url;
80
+ if (-1 !== edgeUrl.indexOf('@')) {
81
+ const [, url] = edgeUrl.split('@');
82
+ edgeUrl = url;
83
+ }
84
+ return edgeUrl;
176
85
  }
@@ -0,0 +1,12 @@
1
+ import type { PartialAssetMapScope, ZephyrBuildTarget } from 'zephyr-agent';
2
+ export interface VitePartialBuildOptions {
3
+ /** Artifact family for this independent producer process. */
4
+ target?: ZephyrBuildTarget;
5
+ /** Shared by every producer and finalizer process for one logical build. */
6
+ invocationId?: string;
7
+ /** Rebuild generation within the invocation (default: 0). */
8
+ generation?: number;
9
+ }
10
+ export declare function resolveVitePartialBuildScope(options: VitePartialBuildOptions | undefined, env?: NodeJS.ProcessEnv): PartialAssetMapScope | undefined;
11
+ export declare function requireVitePartialBuildScope(options: VitePartialBuildOptions | undefined): PartialAssetMapScope;
12
+ //# sourceMappingURL=partial-build-scope.d.mts.map
@@ -0,0 +1,12 @@
1
+ import type { PartialAssetMapScope, ZephyrBuildTarget } from 'zephyr-agent';
2
+ export interface VitePartialBuildOptions {
3
+ /** Artifact family for this independent producer process. */
4
+ target?: ZephyrBuildTarget;
5
+ /** Shared by every producer and finalizer process for one logical build. */
6
+ invocationId?: string;
7
+ /** Rebuild generation within the invocation (default: 0). */
8
+ generation?: number;
9
+ }
10
+ export declare function resolveVitePartialBuildScope(options: VitePartialBuildOptions | undefined, env?: NodeJS.ProcessEnv): PartialAssetMapScope | undefined;
11
+ export declare function requireVitePartialBuildScope(options: VitePartialBuildOptions | undefined): PartialAssetMapScope;
12
+ //# sourceMappingURL=partial-build-scope.d.ts.map
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ requireVitePartialBuildScope: ()=>requireVitePartialBuildScope,
32
+ resolveVitePartialBuildScope: ()=>resolveVitePartialBuildScope
33
+ });
34
+ const external_zephyr_agent_namespaceObject = require("zephyr-agent");
35
+ function firstDefined(parts) {
36
+ return parts.every((part)=>!!part) ? parts.join(':') : void 0;
37
+ }
38
+ function resolveCiInvocationId(env) {
39
+ return firstDefined([
40
+ env['GITHUB_RUN_ID'],
41
+ env['GITHUB_RUN_ATTEMPT'] ?? '1',
42
+ env['GITHUB_JOB']
43
+ ]) ?? firstDefined([
44
+ env['CI_PIPELINE_ID'],
45
+ env['CI_JOB_ID']
46
+ ]) ?? firstDefined([
47
+ env['BUILDKITE_BUILD_ID'],
48
+ env['BUILDKITE_JOB_ID']
49
+ ]) ?? firstDefined([
50
+ env['CIRCLE_WORKFLOW_ID'],
51
+ env['CIRCLE_BUILD_NUM']
52
+ ]);
53
+ }
54
+ function resolveVitePartialBuildScope(options, env = process.env) {
55
+ const invocationId = options?.invocationId?.trim() || env['ZE_BUILD_INVOCATION_ID']?.trim() || resolveCiInvocationId(env);
56
+ if (!invocationId) return;
57
+ const generation = options?.generation ?? 0;
58
+ if (!Number.isSafeInteger(generation) || generation < 0) throw new external_zephyr_agent_namespaceObject.ZephyrError(external_zephyr_agent_namespaceObject.ZeErrors.ERR_DEPLOY_LOCAL_BUILD, {
59
+ message: 'Vite partial build generation must be a non-negative safe integer.'
60
+ });
61
+ return {
62
+ invocationId,
63
+ generation
64
+ };
65
+ }
66
+ function requireVitePartialBuildScope(options) {
67
+ const scope = resolveVitePartialBuildScope(options);
68
+ if (scope) return scope;
69
+ throw new external_zephyr_agent_namespaceObject.ZephyrError(external_zephyr_agent_namespaceObject.ZeErrors.ERR_DEPLOY_LOCAL_BUILD, {
70
+ message: "withZephyrPartial() requires a shared invocationId (or ZE_BUILD_INVOCATION_ID) so concurrent builds of the same application cannot mix outputs."
71
+ });
72
+ }
73
+ exports.requireVitePartialBuildScope = __webpack_exports__.requireVitePartialBuildScope;
74
+ exports.resolveVitePartialBuildScope = __webpack_exports__.resolveVitePartialBuildScope;
75
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
76
+ "requireVitePartialBuildScope",
77
+ "resolveVitePartialBuildScope"
78
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
79
+ Object.defineProperty(exports, '__esModule', {
80
+ value: true
81
+ });
82
+
83
+ //# sourceMappingURL=partial-build-scope.js.map
@@ -0,0 +1,43 @@
1
+ import "node:module";
2
+ import { ZeErrors, ZephyrError } from "zephyr-agent";
3
+ function firstDefined(parts) {
4
+ return parts.every((part)=>!!part) ? parts.join(':') : void 0;
5
+ }
6
+ function resolveCiInvocationId(env) {
7
+ return firstDefined([
8
+ env['GITHUB_RUN_ID'],
9
+ env['GITHUB_RUN_ATTEMPT'] ?? '1',
10
+ env['GITHUB_JOB']
11
+ ]) ?? firstDefined([
12
+ env['CI_PIPELINE_ID'],
13
+ env['CI_JOB_ID']
14
+ ]) ?? firstDefined([
15
+ env['BUILDKITE_BUILD_ID'],
16
+ env['BUILDKITE_JOB_ID']
17
+ ]) ?? firstDefined([
18
+ env['CIRCLE_WORKFLOW_ID'],
19
+ env['CIRCLE_BUILD_NUM']
20
+ ]);
21
+ }
22
+ function resolveVitePartialBuildScope(options, env = process.env) {
23
+ const invocationId = options?.invocationId?.trim() || env['ZE_BUILD_INVOCATION_ID']?.trim() || resolveCiInvocationId(env);
24
+ if (!invocationId) return;
25
+ const generation = options?.generation ?? 0;
26
+ if (!Number.isSafeInteger(generation) || generation < 0) throw new ZephyrError(ZeErrors.ERR_DEPLOY_LOCAL_BUILD, {
27
+ message: 'Vite partial build generation must be a non-negative safe integer.'
28
+ });
29
+ return {
30
+ invocationId,
31
+ generation
32
+ };
33
+ }
34
+ function requireVitePartialBuildScope(options) {
35
+ const scope = resolveVitePartialBuildScope(options);
36
+ if (scope) return scope;
37
+ throw new ZephyrError(ZeErrors.ERR_DEPLOY_LOCAL_BUILD, {
38
+ message: "withZephyrPartial() requires a shared invocationId (or ZE_BUILD_INVOCATION_ID) so concurrent builds of the same application cannot mix outputs."
39
+ });
40
+ }
41
+ export { requireVitePartialBuildScope, resolveVitePartialBuildScope };
42
+
43
+ //# sourceMappingURL=partial-build-scope.mjs.map
@@ -0,0 +1,13 @@
1
+ import type { ZephyrBuildTarget } from 'zephyr-agent';
2
+ import type { ZephyrOutputBundle } from './zephyr-output.mjs';
3
+ export interface ZephyrInternalOptions {
4
+ root: string;
5
+ outDir: string;
6
+ /** Artifact family determines whether filesystem reads must preserve ignored paths. */
7
+ target?: ZephyrBuildTarget;
8
+ configFile?: string;
9
+ publicDir?: string;
10
+ dir?: string;
11
+ assets?: ZephyrOutputBundle;
12
+ }
13
+ //# sourceMappingURL=zephyr-internal-options.d.mts.map
@@ -1,9 +1,13 @@
1
- import type { OutputBundle } from 'rollup';
1
+ import type { ZephyrBuildTarget } from 'zephyr-agent';
2
+ import type { ZephyrOutputBundle } from './zephyr-output';
2
3
  export interface ZephyrInternalOptions {
3
4
  root: string;
4
5
  outDir: string;
6
+ /** Artifact family determines whether filesystem reads must preserve ignored paths. */
7
+ target?: ZephyrBuildTarget;
5
8
  configFile?: string;
6
9
  publicDir?: string;
7
10
  dir?: string;
8
- assets?: OutputBundle;
11
+ assets?: ZephyrOutputBundle;
9
12
  }
13
+ //# sourceMappingURL=zephyr-internal-options.d.ts.map
@@ -1,3 +1,20 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
19
+
3
20
  //# sourceMappingURL=zephyr-internal-options.js.map
@@ -0,0 +1 @@
1
+ import "node:module";
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The output fields Zephyr consumes from both Rollup and Rolldown. Keeping this boundary
3
+ * structural lets one plugin build support Vite 5-8.
4
+ */
5
+ export interface ZephyrOutputChunk {
6
+ type: 'chunk';
7
+ code: string;
8
+ fileName: string;
9
+ name?: string;
10
+ }
11
+ export interface ZephyrOutputAsset {
12
+ type: 'asset';
13
+ source: string | Uint8Array;
14
+ fileName: string;
15
+ name?: string;
16
+ names?: string[];
17
+ needsCodeReference?: boolean;
18
+ originalFileName?: string | null;
19
+ originalFileNames?: string[] | null;
20
+ }
21
+ export type ZephyrOutput = ZephyrOutputChunk | ZephyrOutputAsset;
22
+ export type ZephyrOutputBundle = Record<string, ZephyrOutput>;
23
+ //# sourceMappingURL=zephyr-output.d.mts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The output fields Zephyr consumes from both Rollup and Rolldown. Keeping this boundary
3
+ * structural lets one plugin build support Vite 5-8.
4
+ */
5
+ export interface ZephyrOutputChunk {
6
+ type: 'chunk';
7
+ code: string;
8
+ fileName: string;
9
+ name?: string;
10
+ }
11
+ export interface ZephyrOutputAsset {
12
+ type: 'asset';
13
+ source: string | Uint8Array;
14
+ fileName: string;
15
+ name?: string;
16
+ names?: string[];
17
+ needsCodeReference?: boolean;
18
+ originalFileName?: string | null;
19
+ originalFileNames?: string[] | null;
20
+ }
21
+ export type ZephyrOutput = ZephyrOutputChunk | ZephyrOutputAsset;
22
+ export type ZephyrOutputBundle = Record<string, ZephyrOutput>;
23
+ //# sourceMappingURL=zephyr-output.d.ts.map
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
19
+
20
+ //# sourceMappingURL=zephyr-output.js.map
@@ -0,0 +1 @@
1
+ import "node:module";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Normalizes entrypoint paths to be relative and posix-style.
3
+ *
4
+ * - Converts Windows backslashes to forward slashes
5
+ * - Removes leading './', '/', and 'dist/' prefixes
6
+ *
7
+ * @param entrypoint - The raw entrypoint path
8
+ * @returns Normalized entrypoint path relative to build output
9
+ */
10
+ export declare function normalizeEntrypoint(entrypoint: string): string;
11
+ //# sourceMappingURL=normalize-entrypoint.d.mts.map
@@ -8,3 +8,4 @@
8
8
  * @returns Normalized entrypoint path relative to build output
9
9
  */
10
10
  export declare function normalizeEntrypoint(entrypoint: string): string;
11
+ //# sourceMappingURL=normalize-entrypoint.d.ts.map
@@ -1,31 +1,49 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeEntrypoint = normalizeEntrypoint;
4
- /**
5
- * Normalizes entrypoint paths to be relative and posix-style.
6
- *
7
- * - Converts Windows backslashes to forward slashes
8
- * - Removes leading './', '/', and 'dist/' prefixes
9
- *
10
- * @param entrypoint - The raw entrypoint path
11
- * @returns Normalized entrypoint path relative to build output
12
- */
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
13
30
  function normalizeEntrypoint(entrypoint) {
14
31
  let normalized = entrypoint.trim();
15
- // Normalize path separators to forward slashes (web/posix style)
16
32
  normalized = normalized.split('\\').join('/');
17
- // Remove leading './'
18
- while (normalized.startsWith('./')) {
19
- normalized = normalized.slice(2);
20
- }
21
- // Remove leading '/'
22
- while (normalized.startsWith('/')) {
23
- normalized = normalized.slice(1);
24
- }
25
- // Remove 'dist/' prefix if present
26
- if (normalized.startsWith('dist/')) {
27
- normalized = normalized.slice('dist/'.length);
28
- }
33
+ while(normalized.startsWith('./'))normalized = normalized.slice(2);
34
+ while(normalized.startsWith('/'))normalized = normalized.slice(1);
35
+ if (normalized.startsWith('dist/')) normalized = normalized.slice(5);
29
36
  return normalized;
30
37
  }
38
+ __webpack_require__.d(__webpack_exports__, {
39
+ normalizeEntrypoint: ()=>normalizeEntrypoint
40
+ });
41
+ exports.normalizeEntrypoint = __webpack_exports__.normalizeEntrypoint;
42
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
43
+ "normalizeEntrypoint"
44
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
45
+ Object.defineProperty(exports, '__esModule', {
46
+ value: true
47
+ });
48
+
31
49
  //# sourceMappingURL=normalize-entrypoint.js.map
@@ -0,0 +1,12 @@
1
+ import "node:module";
2
+ function normalizeEntrypoint(entrypoint) {
3
+ let normalized = entrypoint.trim();
4
+ normalized = normalized.split('\\').join('/');
5
+ while(normalized.startsWith('./'))normalized = normalized.slice(2);
6
+ while(normalized.startsWith('/'))normalized = normalized.slice(1);
7
+ if (normalized.startsWith('dist/')) normalized = normalized.slice(5);
8
+ return normalized;
9
+ }
10
+ export { normalizeEntrypoint };
11
+
12
+ //# sourceMappingURL=normalize-entrypoint.mjs.map
@@ -0,0 +1,10 @@
1
+ /** Normalize emitted paths without importing Vite's ESM-only runtime. */
2
+ export declare function normalizeVitePath(pathname: string): string;
3
+ /**
4
+ * Filesystem walkers return paths using the host separator. Keep that portable
5
+ * normalization separate from logical Rollup/Vite bundle keys: on POSIX, a backslash in a
6
+ * bundle key is an alias character rather than a native separator and TAP must reject it
7
+ * instead of silently changing a descriptor-locked path.
8
+ */
9
+ export declare function normalizeFilesystemVitePath(pathname: string): string;
10
+ //# sourceMappingURL=normalize-vite-path.d.mts.map
@@ -0,0 +1,10 @@
1
+ /** Normalize emitted paths without importing Vite's ESM-only runtime. */
2
+ export declare function normalizeVitePath(pathname: string): string;
3
+ /**
4
+ * Filesystem walkers return paths using the host separator. Keep that portable
5
+ * normalization separate from logical Rollup/Vite bundle keys: on POSIX, a backslash in a
6
+ * bundle key is an alias character rather than a native separator and TAP must reject it
7
+ * instead of silently changing a descriptor-locked path.
8
+ */
9
+ export declare function normalizeFilesystemVitePath(pathname: string): string;
10
+ //# sourceMappingURL=normalize-vite-path.d.ts.map