@flight-framework/bundler-flightpack 0.1.10 → 0.1.12
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 +21 -0
- package/dist/index.js +53 -28
- package/dist/index.js.map +1 -1
- package/package.json +56 -56
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Flight Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -115,44 +115,68 @@ function flightpack(options = {}) {
|
|
|
115
115
|
const timer = createTimer();
|
|
116
116
|
try {
|
|
117
117
|
const minifyOption = typeof options.minify === "boolean" ? options.minify : typeof config.build.minify === "boolean" ? config.build.minify : true;
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
entry:
|
|
126
|
-
|
|
118
|
+
const builtins = native.getNodeBuiltins();
|
|
119
|
+
const nodeExternal = [.../* @__PURE__ */ new Set([...options.external || [], ...builtins])];
|
|
120
|
+
const allEntries = await getEntryPoints(config);
|
|
121
|
+
const serverEntries = allEntries.filter((e) => e.includes("entry-server"));
|
|
122
|
+
const clientEntries = allEntries.filter((e) => !e.includes("entry-server"));
|
|
123
|
+
const baseOutDir = resolvePath(config.root, config.build.outDir);
|
|
124
|
+
const baseOptions = {
|
|
125
|
+
entry: [],
|
|
126
|
+
// Overridden per environment
|
|
127
|
+
outDir: baseOutDir,
|
|
127
128
|
root: config.root,
|
|
128
129
|
minify: minifyOption,
|
|
129
130
|
sourcemap: typeof options.sourcemap === "boolean" ? options.sourcemap : typeof config.build.sourcemap === "boolean" ? config.build.sourcemap : true,
|
|
130
131
|
rsc: options.rsc ?? true,
|
|
131
|
-
// Extended options (2026 Parity)
|
|
132
132
|
splitting: options.splitting ?? true,
|
|
133
133
|
treeshake: options.treeshake ?? true,
|
|
134
|
-
platform,
|
|
135
|
-
|
|
136
|
-
noExternal: options.noExternal,
|
|
134
|
+
platform: "neutral",
|
|
135
|
+
// Overridden
|
|
137
136
|
format: options.format ?? "esm",
|
|
138
|
-
target: options.target ?? "
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
target: options.target ?? "es2022",
|
|
138
|
+
define: options.define
|
|
139
|
+
};
|
|
140
|
+
const environments = {
|
|
141
|
+
client: {
|
|
142
|
+
entry: clientEntries,
|
|
143
|
+
platform: "browser",
|
|
144
|
+
outDir: baseOutDir,
|
|
145
|
+
// Client root
|
|
146
|
+
external: options.external
|
|
147
|
+
},
|
|
148
|
+
// Only add SSR environment if server entries exist
|
|
149
|
+
...serverEntries.length > 0 ? {
|
|
150
|
+
ssr: {
|
|
151
|
+
entry: serverEntries,
|
|
152
|
+
platform: "node",
|
|
153
|
+
outDir: resolvePath(baseOutDir, "server"),
|
|
154
|
+
external: nodeExternal
|
|
155
|
+
}
|
|
156
|
+
} : {}
|
|
143
157
|
};
|
|
144
|
-
const result = await native.
|
|
145
|
-
const files =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
const result = await native.buildMultiEnvironment(baseOptions, environments);
|
|
159
|
+
const files = [
|
|
160
|
+
...result.client.chunks.map((chunk) => ({
|
|
161
|
+
path: chunk.fileName,
|
|
162
|
+
size: chunk.size,
|
|
163
|
+
type: chunk.chunkType,
|
|
164
|
+
isDynamicEntry: false
|
|
165
|
+
})),
|
|
166
|
+
...result.ssr?.chunks.map((chunk) => ({
|
|
167
|
+
path: `server/${chunk.fileName}`,
|
|
168
|
+
// Prefix for clarity if needed, though fileName usually contains path
|
|
169
|
+
size: chunk.size,
|
|
170
|
+
type: chunk.chunkType,
|
|
171
|
+
isDynamicEntry: false
|
|
172
|
+
})) || []
|
|
173
|
+
];
|
|
174
|
+
const totalSize = result.client.totalSize + (result.ssr?.totalSize || 0);
|
|
151
175
|
const buildResult = {
|
|
152
|
-
outDir: result.outputDir,
|
|
176
|
+
outDir: result.client.outputDir,
|
|
153
177
|
duration: timer.stop(),
|
|
154
178
|
files,
|
|
155
|
-
totalSize
|
|
179
|
+
totalSize,
|
|
156
180
|
errors: [],
|
|
157
181
|
warnings: [],
|
|
158
182
|
success: true
|
|
@@ -297,6 +321,8 @@ async function getEntryPoints(config) {
|
|
|
297
321
|
// Standard Flight entries
|
|
298
322
|
"src/entry-client.tsx",
|
|
299
323
|
"src/entry-client.ts",
|
|
324
|
+
"src/entry-server.tsx",
|
|
325
|
+
"src/entry-server.ts",
|
|
300
326
|
// Vite-style entries
|
|
301
327
|
"src/main.tsx",
|
|
302
328
|
"src/main.ts",
|
|
@@ -313,7 +339,6 @@ async function getEntryPoints(config) {
|
|
|
313
339
|
const fullPath = join(config.root, entry);
|
|
314
340
|
if (existsSync(fullPath)) {
|
|
315
341
|
entries.push(entry);
|
|
316
|
-
break;
|
|
317
342
|
}
|
|
318
343
|
}
|
|
319
344
|
if (entries.length === 0) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\r\n * @flight-framework/bundler-flightpack\r\n * \r\n * FlightPack native Rust bundler adapter for Flight Framework.\r\n * Wraps the native Rust bundler for maximum performance.\r\n * \r\n * @example\r\n * ```typescript\r\n * // In flight.config.ts\r\n * import { defineConfig } from '@flight-framework/core';\r\n * import { flightpack } from '@flight-framework/bundler-flightpack';\r\n * \r\n * export default defineConfig({\r\n * bundler: flightpack(),\r\n * });\r\n * ```\r\n * \r\n * @packageDocumentation\r\n */\r\n\r\nimport type {\r\n BundlerAdapter,\r\n DevServer,\r\n BuildResult,\r\n PreviewServer,\r\n OutputFile,\r\n TransformOptions,\r\n TransformResult as BundlerTransformResult,\r\n} from '@flight-framework/bundler';\r\nimport {\r\n registerAdapter,\r\n setDefaultAdapter,\r\n createTimer,\r\n createBuildError,\r\n logDevServerStarted,\r\n logBuildSuccess,\r\n logBuildError,\r\n resolvePath,\r\n cleanDirectory,\r\n} from '@flight-framework/bundler';\r\nimport type { FlightConfig } from '@flight-framework/core/config';\r\nimport type {\r\n FlightPackAdapterOptions,\r\n} from './types.js';\r\n\r\n// Re-export types\r\nexport * from './types.js';\r\n\r\n// ============================================================================\r\n// Constants\r\n// ============================================================================\r\n\r\nconst ADAPTER_NAME = 'flight-flightpack';\r\nconst BUNDLER_NAME = 'flightpack';\r\n\r\n// ============================================================================\r\n// Native Binding Loader\r\n// ============================================================================\r\n\r\n/**\r\n * Native binding interface matching the NAPI exports\r\n */\r\ninterface NativeBinding {\r\n FlightPack: new (options?: FlightPackNativeOptions | undefined | null) => {\r\n build(): Promise<NativeBuildResult>;\r\n };\r\n build: (options: FlightPackNativeOptions) => Promise<NativeBuildResult>;\r\n transform: (code: string, filename: string, options?: NativeTransformOptions | undefined | null) => Promise<NativeTransformResult>;\r\n version: () => string;\r\n // Dev Server\r\n startDevServer: (options?: NativeDevServerOptions | undefined | null) => Promise<NativeDevServerResult>;\r\n stopDevServer: () => Promise<boolean>;\r\n isDevServerRunning: () => boolean;\r\n // HMR\r\n sendHmrUpdate: (modules: NativeHMRModuleUpdate[]) => boolean;\r\n sendHmrError: (message: string) => boolean;\r\n // File Watcher\r\n watchFiles: (options: NativeWatcherOptions, callback: (event: NativeWatchEvent) => void) => NativeWatchHandle;\r\n // CSS Processing\r\n transformCss: (code: string, filename: string, options?: NativeCssTransformOptions | undefined | null) => NativeCssTransformResult;\r\n minifyCss: (code: string, filename: string) => string;\r\n transformCssModule: (code: string, filename: string) => NativeCssModuleResult;\r\n\r\n // ============================================================================\r\n // Extended NAPI Exports (2026 Parity)\r\n // ============================================================================\r\n\r\n // SSG/ISR\r\n generateSsg: (options: NativeSSGOptions) => Promise<NativeSSGResult>;\r\n\r\n // Multi-Environment Builds\r\n buildMultiEnvironment: (baseOptions: FlightPackNativeOptions, environments: NativeEnvironmentsConfig) => Promise<NativeMultiEnvironmentResult>;\r\n\r\n // Externals Detection\r\n isNodeBuiltin: (moduleId: string) => boolean;\r\n getNodeBuiltins: () => string[];\r\n getNodeBuiltinsPrefixed: () => string[];\r\n isBareImport: (moduleId: string) => boolean;\r\n isEdgeCompatible: (moduleId: string) => boolean;\r\n getEdgeIncompatibleModules: () => string[];\r\n getPlatformConditions: (platform: string) => string[];\r\n}\r\n\r\n/**\r\n * Native CSS transform options\r\n */\r\ninterface NativeCssTransformOptions {\r\n minify?: boolean;\r\n cssModules?: boolean;\r\n cssModulesPattern?: string;\r\n dashedIdents?: boolean;\r\n sourcemap?: boolean;\r\n browserTargets?: {\r\n chrome?: number;\r\n firefox?: number;\r\n safari?: number;\r\n edge?: number;\r\n };\r\n}\r\n\r\n/**\r\n * Native CSS transform result\r\n */\r\ninterface NativeCssTransformResult {\r\n code: string;\r\n map?: string | null;\r\n exports: Array<{\r\n original: string;\r\n hashed: string;\r\n isReferenced: boolean;\r\n composes: string[];\r\n }>;\r\n success: boolean;\r\n}\r\n\r\n/**\r\n * Native CSS module result\r\n */\r\ninterface NativeCssModuleResult {\r\n code: string;\r\n classMap: Array<{\r\n original: string;\r\n hashed: string;\r\n }>;\r\n}\r\n\r\n/**\r\n * Platform type\r\n */\r\ntype NativePlatform = 'browser' | 'node' | 'edge' | 'neutral';\r\n\r\n/**\r\n * Extended NativeBinding interface with universal support\r\n */\r\ninterface NativeBindingExtended extends NativeBinding {\r\n // Externals Detection\r\n isNodeBuiltin: (moduleId: string) => boolean;\r\n getNodeBuiltins: () => string[];\r\n getNodeBuiltinsPrefixed: () => string[];\r\n isBareImport: (moduleId: string) => boolean;\r\n isEdgeCompatible: (moduleId: string) => boolean;\r\n getEdgeIncompatibleModules: () => string[];\r\n getPlatformConditions: (platform: string) => string[];\r\n}\r\n\r\n\r\n/**\r\n * Native dev server options\r\n */\r\ninterface NativeDevServerOptions {\r\n port?: number;\r\n publicDir?: string;\r\n outDir?: string;\r\n hmr?: boolean;\r\n root?: string;\r\n}\r\n\r\n/**\r\n * Native dev server result\r\n */\r\ninterface NativeDevServerResult {\r\n url: string;\r\n port: number;\r\n hmr: boolean;\r\n}\r\n\r\n/**\r\n * Native HMR module update\r\n */\r\ninterface NativeHMRModuleUpdate {\r\n id: string;\r\n path: string;\r\n code: string;\r\n deps?: string[] | null;\r\n accept: boolean;\r\n}\r\n\r\n/**\r\n * Native watcher options\r\n */\r\ninterface NativeWatcherOptions {\r\n paths: string[];\r\n extensions?: string[] | null;\r\n debounceMs?: number | null;\r\n}\r\n\r\n/**\r\n * Native watch event\r\n */\r\ninterface NativeWatchEvent {\r\n paths: string[];\r\n eventType: string;\r\n}\r\n\r\n/**\r\n * Native watch handle\r\n */\r\ninterface NativeWatchHandle {\r\n stop(): boolean;\r\n}\r\n\r\n/**\r\n * Native options matching Rust struct\r\n */\r\ninterface FlightPackNativeOptions {\r\n entry: string[];\r\n outDir: string;\r\n root?: string;\r\n minify?: boolean;\r\n sourcemap?: boolean;\r\n rsc?: boolean;\r\n\r\n // Extended options (2026 Parity)\r\n splitting?: boolean;\r\n treeshake?: boolean;\r\n platform?: string;\r\n external?: string[];\r\n noExternal?: string[];\r\n format?: string;\r\n target?: string;\r\n serverActions?: boolean;\r\n define?: Record<string, string>;\r\n conditions?: string[];\r\n nodeTarget?: string;\r\n}\r\n\r\n/**\r\n * Native SSG options\r\n */\r\ninterface NativeSSGPageConfig {\r\n path: string;\r\n params?: Record<string, string>[];\r\n fallback?: string;\r\n revalidate?: number;\r\n}\r\n\r\ninterface NativeSSGOptions {\r\n pages: NativeSSGPageConfig[];\r\n outDir?: string;\r\n ssrBundle?: string;\r\n defaultRevalidate?: number;\r\n concurrency?: number;\r\n trailingSlash?: boolean;\r\n}\r\n\r\ninterface NativeSSGGeneratedPage {\r\n path: string;\r\n filePath: string;\r\n revalidate?: number;\r\n size: number;\r\n}\r\n\r\ninterface NativeSSGResult {\r\n pages: NativeSSGGeneratedPage[];\r\n durationMs: number;\r\n totalSize: number;\r\n isrPages: string[];\r\n errors: string[];\r\n}\r\n\r\n/**\r\n * Native Multi-Environment types\r\n */\r\ninterface NativeEnvironmentOptions {\r\n platform?: string;\r\n nodeTarget?: string;\r\n conditions?: string[];\r\n external?: string[];\r\n noExternal?: string[];\r\n outDir?: string;\r\n entry?: string[];\r\n minify?: boolean;\r\n sourcemap?: boolean;\r\n}\r\n\r\ninterface NativeEnvironmentsConfig {\r\n client: NativeEnvironmentOptions;\r\n ssr?: NativeEnvironmentOptions;\r\n edge?: NativeEnvironmentOptions;\r\n}\r\n\r\ninterface NativeMultiEnvironmentResult {\r\n client: NativeBuildResult;\r\n ssr?: NativeBuildResult;\r\n edge?: NativeBuildResult;\r\n totalDurationMs: number;\r\n}\r\n\r\n/**\r\n * Native build result matching Rust struct\r\n */\r\ninterface NativeBuildResult {\r\n outputDir: string;\r\n durationMs: number;\r\n totalSize: number;\r\n chunks: NativeChunkInfo[];\r\n}\r\n\r\n/**\r\n * Native chunk info matching Rust struct\r\n */\r\ninterface NativeChunkInfo {\r\n fileName: string;\r\n chunkType: string;\r\n size: number;\r\n}\r\n\r\n/**\r\n * Native transform options matching Rust struct\r\n */\r\ninterface NativeTransformOptions {\r\n sourcemap?: boolean;\r\n minify?: boolean;\r\n target?: string;\r\n jsxFactory?: string;\r\n jsxFragment?: string;\r\n}\r\n\r\n/**\r\n * Native transform result matching Rust struct\r\n */\r\ninterface NativeTransformResult {\r\n code: string;\r\n map?: string | null;\r\n success: boolean;\r\n}\r\n\r\n/**\r\n * Lazy-loaded native FlightPack binding\r\n * This defers loading until actually needed, improving startup time\r\n */\r\nlet nativeBinding: NativeBinding | null = null;\r\n\r\nasync function loadNativeBinding(): Promise<NativeBinding> {\r\n if (nativeBinding) return nativeBinding;\r\n\r\n try {\r\n // Use createRequire for ESM compatibility with native modules\r\n // Native .node files require \"require()\" which isn't available in ESM\r\n const { createRequire } = await import('node:module');\r\n const require = createRequire(import.meta.url);\r\n const native = require('@flight-framework/flightpack') as NativeBinding;\r\n nativeBinding = native;\r\n return native;\r\n } catch (error) {\r\n throw new Error(\r\n `Failed to load FlightPack native binding. ` +\r\n `Make sure @flight-framework/flightpack is installed.\\n` +\r\n `Original error: ${error}`\r\n );\r\n }\r\n}\r\n\r\n// ============================================================================\r\n// Adapter Implementation\r\n// ============================================================================\r\n\r\n/**\r\n * Create a FlightPack bundler adapter\r\n * \r\n * FlightPack is a native Rust bundler that provides:\r\n * - 1,874+ files/second processing speed\r\n * - Zero-config TypeScript/TSX support via Oxc\r\n * - React Server Components (RSC) support\r\n * - Tree shaking and code splitting\r\n * - Hot Module Replacement (HMR)\r\n * \r\n * @param options - FlightPack adapter options\r\n * @returns A BundlerAdapter instance\r\n * \r\n * @example\r\n * ```typescript\r\n * import { flightpack } from '@flight-framework/bundler-flightpack';\r\n * \r\n * const adapter = flightpack({\r\n * minify: true,\r\n * sourcemap: true,\r\n * rsc: true,\r\n * });\r\n * ```\r\n */\r\nexport function flightpack(options: FlightPackAdapterOptions = {}): BundlerAdapter {\r\n const adapter: BundlerAdapter = {\r\n name: ADAPTER_NAME,\r\n bundler: BUNDLER_NAME,\r\n options,\r\n\r\n async createDevServer(config: FlightConfig): Promise<DevServer> {\r\n const native = await loadNativeBinding();\r\n\r\n // Internal port for transform API (CLI will proxy to this)\r\n const internalPort = (config.dev.port ?? 5173) + 1000;\r\n const host = config.dev.host ?? 'localhost';\r\n const https = config.dev.https === true;\r\n\r\n console.log('[Bundler] JS Root:', config.root);\r\n console.log('[Bundler] Resolved Public Dir:', resolvePath(config.root, 'public'));\r\n console.log('[Bundler] Internal Port:', internalPort);\r\n\r\n // Use native Rust dev server with Axum and WebSocket HMR\r\n const result = await native.startDevServer({\r\n port: internalPort,\r\n publicDir: resolvePath(config.root, 'public'),\r\n outDir: resolvePath(config.root, config.build.outDir),\r\n hmr: options.hmr ?? true,\r\n root: config.root,\r\n });\r\n\r\n logDevServerStarted(result.url, 'FlightPack');\r\n\r\n // Set up file watcher for HMR updates\r\n let watchHandle: NativeWatchHandle | undefined;\r\n if (result.hmr) {\r\n try {\r\n watchHandle = native.watchFiles(\r\n {\r\n paths: [resolvePath(config.root, 'src')],\r\n extensions: ['ts', 'tsx', 'js', 'jsx', 'css'],\r\n debounceMs: 100,\r\n },\r\n async (event: NativeWatchEvent) => {\r\n // Transform changed files and send HMR updates\r\n const updates: NativeHMRModuleUpdate[] = [];\r\n\r\n for (const filePath of event.paths) {\r\n try {\r\n const { readFile } = await import('node:fs/promises');\r\n const source = await readFile(filePath, 'utf-8');\r\n const transformed = await native.transform(source, filePath);\r\n\r\n if (transformed.success) {\r\n updates.push({\r\n id: filePath,\r\n path: filePath,\r\n code: transformed.code,\r\n accept: true,\r\n deps: [],\r\n });\r\n }\r\n } catch (error) {\r\n native.sendHmrError(`Failed to transform ${filePath}: ${error}`);\r\n }\r\n }\r\n\r\n if (updates.length > 0) {\r\n native.sendHmrUpdate(updates);\r\n }\r\n }\r\n );\r\n } catch (error) {\r\n console.warn('[FlightPack] File watcher failed to start:', error);\r\n }\r\n }\r\n\r\n return {\r\n url: result.url,\r\n port: result.port,\r\n host: host as string,\r\n https,\r\n async close() {\r\n // Stop file watcher\r\n if (watchHandle) {\r\n watchHandle.stop();\r\n }\r\n // Stop native dev server\r\n await native.stopDevServer();\r\n },\r\n restart: undefined,\r\n reload: undefined,\r\n hmrUpdate: undefined,\r\n printUrls() {\r\n console.log(` ⚡ FlightPack Dev Server`);\r\n console.log(` ➜ Local: ${result.url}`);\r\n if (result.hmr) {\r\n console.log(` ➜ HMR: enabled (WebSocket)`);\r\n }\r\n },\r\n };\r\n },\r\n\r\n async build(config: FlightConfig): Promise<BuildResult> {\r\n const native = await loadNativeBinding();\r\n const timer = createTimer();\r\n\r\n try {\r\n // Build FlightPack options from config\r\n const minifyOption = typeof options.minify === 'boolean'\r\n ? options.minify\r\n : typeof config.build.minify === 'boolean'\r\n ? config.build.minify\r\n : true;\r\n\r\n // Determine platform\r\n const platform = options.platform ?? 'browser';\r\n\r\n // Auto-externalize Node.js builtins for Node platform\r\n let external = options.external || [];\r\n if (platform === 'node') {\r\n const builtins = native.getNodeBuiltins();\r\n external = [...new Set([...external, ...builtins])];\r\n }\r\n\r\n const flightpackOptions: FlightPackNativeOptions = {\r\n entry: await getEntryPoints(config),\r\n outDir: resolvePath(config.root, config.build.outDir),\r\n root: config.root,\r\n minify: minifyOption,\r\n sourcemap: typeof options.sourcemap === 'boolean'\r\n ? options.sourcemap\r\n : typeof config.build.sourcemap === 'boolean'\r\n ? config.build.sourcemap\r\n : true,\r\n rsc: options.rsc ?? true,\r\n // Extended options (2026 Parity)\r\n splitting: options.splitting ?? true,\r\n treeshake: options.treeshake ?? true,\r\n platform,\r\n external,\r\n noExternal: options.noExternal,\r\n format: options.format ?? 'esm',\r\n target: options.target ?? 'es2024',\r\n serverActions: options.serverActions ?? true,\r\n define: options.define,\r\n conditions: options.conditions,\r\n nodeTarget: options.nodeTarget,\r\n };\r\n\r\n // Run the native build\r\n const result = await native.build(flightpackOptions);\r\n\r\n // Convert to BundlerAdapter result format\r\n const files: OutputFile[] = result.chunks.map((chunk: NativeChunkInfo) => ({\r\n path: chunk.fileName,\r\n size: chunk.size,\r\n type: chunk.chunkType as 'entry' | 'chunk' | 'asset',\r\n isDynamicEntry: false,\r\n }));\r\n\r\n const buildResult: BuildResult = {\r\n outDir: result.outputDir,\r\n duration: timer.stop(),\r\n files,\r\n totalSize: result.totalSize,\r\n errors: [],\r\n warnings: [],\r\n success: true,\r\n };\r\n\r\n logBuildSuccess(buildResult);\r\n return buildResult;\r\n\r\n } catch (error) {\r\n const buildResult: BuildResult = {\r\n outDir: resolvePath(config.root, config.build.outDir),\r\n duration: timer.stop(),\r\n files: [],\r\n totalSize: 0,\r\n errors: [createBuildError(error)],\r\n warnings: [],\r\n success: false,\r\n };\r\n\r\n logBuildError(buildResult);\r\n return buildResult;\r\n }\r\n },\r\n\r\n async preview(config: FlightConfig): Promise<PreviewServer> {\r\n const { createServer } = await import('node:http');\r\n const { readFile, stat } = await import('node:fs/promises');\r\n const { join, extname } = await import('node:path');\r\n\r\n const outDir = resolvePath(config.root, config.build.outDir);\r\n const port = 4173;\r\n const host = 'localhost';\r\n const url = `http://${host}:${port}`;\r\n\r\n const mimeTypes: Record<string, string> = {\r\n '.html': 'text/html',\r\n '.js': 'text/javascript',\r\n '.css': 'text/css',\r\n '.json': 'application/json',\r\n };\r\n\r\n const server = createServer(async (req, res) => {\r\n let urlPath = req.url === '/' ? '/index.html' : req.url!;\r\n const filePath = join(outDir, urlPath);\r\n\r\n try {\r\n const content = await readFile(filePath);\r\n const ext = extname(filePath);\r\n res.setHeader('Content-Type', mimeTypes[ext] || 'application/octet-stream');\r\n res.writeHead(200);\r\n res.end(content);\r\n } catch {\r\n // Try with .html extension\r\n try {\r\n const htmlPath = filePath.endsWith('.html') ? filePath : `${filePath}.html`;\r\n const content = await readFile(htmlPath);\r\n res.setHeader('Content-Type', 'text/html');\r\n res.writeHead(200);\r\n res.end(content);\r\n } catch {\r\n res.writeHead(404);\r\n res.end('Not Found');\r\n }\r\n }\r\n });\r\n\r\n server.listen(port, host);\r\n\r\n return {\r\n url,\r\n port,\r\n async close() {\r\n return new Promise((resolve) => {\r\n server.close(() => resolve());\r\n });\r\n },\r\n printUrls() {\r\n console.log(` ➜ Preview: ${url}`);\r\n },\r\n };\r\n },\r\n\r\n async clean(config: FlightConfig): Promise<void> {\r\n const outDir = resolvePath(config.root, config.build.outDir);\r\n await cleanDirectory(outDir);\r\n },\r\n\r\n async version(): Promise<string> {\r\n const native = await loadNativeBinding();\r\n return native.version();\r\n },\r\n\r\n async transform(\r\n code: string,\r\n id: string,\r\n transformOptions?: TransformOptions\r\n ): Promise<BundlerTransformResult> {\r\n const native = await loadNativeBinding();\r\n\r\n // Handle CSS files with native CSS processor\r\n if (id.endsWith('.css')) {\r\n const isCssModule = id.includes('.module.');\r\n\r\n if (isCssModule) {\r\n // CSS Modules: transform and generate class mappings\r\n const result = native.transformCssModule(code, id);\r\n\r\n // Generate JS export for CSS modules\r\n const classMapObject = Object.fromEntries(\r\n result.classMap.map(c => [c.original, c.hashed])\r\n );\r\n\r\n const jsCode = [\r\n `// CSS Module: ${id}`,\r\n `const styles = ${JSON.stringify(classMapObject)};`,\r\n `export default styles;`,\r\n ``,\r\n `// Inject CSS`,\r\n `if (typeof document !== 'undefined') {`,\r\n ` const style = document.createElement('style');`,\r\n ` style.textContent = ${JSON.stringify(result.code)};`,\r\n ` document.head.appendChild(style);`,\r\n `}`,\r\n ].join('\\n');\r\n\r\n return {\r\n code: jsCode,\r\n map: null,\r\n };\r\n } else {\r\n // Regular CSS: just minify and inject\r\n const minified = native.minifyCss(code, id);\r\n\r\n const jsCode = [\r\n `// CSS: ${id}`,\r\n `if (typeof document !== 'undefined') {`,\r\n ` const style = document.createElement('style');`,\r\n ` style.textContent = ${JSON.stringify(minified)};`,\r\n ` document.head.appendChild(style);`,\r\n `}`,\r\n ].join('\\n');\r\n\r\n return {\r\n code: jsCode,\r\n map: null,\r\n };\r\n }\r\n }\r\n\r\n // Handle TypeScript/JavaScript files\r\n const sourcemapOption = typeof transformOptions?.sourcemap === 'boolean'\r\n ? transformOptions.sourcemap\r\n : true;\r\n\r\n const result = await native.transform(code, id, {\r\n sourcemap: sourcemapOption,\r\n target: transformOptions?.target ?? 'es2022',\r\n });\r\n\r\n return {\r\n code: result.code,\r\n map: result.map,\r\n };\r\n },\r\n };\r\n\r\n // Auto-register as default if specified\r\n if (options.autoRegister !== false) {\r\n registerAdapter(adapter);\r\n\r\n // Set as default bundler\r\n setDefaultAdapter(ADAPTER_NAME);\r\n }\r\n\r\n return adapter;\r\n}\r\n\r\n// ============================================================================\r\n// Helper Functions\r\n// ============================================================================\r\n\r\n/**\r\n * Get entry points from Flight configuration\r\n */\r\nasync function getEntryPoints(config: FlightConfig): Promise<string[]> {\r\n const entries: string[] = [];\r\n const { existsSync } = await import('node:fs');\r\n const { join } = await import('node:path');\r\n\r\n // Look for common entry patterns in priority order\r\n const possibleEntries = [\r\n // Standard Flight entries\r\n 'src/entry-client.tsx',\r\n 'src/entry-client.ts',\r\n // Vite-style entries\r\n 'src/main.tsx',\r\n 'src/main.ts',\r\n // App-style entries\r\n 'src/App.tsx',\r\n 'src/App.ts',\r\n 'src/app.tsx',\r\n 'src/app.ts',\r\n // Index-style entries\r\n 'src/index.tsx',\r\n 'src/index.ts',\r\n ];\r\n\r\n // Find existing entries\r\n for (const entry of possibleEntries) {\r\n const fullPath = join(config.root, entry);\r\n if (existsSync(fullPath)) {\r\n entries.push(entry);\r\n break; // Only need one primary entry\r\n }\r\n }\r\n\r\n // Fallback if nothing found\r\n if (entries.length === 0) {\r\n entries.push('src/index.tsx');\r\n }\r\n\r\n return entries;\r\n}\r\n\r\n// ============================================================================\r\n// Exports\r\n// ============================================================================\r\n\r\nexport default flightpack;\r\nexport { flightpack as createFlightPackAdapter };\r\n\r\n/**\r\n * Package version\r\n */\r\nexport const VERSION = '0.0.1';\r\n\r\n// ============================================================================\r\n// Public Utilities (100% Parity)\r\n// ============================================================================\r\n\r\n/**\r\n * FlightPack utility functions for advanced usage\r\n * \r\n * @example\r\n * ```typescript\r\n * import { utils } from '@flight-framework/bundler-flightpack';\r\n * \r\n * utils.isNodeBuiltin('fs'); // true\r\n * utils.isEdgeCompatible('fs'); // false\r\n * utils.isBareImport('react'); // true\r\n * ```\r\n */\r\nexport const utils = {\r\n /**\r\n * Check if a module is a Node.js builtin\r\n * Handles both 'fs' and 'node:fs' formats\r\n */\r\n async isNodeBuiltin(moduleId: string): Promise<boolean> {\r\n const native = await loadNativeBinding();\r\n return native.isNodeBuiltin(moduleId);\r\n },\r\n\r\n /**\r\n * Get list of all Node.js builtin modules\r\n */\r\n async getNodeBuiltins(): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getNodeBuiltins();\r\n },\r\n\r\n /**\r\n * Get list of all Node.js builtins with node: prefix\r\n */\r\n async getNodeBuiltinsPrefixed(): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getNodeBuiltinsPrefixed();\r\n },\r\n\r\n /**\r\n * Check if a module is a bare import (from node_modules)\r\n * Returns false for relative/absolute paths\r\n */\r\n async isBareImport(moduleId: string): Promise<boolean> {\r\n const native = await loadNativeBinding();\r\n return native.isBareImport(moduleId);\r\n },\r\n\r\n /**\r\n * Check if a module is compatible with Edge runtimes\r\n * Returns false for modules like 'fs', 'child_process', etc.\r\n */\r\n async isEdgeCompatible(moduleId: string): Promise<boolean> {\r\n const native = await loadNativeBinding();\r\n return native.isEdgeCompatible(moduleId);\r\n },\r\n\r\n /**\r\n * Get list of Edge-incompatible modules\r\n */\r\n async getEdgeIncompatibleModules(): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getEdgeIncompatibleModules();\r\n },\r\n\r\n /**\r\n * Get default resolve conditions for a platform\r\n */\r\n async getPlatformConditions(platform: 'browser' | 'node' | 'edge' | 'neutral'): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getPlatformConditions(platform);\r\n },\r\n};\r\n\r\n// ============================================================================\r\n// SSG/ISR Public API\r\n// ============================================================================\r\n\r\nimport type { SSGOptions, SSGResult } from './types.js';\r\n\r\n/**\r\n * Generate static pages (SSG/ISR)\r\n * \r\n * Pre-renders pages at build time with optional Incremental Static Regeneration.\r\n * \r\n * @example\r\n * ```typescript\r\n * import { generateSSG } from '@flight-framework/bundler-flightpack';\r\n * \r\n * const result = await generateSSG({\r\n * pages: [\r\n * { path: '/' },\r\n * { path: '/about' },\r\n * { path: '/blog/[slug]', params: [{ slug: 'hello' }, { slug: 'world' }] },\r\n * ],\r\n * outDir: './dist',\r\n * ssrBundle: './dist/server/entry-server.js',\r\n * });\r\n * ```\r\n */\r\nexport async function generateSSG(options: SSGOptions): Promise<SSGResult> {\r\n const native = await loadNativeBinding();\r\n\r\n const nativeOptions: NativeSSGOptions = {\r\n pages: options.pages.map(p => ({\r\n path: p.path,\r\n params: p.params,\r\n fallback: p.fallback,\r\n revalidate: p.revalidate,\r\n })),\r\n outDir: options.outDir,\r\n ssrBundle: options.ssrBundle,\r\n defaultRevalidate: options.defaultRevalidate,\r\n concurrency: options.concurrency,\r\n trailingSlash: options.trailingSlash,\r\n };\r\n\r\n const result = await native.generateSsg(nativeOptions);\r\n\r\n return {\r\n pages: result.pages.map(p => ({\r\n path: p.path,\r\n filePath: p.filePath,\r\n revalidate: p.revalidate,\r\n size: p.size,\r\n })),\r\n durationMs: result.durationMs,\r\n totalSize: result.totalSize,\r\n isrPages: result.isrPages,\r\n errors: result.errors,\r\n };\r\n}\r\n\r\n// ============================================================================\r\n// Multi-Environment Build Public API\r\n// ============================================================================\r\n\r\nimport type { EnvironmentsConfig, MultiEnvironmentBuildResult } from './types.js';\r\n\r\n/**\r\n * Internal build result type (avoids conflict with types.ts)\r\n */\r\ninterface InternalBuildResult {\r\n outputDir: string;\r\n durationMs: number;\r\n totalSize: number;\r\n chunks: Array<{\r\n fileName: string;\r\n chunkType: 'entry' | 'chunk' | 'asset';\r\n size: number;\r\n }>;\r\n}\r\n\r\n/**\r\n * Build for multiple environments simultaneously\r\n * \r\n * Builds client, SSR, and edge bundles in parallel for maximum performance.\r\n * Follows Vite 7+ Environment API patterns.\r\n * \r\n * @example\r\n * ```typescript\r\n * import { buildMultiEnvironment } from '@flight-framework/bundler-flightpack';\r\n * \r\n * const result = await buildMultiEnvironment({\r\n * entry: ['src/index.tsx'],\r\n * outDir: './dist',\r\n * }, {\r\n * client: { platform: 'browser', outDir: './dist/client' },\r\n * ssr: { platform: 'node', outDir: './dist/server', external: ['express'] },\r\n * edge: { platform: 'edge', outDir: './dist/edge' },\r\n * });\r\n * ```\r\n */\r\nexport async function buildMultiEnvironment(\r\n baseOptions: {\r\n entry: string[];\r\n outDir: string;\r\n root?: string;\r\n minify?: boolean;\r\n sourcemap?: boolean;\r\n rsc?: boolean;\r\n treeshake?: boolean;\r\n target?: string;\r\n define?: Record<string, string>;\r\n },\r\n environments: EnvironmentsConfig,\r\n): Promise<MultiEnvironmentBuildResult> {\r\n const native = await loadNativeBinding();\r\n\r\n const nativeBaseOptions: FlightPackNativeOptions = {\r\n entry: baseOptions.entry,\r\n outDir: baseOptions.outDir,\r\n root: baseOptions.root,\r\n minify: baseOptions.minify,\r\n sourcemap: baseOptions.sourcemap,\r\n rsc: baseOptions.rsc,\r\n treeshake: baseOptions.treeshake,\r\n target: baseOptions.target,\r\n define: baseOptions.define,\r\n };\r\n\r\n const nativeEnvironments: NativeEnvironmentsConfig = {\r\n client: {\r\n platform: environments.client.platform,\r\n nodeTarget: environments.client.nodeTarget,\r\n conditions: environments.client.conditions,\r\n external: environments.client.external,\r\n noExternal: environments.client.noExternal,\r\n outDir: environments.client.outDir,\r\n entry: environments.client.entry,\r\n minify: environments.client.minify,\r\n sourcemap: environments.client.sourcemap,\r\n },\r\n ssr: environments.ssr ? {\r\n platform: environments.ssr.platform,\r\n nodeTarget: environments.ssr.nodeTarget,\r\n conditions: environments.ssr.conditions,\r\n external: environments.ssr.external,\r\n noExternal: environments.ssr.noExternal,\r\n outDir: environments.ssr.outDir,\r\n entry: environments.ssr.entry,\r\n minify: environments.ssr.minify,\r\n sourcemap: environments.ssr.sourcemap,\r\n } : undefined,\r\n edge: environments.edge ? {\r\n platform: environments.edge.platform,\r\n nodeTarget: environments.edge.nodeTarget,\r\n conditions: environments.edge.conditions,\r\n external: environments.edge.external,\r\n noExternal: environments.edge.noExternal,\r\n outDir: environments.edge.outDir,\r\n entry: environments.edge.entry,\r\n minify: environments.edge.minify,\r\n sourcemap: environments.edge.sourcemap,\r\n } : undefined,\r\n };\r\n\r\n const result = await native.buildMultiEnvironment(nativeBaseOptions, nativeEnvironments);\r\n\r\n const mapBuildResult = (r: NativeBuildResult): InternalBuildResult => ({\r\n outputDir: r.outputDir,\r\n durationMs: r.durationMs,\r\n totalSize: r.totalSize,\r\n chunks: r.chunks.map(c => ({\r\n fileName: c.fileName,\r\n chunkType: c.chunkType as 'entry' | 'chunk' | 'asset',\r\n size: c.size,\r\n })),\r\n });\r\n\r\n return {\r\n client: mapBuildResult(result.client),\r\n ssr: result.ssr ? mapBuildResult(result.ssr) : undefined,\r\n edge: result.edge ? mapBuildResult(result.edge) : undefined,\r\n totalDurationMs: result.totalDurationMs,\r\n };\r\n}\r\n"],"mappings":";AA6BA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAaP,IAAM,eAAe;AACrB,IAAM,eAAe;AA0SrB,IAAI,gBAAsC;AAE1C,eAAe,oBAA4C;AACvD,MAAI,cAAe,QAAO;AAE1B,MAAI;AAGA,UAAM,EAAE,cAAc,IAAI,MAAM,OAAO,QAA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C3B,YAAY,aAAa,IAAI;AAAA,MAC7B,YAAY,aAAa,IAAI;AAAA,MAC7B,UAAU,aAAa,IAAI;AAAA,MAC3B,YAAY,aAAa,IAAI;AAAA,MAC7B,QAAQ,aAAa,IAAI;AAAA,MACzB,OAAO,aAAa,IAAI;AAAA,MACxB,QAAQ,aAAa,IAAI;AAAA,MACzB,WAAW,aAAa,IAAI;AAAA,IAChC,IAAI;AAAA,IACJ,MAAM,aAAa,OAAO;AAAA,MACtB,UAAU,aAAa,KAAK;AAAA,MAC5B,YAAY,aAAa,KAAK;AAAA,MAC9B,YAAY,aAAa,KAAK;AAAA,MAC9B,UAAU,aAAa,KAAK;AAAA,MAC5B,YAAY,aAAa,KAAK;AAAA,MAC9B,QAAQ,aAAa,KAAK;AAAA,MAC1B,OAAO,aAAa,KAAK;AAAA,MACzB,QAAQ,aAAa,KAAK;AAAA,MAC1B,WAAW,aAAa,KAAK;AAAA,IACjC,IAAI;AAAA,EACR;AAEA,QAAM,SAAS,MAAM,OAAO,sBAAsB,mBAAmB,kBAAkB;AAEvF,QAAM,iBAAiB,CAAC,OAA+C;AAAA,IACnE,WAAW,EAAE;AAAA,IACb,YAAY,EAAE;AAAA,IACd,WAAW,EAAE;AAAA,IACb,QAAQ,EAAE,OAAO,IAAI,QAAM;AAAA,MACvB,UAAU,EAAE;AAAA,MACZ,WAAW,EAAE;AAAA,MACb,MAAM,EAAE;AAAA,IACZ,EAAE;AAAA,EACN;AAEA,SAAO;AAAA,IACH,QAAQ,eAAe,OAAO,MAAM;AAAA,IACpC,KAAK,OAAO,MAAM,eAAe,OAAO,GAAG,IAAI;AAAA,IAC/C,MAAM,OAAO,OAAO,eAAe,OAAO,IAAI,IAAI;AAAA,IAClD,iBAAiB,OAAO;AAAA,EAC5B;AACJ;","names":["require","result"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\r\n * @flight-framework/bundler-flightpack\r\n * \r\n * FlightPack native Rust bundler adapter for Flight Framework.\r\n * Wraps the native Rust bundler for maximum performance.\r\n * \r\n * @example\r\n * ```typescript\r\n * // In flight.config.ts\r\n * import { defineConfig } from '@flight-framework/core';\r\n * import { flightpack } from '@flight-framework/bundler-flightpack';\r\n * \r\n * export default defineConfig({\r\n * bundler: flightpack(),\r\n * });\r\n * ```\r\n * \r\n * @packageDocumentation\r\n */\r\n\r\nimport type {\r\n BundlerAdapter,\r\n DevServer,\r\n BuildResult,\r\n PreviewServer,\r\n OutputFile,\r\n TransformOptions,\r\n TransformResult as BundlerTransformResult,\r\n} from '@flight-framework/bundler';\r\nimport {\r\n registerAdapter,\r\n setDefaultAdapter,\r\n createTimer,\r\n createBuildError,\r\n logDevServerStarted,\r\n logBuildSuccess,\r\n logBuildError,\r\n resolvePath,\r\n cleanDirectory,\r\n} from '@flight-framework/bundler';\r\nimport type { FlightConfig } from '@flight-framework/core/config';\r\nimport type {\r\n FlightPackAdapterOptions,\r\n} from './types.js';\r\n\r\n// Re-export types\r\nexport * from './types.js';\r\n\r\n// ============================================================================\r\n// Constants\r\n// ============================================================================\r\n\r\nconst ADAPTER_NAME = 'flight-flightpack';\r\nconst BUNDLER_NAME = 'flightpack';\r\n\r\n// ============================================================================\r\n// Native Binding Loader\r\n// ============================================================================\r\n\r\n/**\r\n * Native binding interface matching the NAPI exports\r\n */\r\ninterface NativeBinding {\r\n FlightPack: new (options?: FlightPackNativeOptions | undefined | null) => {\r\n build(): Promise<NativeBuildResult>;\r\n };\r\n build: (options: FlightPackNativeOptions) => Promise<NativeBuildResult>;\r\n transform: (code: string, filename: string, options?: NativeTransformOptions | undefined | null) => Promise<NativeTransformResult>;\r\n version: () => string;\r\n // Dev Server\r\n startDevServer: (options?: NativeDevServerOptions | undefined | null) => Promise<NativeDevServerResult>;\r\n stopDevServer: () => Promise<boolean>;\r\n isDevServerRunning: () => boolean;\r\n // HMR\r\n sendHmrUpdate: (modules: NativeHMRModuleUpdate[]) => boolean;\r\n sendHmrError: (message: string) => boolean;\r\n // File Watcher\r\n watchFiles: (options: NativeWatcherOptions, callback: (event: NativeWatchEvent) => void) => NativeWatchHandle;\r\n // CSS Processing\r\n transformCss: (code: string, filename: string, options?: NativeCssTransformOptions | undefined | null) => NativeCssTransformResult;\r\n minifyCss: (code: string, filename: string) => string;\r\n transformCssModule: (code: string, filename: string) => NativeCssModuleResult;\r\n\r\n // ============================================================================\r\n // Extended NAPI Exports (2026 Parity)\r\n // ============================================================================\r\n\r\n // SSG/ISR\r\n generateSsg: (options: NativeSSGOptions) => Promise<NativeSSGResult>;\r\n\r\n // Multi-Environment Builds\r\n buildMultiEnvironment: (baseOptions: FlightPackNativeOptions, environments: NativeEnvironmentsConfig) => Promise<NativeMultiEnvironmentResult>;\r\n\r\n // Externals Detection\r\n isNodeBuiltin: (moduleId: string) => boolean;\r\n getNodeBuiltins: () => string[];\r\n getNodeBuiltinsPrefixed: () => string[];\r\n isBareImport: (moduleId: string) => boolean;\r\n isEdgeCompatible: (moduleId: string) => boolean;\r\n getEdgeIncompatibleModules: () => string[];\r\n getPlatformConditions: (platform: string) => string[];\r\n}\r\n\r\n/**\r\n * Native CSS transform options\r\n */\r\ninterface NativeCssTransformOptions {\r\n minify?: boolean;\r\n cssModules?: boolean;\r\n cssModulesPattern?: string;\r\n dashedIdents?: boolean;\r\n sourcemap?: boolean;\r\n browserTargets?: {\r\n chrome?: number;\r\n firefox?: number;\r\n safari?: number;\r\n edge?: number;\r\n };\r\n}\r\n\r\n/**\r\n * Native CSS transform result\r\n */\r\ninterface NativeCssTransformResult {\r\n code: string;\r\n map?: string | null;\r\n exports: Array<{\r\n original: string;\r\n hashed: string;\r\n isReferenced: boolean;\r\n composes: string[];\r\n }>;\r\n success: boolean;\r\n}\r\n\r\n/**\r\n * Native CSS module result\r\n */\r\ninterface NativeCssModuleResult {\r\n code: string;\r\n classMap: Array<{\r\n original: string;\r\n hashed: string;\r\n }>;\r\n}\r\n\r\n/**\r\n * Platform type\r\n */\r\ntype NativePlatform = 'browser' | 'node' | 'edge' | 'neutral';\r\n\r\n/**\r\n * Extended NativeBinding interface with universal support\r\n */\r\ninterface NativeBindingExtended extends NativeBinding {\r\n // Externals Detection\r\n isNodeBuiltin: (moduleId: string) => boolean;\r\n getNodeBuiltins: () => string[];\r\n getNodeBuiltinsPrefixed: () => string[];\r\n isBareImport: (moduleId: string) => boolean;\r\n isEdgeCompatible: (moduleId: string) => boolean;\r\n getEdgeIncompatibleModules: () => string[];\r\n getPlatformConditions: (platform: string) => string[];\r\n}\r\n\r\n\r\n/**\r\n * Native dev server options\r\n */\r\ninterface NativeDevServerOptions {\r\n port?: number;\r\n publicDir?: string;\r\n outDir?: string;\r\n hmr?: boolean;\r\n root?: string;\r\n}\r\n\r\n/**\r\n * Native dev server result\r\n */\r\ninterface NativeDevServerResult {\r\n url: string;\r\n port: number;\r\n hmr: boolean;\r\n}\r\n\r\n/**\r\n * Native HMR module update\r\n */\r\ninterface NativeHMRModuleUpdate {\r\n id: string;\r\n path: string;\r\n code: string;\r\n deps?: string[] | null;\r\n accept: boolean;\r\n}\r\n\r\n/**\r\n * Native watcher options\r\n */\r\ninterface NativeWatcherOptions {\r\n paths: string[];\r\n extensions?: string[] | null;\r\n debounceMs?: number | null;\r\n}\r\n\r\n/**\r\n * Native watch event\r\n */\r\ninterface NativeWatchEvent {\r\n paths: string[];\r\n eventType: string;\r\n}\r\n\r\n/**\r\n * Native watch handle\r\n */\r\ninterface NativeWatchHandle {\r\n stop(): boolean;\r\n}\r\n\r\n/**\r\n * Native options matching Rust struct\r\n */\r\ninterface FlightPackNativeOptions {\r\n entry: string[];\r\n outDir: string;\r\n root?: string;\r\n minify?: boolean;\r\n sourcemap?: boolean;\r\n rsc?: boolean;\r\n\r\n // Extended options (2026 Parity)\r\n splitting?: boolean;\r\n treeshake?: boolean;\r\n platform?: string;\r\n external?: string[];\r\n noExternal?: string[];\r\n format?: string;\r\n target?: string;\r\n serverActions?: boolean;\r\n define?: Record<string, string>;\r\n conditions?: string[];\r\n nodeTarget?: string;\r\n}\r\n\r\n/**\r\n * Native SSG options\r\n */\r\ninterface NativeSSGPageConfig {\r\n path: string;\r\n params?: Record<string, string>[];\r\n fallback?: string;\r\n revalidate?: number;\r\n}\r\n\r\ninterface NativeSSGOptions {\r\n pages: NativeSSGPageConfig[];\r\n outDir?: string;\r\n ssrBundle?: string;\r\n defaultRevalidate?: number;\r\n concurrency?: number;\r\n trailingSlash?: boolean;\r\n}\r\n\r\ninterface NativeSSGGeneratedPage {\r\n path: string;\r\n filePath: string;\r\n revalidate?: number;\r\n size: number;\r\n}\r\n\r\ninterface NativeSSGResult {\r\n pages: NativeSSGGeneratedPage[];\r\n durationMs: number;\r\n totalSize: number;\r\n isrPages: string[];\r\n errors: string[];\r\n}\r\n\r\n/**\r\n * Native Multi-Environment types\r\n */\r\ninterface NativeEnvironmentOptions {\r\n platform?: string;\r\n nodeTarget?: string;\r\n conditions?: string[];\r\n external?: string[];\r\n noExternal?: string[];\r\n outDir?: string;\r\n entry?: string[];\r\n minify?: boolean;\r\n sourcemap?: boolean;\r\n}\r\n\r\ninterface NativeEnvironmentsConfig {\r\n client: NativeEnvironmentOptions;\r\n ssr?: NativeEnvironmentOptions;\r\n edge?: NativeEnvironmentOptions;\r\n}\r\n\r\ninterface NativeMultiEnvironmentResult {\r\n client: NativeBuildResult;\r\n ssr?: NativeBuildResult;\r\n edge?: NativeBuildResult;\r\n totalDurationMs: number;\r\n}\r\n\r\n/**\r\n * Native build result matching Rust struct\r\n */\r\ninterface NativeBuildResult {\r\n outputDir: string;\r\n durationMs: number;\r\n totalSize: number;\r\n chunks: NativeChunkInfo[];\r\n}\r\n\r\n/**\r\n * Native chunk info matching Rust struct\r\n */\r\ninterface NativeChunkInfo {\r\n fileName: string;\r\n chunkType: string;\r\n size: number;\r\n}\r\n\r\n/**\r\n * Native transform options matching Rust struct\r\n */\r\ninterface NativeTransformOptions {\r\n sourcemap?: boolean;\r\n minify?: boolean;\r\n target?: string;\r\n jsxFactory?: string;\r\n jsxFragment?: string;\r\n}\r\n\r\n/**\r\n * Native transform result matching Rust struct\r\n */\r\ninterface NativeTransformResult {\r\n code: string;\r\n map?: string | null;\r\n success: boolean;\r\n}\r\n\r\n/**\r\n * Lazy-loaded native FlightPack binding\r\n * This defers loading until actually needed, improving startup time\r\n */\r\nlet nativeBinding: NativeBinding | null = null;\r\n\r\nasync function loadNativeBinding(): Promise<NativeBinding> {\r\n if (nativeBinding) return nativeBinding;\r\n\r\n try {\r\n // Use createRequire for ESM compatibility with native modules\r\n // Native .node files require \"require()\" which isn't available in ESM\r\n const { createRequire } = await import('node:module');\r\n const require = createRequire(import.meta.url);\r\n const native = require('@flight-framework/flightpack') as NativeBinding;\r\n nativeBinding = native;\r\n return native;\r\n } catch (error) {\r\n throw new Error(\r\n `Failed to load FlightPack native binding. ` +\r\n `Make sure @flight-framework/flightpack is installed.\\n` +\r\n `Original error: ${error}`\r\n );\r\n }\r\n}\r\n\r\n// ============================================================================\r\n// Adapter Implementation\r\n// ============================================================================\r\n\r\n/**\r\n * Create a FlightPack bundler adapter\r\n * \r\n * FlightPack is a native Rust bundler that provides:\r\n * - 1,874+ files/second processing speed\r\n * - Zero-config TypeScript/TSX support via Oxc\r\n * - React Server Components (RSC) support\r\n * - Tree shaking and code splitting\r\n * - Hot Module Replacement (HMR)\r\n * \r\n * @param options - FlightPack adapter options\r\n * @returns A BundlerAdapter instance\r\n * \r\n * @example\r\n * ```typescript\r\n * import { flightpack } from '@flight-framework/bundler-flightpack';\r\n * \r\n * const adapter = flightpack({\r\n * minify: true,\r\n * sourcemap: true,\r\n * rsc: true,\r\n * });\r\n * ```\r\n */\r\nexport function flightpack(options: FlightPackAdapterOptions = {}): BundlerAdapter {\r\n const adapter: BundlerAdapter = {\r\n name: ADAPTER_NAME,\r\n bundler: BUNDLER_NAME,\r\n options,\r\n\r\n async createDevServer(config: FlightConfig): Promise<DevServer> {\r\n const native = await loadNativeBinding();\r\n\r\n // Internal port for transform API (CLI will proxy to this)\r\n const internalPort = (config.dev.port ?? 5173) + 1000;\r\n const host = config.dev.host ?? 'localhost';\r\n const https = config.dev.https === true;\r\n\r\n console.log('[Bundler] JS Root:', config.root);\r\n console.log('[Bundler] Resolved Public Dir:', resolvePath(config.root, 'public'));\r\n console.log('[Bundler] Internal Port:', internalPort);\r\n\r\n // Use native Rust dev server with Axum and WebSocket HMR\r\n const result = await native.startDevServer({\r\n port: internalPort,\r\n publicDir: resolvePath(config.root, 'public'),\r\n outDir: resolvePath(config.root, config.build.outDir),\r\n hmr: options.hmr ?? true,\r\n root: config.root,\r\n });\r\n\r\n logDevServerStarted(result.url, 'FlightPack');\r\n\r\n // Set up file watcher for HMR updates\r\n let watchHandle: NativeWatchHandle | undefined;\r\n if (result.hmr) {\r\n try {\r\n watchHandle = native.watchFiles(\r\n {\r\n paths: [resolvePath(config.root, 'src')],\r\n extensions: ['ts', 'tsx', 'js', 'jsx', 'css'],\r\n debounceMs: 100,\r\n },\r\n async (event: NativeWatchEvent) => {\r\n // Transform changed files and send HMR updates\r\n const updates: NativeHMRModuleUpdate[] = [];\r\n\r\n for (const filePath of event.paths) {\r\n try {\r\n const { readFile } = await import('node:fs/promises');\r\n const source = await readFile(filePath, 'utf-8');\r\n const transformed = await native.transform(source, filePath);\r\n\r\n if (transformed.success) {\r\n updates.push({\r\n id: filePath,\r\n path: filePath,\r\n code: transformed.code,\r\n accept: true,\r\n deps: [],\r\n });\r\n }\r\n } catch (error) {\r\n native.sendHmrError(`Failed to transform ${filePath}: ${error}`);\r\n }\r\n }\r\n\r\n if (updates.length > 0) {\r\n native.sendHmrUpdate(updates);\r\n }\r\n }\r\n );\r\n } catch (error) {\r\n console.warn('[FlightPack] File watcher failed to start:', error);\r\n }\r\n }\r\n\r\n return {\r\n url: result.url,\r\n port: result.port,\r\n host: host as string,\r\n https,\r\n async close() {\r\n // Stop file watcher\r\n if (watchHandle) {\r\n watchHandle.stop();\r\n }\r\n // Stop native dev server\r\n await native.stopDevServer();\r\n },\r\n restart: undefined,\r\n reload: undefined,\r\n hmrUpdate: undefined,\r\n printUrls() {\r\n console.log(` ⚡ FlightPack Dev Server`);\r\n console.log(` ➜ Local: ${result.url}`);\r\n if (result.hmr) {\r\n console.log(` ➜ HMR: enabled (WebSocket)`);\r\n }\r\n },\r\n };\r\n },\r\n\r\n async build(config: FlightConfig): Promise<BuildResult> {\r\n const native = await loadNativeBinding();\r\n const timer = createTimer();\r\n\r\n try {\r\n // Build FlightPack options from config\r\n const minifyOption = typeof options.minify === 'boolean'\r\n ? options.minify\r\n : typeof config.build.minify === 'boolean'\r\n ? config.build.minify\r\n : true;\r\n\r\n // Auto-externalize Node.js builtins for Node platform\r\n const builtins = native.getNodeBuiltins();\r\n const nodeExternal = [...new Set([...(options.external || []), ...builtins])];\r\n\r\n // Get all entry points\r\n const allEntries = await getEntryPoints(config);\r\n const serverEntries = allEntries.filter(e => e.includes('entry-server'));\r\n const clientEntries = allEntries.filter(e => !e.includes('entry-server'));\r\n\r\n const baseOutDir = resolvePath(config.root, config.build.outDir);\r\n\r\n // Base options shared across environments\r\n const baseOptions: FlightPackNativeOptions = {\r\n entry: [], // Overridden per environment\r\n outDir: baseOutDir,\r\n root: config.root,\r\n minify: minifyOption,\r\n sourcemap: typeof options.sourcemap === 'boolean'\r\n ? options.sourcemap\r\n : typeof config.build.sourcemap === 'boolean'\r\n ? config.build.sourcemap\r\n : true,\r\n rsc: options.rsc ?? true,\r\n splitting: options.splitting ?? true,\r\n treeshake: options.treeshake ?? true,\r\n platform: 'neutral', // Overridden\r\n format: options.format ?? 'esm',\r\n target: options.target ?? 'es2022',\r\n define: options.define,\r\n };\r\n\r\n const environments: NativeEnvironmentsConfig = {\r\n client: {\r\n entry: clientEntries,\r\n platform: 'browser',\r\n outDir: baseOutDir, // Client root\r\n external: options.external,\r\n },\r\n // Only add SSR environment if server entries exist\r\n ...(serverEntries.length > 0 ? {\r\n ssr: {\r\n entry: serverEntries,\r\n platform: 'node',\r\n outDir: resolvePath(baseOutDir, 'server'),\r\n external: nodeExternal,\r\n }\r\n } : {})\r\n };\r\n\r\n // Run the multi-environment build\r\n const result = await native.buildMultiEnvironment(baseOptions, environments);\r\n\r\n // Collect files from all environments\r\n const files: OutputFile[] = [\r\n ...result.client.chunks.map((chunk: NativeChunkInfo) => ({\r\n path: chunk.fileName,\r\n size: chunk.size,\r\n type: chunk.chunkType as 'entry' | 'chunk' | 'asset',\r\n isDynamicEntry: false,\r\n })),\r\n ...(result.ssr?.chunks.map((chunk: NativeChunkInfo) => ({\r\n path: `server/${chunk.fileName}`, // Prefix for clarity if needed, though fileName usually contains path\r\n size: chunk.size,\r\n type: chunk.chunkType as 'entry' | 'chunk' | 'asset',\r\n isDynamicEntry: false,\r\n })) || [])\r\n ];\r\n\r\n const totalSize = result.client.totalSize + (result.ssr?.totalSize || 0);\r\n\r\n const buildResult: BuildResult = {\r\n outDir: result.client.outputDir,\r\n duration: timer.stop(),\r\n files,\r\n totalSize,\r\n errors: [],\r\n warnings: [],\r\n success: true,\r\n };\r\n\r\n logBuildSuccess(buildResult);\r\n return buildResult;\r\n\r\n } catch (error) {\r\n const buildResult: BuildResult = {\r\n outDir: resolvePath(config.root, config.build.outDir),\r\n duration: timer.stop(),\r\n files: [],\r\n totalSize: 0,\r\n errors: [createBuildError(error)],\r\n warnings: [],\r\n success: false,\r\n };\r\n\r\n logBuildError(buildResult);\r\n return buildResult;\r\n }\r\n },\r\n\r\n async preview(config: FlightConfig): Promise<PreviewServer> {\r\n const { createServer } = await import('node:http');\r\n const { readFile, stat } = await import('node:fs/promises');\r\n const { join, extname } = await import('node:path');\r\n\r\n const outDir = resolvePath(config.root, config.build.outDir);\r\n const port = 4173;\r\n const host = 'localhost';\r\n const url = `http://${host}:${port}`;\r\n\r\n const mimeTypes: Record<string, string> = {\r\n '.html': 'text/html',\r\n '.js': 'text/javascript',\r\n '.css': 'text/css',\r\n '.json': 'application/json',\r\n };\r\n\r\n const server = createServer(async (req, res) => {\r\n let urlPath = req.url === '/' ? '/index.html' : req.url!;\r\n const filePath = join(outDir, urlPath);\r\n\r\n try {\r\n const content = await readFile(filePath);\r\n const ext = extname(filePath);\r\n res.setHeader('Content-Type', mimeTypes[ext] || 'application/octet-stream');\r\n res.writeHead(200);\r\n res.end(content);\r\n } catch {\r\n // Try with .html extension\r\n try {\r\n const htmlPath = filePath.endsWith('.html') ? filePath : `${filePath}.html`;\r\n const content = await readFile(htmlPath);\r\n res.setHeader('Content-Type', 'text/html');\r\n res.writeHead(200);\r\n res.end(content);\r\n } catch {\r\n res.writeHead(404);\r\n res.end('Not Found');\r\n }\r\n }\r\n });\r\n\r\n server.listen(port, host);\r\n\r\n return {\r\n url,\r\n port,\r\n async close() {\r\n return new Promise((resolve) => {\r\n server.close(() => resolve());\r\n });\r\n },\r\n printUrls() {\r\n console.log(` ➜ Preview: ${url}`);\r\n },\r\n };\r\n },\r\n\r\n async clean(config: FlightConfig): Promise<void> {\r\n const outDir = resolvePath(config.root, config.build.outDir);\r\n await cleanDirectory(outDir);\r\n },\r\n\r\n async version(): Promise<string> {\r\n const native = await loadNativeBinding();\r\n return native.version();\r\n },\r\n\r\n async transform(\r\n code: string,\r\n id: string,\r\n transformOptions?: TransformOptions\r\n ): Promise<BundlerTransformResult> {\r\n const native = await loadNativeBinding();\r\n\r\n // Handle CSS files with native CSS processor\r\n if (id.endsWith('.css')) {\r\n const isCssModule = id.includes('.module.');\r\n\r\n if (isCssModule) {\r\n // CSS Modules: transform and generate class mappings\r\n const result = native.transformCssModule(code, id);\r\n\r\n // Generate JS export for CSS modules\r\n const classMapObject = Object.fromEntries(\r\n result.classMap.map(c => [c.original, c.hashed])\r\n );\r\n\r\n const jsCode = [\r\n `// CSS Module: ${id}`,\r\n `const styles = ${JSON.stringify(classMapObject)};`,\r\n `export default styles;`,\r\n ``,\r\n `// Inject CSS`,\r\n `if (typeof document !== 'undefined') {`,\r\n ` const style = document.createElement('style');`,\r\n ` style.textContent = ${JSON.stringify(result.code)};`,\r\n ` document.head.appendChild(style);`,\r\n `}`,\r\n ].join('\\n');\r\n\r\n return {\r\n code: jsCode,\r\n map: null,\r\n };\r\n } else {\r\n // Regular CSS: just minify and inject\r\n const minified = native.minifyCss(code, id);\r\n\r\n const jsCode = [\r\n `// CSS: ${id}`,\r\n `if (typeof document !== 'undefined') {`,\r\n ` const style = document.createElement('style');`,\r\n ` style.textContent = ${JSON.stringify(minified)};`,\r\n ` document.head.appendChild(style);`,\r\n `}`,\r\n ].join('\\n');\r\n\r\n return {\r\n code: jsCode,\r\n map: null,\r\n };\r\n }\r\n }\r\n\r\n // Handle TypeScript/JavaScript files\r\n const sourcemapOption = typeof transformOptions?.sourcemap === 'boolean'\r\n ? transformOptions.sourcemap\r\n : true;\r\n\r\n const result = await native.transform(code, id, {\r\n sourcemap: sourcemapOption,\r\n target: transformOptions?.target ?? 'es2022',\r\n });\r\n\r\n return {\r\n code: result.code,\r\n map: result.map,\r\n };\r\n },\r\n };\r\n\r\n // Auto-register as default if specified\r\n if (options.autoRegister !== false) {\r\n registerAdapter(adapter);\r\n\r\n // Set as default bundler\r\n setDefaultAdapter(ADAPTER_NAME);\r\n }\r\n\r\n return adapter;\r\n}\r\n\r\n// ============================================================================\r\n// Helper Functions\r\n// ============================================================================\r\n\r\n/**\r\n * Get entry points from Flight configuration\r\n */\r\nasync function getEntryPoints(config: FlightConfig): Promise<string[]> {\r\n const entries: string[] = [];\r\n const { existsSync } = await import('node:fs');\r\n const { join } = await import('node:path');\r\n\r\n // Look for common entry patterns in priority order\r\n // Look for common entry patterns in priority order\r\n const possibleEntries = [\r\n // Standard Flight entries\r\n 'src/entry-client.tsx',\r\n 'src/entry-client.ts',\r\n 'src/entry-server.tsx',\r\n 'src/entry-server.ts',\r\n // Vite-style entries\r\n 'src/main.tsx',\r\n 'src/main.ts',\r\n // App-style entries\r\n 'src/App.tsx',\r\n 'src/App.ts',\r\n 'src/app.tsx',\r\n 'src/app.ts',\r\n // Index-style entries\r\n 'src/index.tsx',\r\n 'src/index.ts',\r\n ];\r\n\r\n // Find existing entries\r\n for (const entry of possibleEntries) {\r\n const fullPath = join(config.root, entry);\r\n if (existsSync(fullPath)) {\r\n entries.push(entry);\r\n // Don't break - collect all valid entry points\r\n }\r\n }\r\n\r\n // Fallback if nothing found\r\n if (entries.length === 0) {\r\n entries.push('src/index.tsx');\r\n }\r\n\r\n return entries;\r\n}\r\n\r\n// ============================================================================\r\n// Exports\r\n// ============================================================================\r\n\r\nexport default flightpack;\r\nexport { flightpack as createFlightPackAdapter };\r\n\r\n/**\r\n * Package version\r\n */\r\nexport const VERSION = '0.0.1';\r\n\r\n// ============================================================================\r\n// Public Utilities (100% Parity)\r\n// ============================================================================\r\n\r\n/**\r\n * FlightPack utility functions for advanced usage\r\n * \r\n * @example\r\n * ```typescript\r\n * import { utils } from '@flight-framework/bundler-flightpack';\r\n * \r\n * utils.isNodeBuiltin('fs'); // true\r\n * utils.isEdgeCompatible('fs'); // false\r\n * utils.isBareImport('react'); // true\r\n * ```\r\n */\r\nexport const utils = {\r\n /**\r\n * Check if a module is a Node.js builtin\r\n * Handles both 'fs' and 'node:fs' formats\r\n */\r\n async isNodeBuiltin(moduleId: string): Promise<boolean> {\r\n const native = await loadNativeBinding();\r\n return native.isNodeBuiltin(moduleId);\r\n },\r\n\r\n /**\r\n * Get list of all Node.js builtin modules\r\n */\r\n async getNodeBuiltins(): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getNodeBuiltins();\r\n },\r\n\r\n /**\r\n * Get list of all Node.js builtins with node: prefix\r\n */\r\n async getNodeBuiltinsPrefixed(): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getNodeBuiltinsPrefixed();\r\n },\r\n\r\n /**\r\n * Check if a module is a bare import (from node_modules)\r\n * Returns false for relative/absolute paths\r\n */\r\n async isBareImport(moduleId: string): Promise<boolean> {\r\n const native = await loadNativeBinding();\r\n return native.isBareImport(moduleId);\r\n },\r\n\r\n /**\r\n * Check if a module is compatible with Edge runtimes\r\n * Returns false for modules like 'fs', 'child_process', etc.\r\n */\r\n async isEdgeCompatible(moduleId: string): Promise<boolean> {\r\n const native = await loadNativeBinding();\r\n return native.isEdgeCompatible(moduleId);\r\n },\r\n\r\n /**\r\n * Get list of Edge-incompatible modules\r\n */\r\n async getEdgeIncompatibleModules(): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getEdgeIncompatibleModules();\r\n },\r\n\r\n /**\r\n * Get default resolve conditions for a platform\r\n */\r\n async getPlatformConditions(platform: 'browser' | 'node' | 'edge' | 'neutral'): Promise<string[]> {\r\n const native = await loadNativeBinding();\r\n return native.getPlatformConditions(platform);\r\n },\r\n};\r\n\r\n// ============================================================================\r\n// SSG/ISR Public API\r\n// ============================================================================\r\n\r\nimport type { SSGOptions, SSGResult } from './types.js';\r\n\r\n/**\r\n * Generate static pages (SSG/ISR)\r\n * \r\n * Pre-renders pages at build time with optional Incremental Static Regeneration.\r\n * \r\n * @example\r\n * ```typescript\r\n * import { generateSSG } from '@flight-framework/bundler-flightpack';\r\n * \r\n * const result = await generateSSG({\r\n * pages: [\r\n * { path: '/' },\r\n * { path: '/about' },\r\n * { path: '/blog/[slug]', params: [{ slug: 'hello' }, { slug: 'world' }] },\r\n * ],\r\n * outDir: './dist',\r\n * ssrBundle: './dist/server/entry-server.js',\r\n * });\r\n * ```\r\n */\r\nexport async function generateSSG(options: SSGOptions): Promise<SSGResult> {\r\n const native = await loadNativeBinding();\r\n\r\n const nativeOptions: NativeSSGOptions = {\r\n pages: options.pages.map(p => ({\r\n path: p.path,\r\n params: p.params,\r\n fallback: p.fallback,\r\n revalidate: p.revalidate,\r\n })),\r\n outDir: options.outDir,\r\n ssrBundle: options.ssrBundle,\r\n defaultRevalidate: options.defaultRevalidate,\r\n concurrency: options.concurrency,\r\n trailingSlash: options.trailingSlash,\r\n };\r\n\r\n const result = await native.generateSsg(nativeOptions);\r\n\r\n return {\r\n pages: result.pages.map(p => ({\r\n path: p.path,\r\n filePath: p.filePath,\r\n revalidate: p.revalidate,\r\n size: p.size,\r\n })),\r\n durationMs: result.durationMs,\r\n totalSize: result.totalSize,\r\n isrPages: result.isrPages,\r\n errors: result.errors,\r\n };\r\n}\r\n\r\n// ============================================================================\r\n// Multi-Environment Build Public API\r\n// ============================================================================\r\n\r\nimport type { EnvironmentsConfig, MultiEnvironmentBuildResult } from './types.js';\r\n\r\n/**\r\n * Internal build result type (avoids conflict with types.ts)\r\n */\r\ninterface InternalBuildResult {\r\n outputDir: string;\r\n durationMs: number;\r\n totalSize: number;\r\n chunks: Array<{\r\n fileName: string;\r\n chunkType: 'entry' | 'chunk' | 'asset';\r\n size: number;\r\n }>;\r\n}\r\n\r\n/**\r\n * Build for multiple environments simultaneously\r\n * \r\n * Builds client, SSR, and edge bundles in parallel for maximum performance.\r\n * Follows Vite 7+ Environment API patterns.\r\n * \r\n * @example\r\n * ```typescript\r\n * import { buildMultiEnvironment } from '@flight-framework/bundler-flightpack';\r\n * \r\n * const result = await buildMultiEnvironment({\r\n * entry: ['src/index.tsx'],\r\n * outDir: './dist',\r\n * }, {\r\n * client: { platform: 'browser', outDir: './dist/client' },\r\n * ssr: { platform: 'node', outDir: './dist/server', external: ['express'] },\r\n * edge: { platform: 'edge', outDir: './dist/edge' },\r\n * });\r\n * ```\r\n */\r\nexport async function buildMultiEnvironment(\r\n baseOptions: {\r\n entry: string[];\r\n outDir: string;\r\n root?: string;\r\n minify?: boolean;\r\n sourcemap?: boolean;\r\n rsc?: boolean;\r\n treeshake?: boolean;\r\n target?: string;\r\n define?: Record<string, string>;\r\n },\r\n environments: EnvironmentsConfig,\r\n): Promise<MultiEnvironmentBuildResult> {\r\n const native = await loadNativeBinding();\r\n\r\n const nativeBaseOptions: FlightPackNativeOptions = {\r\n entry: baseOptions.entry,\r\n outDir: baseOptions.outDir,\r\n root: baseOptions.root,\r\n minify: baseOptions.minify,\r\n sourcemap: baseOptions.sourcemap,\r\n rsc: baseOptions.rsc,\r\n treeshake: baseOptions.treeshake,\r\n target: baseOptions.target,\r\n define: baseOptions.define,\r\n };\r\n\r\n const nativeEnvironments: NativeEnvironmentsConfig = {\r\n client: {\r\n platform: environments.client.platform,\r\n nodeTarget: environments.client.nodeTarget,\r\n conditions: environments.client.conditions,\r\n external: environments.client.external,\r\n noExternal: environments.client.noExternal,\r\n outDir: environments.client.outDir,\r\n entry: environments.client.entry,\r\n minify: environments.client.minify,\r\n sourcemap: environments.client.sourcemap,\r\n },\r\n ssr: environments.ssr ? {\r\n platform: environments.ssr.platform,\r\n nodeTarget: environments.ssr.nodeTarget,\r\n conditions: environments.ssr.conditions,\r\n external: environments.ssr.external,\r\n noExternal: environments.ssr.noExternal,\r\n outDir: environments.ssr.outDir,\r\n entry: environments.ssr.entry,\r\n minify: environments.ssr.minify,\r\n sourcemap: environments.ssr.sourcemap,\r\n } : undefined,\r\n edge: environments.edge ? {\r\n platform: environments.edge.platform,\r\n nodeTarget: environments.edge.nodeTarget,\r\n conditions: environments.edge.conditions,\r\n external: environments.edge.external,\r\n noExternal: environments.edge.noExternal,\r\n outDir: environments.edge.outDir,\r\n entry: environments.edge.entry,\r\n minify: environments.edge.minify,\r\n sourcemap: environments.edge.sourcemap,\r\n } : undefined,\r\n };\r\n\r\n const result = await native.buildMultiEnvironment(nativeBaseOptions, nativeEnvironments);\r\n\r\n const mapBuildResult = (r: NativeBuildResult): InternalBuildResult => ({\r\n outputDir: r.outputDir,\r\n durationMs: r.durationMs,\r\n totalSize: r.totalSize,\r\n chunks: r.chunks.map(c => ({\r\n fileName: c.fileName,\r\n chunkType: c.chunkType as 'entry' | 'chunk' | 'asset',\r\n size: c.size,\r\n })),\r\n });\r\n\r\n return {\r\n client: mapBuildResult(result.client),\r\n ssr: result.ssr ? mapBuildResult(result.ssr) : undefined,\r\n edge: result.edge ? mapBuildResult(result.edge) : undefined,\r\n totalDurationMs: result.totalDurationMs,\r\n };\r\n}\r\n"],"mappings":";AA6BA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@flight-framework/bundler-flightpack",
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "FlightPack native Rust bundler adapter for Flight Framework",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"flight",
|
|
20
|
+
"flightpack",
|
|
21
|
+
"bundler",
|
|
22
|
+
"rust",
|
|
23
|
+
"native",
|
|
24
|
+
"performance",
|
|
25
|
+
"typescript",
|
|
26
|
+
"react"
|
|
27
|
+
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/flight-framework/flight.git",
|
|
31
|
+
"directory": "packages/bundler-flightpack"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@flight-framework/bundler": "^3.0.0",
|
|
36
|
+
"@flight-framework/core": "^0.6.7"
|
|
37
|
+
},
|
|
38
|
+
"optionalDependencies": {
|
|
39
|
+
"@flight-framework/flightpack": "^0.1.1"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"tsup": "^8.5.1",
|
|
43
|
+
"typescript": "^5.9.3"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=20.0.0"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsup",
|
|
53
|
+
"dev": "tsup --watch",
|
|
54
|
+
"typecheck": "tsc --noEmit",
|
|
55
|
+
"clean": "rimraf dist"
|
|
56
|
+
}
|
|
57
57
|
}
|