@interfere/next 0.2.0-alpha.8 → 0.2.0-alpha.9
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/package.json +27 -27
- package/dist/_virtual/_rolldown/runtime.mjs +0 -13
- package/dist/config.d.mts +0 -11
- package/dist/config.d.mts.map +0 -1
- package/dist/config.mjs +0 -109
- package/dist/config.mjs.map +0 -1
- package/dist/instrument-client.d.mts +0 -3
- package/dist/instrument-client.mjs +0 -2
- package/dist/internal/build/configure-build.d.mts +0 -25
- package/dist/internal/build/configure-build.d.mts.map +0 -1
- package/dist/internal/build/configure-build.mjs +0 -87
- package/dist/internal/build/configure-build.mjs.map +0 -1
- package/dist/internal/build/release/destinations/vercel.d.mts +0 -6
- package/dist/internal/build/release/destinations/vercel.d.mts.map +0 -1
- package/dist/internal/build/release/destinations/vercel.mjs +0 -25
- package/dist/internal/build/release/destinations/vercel.mjs.map +0 -1
- package/dist/internal/build/release/git.d.mts +0 -4
- package/dist/internal/build/release/git.d.mts.map +0 -1
- package/dist/internal/build/release/git.mjs +0 -21
- package/dist/internal/build/release/git.mjs.map +0 -1
- package/dist/internal/build/release/index.d.mts +0 -7
- package/dist/internal/build/release/index.d.mts.map +0 -1
- package/dist/internal/build/release/index.mjs +0 -24
- package/dist/internal/build/release/index.mjs.map +0 -1
- package/dist/internal/build/release/sources/github.d.mts +0 -6
- package/dist/internal/build/release/sources/github.d.mts.map +0 -1
- package/dist/internal/build/release/sources/github.mjs +0 -15
- package/dist/internal/build/release/sources/github.mjs.map +0 -1
- package/dist/internal/build/source-maps/discover.d.mts +0 -14
- package/dist/internal/build/source-maps/discover.d.mts.map +0 -1
- package/dist/internal/build/source-maps/discover.mjs +0 -61
- package/dist/internal/build/source-maps/discover.mjs.map +0 -1
- package/dist/internal/build/source-maps/index.d.mts +0 -23
- package/dist/internal/build/source-maps/index.d.mts.map +0 -1
- package/dist/internal/build/source-maps/index.mjs +0 -33
- package/dist/internal/build/source-maps/index.mjs.map +0 -1
- package/dist/internal/build/value-injection-loader.d.mts +0 -10
- package/dist/internal/build/value-injection-loader.d.mts.map +0 -1
- package/dist/internal/build/value-injection-loader.mjs +0 -24
- package/dist/internal/build/value-injection-loader.mjs.map +0 -1
- package/dist/internal/env.d.mts +0 -16
- package/dist/internal/env.d.mts.map +0 -1
- package/dist/internal/env.mjs +0 -19
- package/dist/internal/env.mjs.map +0 -1
- package/dist/internal/logger.d.mts +0 -8
- package/dist/internal/logger.d.mts.map +0 -1
- package/dist/internal/logger.mjs +0 -44
- package/dist/internal/logger.mjs.map +0 -1
- package/dist/internal/route/handle-get.d.mts +0 -4
- package/dist/internal/route/handle-get.d.mts.map +0 -1
- package/dist/internal/route/handle-get.mjs +0 -15
- package/dist/internal/route/handle-get.mjs.map +0 -1
- package/dist/internal/route/handle-post.d.mts +0 -4
- package/dist/internal/route/handle-post.d.mts.map +0 -1
- package/dist/internal/route/handle-post.mjs +0 -105
- package/dist/internal/route/handle-post.mjs.map +0 -1
- package/dist/internal/route/sw-script.d.mts +0 -4
- package/dist/internal/route/sw-script.d.mts.map +0 -1
- package/dist/internal/route/sw-script.mjs +0 -32
- package/dist/internal/route/sw-script.mjs.map +0 -1
- package/dist/internal/server/capture.d.mts +0 -9
- package/dist/internal/server/capture.d.mts.map +0 -1
- package/dist/internal/server/capture.mjs +0 -50
- package/dist/internal/server/capture.mjs.map +0 -1
- package/dist/internal/server/dedupe.d.mts +0 -5
- package/dist/internal/server/dedupe.d.mts.map +0 -1
- package/dist/internal/server/dedupe.mjs +0 -11
- package/dist/internal/server/dedupe.mjs.map +0 -1
- package/dist/internal/server/envelope.d.mts +0 -14
- package/dist/internal/server/envelope.d.mts.map +0 -1
- package/dist/internal/server/envelope.mjs +0 -55
- package/dist/internal/server/envelope.mjs.map +0 -1
- package/dist/internal/server/normalize-request.d.mts +0 -7
- package/dist/internal/server/normalize-request.d.mts.map +0 -1
- package/dist/internal/server/normalize-request.mjs +0 -50
- package/dist/internal/server/normalize-request.mjs.map +0 -1
- package/dist/internal/server/runtime.d.mts +0 -14
- package/dist/internal/server/runtime.d.mts.map +0 -1
- package/dist/internal/server/runtime.mjs +0 -18
- package/dist/internal/server/runtime.mjs.map +0 -1
- package/dist/internal/server/transport.d.mts +0 -12
- package/dist/internal/server/transport.d.mts.map +0 -1
- package/dist/internal/server/transport.mjs +0 -17
- package/dist/internal/server/transport.mjs.map +0 -1
- package/dist/internal/server/types.d.mts +0 -17
- package/dist/internal/server/types.d.mts.map +0 -1
- package/dist/internal/server/types.mjs +0 -1
- package/dist/provider.d.mts +0 -3
- package/dist/provider.mjs +0 -3
- package/dist/route-handler.d.mts +0 -7
- package/dist/route-handler.d.mts.map +0 -1
- package/dist/route-handler.mjs +0 -26
- package/dist/route-handler.mjs.map +0 -1
- package/dist/server.d.mts +0 -3
- package/dist/server.mjs +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/next",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Build software that never breaks.",
|
|
6
6
|
"keywords": [
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
"test": "bun run test:unit && bun run test:browser"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@interfere/constants": "
|
|
68
|
-
"@interfere/react": "
|
|
69
|
-
"@interfere/sdk": "
|
|
70
|
-
"@interfere/types": "
|
|
71
|
-
"chalk": "
|
|
72
|
-
"glob": "
|
|
73
|
-
"uuid": "
|
|
67
|
+
"@interfere/constants": "workspace:*",
|
|
68
|
+
"@interfere/react": "workspace:*",
|
|
69
|
+
"@interfere/sdk": "workspace:*",
|
|
70
|
+
"@interfere/types": "workspace:*",
|
|
71
|
+
"chalk": "catalog:",
|
|
72
|
+
"glob": "catalog:",
|
|
73
|
+
"uuid": "catalog:"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@vercel/blob": "^2",
|
|
@@ -79,24 +79,24 @@
|
|
|
79
79
|
"react-dom": ">=19"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@interfere/typescript-config": "
|
|
83
|
-
"@interfere/vitest-config": "
|
|
84
|
-
"@testing-library/react": "
|
|
85
|
-
"@types/node": "
|
|
86
|
-
"@types/react": "
|
|
87
|
-
"@types/react-dom": "
|
|
88
|
-
"@vitejs/plugin-react": "
|
|
89
|
-
"@vitest/browser": "
|
|
90
|
-
"@vitest/browser-playwright": "
|
|
91
|
-
"@vitest/coverage-v8": "
|
|
92
|
-
"jsdom": "
|
|
93
|
-
"next": "
|
|
94
|
-
"playwright": "
|
|
95
|
-
"react": "
|
|
96
|
-
"react-dom": "
|
|
97
|
-
"tsdown": "
|
|
98
|
-
"typescript": "
|
|
99
|
-
"vitest": "
|
|
100
|
-
"webpack": "
|
|
82
|
+
"@interfere/typescript-config": "workspace:*",
|
|
83
|
+
"@interfere/vitest-config": "workspace:*",
|
|
84
|
+
"@testing-library/react": "catalog:",
|
|
85
|
+
"@types/node": "catalog:",
|
|
86
|
+
"@types/react": "catalog:",
|
|
87
|
+
"@types/react-dom": "catalog:",
|
|
88
|
+
"@vitejs/plugin-react": "catalog:",
|
|
89
|
+
"@vitest/browser": "catalog:",
|
|
90
|
+
"@vitest/browser-playwright": "catalog:",
|
|
91
|
+
"@vitest/coverage-v8": "catalog:",
|
|
92
|
+
"jsdom": "catalog:",
|
|
93
|
+
"next": "catalog:",
|
|
94
|
+
"playwright": "catalog:",
|
|
95
|
+
"react": "catalog:",
|
|
96
|
+
"react-dom": "catalog:",
|
|
97
|
+
"tsdown": "catalog:",
|
|
98
|
+
"typescript": "catalog:",
|
|
99
|
+
"vitest": "catalog:",
|
|
100
|
+
"webpack": "catalog:"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __exportAll = (all, no_symbols) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
-
return target;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { __exportAll };
|
package/dist/config.d.mts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Envelope } from "@interfere/types/sdk/envelope";
|
|
2
|
-
import { NextConfig } from "next";
|
|
3
|
-
|
|
4
|
-
//#region src/config.d.ts
|
|
5
|
-
interface InterfereConfig extends Partial<Pick<Envelope, "buildId" | "releaseId">> {}
|
|
6
|
-
interface NextConfigWithInterfere extends NextConfig {
|
|
7
|
-
interfere?: InterfereConfig;
|
|
8
|
-
}
|
|
9
|
-
declare function withInterfere(nextConfig?: NextConfigWithInterfere): NextConfig;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { InterfereConfig, NextConfigWithInterfere, withInterfere };
|
package/dist/config.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"mappings":";;;;UAciB,eAAA,SACP,OAAA,CAAQ,IAAA,CAAK,QAAA;AAAA,UAEN,uBAAA,SAAgC,UAAA;EAC/C,SAAA,GAAY,eAAA;AAAA;AAAA,iBAUE,aAAA,CACd,UAAA,GAAY,uBAAA,GACX,UAAA"}
|
package/dist/config.mjs
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { configureBuild } from "./internal/build/configure-build.mjs";
|
|
2
|
-
import { log } from "./internal/logger.mjs";
|
|
3
|
-
import { runGitCommand } from "./internal/build/release/git.mjs";
|
|
4
|
-
import { readInterfereEnv } from "./internal/env.mjs";
|
|
5
|
-
import { releaseDestinationIdEnvKeys, releaseSourceIdEnvKeys } from "@interfere/types/integrations";
|
|
6
|
-
import { parseEnvValue, readFirstEnvValue } from "@interfere/types/sdk/env";
|
|
7
|
-
//#region src/config.ts
|
|
8
|
-
function withInterfere(nextConfig = {}) {
|
|
9
|
-
const { interfere, env: userEnv, webpack, turbopack, compiler, productionBrowserSourceMaps, ...rest } = nextConfig;
|
|
10
|
-
const config = resolveBuildConfig(interfere);
|
|
11
|
-
const build = configureBuild({
|
|
12
|
-
existingWebpack: webpack,
|
|
13
|
-
existingTurbopack: turbopack,
|
|
14
|
-
projectDir: process.cwd(),
|
|
15
|
-
values: {
|
|
16
|
-
__INTERFERE_BUILD_ID__: config.buildId,
|
|
17
|
-
__INTERFERE_RELEASE_ID__: config.releaseId
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
if (config.apiKey !== null && !build.webpack && !build.turbopack) throw new Error("[Interfere] INTERFERE_API_KEY is set but no instrumentation-client file was found. Create an instrumentation-client.ts file in your project root or src/ directory. See: https://interfere.com/docs/nextjs/setup");
|
|
21
|
-
const existingHook = compiler?.runAfterProductionCompile;
|
|
22
|
-
return {
|
|
23
|
-
...rest,
|
|
24
|
-
env: mergeEnvConfig(userEnv, config),
|
|
25
|
-
compiler: {
|
|
26
|
-
...compiler ?? {},
|
|
27
|
-
async runAfterProductionCompile(context) {
|
|
28
|
-
if (existingHook) await existingHook(context);
|
|
29
|
-
await runBuildReleasePipeline(context, config);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
webpack: build.webpack,
|
|
33
|
-
turbopack: build.turbopack,
|
|
34
|
-
productionBrowserSourceMaps: config.apiKey !== null ? true : productionBrowserSourceMaps
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function resolveBuildConfig(interfere) {
|
|
38
|
-
const { apiKey, apiUrl } = readInterfereEnv();
|
|
39
|
-
const buildId = parseEnvValue(interfere?.buildId) ?? readFirstEnvValue(process.env, releaseSourceIdEnvKeys) ?? runGitCommand("git rev-parse HEAD");
|
|
40
|
-
return {
|
|
41
|
-
apiKey,
|
|
42
|
-
apiUrl,
|
|
43
|
-
buildId,
|
|
44
|
-
releaseId: parseEnvValue(interfere?.releaseId) ?? readFirstEnvValue(process.env, releaseDestinationIdEnvKeys) ?? buildId
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function mergeEnvConfig(userEnv, config) {
|
|
48
|
-
const merged = {};
|
|
49
|
-
if (config.buildId !== null) merged.NEXT_PUBLIC_INTERFERE_BUILD_ID = config.buildId;
|
|
50
|
-
if (config.releaseId !== null) merged.NEXT_PUBLIC_INTERFERE_RELEASE_ID = config.releaseId;
|
|
51
|
-
return {
|
|
52
|
-
...merged,
|
|
53
|
-
...userEnv
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
async function runBuildReleasePipeline(context, config) {
|
|
57
|
-
const { apiKey, apiUrl, buildId } = config;
|
|
58
|
-
if (apiKey === null) throw new Error("[Interfere] INTERFERE_API_KEY is not set. withInterfere() requires an API key to upload source maps during production builds. Set the INTERFERE_API_KEY environment variable, or remove withInterfere() from your Next.js config. See: https://interfere.com/docs/nextjs/setup");
|
|
59
|
-
if (buildId === null) {
|
|
60
|
-
log.error("Build ID missing", [
|
|
61
|
-
"Could not resolve a build ID from config, environment variables, or git.",
|
|
62
|
-
"Source maps will not be uploaded and errors will have unresolved stack traces.",
|
|
63
|
-
"Set INTERFERE_BUILD_ID, or ensure git is available in your build environment."
|
|
64
|
-
]);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const { createRelease } = await import("./internal/build/release/index.mjs");
|
|
68
|
-
const { runSourceMapPipeline } = await import("./internal/build/source-maps/index.mjs");
|
|
69
|
-
const client = {
|
|
70
|
-
async createRelease() {
|
|
71
|
-
const release = await createRelease(apiKey, apiUrl, buildId);
|
|
72
|
-
return {
|
|
73
|
-
slug: release.destination.slug,
|
|
74
|
-
orgSlug: release.org.slug,
|
|
75
|
-
buildId: release.build.hash ?? buildId
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
|
-
async uploadSourceMaps(releaseSlug, body) {
|
|
79
|
-
const url = `${apiUrl}/v1/releases/${releaseSlug}/source-maps`;
|
|
80
|
-
const response = await fetch(url, {
|
|
81
|
-
method: "POST",
|
|
82
|
-
headers: { "x-api-key": apiKey },
|
|
83
|
-
body
|
|
84
|
-
});
|
|
85
|
-
if (!response.ok) {
|
|
86
|
-
const text = await response.text().catch(() => "");
|
|
87
|
-
throw new Error(`Source map upload failed: ${response.status} ${response.statusText} ${text}`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
try {
|
|
92
|
-
const result = await runSourceMapPipeline(context.projectDir, context.distDir, client);
|
|
93
|
-
if (!result.ready) {
|
|
94
|
-
log.warn("Skipping", ["No source maps found"]);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
log.info("Completed", [
|
|
98
|
-
`https://interfere.com/~/${result.orgSlug}`,
|
|
99
|
-
`Release: ${result.releaseSlug}`,
|
|
100
|
-
`Build: ${result.buildId}`,
|
|
101
|
-
`Artifacts: ${result.fileCount} source maps`
|
|
102
|
-
]);
|
|
103
|
-
} catch (error) {
|
|
104
|
-
log.error("Error", [error instanceof Error ? error.message : String(error)]);
|
|
105
|
-
throw error;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
//#endregion
|
|
109
|
-
export { withInterfere };
|
package/dist/config.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import {\n releaseDestinationIdEnvKeys,\n releaseSourceIdEnvKeys,\n} from \"@interfere/types/integrations\";\nimport { parseEnvValue, readFirstEnvValue } from \"@interfere/types/sdk/env\";\nimport type { Envelope } from \"@interfere/types/sdk/envelope\";\n\nimport type { NextConfig } from \"next\";\n\nimport { configureBuild } from \"./internal/build/configure-build.js\";\nimport { runGitCommand } from \"./internal/build/release/git.js\";\nimport { readInterfereEnv } from \"./internal/env.js\";\nimport { log } from \"./internal/logger.js\";\n\nexport interface InterfereConfig\n extends Partial<Pick<Envelope, \"buildId\" | \"releaseId\">> {}\n\nexport interface NextConfigWithInterfere extends NextConfig {\n interfere?: InterfereConfig;\n}\n\ninterface ResolvedBuildConfig {\n readonly apiKey: string | null;\n readonly apiUrl: string;\n readonly buildId: string | null;\n readonly releaseId: string | null;\n}\n\nexport function withInterfere(\n nextConfig: NextConfigWithInterfere = {}\n): NextConfig {\n const {\n interfere,\n env: userEnv,\n webpack,\n turbopack,\n compiler,\n productionBrowserSourceMaps,\n ...rest\n } = nextConfig;\n\n const config = resolveBuildConfig(interfere);\n const build = configureBuild({\n existingWebpack: webpack,\n existingTurbopack: turbopack,\n projectDir: process.cwd(),\n values: {\n __INTERFERE_BUILD_ID__: config.buildId,\n __INTERFERE_RELEASE_ID__: config.releaseId,\n },\n });\n\n if (config.apiKey !== null && !build.webpack && !build.turbopack) {\n throw new Error(\n \"[Interfere] INTERFERE_API_KEY is set but no instrumentation-client file was found. \" +\n \"Create an instrumentation-client.ts file in your project root or src/ directory. \" +\n \"See: https://interfere.com/docs/nextjs/setup\"\n );\n }\n\n const existingHook = (compiler as NextCompilerWithProductionHook | undefined)\n ?.runAfterProductionCompile;\n\n return {\n ...rest,\n env: mergeEnvConfig(userEnv, config),\n compiler: {\n ...(compiler ?? {}),\n async runAfterProductionCompile(context: ProductionCompileContext) {\n if (existingHook) {\n await existingHook(context);\n }\n\n await runBuildReleasePipeline(context, config);\n },\n } as NextConfig[\"compiler\"],\n webpack: build.webpack,\n turbopack: build.turbopack,\n productionBrowserSourceMaps:\n config.apiKey !== null ? true : productionBrowserSourceMaps,\n };\n}\n\nfunction resolveBuildConfig(interfere?: InterfereConfig): ResolvedBuildConfig {\n const { apiKey, apiUrl } = readInterfereEnv();\n\n const buildId =\n parseEnvValue(interfere?.buildId) ??\n readFirstEnvValue(process.env, releaseSourceIdEnvKeys) ??\n runGitCommand(\"git rev-parse HEAD\");\n const releaseId =\n parseEnvValue(interfere?.releaseId) ??\n readFirstEnvValue(process.env, releaseDestinationIdEnvKeys) ??\n buildId;\n\n return { apiKey, apiUrl, buildId, releaseId };\n}\n\nfunction mergeEnvConfig(\n userEnv: NextConfig[\"env\"] | undefined,\n config: ResolvedBuildConfig\n): NextConfig[\"env\"] {\n const merged: Record<string, string> = {};\n\n if (config.buildId !== null) {\n merged.NEXT_PUBLIC_INTERFERE_BUILD_ID = config.buildId;\n }\n\n if (config.releaseId !== null) {\n merged.NEXT_PUBLIC_INTERFERE_RELEASE_ID = config.releaseId;\n }\n\n return { ...merged, ...userEnv };\n}\n\ninterface ProductionCompileContext {\n readonly distDir: string;\n readonly projectDir: string;\n}\n\ntype NextCompilerWithProductionHook = NonNullable<NextConfig[\"compiler\"]> & {\n runAfterProductionCompile?: (\n context: ProductionCompileContext\n ) => void | Promise<void>;\n};\n\nasync function runBuildReleasePipeline(\n context: ProductionCompileContext,\n config: ResolvedBuildConfig\n): Promise<void> {\n const { apiKey, apiUrl, buildId } = config;\n\n if (apiKey === null) {\n throw new Error(\n \"[Interfere] INTERFERE_API_KEY is not set. \" +\n \"withInterfere() requires an API key to upload source maps during production builds. \" +\n \"Set the INTERFERE_API_KEY environment variable, or remove withInterfere() from your Next.js config. \" +\n \"See: https://interfere.com/docs/nextjs/setup\"\n );\n }\n\n if (buildId === null) {\n log.error(\"Build ID missing\", [\n \"Could not resolve a build ID from config, environment variables, or git.\",\n \"Source maps will not be uploaded and errors will have unresolved stack traces.\",\n \"Set INTERFERE_BUILD_ID, or ensure git is available in your build environment.\",\n ]);\n return;\n }\n\n const { createRelease } = await import(\"./internal/build/release/index.js\");\n const { runSourceMapPipeline } = await import(\n \"./internal/build/source-maps/index.js\"\n );\n\n const client: import(\"./internal/build/source-maps/index.js\").BuildClient = {\n async createRelease() {\n const release = await createRelease(apiKey, apiUrl, buildId);\n return {\n slug: release.destination.slug,\n orgSlug: release.org.slug,\n buildId: release.build.hash ?? buildId,\n };\n },\n async uploadSourceMaps(releaseSlug, body) {\n const url = `${apiUrl}/v1/releases/${releaseSlug}/source-maps`;\n const response = await fetch(url, {\n method: \"POST\",\n headers: { \"x-api-key\": apiKey },\n body,\n });\n\n if (!response.ok) {\n const text = await response.text().catch(() => \"\");\n throw new Error(\n `Source map upload failed: ${response.status} ${response.statusText} ${text}`\n );\n }\n },\n };\n\n try {\n const result = await runSourceMapPipeline(\n context.projectDir,\n context.distDir,\n client\n );\n\n if (!result.ready) {\n log.warn(\"Skipping\", [\"No source maps found\"]);\n return;\n }\n\n log.info(\"Completed\", [\n `https://interfere.com/~/${result.orgSlug}`,\n `Release: ${result.releaseSlug}`,\n `Build: ${result.buildId}`,\n `Artifacts: ${result.fileCount} source maps`,\n ]);\n } catch (error) {\n log.error(\"Error\", [\n error instanceof Error ? error.message : String(error),\n ]);\n throw error;\n }\n}\n"],"mappings":";;;;;;;AA4BA,SAAgB,cACd,aAAsC,EAAE,EAC5B;CACZ,MAAM,EACJ,WACA,KAAK,SACL,SACA,WACA,UACA,6BACA,GAAG,SACD;CAEJ,MAAM,SAAS,mBAAmB,UAAU;CAC5C,MAAM,QAAQ,eAAe;EAC3B,iBAAiB;EACjB,mBAAmB;EACnB,YAAY,QAAQ,KAAK;EACzB,QAAQ;GACN,wBAAwB,OAAO;GAC/B,0BAA0B,OAAO;GAClC;EACF,CAAC;AAEF,KAAI,OAAO,WAAW,QAAQ,CAAC,MAAM,WAAW,CAAC,MAAM,UACrD,OAAM,IAAI,MACR,mNAGD;CAGH,MAAM,eAAgB,UAClB;AAEJ,QAAO;EACL,GAAG;EACH,KAAK,eAAe,SAAS,OAAO;EACpC,UAAU;GACR,GAAI,YAAY,EAAE;GAClB,MAAM,0BAA0B,SAAmC;AACjE,QAAI,aACF,OAAM,aAAa,QAAQ;AAG7B,UAAM,wBAAwB,SAAS,OAAO;;GAEjD;EACD,SAAS,MAAM;EACf,WAAW,MAAM;EACjB,6BACE,OAAO,WAAW,OAAO,OAAO;EACnC;;AAGH,SAAS,mBAAmB,WAAkD;CAC5E,MAAM,EAAE,QAAQ,WAAW,kBAAkB;CAE7C,MAAM,UACJ,cAAc,WAAW,QAAQ,IACjC,kBAAkB,QAAQ,KAAK,uBAAuB,IACtD,cAAc,qBAAqB;AAMrC,QAAO;EAAE;EAAQ;EAAQ;EAAS,WAJhC,cAAc,WAAW,UAAU,IACnC,kBAAkB,QAAQ,KAAK,4BAA4B,IAC3D;EAE2C;;AAG/C,SAAS,eACP,SACA,QACmB;CACnB,MAAM,SAAiC,EAAE;AAEzC,KAAI,OAAO,YAAY,KACrB,QAAO,iCAAiC,OAAO;AAGjD,KAAI,OAAO,cAAc,KACvB,QAAO,mCAAmC,OAAO;AAGnD,QAAO;EAAE,GAAG;EAAQ,GAAG;EAAS;;AAclC,eAAe,wBACb,SACA,QACe;CACf,MAAM,EAAE,QAAQ,QAAQ,YAAY;AAEpC,KAAI,WAAW,KACb,OAAM,IAAI,MACR,iRAID;AAGH,KAAI,YAAY,MAAM;AACpB,MAAI,MAAM,oBAAoB;GAC5B;GACA;GACA;GACD,CAAC;AACF;;CAGF,MAAM,EAAE,kBAAkB,MAAM,OAAO;CACvC,MAAM,EAAE,yBAAyB,MAAM,OACrC;CAGF,MAAM,SAAsE;EAC1E,MAAM,gBAAgB;GACpB,MAAM,UAAU,MAAM,cAAc,QAAQ,QAAQ,QAAQ;AAC5D,UAAO;IACL,MAAM,QAAQ,YAAY;IAC1B,SAAS,QAAQ,IAAI;IACrB,SAAS,QAAQ,MAAM,QAAQ;IAChC;;EAEH,MAAM,iBAAiB,aAAa,MAAM;GACxC,MAAM,MAAM,GAAG,OAAO,eAAe,YAAY;GACjD,MAAM,WAAW,MAAM,MAAM,KAAK;IAChC,QAAQ;IACR,SAAS,EAAE,aAAa,QAAQ;IAChC;IACD,CAAC;AAEF,OAAI,CAAC,SAAS,IAAI;IAChB,MAAM,OAAO,MAAM,SAAS,MAAM,CAAC,YAAY,GAAG;AAClD,UAAM,IAAI,MACR,6BAA6B,SAAS,OAAO,GAAG,SAAS,WAAW,GAAG,OACxE;;;EAGN;AAED,KAAI;EACF,MAAM,SAAS,MAAM,qBACnB,QAAQ,YACR,QAAQ,SACR,OACD;AAED,MAAI,CAAC,OAAO,OAAO;AACjB,OAAI,KAAK,YAAY,CAAC,uBAAuB,CAAC;AAC9C;;AAGF,MAAI,KAAK,aAAa;GACpB,2BAA2B,OAAO;GAClC,YAAY,OAAO;GACnB,UAAU,OAAO;GACjB,cAAc,OAAO,UAAU;GAChC,CAAC;UACK,OAAO;AACd,MAAI,MAAM,SAAS,CACjB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CACvD,CAAC;AACF,QAAM"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { NextConfig } from "next";
|
|
2
|
-
|
|
3
|
-
//#region src/internal/build/configure-build.d.ts
|
|
4
|
-
interface InterfereInjectedValues {
|
|
5
|
-
readonly __INTERFERE_BUILD_ID__: string | null;
|
|
6
|
-
readonly __INTERFERE_RELEASE_ID__: string | null;
|
|
7
|
-
}
|
|
8
|
-
interface ConfigureBuildInput {
|
|
9
|
-
readonly existingWebpack: NextConfig["webpack"] | undefined;
|
|
10
|
-
readonly existingTurbopack: NextConfig["turbopack"] | undefined;
|
|
11
|
-
readonly projectDir: string;
|
|
12
|
-
readonly values: InterfereInjectedValues;
|
|
13
|
-
}
|
|
14
|
-
interface ConfigureBuildOutput {
|
|
15
|
-
readonly webpack: NextConfig["webpack"] | undefined;
|
|
16
|
-
readonly turbopack: NextConfig["turbopack"] | undefined;
|
|
17
|
-
}
|
|
18
|
-
declare function configureBuild({
|
|
19
|
-
existingWebpack,
|
|
20
|
-
existingTurbopack,
|
|
21
|
-
projectDir,
|
|
22
|
-
values
|
|
23
|
-
}: ConfigureBuildInput): ConfigureBuildOutput;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { InterfereInjectedValues, configureBuild };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configure-build.d.mts","names":[],"sources":["../../../src/internal/build/configure-build.ts"],"mappings":";;;UAKiB,uBAAA;EAAA,SACN,sBAAA;EAAA,SACA,wBAAA;AAAA;AAAA,UAqBD,mBAAA;EAAA,SACC,eAAA,EAAiB,UAAA;EAAA,SACjB,iBAAA,EAAmB,UAAA;EAAA,SACnB,UAAA;EAAA,SACA,MAAA,EAAQ,uBAAA;AAAA;AAAA,UAGT,oBAAA;EAAA,SACC,OAAA,EAAS,UAAA;EAAA,SACT,SAAA,EAAW,UAAA;AAAA;AAAA,iBAGN,cAAA,CAAA;EACd,eAAA;EACA,iBAAA;EACA,UAAA;EACA;AAAA,GACC,mBAAA,GAAsB,oBAAA"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
2
|
-
import { basename, dirname, join, normalize, resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
//#region src/internal/build/configure-build.ts
|
|
5
|
-
const INSTRUMENTATION_CLIENT_FILES = [
|
|
6
|
-
"instrumentation-client.ts",
|
|
7
|
-
"instrumentation-client.tsx",
|
|
8
|
-
"instrumentation-client.js",
|
|
9
|
-
"instrumentation-client.jsx",
|
|
10
|
-
"src/instrumentation-client.ts",
|
|
11
|
-
"src/instrumentation-client.tsx",
|
|
12
|
-
"src/instrumentation-client.js",
|
|
13
|
-
"src/instrumentation-client.jsx"
|
|
14
|
-
];
|
|
15
|
-
const LOADER_FILE_CANDIDATES = [
|
|
16
|
-
"value-injection-loader.ts",
|
|
17
|
-
"value-injection-loader.js",
|
|
18
|
-
"value-injection-loader.mjs",
|
|
19
|
-
"value-injection-loader.cjs"
|
|
20
|
-
];
|
|
21
|
-
function configureBuild({ existingWebpack, existingTurbopack, projectDir, values }) {
|
|
22
|
-
const instrumentationClientPath = resolveInstrumentationClientPath(projectDir);
|
|
23
|
-
return {
|
|
24
|
-
webpack: buildWebpackHook(existingWebpack, instrumentationClientPath, values),
|
|
25
|
-
turbopack: buildTurbopackConfig(existingTurbopack, instrumentationClientPath, values)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function hasInjectedMetadata(metadata) {
|
|
29
|
-
return metadata.__INTERFERE_BUILD_ID__ !== null || metadata.__INTERFERE_RELEASE_ID__ !== null;
|
|
30
|
-
}
|
|
31
|
-
function buildWebpackHook(existingWebpack, instrumentationClientPath, values) {
|
|
32
|
-
if (!(instrumentationClientPath && hasInjectedMetadata(values))) return existingWebpack;
|
|
33
|
-
const normalizedPath = normalize(instrumentationClientPath);
|
|
34
|
-
const loaderPath = resolveLoaderPath();
|
|
35
|
-
return (webpackConfig, options) => {
|
|
36
|
-
const outputConfig = existingWebpack ? existingWebpack(webpackConfig, options) : webpackConfig;
|
|
37
|
-
const mutableConfig = outputConfig;
|
|
38
|
-
const injectionRule = {
|
|
39
|
-
test: (resource) => Boolean(resource) && normalize(resource) === normalizedPath,
|
|
40
|
-
use: [{
|
|
41
|
-
loader: loaderPath,
|
|
42
|
-
options: { values }
|
|
43
|
-
}]
|
|
44
|
-
};
|
|
45
|
-
mutableConfig.module ??= {};
|
|
46
|
-
mutableConfig.module.rules ??= [];
|
|
47
|
-
mutableConfig.module.rules.push(injectionRule);
|
|
48
|
-
return outputConfig;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function buildTurbopackConfig(existingTurbopack, instrumentationClientPath, values) {
|
|
52
|
-
if (!(instrumentationClientPath && hasInjectedMetadata(values))) return existingTurbopack;
|
|
53
|
-
const baseConfig = existingTurbopack ?? {};
|
|
54
|
-
const ruleKey = `**/${basename(instrumentationClientPath)}`;
|
|
55
|
-
const existingRule = baseConfig.rules?.[ruleKey] ?? {};
|
|
56
|
-
const existingLoaders = Array.isArray(existingRule.loaders) ? existingRule.loaders : [];
|
|
57
|
-
return {
|
|
58
|
-
...baseConfig,
|
|
59
|
-
rules: {
|
|
60
|
-
...baseConfig.rules,
|
|
61
|
-
[ruleKey]: {
|
|
62
|
-
...existingRule,
|
|
63
|
-
loaders: [...existingLoaders, {
|
|
64
|
-
loader: resolveLoaderPath(),
|
|
65
|
-
options: { serializedValues: JSON.stringify(values) }
|
|
66
|
-
}]
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function resolveInstrumentationClientPath(projectDir) {
|
|
72
|
-
for (const candidate of INSTRUMENTATION_CLIENT_FILES) {
|
|
73
|
-
const filePath = resolve(projectDir, candidate);
|
|
74
|
-
if (existsSync(filePath)) return filePath;
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
function resolveLoaderPath() {
|
|
79
|
-
const directory = resolve(dirname(fileURLToPath(import.meta.url)));
|
|
80
|
-
for (const candidate of LOADER_FILE_CANDIDATES) {
|
|
81
|
-
const filePath = join(directory, candidate);
|
|
82
|
-
if (existsSync(filePath)) return filePath;
|
|
83
|
-
}
|
|
84
|
-
return join(directory, "value-injection-loader.js");
|
|
85
|
-
}
|
|
86
|
-
//#endregion
|
|
87
|
-
export { configureBuild };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configure-build.mjs","names":[],"sources":["../../../src/internal/build/configure-build.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { basename, dirname, join, normalize, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { NextConfig } from \"next\";\n\nexport interface InterfereInjectedValues {\n readonly __INTERFERE_BUILD_ID__: string | null;\n readonly __INTERFERE_RELEASE_ID__: string | null;\n}\n\nconst INSTRUMENTATION_CLIENT_FILES = [\n \"instrumentation-client.ts\",\n \"instrumentation-client.tsx\",\n \"instrumentation-client.js\",\n \"instrumentation-client.jsx\",\n \"src/instrumentation-client.ts\",\n \"src/instrumentation-client.tsx\",\n \"src/instrumentation-client.js\",\n \"src/instrumentation-client.jsx\",\n] as const;\n\nconst LOADER_FILE_CANDIDATES = [\n \"value-injection-loader.ts\",\n \"value-injection-loader.js\",\n \"value-injection-loader.mjs\",\n \"value-injection-loader.cjs\",\n] as const;\n\ninterface ConfigureBuildInput {\n readonly existingWebpack: NextConfig[\"webpack\"] | undefined;\n readonly existingTurbopack: NextConfig[\"turbopack\"] | undefined;\n readonly projectDir: string;\n readonly values: InterfereInjectedValues;\n}\n\ninterface ConfigureBuildOutput {\n readonly webpack: NextConfig[\"webpack\"] | undefined;\n readonly turbopack: NextConfig[\"turbopack\"] | undefined;\n}\n\nexport function configureBuild({\n existingWebpack,\n existingTurbopack,\n projectDir,\n values,\n}: ConfigureBuildInput): ConfigureBuildOutput {\n const instrumentationClientPath = resolveInstrumentationClientPath(projectDir);\n\n return {\n webpack: buildWebpackHook(existingWebpack, instrumentationClientPath, values),\n turbopack: buildTurbopackConfig(\n existingTurbopack,\n instrumentationClientPath,\n values\n ),\n };\n}\n\nfunction hasInjectedMetadata(metadata: InterfereInjectedValues): boolean {\n return (\n metadata.__INTERFERE_BUILD_ID__ !== null ||\n metadata.__INTERFERE_RELEASE_ID__ !== null\n );\n}\n\nfunction buildWebpackHook(\n existingWebpack: NextConfig[\"webpack\"] | undefined,\n instrumentationClientPath: string | null,\n values: InterfereInjectedValues\n): NextConfig[\"webpack\"] | undefined {\n if (!(instrumentationClientPath && hasInjectedMetadata(values))) {\n return existingWebpack;\n }\n\n const normalizedPath = normalize(instrumentationClientPath);\n const loaderPath = resolveLoaderPath();\n\n return (webpackConfig, options) => {\n const outputConfig = existingWebpack\n ? existingWebpack(webpackConfig, options)\n : webpackConfig;\n const mutableConfig = outputConfig as {\n module?: { rules?: unknown[] };\n };\n\n const injectionRule = {\n test: (resource: string): boolean =>\n Boolean(resource) && normalize(resource) === normalizedPath,\n use: [\n {\n loader: loaderPath,\n options: { values },\n },\n ],\n };\n\n mutableConfig.module ??= {};\n mutableConfig.module.rules ??= [];\n mutableConfig.module.rules.push(injectionRule);\n\n return outputConfig;\n };\n}\n\nfunction buildTurbopackConfig(\n existingTurbopack: NextConfig[\"turbopack\"] | undefined,\n instrumentationClientPath: string | null,\n values: InterfereInjectedValues\n): NextConfig[\"turbopack\"] | undefined {\n if (!(instrumentationClientPath && hasInjectedMetadata(values))) {\n return existingTurbopack;\n }\n\n const baseConfig = (existingTurbopack ?? {}) as {\n rules?: Record<string, unknown>;\n };\n const ruleKey = `**/${basename(instrumentationClientPath)}`;\n const existingRule = (baseConfig.rules?.[ruleKey] ?? {}) as {\n loaders?: unknown[];\n };\n const existingLoaders = Array.isArray(existingRule.loaders)\n ? existingRule.loaders\n : [];\n\n return {\n ...baseConfig,\n rules: {\n ...baseConfig.rules,\n [ruleKey]: {\n ...existingRule,\n loaders: [\n ...existingLoaders,\n {\n loader: resolveLoaderPath(),\n options: {\n serializedValues: JSON.stringify(values),\n },\n },\n ],\n },\n },\n } as NextConfig[\"turbopack\"];\n}\n\nfunction resolveInstrumentationClientPath(projectDir: string): string | null {\n for (const candidate of INSTRUMENTATION_CLIENT_FILES) {\n const filePath = resolve(projectDir, candidate);\n if (existsSync(filePath)) {\n return filePath;\n }\n }\n\n return null;\n}\n\nfunction resolveLoaderPath(): string {\n const directory = resolve(dirname(fileURLToPath(import.meta.url)));\n\n for (const candidate of LOADER_FILE_CANDIDATES) {\n const filePath = join(directory, candidate);\n if (existsSync(filePath)) {\n return filePath;\n }\n }\n\n return join(directory, \"value-injection-loader.js\");\n}\n"],"mappings":";;;;AAUA,MAAM,+BAA+B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACD;AAcD,SAAgB,eAAe,EAC7B,iBACA,mBACA,YACA,UAC4C;CAC5C,MAAM,4BAA4B,iCAAiC,WAAW;AAE9E,QAAO;EACL,SAAS,iBAAiB,iBAAiB,2BAA2B,OAAO;EAC7E,WAAW,qBACT,mBACA,2BACA,OACD;EACF;;AAGH,SAAS,oBAAoB,UAA4C;AACvE,QACE,SAAS,2BAA2B,QACpC,SAAS,6BAA6B;;AAI1C,SAAS,iBACP,iBACA,2BACA,QACmC;AACnC,KAAI,EAAE,6BAA6B,oBAAoB,OAAO,EAC5D,QAAO;CAGT,MAAM,iBAAiB,UAAU,0BAA0B;CAC3D,MAAM,aAAa,mBAAmB;AAEtC,SAAQ,eAAe,YAAY;EACjC,MAAM,eAAe,kBACjB,gBAAgB,eAAe,QAAQ,GACvC;EACJ,MAAM,gBAAgB;EAItB,MAAM,gBAAgB;GACpB,OAAO,aACL,QAAQ,SAAS,IAAI,UAAU,SAAS,KAAK;GAC/C,KAAK,CACH;IACE,QAAQ;IACR,SAAS,EAAE,QAAQ;IACpB,CACF;GACF;AAED,gBAAc,WAAW,EAAE;AAC3B,gBAAc,OAAO,UAAU,EAAE;AACjC,gBAAc,OAAO,MAAM,KAAK,cAAc;AAE9C,SAAO;;;AAIX,SAAS,qBACP,mBACA,2BACA,QACqC;AACrC,KAAI,EAAE,6BAA6B,oBAAoB,OAAO,EAC5D,QAAO;CAGT,MAAM,aAAc,qBAAqB,EAAE;CAG3C,MAAM,UAAU,MAAM,SAAS,0BAA0B;CACzD,MAAM,eAAgB,WAAW,QAAQ,YAAY,EAAE;CAGvD,MAAM,kBAAkB,MAAM,QAAQ,aAAa,QAAQ,GACvD,aAAa,UACb,EAAE;AAEN,QAAO;EACL,GAAG;EACH,OAAO;GACL,GAAG,WAAW;IACb,UAAU;IACT,GAAG;IACH,SAAS,CACP,GAAG,iBACH;KACE,QAAQ,mBAAmB;KAC3B,SAAS,EACP,kBAAkB,KAAK,UAAU,OAAO,EACzC;KACF,CACF;IACF;GACF;EACF;;AAGH,SAAS,iCAAiC,YAAmC;AAC3E,MAAK,MAAM,aAAa,8BAA8B;EACpD,MAAM,WAAW,QAAQ,YAAY,UAAU;AAC/C,MAAI,WAAW,SAAS,CACtB,QAAO;;AAIX,QAAO;;AAGT,SAAS,oBAA4B;CACnC,MAAM,YAAY,QAAQ,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC,CAAC;AAElE,MAAK,MAAM,aAAa,wBAAwB;EAC9C,MAAM,WAAW,KAAK,WAAW,UAAU;AAC3C,MAAI,WAAW,SAAS,CACtB,QAAO;;AAIX,QAAO,KAAK,WAAW,4BAA4B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercel.d.mts","names":[],"sources":["../../../../../src/internal/build/release/destinations/vercel.ts"],"mappings":";;;iBAGgB,OAAA,CAAA,GAAW,0BAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { __exportAll } from "../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { parseEnvValue } from "@interfere/types/sdk/env";
|
|
3
|
-
//#region src/internal/build/release/destinations/vercel.ts
|
|
4
|
-
var vercel_exports = /* @__PURE__ */ __exportAll({ resolve: () => resolve });
|
|
5
|
-
function resolve() {
|
|
6
|
-
const deploymentId = parseEnvValue(process.env.VERCEL_DEPLOYMENT_ID);
|
|
7
|
-
const environment = parseEnvValue(process.env.VERCEL_ENV ?? process.env.VERCEL_TARGET_ENV);
|
|
8
|
-
if (!deploymentId && !environment) return null;
|
|
9
|
-
return {
|
|
10
|
-
provider: "vercel",
|
|
11
|
-
environment,
|
|
12
|
-
deploymentId,
|
|
13
|
-
deploymentUrl: resolveDeploymentUrl(),
|
|
14
|
-
environmentName: environment,
|
|
15
|
-
environmentTarget: environment
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function resolveDeploymentUrl() {
|
|
19
|
-
const deploymentUrl = parseEnvValue(process.env.VERCEL_URL);
|
|
20
|
-
if (deploymentUrl === null) return null;
|
|
21
|
-
if (deploymentUrl.startsWith("https://") || deploymentUrl.startsWith("http://")) return deploymentUrl;
|
|
22
|
-
return `https://${deploymentUrl}`;
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { resolve, vercel_exports };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercel.mjs","names":[],"sources":["../../../../../src/internal/build/release/destinations/vercel.ts"],"sourcesContent":["import type { ReleaseDestinationMetadata } from \"@interfere/types/integrations\";\nimport { parseEnvValue } from \"@interfere/types/sdk/env\";\n\nexport function resolve(): ReleaseDestinationMetadata | null {\n const deploymentId = parseEnvValue(process.env.VERCEL_DEPLOYMENT_ID);\n const environment = parseEnvValue(\n process.env.VERCEL_ENV ?? process.env.VERCEL_TARGET_ENV,\n );\n\n if (!deploymentId && !environment) {\n return null;\n }\n\n return {\n provider: \"vercel\",\n environment,\n deploymentId,\n deploymentUrl: resolveDeploymentUrl(),\n environmentName: environment,\n environmentTarget: environment,\n };\n}\n\nfunction resolveDeploymentUrl(): string | null {\n const deploymentUrl = parseEnvValue(process.env.VERCEL_URL);\n\n if (deploymentUrl === null) {\n return null;\n }\n\n if (\n deploymentUrl.startsWith(\"https://\") ||\n deploymentUrl.startsWith(\"http://\")\n ) {\n return deploymentUrl;\n }\n\n return `https://${deploymentUrl}`;\n}\n"],"mappings":";;;;AAGA,SAAgB,UAA6C;CAC3D,MAAM,eAAe,cAAc,QAAQ,IAAI,qBAAqB;CACpE,MAAM,cAAc,cAClB,QAAQ,IAAI,cAAc,QAAQ,IAAI,kBACvC;AAED,KAAI,CAAC,gBAAgB,CAAC,YACpB,QAAO;AAGT,QAAO;EACL,UAAU;EACV;EACA;EACA,eAAe,sBAAsB;EACrC,iBAAiB;EACjB,mBAAmB;EACpB;;AAGH,SAAS,uBAAsC;CAC7C,MAAM,gBAAgB,cAAc,QAAQ,IAAI,WAAW;AAE3D,KAAI,kBAAkB,KACpB,QAAO;AAGT,KACE,cAAc,WAAW,WAAW,IACpC,cAAc,WAAW,UAAU,CAEnC,QAAO;AAGT,QAAO,WAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.mts","names":[],"sources":["../../../../src/internal/build/release/git.ts"],"mappings":";iBAIgB,aAAA,CAAc,OAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { log } from "../../logger.mjs";
|
|
2
|
-
import { execSync } from "node:child_process";
|
|
3
|
-
//#region src/internal/build/release/git.ts
|
|
4
|
-
function runGitCommand(command) {
|
|
5
|
-
try {
|
|
6
|
-
const output = execSync(command, {
|
|
7
|
-
encoding: "utf8",
|
|
8
|
-
stdio: [
|
|
9
|
-
"ignore",
|
|
10
|
-
"pipe",
|
|
11
|
-
"ignore"
|
|
12
|
-
]
|
|
13
|
-
}).trim();
|
|
14
|
-
return output.length > 0 ? output : null;
|
|
15
|
-
} catch {
|
|
16
|
-
log.warn("Git unavailable", [`Failed: ${command}`]);
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { runGitCommand };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git.mjs","names":[],"sources":["../../../../src/internal/build/release/git.ts"],"sourcesContent":["import { execSync } from \"node:child_process\";\n\nimport { log } from \"../../logger.js\";\n\nexport function runGitCommand(command: string): string | null {\n try {\n const output = execSync(command, {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n\n return output.length > 0 ? output : null;\n } catch {\n log.warn(\"Git unavailable\", [`Failed: ${command}`]);\n return null;\n }\n}\n"],"mappings":";;;AAIA,SAAgB,cAAc,SAAgC;AAC5D,KAAI;EACF,MAAM,SAAS,SAAS,SAAS;GAC/B,UAAU;GACV,OAAO;IAAC;IAAU;IAAQ;IAAS;GACpC,CAAC,CAAC,MAAM;AAET,SAAO,OAAO,SAAS,IAAI,SAAS;SAC9B;AACN,MAAI,KAAK,mBAAmB,CAAC,WAAW,UAAU,CAAC;AACnD,SAAO"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { runGitCommand } from "./git.mjs";
|
|
2
|
-
import { CreateReleaseResponse } from "@interfere/types/releases/definition";
|
|
3
|
-
|
|
4
|
-
//#region src/internal/build/release/index.d.ts
|
|
5
|
-
declare function createRelease(apiKey: string, apiUrl: string, buildId: string): Promise<CreateReleaseResponse>;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { createRelease, runGitCommand };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/internal/build/release/index.ts"],"mappings":";;;;iBAgCsB,aAAA,CACpB,MAAA,UACA,MAAA,UACA,OAAA,WACC,OAAA,CAAQ,qBAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { runGitCommand } from "./git.mjs";
|
|
2
|
-
import { vercel_exports } from "./destinations/vercel.mjs";
|
|
3
|
-
import { github_exports } from "./sources/github.mjs";
|
|
4
|
-
import { Interfere } from "@interfere/sdk";
|
|
5
|
-
import { InterfereHTTPError } from "@interfere/sdk/models/errors/interfere-http-error.js";
|
|
6
|
-
//#region src/internal/build/release/index.ts
|
|
7
|
-
const sources = { github: github_exports };
|
|
8
|
-
const destinations = { vercel: vercel_exports };
|
|
9
|
-
async function createRelease(apiKey, apiUrl, buildId) {
|
|
10
|
-
const sdk = new Interfere({ serverURL: apiUrl });
|
|
11
|
-
const request = {
|
|
12
|
-
source: sources.github.resolve(),
|
|
13
|
-
destination: destinations.vercel.resolve(),
|
|
14
|
-
buildId
|
|
15
|
-
};
|
|
16
|
-
try {
|
|
17
|
-
return await sdk.releases.createRelease(request, { headers: { "x-api-key": apiKey } });
|
|
18
|
-
} catch (error) {
|
|
19
|
-
if (error instanceof InterfereHTTPError && error.statusCode === 404) throw new Error(`Interfere release API returned 404 at '${error.rawResponse.url}'. Is INTERFERE_API_URL incorrectly set?`);
|
|
20
|
-
throw error;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { createRelease, runGitCommand };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/internal/build/release/index.ts"],"sourcesContent":["import type {\n DestinationProvider,\n ReleaseDestinationMetadata,\n ReleaseSourceMetadata,\n SourceProvider,\n} from \"@interfere/types/integrations\";\nimport type { CreateReleaseResponse } from \"@interfere/types/releases/definition\";\n\nimport { Interfere } from \"@interfere/sdk\";\nimport { InterfereHTTPError } from \"@interfere/sdk/models/errors/interfere-http-error.js\";\n\nimport * as vercel from \"./destinations/vercel.js\";\nimport * as github from \"./sources/github.js\";\n\ninterface SourceResolver {\n resolve(): ReleaseSourceMetadata;\n}\n\ninterface DestinationResolver {\n resolve(): ReleaseDestinationMetadata | null;\n}\n\nexport { runGitCommand } from \"./git.js\";\n\nconst sources: Record<SourceProvider, SourceResolver> = {\n github,\n};\n\nconst destinations: Record<DestinationProvider, DestinationResolver> = {\n vercel,\n};\n\nexport async function createRelease(\n apiKey: string,\n apiUrl: string,\n buildId: string,\n): Promise<CreateReleaseResponse> {\n const sdk = new Interfere({ serverURL: apiUrl });\n\n const request = {\n source: sources.github.resolve(),\n destination: destinations.vercel.resolve(),\n buildId,\n };\n\n try {\n return await sdk.releases.createRelease(request, {\n headers: { \"x-api-key\": apiKey },\n });\n } catch (error) {\n if (error instanceof InterfereHTTPError && error.statusCode === 404) {\n throw new Error(\n `Interfere release API returned 404 at '${error.rawResponse.url}'. Is INTERFERE_API_URL incorrectly set?`,\n );\n }\n\n throw error;\n }\n}\n"],"mappings":";;;;;;AAwBA,MAAM,UAAkD,EACtD,QAAA,gBACD;AAED,MAAM,eAAiE,EACrE,QAAA,gBACD;AAED,eAAsB,cACpB,QACA,QACA,SACgC;CAChC,MAAM,MAAM,IAAI,UAAU,EAAE,WAAW,QAAQ,CAAC;CAEhD,MAAM,UAAU;EACd,QAAQ,QAAQ,OAAO,SAAS;EAChC,aAAa,aAAa,OAAO,SAAS;EAC1C;EACD;AAED,KAAI;AACF,SAAO,MAAM,IAAI,SAAS,cAAc,SAAS,EAC/C,SAAS,EAAE,aAAa,QAAQ,EACjC,CAAC;UACK,OAAO;AACd,MAAI,iBAAiB,sBAAsB,MAAM,eAAe,IAC9D,OAAM,IAAI,MACR,0CAA0C,MAAM,YAAY,IAAI,0CACjE;AAGH,QAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.mts","names":[],"sources":["../../../../../src/internal/build/release/sources/github.ts"],"mappings":";;;iBAKgB,OAAA,CAAA,GAAW,qBAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { __exportAll } from "../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { runGitCommand } from "../git.mjs";
|
|
3
|
-
import { parseEnvValue } from "@interfere/types/sdk/env";
|
|
4
|
-
//#region src/internal/build/release/sources/github.ts
|
|
5
|
-
var github_exports = /* @__PURE__ */ __exportAll({ resolve: () => resolve });
|
|
6
|
-
function resolve() {
|
|
7
|
-
return {
|
|
8
|
-
provider: "github",
|
|
9
|
-
branch: parseEnvValue(process.env.VERCEL_GIT_COMMIT_REF) ?? parseEnvValue(process.env.GITHUB_REF_NAME) ?? parseEnvValue(process.env.GITHUB_HEAD_REF) ?? runGitCommand("git rev-parse --abbrev-ref HEAD") ?? "unknown",
|
|
10
|
-
commitMessage: parseEnvValue(process.env.VERCEL_GIT_COMMIT_MESSAGE) ?? runGitCommand("git log -1 --pretty=%B") ?? "",
|
|
11
|
-
commitSha: parseEnvValue(process.env.VERCEL_GIT_COMMIT_SHA) ?? parseEnvValue(process.env.GITHUB_SHA) ?? runGitCommand("git rev-parse HEAD")
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { github_exports, resolve };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github.mjs","names":[],"sources":["../../../../../src/internal/build/release/sources/github.ts"],"sourcesContent":["import type { ReleaseSourceMetadata } from \"@interfere/types/integrations\";\nimport { parseEnvValue } from \"@interfere/types/sdk/env\";\n\nimport { runGitCommand } from \"../git.js\";\n\nexport function resolve(): ReleaseSourceMetadata {\n return {\n provider: \"github\",\n branch:\n parseEnvValue(process.env.VERCEL_GIT_COMMIT_REF) ??\n parseEnvValue(process.env.GITHUB_REF_NAME) ??\n parseEnvValue(process.env.GITHUB_HEAD_REF) ??\n runGitCommand(\"git rev-parse --abbrev-ref HEAD\") ??\n \"unknown\",\n commitMessage:\n parseEnvValue(process.env.VERCEL_GIT_COMMIT_MESSAGE) ??\n runGitCommand(\"git log -1 --pretty=%B\") ??\n \"\",\n commitSha:\n parseEnvValue(process.env.VERCEL_GIT_COMMIT_SHA) ??\n parseEnvValue(process.env.GITHUB_SHA) ??\n runGitCommand(\"git rev-parse HEAD\"),\n };\n}\n"],"mappings":";;;;;AAKA,SAAgB,UAAiC;AAC/C,QAAO;EACL,UAAU;EACV,QACE,cAAc,QAAQ,IAAI,sBAAsB,IAChD,cAAc,QAAQ,IAAI,gBAAgB,IAC1C,cAAc,QAAQ,IAAI,gBAAgB,IAC1C,cAAc,kCAAkC,IAChD;EACF,eACE,cAAc,QAAQ,IAAI,0BAA0B,IACpD,cAAc,yBAAyB,IACvC;EACF,WACE,cAAc,QAAQ,IAAI,sBAAsB,IAChD,cAAc,QAAQ,IAAI,WAAW,IACrC,cAAc,qBAAqB;EACtC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/internal/build/source-maps/discover.d.ts
|
|
2
|
-
type SourceMapFile = {
|
|
3
|
-
readonly absolute: string;
|
|
4
|
-
readonly path: string;
|
|
5
|
-
readonly content: string;
|
|
6
|
-
readonly hash: string;
|
|
7
|
-
};
|
|
8
|
-
declare function discover(projectDir: string, distDir: string): Promise<{
|
|
9
|
-
files: SourceMapFile[];
|
|
10
|
-
mapping: Record<string, string>;
|
|
11
|
-
}>;
|
|
12
|
-
declare function normalizeDistDir(distDir?: string): string;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { SourceMapFile, discover, normalizeDistDir };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.mts","names":[],"sources":["../../../../src/internal/build/source-maps/discover.ts"],"mappings":";KAMY,aAAA;EAAA,SACD,QAAA;EAAA,SACA,IAAA;EAAA,SACA,OAAA;EAAA,SACA,IAAA;AAAA;AAAA,iBAgBW,QAAA,CAAS,UAAA,UAAoB,OAAA,WAAe,OAAA;;;;iBAsDlD,gBAAA,CAAiB,OAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { readFile, readdir } from "node:fs/promises";
|
|
4
|
-
//#region src/internal/build/source-maps/discover.ts
|
|
5
|
-
const SOURCEMAPPING_RE = /\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/;
|
|
6
|
-
function resolveDistDir(projectDir, distDir) {
|
|
7
|
-
return isAbsolute(distDir) ? distDir : resolve(projectDir, distDir);
|
|
8
|
-
}
|
|
9
|
-
async function findJsFiles(dir) {
|
|
10
|
-
return (await readdir(dir, { recursive: true }).catch(() => [])).filter((entry) => entry.endsWith(".js")).map((entry) => join(dir, entry));
|
|
11
|
-
}
|
|
12
|
-
async function discover(projectDir, distDir) {
|
|
13
|
-
const absDistDir = resolveDistDir(projectDir, distDir);
|
|
14
|
-
const relDistDir = relative(projectDir, absDistDir);
|
|
15
|
-
const [staticFiles, serverFiles] = await Promise.all([findJsFiles(join(absDistDir, "static")), findJsFiles(join(absDistDir, "server"))]);
|
|
16
|
-
const jsPaths = [...staticFiles, ...serverFiles];
|
|
17
|
-
const mapping = {};
|
|
18
|
-
const mapAbsolutes = /* @__PURE__ */ new Map();
|
|
19
|
-
for (const jsAbs of jsPaths) {
|
|
20
|
-
const content = await readFile(jsAbs, "utf8");
|
|
21
|
-
const match = SOURCEMAPPING_RE.exec(content);
|
|
22
|
-
if (!match?.[1]) continue;
|
|
23
|
-
const mapAbs = `${jsAbs.slice(0, jsAbs.lastIndexOf("/") + 1)}${decodeURIComponent(match[1])}`;
|
|
24
|
-
const jsPublic = toPublicPath(relative(projectDir, jsAbs), relDistDir);
|
|
25
|
-
const mapPublic = toPublicPath(relative(projectDir, mapAbs), relDistDir);
|
|
26
|
-
mapping[mapPublic] = jsPublic;
|
|
27
|
-
mapAbsolutes.set(mapPublic, mapAbs);
|
|
28
|
-
}
|
|
29
|
-
const loaded = (await Promise.all([...mapAbsolutes.entries()].map(async ([mapPublic, mapAbs]) => {
|
|
30
|
-
const content = await readFile(mapAbs, "utf8").catch(() => null);
|
|
31
|
-
if (content === null) return null;
|
|
32
|
-
return {
|
|
33
|
-
absolute: mapAbs,
|
|
34
|
-
path: mapPublic,
|
|
35
|
-
content,
|
|
36
|
-
hash: createHash("sha256").update(content).digest("hex")
|
|
37
|
-
};
|
|
38
|
-
}))).filter((f) => f !== null);
|
|
39
|
-
const validMapping = {};
|
|
40
|
-
for (const file of loaded) {
|
|
41
|
-
const js = mapping[file.path];
|
|
42
|
-
if (js) validMapping[file.path] = js;
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
files: loaded,
|
|
46
|
-
mapping: validMapping
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function normalizeDistDir(distDir = ".next") {
|
|
50
|
-
let d = distDir.split("\\").join("/");
|
|
51
|
-
while (d.startsWith("./")) d = d.slice(2);
|
|
52
|
-
return d;
|
|
53
|
-
}
|
|
54
|
-
function toPublicPath(rel, distDir) {
|
|
55
|
-
const p = rel.split("\\").join("/");
|
|
56
|
-
if (p.startsWith(`${distDir}/`)) return `_next/${p.slice(distDir.length + 1)}`;
|
|
57
|
-
if (p.startsWith(".next/")) return `_next/${p.slice(6)}`;
|
|
58
|
-
return p;
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
export { discover, normalizeDistDir };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover.mjs","names":[],"sources":["../../../../src/internal/build/source-maps/discover.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { readFile, readdir } from \"node:fs/promises\";\nimport { isAbsolute, join, relative, resolve } from \"node:path\";\n\nconst SOURCEMAPPING_RE = /\\/\\/[#@]\\s*sourceMappingURL=(\\S+)\\s*$/;\n\nexport type SourceMapFile = {\n readonly absolute: string;\n readonly path: string;\n readonly content: string;\n readonly hash: string;\n};\n\nfunction resolveDistDir(projectDir: string, distDir: string) {\n return isAbsolute(distDir) ? distDir : resolve(projectDir, distDir);\n}\n\nasync function findJsFiles(dir: string) {\n const entries = await readdir(dir, { recursive: true }).catch(\n () => [] as string[]\n );\n return entries\n .filter((entry) => entry.endsWith(\".js\"))\n .map((entry) => join(dir, entry));\n}\n\nexport async function discover(projectDir: string, distDir: string) {\n const absDistDir = resolveDistDir(projectDir, distDir);\n const relDistDir = relative(projectDir, absDistDir);\n\n const [staticFiles, serverFiles] = await Promise.all([\n findJsFiles(join(absDistDir, \"static\")),\n findJsFiles(join(absDistDir, \"server\")),\n ]);\n\n const jsPaths = [...staticFiles, ...serverFiles];\n\n const mapping: Record<string, string> = {};\n const mapAbsolutes = new Map<string, string>();\n\n for (const jsAbs of jsPaths) {\n const content = await readFile(jsAbs, \"utf8\");\n const match = SOURCEMAPPING_RE.exec(content);\n if (!match?.[1]) continue;\n\n const jsDir = jsAbs.slice(0, jsAbs.lastIndexOf(\"/\") + 1);\n const mapRef = decodeURIComponent(match[1]);\n const mapAbs = `${jsDir}${mapRef}`;\n const jsPublic = toPublicPath(relative(projectDir, jsAbs), relDistDir);\n const mapPublic = toPublicPath(relative(projectDir, mapAbs), relDistDir);\n\n mapping[mapPublic] = jsPublic;\n mapAbsolutes.set(mapPublic, mapAbs);\n }\n\n const files = await Promise.all(\n [...mapAbsolutes.entries()].map(async ([mapPublic, mapAbs]) => {\n const content = await readFile(mapAbs, \"utf8\").catch(() => null);\n if (content === null) return null;\n\n return {\n absolute: mapAbs,\n path: mapPublic,\n content,\n hash: createHash(\"sha256\").update(content).digest(\"hex\"),\n };\n }),\n );\n\n const loaded = files.filter((f): f is SourceMapFile => f !== null);\n\n const validMapping: Record<string, string> = {};\n for (const file of loaded) {\n const js = mapping[file.path];\n if (js) validMapping[file.path] = js;\n }\n\n return { files: loaded, mapping: validMapping };\n}\n\nexport function normalizeDistDir(distDir = \".next\") {\n let d = distDir.split(\"\\\\\").join(\"/\");\n while (d.startsWith(\"./\")) d = d.slice(2);\n return d;\n}\n\nfunction toPublicPath(rel: string, distDir: string) {\n const p = rel.split(\"\\\\\").join(\"/\");\n if (p.startsWith(`${distDir}/`)) return `_next/${p.slice(distDir.length + 1)}`;\n if (p.startsWith(\".next/\")) return `_next/${p.slice(6)}`;\n return p;\n}\n"],"mappings":";;;;AAIA,MAAM,mBAAmB;AASzB,SAAS,eAAe,YAAoB,SAAiB;AAC3D,QAAO,WAAW,QAAQ,GAAG,UAAU,QAAQ,YAAY,QAAQ;;AAGrE,eAAe,YAAY,KAAa;AAItC,SAHgB,MAAM,QAAQ,KAAK,EAAE,WAAW,MAAM,CAAC,CAAC,YAChD,EAAE,CACT,EAEE,QAAQ,UAAU,MAAM,SAAS,MAAM,CAAC,CACxC,KAAK,UAAU,KAAK,KAAK,MAAM,CAAC;;AAGrC,eAAsB,SAAS,YAAoB,SAAiB;CAClE,MAAM,aAAa,eAAe,YAAY,QAAQ;CACtD,MAAM,aAAa,SAAS,YAAY,WAAW;CAEnD,MAAM,CAAC,aAAa,eAAe,MAAM,QAAQ,IAAI,CACnD,YAAY,KAAK,YAAY,SAAS,CAAC,EACvC,YAAY,KAAK,YAAY,SAAS,CAAC,CACxC,CAAC;CAEF,MAAM,UAAU,CAAC,GAAG,aAAa,GAAG,YAAY;CAEhD,MAAM,UAAkC,EAAE;CAC1C,MAAM,+BAAe,IAAI,KAAqB;AAE9C,MAAK,MAAM,SAAS,SAAS;EAC3B,MAAM,UAAU,MAAM,SAAS,OAAO,OAAO;EAC7C,MAAM,QAAQ,iBAAiB,KAAK,QAAQ;AAC5C,MAAI,CAAC,QAAQ,GAAI;EAIjB,MAAM,SAAS,GAFD,MAAM,MAAM,GAAG,MAAM,YAAY,IAAI,GAAG,EAAE,GACzC,mBAAmB,MAAM,GAAG;EAE3C,MAAM,WAAW,aAAa,SAAS,YAAY,MAAM,EAAE,WAAW;EACtE,MAAM,YAAY,aAAa,SAAS,YAAY,OAAO,EAAE,WAAW;AAExE,UAAQ,aAAa;AACrB,eAAa,IAAI,WAAW,OAAO;;CAiBrC,MAAM,UAdQ,MAAM,QAAQ,IAC1B,CAAC,GAAG,aAAa,SAAS,CAAC,CAAC,IAAI,OAAO,CAAC,WAAW,YAAY;EAC7D,MAAM,UAAU,MAAM,SAAS,QAAQ,OAAO,CAAC,YAAY,KAAK;AAChE,MAAI,YAAY,KAAM,QAAO;AAE7B,SAAO;GACL,UAAU;GACV,MAAM;GACN;GACA,MAAM,WAAW,SAAS,CAAC,OAAO,QAAQ,CAAC,OAAO,MAAM;GACzD;GACD,CACH,EAEoB,QAAQ,MAA0B,MAAM,KAAK;CAElE,MAAM,eAAuC,EAAE;AAC/C,MAAK,MAAM,QAAQ,QAAQ;EACzB,MAAM,KAAK,QAAQ,KAAK;AACxB,MAAI,GAAI,cAAa,KAAK,QAAQ;;AAGpC,QAAO;EAAE,OAAO;EAAQ,SAAS;EAAc;;AAGjD,SAAgB,iBAAiB,UAAU,SAAS;CAClD,IAAI,IAAI,QAAQ,MAAM,KAAK,CAAC,KAAK,IAAI;AACrC,QAAO,EAAE,WAAW,KAAK,CAAE,KAAI,EAAE,MAAM,EAAE;AACzC,QAAO;;AAGT,SAAS,aAAa,KAAa,SAAiB;CAClD,MAAM,IAAI,IAAI,MAAM,KAAK,CAAC,KAAK,IAAI;AACnC,KAAI,EAAE,WAAW,GAAG,QAAQ,GAAG,CAAE,QAAO,SAAS,EAAE,MAAM,QAAQ,SAAS,EAAE;AAC5E,KAAI,EAAE,WAAW,SAAS,CAAE,QAAO,SAAS,EAAE,MAAM,EAAE;AACtD,QAAO"}
|