refactor: 리펙토링
This commit is contained in:
@@ -7,7 +7,12 @@ import {
|
||||
ROUTE_REGISTRY,
|
||||
ROUTE_RUNTIME_CONTRACT,
|
||||
} from "../src/features/installed-feature-contracts.ts";
|
||||
import { runtimeConfigSchema } from "../src/bootstrap/runtime-config-schema.ts";
|
||||
import {
|
||||
buildManifestArtifactSchema,
|
||||
releaseManifestV2ArtifactSchema,
|
||||
runtimeConfigV2ArtifactSchema,
|
||||
} from "../src/contracts/release-artifacts.ts";
|
||||
import { buildContractSet } from "./generate-contract-set.ts";
|
||||
import {
|
||||
assertCiBuildEnvironment,
|
||||
buildDate,
|
||||
@@ -43,7 +48,7 @@ const assetManifestHash = createHash("sha256")
|
||||
const moduleInventoryHash = createHash("sha256")
|
||||
.update(moduleInventory)
|
||||
.digest("hex");
|
||||
const runtimeConfig = runtimeConfigSchema.parse(
|
||||
const runtimeConfig = runtimeConfigV2ArtifactSchema.parse(
|
||||
JSON.parse(await readFile("dist/config.json", "utf8")),
|
||||
);
|
||||
const routeChunks: Record<string, string> = {};
|
||||
@@ -59,12 +64,12 @@ for (const definition of Object.values(ROUTE_REGISTRY)) {
|
||||
}
|
||||
routeChunks[definition.chunkId] = asset.file;
|
||||
}
|
||||
const runtimeConfigJsonSchema = z.toJSONSchema(runtimeConfigSchema);
|
||||
const runtimeConfigJsonSchema = z.toJSONSchema(runtimeConfigV2ArtifactSchema);
|
||||
|
||||
runtimeConfig.BUILD_ID = buildId;
|
||||
runtimeConfig.RELEASE_ID = releaseId;
|
||||
|
||||
const manifest = {
|
||||
const manifest = buildManifestArtifactSchema.parse({
|
||||
schemaVersion: 1,
|
||||
buildId,
|
||||
commitSha,
|
||||
@@ -84,20 +89,22 @@ const manifest = {
|
||||
routeChunks,
|
||||
runtimeConfigSchema: "dist/runtime-config.schema.json",
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
const releaseManifest = {
|
||||
schemaVersion: 1,
|
||||
// §5.2 / §24.6 RC-3. The writer emits V2 only; the scalar API contract
|
||||
// version has no writer source left.
|
||||
const releaseManifest = releaseManifestV2ArtifactSchema.parse({
|
||||
schemaVersion: 2,
|
||||
appVersion: packageJson.version,
|
||||
buildId,
|
||||
commitSha,
|
||||
configSchemaVersion: runtimeConfig.CONFIG_SCHEMA_VERSION,
|
||||
apiContractVersion: runtimeConfig.API_CONTRACT_VERSION,
|
||||
assetManifestHash,
|
||||
releaseId,
|
||||
builtAt,
|
||||
routeChunks,
|
||||
};
|
||||
contractSet: buildContractSet(),
|
||||
});
|
||||
|
||||
await mkdir("artifacts/release", { recursive: true });
|
||||
await mkdir("artifacts/quality", { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user