@empire-builder-kit/nx 1.0.0-rc.44 → 1.0.0-rc.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/package.json +3 -3
  2. package/src/blueprints/external-sandbox.d.ts +1 -1
  3. package/src/cli/main.d.ts +11 -5
  4. package/src/cli/main.js +88 -29
  5. package/src/container-images.d.ts +1 -1
  6. package/src/container-images.js +1 -1
  7. package/src/developer-agent/generator-planning.js +10 -3
  8. package/src/developer-agent/operation-registry.js +1 -1
  9. package/src/executors/deployment-plan/deployment-plan.js +5 -1
  10. package/src/executors/deployment-plan/schema.json +1 -1
  11. package/src/executors/fleet/fleet.js +4 -0
  12. package/src/executors/fleet/schema.json +1 -1
  13. package/src/executors/github-bootstrap/github-bootstrap.d.ts +3 -0
  14. package/src/executors/github-bootstrap/github-bootstrap.js +28 -0
  15. package/src/executors/github-bootstrap/schema.json +14 -0
  16. package/src/executors/local-deploy/federated-credential-transport.d.ts +4 -3
  17. package/src/executors/local-deploy/federated-credential-transport.js +15 -5
  18. package/src/foundation/cost-estimate.d.ts +8 -3
  19. package/src/foundation/cost-estimate.js +42 -19
  20. package/src/foundation/index.d.ts +1 -0
  21. package/src/foundation/index.js +1 -0
  22. package/src/foundation/local-private-smoke-access.js +6 -0
  23. package/src/foundation/logging.d.ts +3 -1
  24. package/src/foundation/logging.js +8 -1
  25. package/src/foundation/observability.d.ts +42 -0
  26. package/src/foundation/observability.js +181 -0
  27. package/src/foundation/preflight.js +1 -1
  28. package/src/generators/function/function.js +5 -2
  29. package/src/generators/observability-infrastructure.d.ts +2 -0
  30. package/src/generators/observability-infrastructure.js +31 -0
  31. package/src/generators/observability-policy.d.ts +4 -0
  32. package/src/generators/observability-policy.js +23 -0
  33. package/src/generators/preset/dependency-overrides.d.ts +17 -6
  34. package/src/generators/preset/dependency-overrides.js +17 -6
  35. package/src/generators/preset/tool-versions.d.ts +2 -2
  36. package/src/generators/preset/tool-versions.js +2 -2
  37. package/src/generators/preset/workspace-files-adopter-skills.js +28 -17
  38. package/src/generators/preset/workspace-files-agent-development.d.ts +9 -0
  39. package/src/generators/preset/workspace-files-agent-development.js +42 -0
  40. package/src/generators/preset/workspace-files-thin-deploy.js +17 -4
  41. package/src/generators/preset/workspace-files-thin-docs.js +10 -22
  42. package/src/generators/preset/workspace-files.d.ts +1 -0
  43. package/src/generators/preset/workspace-files.js +120 -35
  44. package/src/generators/slice/built-in-plan-alarm-identity.d.ts +173 -0
  45. package/src/generators/slice/built-in-plan-alarm-identity.js +202 -0
  46. package/src/generators/slice/built-in-plan-api-contract-files.js +136 -0
  47. package/src/generators/slice/built-in-plan-data-files.js +10 -3
  48. package/src/generators/slice/built-in-plan-database-lifecycle-files.js +1 -1
  49. package/src/generators/slice/built-in-plan-event-contract-literal.d.ts +6 -0
  50. package/src/generators/slice/built-in-plan-event-contract-literal.js +52 -0
  51. package/src/generators/slice/built-in-plan-infrastructure-files.js +304 -144
  52. package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.js +2 -2
  53. package/src/generators/slice/built-in-plan-metadata-files.js +37 -2
  54. package/src/generators/slice/built-in-plan-operations-files.js +106 -6
  55. package/src/generators/slice/built-in-plan-project-files.js +1 -0
  56. package/src/generators/slice/built-in-plan-release-files.js +2 -44
  57. package/src/generators/slice/built-in-plan-reliability-files.js +222 -236
  58. package/src/generators/slice/built-in-plan-shared.d.ts +29 -3
  59. package/src/generators/slice/built-in-plan-shared.js +29 -2
  60. package/src/generators/slice/built-in-plan-verification-files.js +0 -1
  61. package/src/generators/slice/built-in-plan-web-files.js +22 -6
  62. package/src/generators/slice/built-in-plan.js +2 -2
  63. package/src/generators/slice/slice.js +2 -0
  64. package/src/generators/upgrade/upgrade.d.ts +4 -3
  65. package/src/generators/upgrade/upgrade.js +139 -29
  66. package/src/generators/workload/frozen-container.d.ts +1 -1
  67. package/src/generators/workload/reliability-registration.d.ts +1 -1
  68. package/src/generators/workload/reliability-registration.js +9 -9
  69. package/src/generators/workload/workload.d.ts +1 -1
  70. package/src/generators/workload/workload.js +32 -10
  71. package/src/git-policy/github-bootstrap.d.ts +18 -0
  72. package/src/git-policy/github-bootstrap.js +99 -6
  73. package/src/local-dev/dev-command-core.d.ts +24 -3
  74. package/src/local-dev/dev-command-core.js +124 -12
  75. package/src/local-dev/errors.d.ts +19 -1
  76. package/src/local-dev/errors.js +18 -1
  77. package/src/local-dev/fleet-client.d.ts +64 -6
  78. package/src/local-dev/fleet-client.js +189 -15
  79. package/src/local-dev/fleet-process.d.ts +47 -2
  80. package/src/local-dev/fleet-process.js +248 -31
  81. package/src/local-dev/fleet-runtime.d.ts +37 -0
  82. package/src/local-dev/fleet-runtime.js +127 -69
  83. package/src/local-dev/fleet-session.d.ts +1 -0
  84. package/src/local-dev/fleet-session.js +83 -7
  85. package/src/local-dev/fleet-state.d.ts +5 -0
  86. package/src/local-dev/fleet-state.js +11 -2
  87. package/src/local-dev/fleet-supervisor-daemon.js +1 -5
  88. package/src/local-dev/fleet-supervisor.d.ts +7 -0
  89. package/src/local-dev/fleet-supervisor.js +83 -12
  90. package/src/local-dev/slice-runner.d.ts +19 -1
  91. package/src/local-dev/slice-runner.js +290 -91
  92. package/src/repository-policy/deployment-plan.d.ts +1 -1
  93. package/src/repository-policy/deployment-plan.js +16 -1
  94. package/src/secrets/generated-aws-control-plane.d.ts +11 -1
  95. package/src/secrets/generated-aws-control-plane.js +92 -29
  96. package/src/secrets/operator.d.ts +3 -2
  97. package/src/secrets/operator.js +27 -5
  98. package/src/supply-chain/blueprint-verification-authority.js +24 -3
  99. package/src/supply-chain/generated-files.js +9 -0
  100. package/src/supply-chain/sbom.js +74 -12
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderKeyValueRetentionInfrastructureFiles = renderKeyValueRetentionInfrastructureFiles;
4
+ const built_in_plan_alarm_identity_js_1 = require("./built-in-plan-alarm-identity.js");
4
5
  /** Framework retention uses native DynamoDB regardless of optional feature SQL. */
5
6
  function renderKeyValueRetentionInfrastructureFiles(name, pascalName) {
6
7
  return {
@@ -78,8 +79,7 @@ function renderKeyValueRetentionInfrastructureFiles(name, pascalName) {
78
79
  const registration = input.register(stateMachine.arn);
79
80
  const failureAlarm = new aws.cloudwatch.MetricAlarm('${pascalName}DataRetentionFailure', {
80
81
  name: '${name}-' + $app.stage + '-retention-job-failure', alarmActions: [input.alertTopicArn],
81
- alarmDescription: JSON.stringify({ schemaVersion: 1, slice: '${name}', owner: '${name}-product', route: '${name}-on-call',
82
- businessSymptom: 'The native retention Job terminated unsuccessfully.', id: 'retention-job-failure', runbook: 'jobs/data-retention/README.md' }),
82
+ alarmDescription: JSON.stringify(${(0, built_in_plan_alarm_identity_js_1.renderSliceAlarmDescriptionObject)(name, 'retention-job-failure')}),
83
83
  comparisonOperator: 'GreaterThanOrEqualToThreshold', evaluationPeriods: 1, threshold: 1, treatMissingData: 'notBreaching',
84
84
  metricQueries: [...['ExecutionsFailed', 'ExecutionsTimedOut', 'ExecutionsAborted'].map((metricName, index) => ({
85
85
  id: 'm' + index, metric: { dimensions: { StateMachineArn: stateMachine.arn }, metricName, namespace: 'AWS/States', period: 60, stat: 'Sum' }, returnData: false })),
@@ -41,6 +41,26 @@ Commit domain changes and event intents together through the DynamoDB store,
41
41
  and commit consumer effects with the inbox. Do not edit managed routing or
42
42
  assume that declaring an event implements its consumer behavior.
43
43
 
44
+ To consume another Slice's domain event, add its \`${scope}/<producer>/contracts\`
45
+ package to \`contracts/dependencies.json\` \`consumes\` with a \`workspace:*\`
46
+ dependency, run \`pnpm nx run ${name}:contract-dependencies-sync\`, then declare
47
+ the subscription in the seeded \`contracts/event-subscriptions.json\`, for example
48
+ \`{ "source": "<producer>", "events": [{ "detailType": "<EventType>", "schemaVersions": [1] }] }\`.
49
+ Every event of one source declares the same \`schemaVersions\`. When one event of
50
+ a source moves to a new version, declare that version for every event of the
51
+ source (the check accepts versions the producer does not publish yet) and widen
52
+ the consumer's version gate to match. Managed infrastructure adds one rule per
53
+ declared source, filtered by stage, source, detail type and schema version, to
54
+ this Slice's existing queue, DLQ and alarm.
55
+ \`contract-dependencies-check\` fails when the producer's \`EventContractSchema\`
56
+ no longer publishes a declared event at one of the declared versions. Extend the
57
+ seeded \`api/event-consumer.ts\` to accept that source and detail type, and widen
58
+ its schema-version gate to every version you declare; otherwise the event
59
+ reaches the DLQ. Source and detail type are delivery filters, not
60
+ authentication: authorize every effect from this Slice's own data and policy,
61
+ never from the event source alone. A producer's own queue rule also receives
62
+ every event it declares, so its consumer must acknowledge them.
63
+
44
64
  Run \`pnpm nx run ${name}:verify\` for the non-deployed Slice checks. The policy files under
45
65
  \`frontend/\`, \`docs/reliability/\`, \`operations/\`, and \`performance/\` are seeded decisions:
46
66
  adopt real owners, journeys, thresholds, targets, and evidence sources before enabling
@@ -161,6 +181,10 @@ export const ${pascalName}ContractVersion = '1.0.0' as const;
161
181
  consumes: [],
162
182
  schemaVersion: 1,
163
183
  }),
184
+ 'contracts/event-subscriptions.json': (0, built_in_plan_shared_js_1.json)({
185
+ schemaVersion: 1,
186
+ subscriptions: [],
187
+ }),
164
188
  'docs/architecture.md': `# ${name} architecture
165
189
 
166
190
  ## Boundary
@@ -265,7 +289,7 @@ retain record bodies, credentials or raw provider state.
265
289
 
266
290
  ## DynamoDB
267
291
 
268
- For \`database-errors\`, inspect both table and PendingEvents index read/write
292
+ For \`database-capacity\`, inspect both table and PendingEvents index read/write
269
293
  throttle metrics. Check hot keys, account/service quotas, retries and backlog;
270
294
  do not treat a missing RDS signal as proof that the table is healthy. Check the
271
295
  outbox schedule and stream mapping against their deliberate maintenance state.
@@ -304,8 +328,19 @@ as an incidental repair.
304
328
  : `SQL is not declared. No Aurora investigation or SQL migration command is
305
329
  required for this Slice's DynamoDB recovery.
306
330
  `}
331
+ ## Retention Job failure
332
+
333
+ For \`retention-job-failure\`, the exact retention Step Functions workflow
334
+ failed, timed out or was aborted without accepted evidence. Follow the run
335
+ procedure in [the data-retention Job README](../../jobs/data-retention/README.md):
336
+ keep the source checkout, continue an interrupted report with its run
337
+ reference, and retry the same approved run. Never delete its checkpoint,
338
+ pending deletion work or retained evidence to silence the alarm.
307
339
  `,
308
- 'ebk-globals.d.ts': `import 'sst/resource';
340
+ 'ebk-globals.d.ts': `// Next.js ambient types, independent of the gitignored web/next-env.d.ts.
341
+ /// <reference types="next" />
342
+ /// <reference types="next/image-types/global" />
343
+ import 'sst/resource';
309
344
 
310
345
  declare global {
311
346
  type EbkSstOutput<T> = {
@@ -760,10 +760,15 @@ try {
760
760
  }
761
761
  `,
762
762
  'tools/ebk-next-build-environment.mjs': `import { spawnSync } from 'node:child_process';
763
+ import { fileURLToPath } from 'node:url';
763
764
  import {
764
765
  chmodSync,
766
+ closeSync,
765
767
  existsSync,
768
+ fstatSync,
766
769
  lstatSync,
770
+ openSync,
771
+ readSync,
767
772
  readFileSync,
768
773
  readdirSync,
769
774
  realpathSync,
@@ -922,12 +927,46 @@ const environment = Object.fromEntries(
922
927
  )
923
928
  .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0)),
924
929
  );
925
- const windows = process.platform === 'win32';
930
+ // Resolve through this managed Slice, never an ephemeral npx/dlx install.
931
+ const sliceRoot = realpathSync(resolve(dirname(fileURLToPath(import.meta.url)), '..'));
932
+ const sliceManifestPath = join(sliceRoot, 'package.json');
933
+ const sliceManifestIdentity = lstatSync(sliceManifestPath, { throwIfNoEntry: false });
934
+ if (!sliceManifestIdentity?.isFile() || sliceManifestIdentity.size > 1_048_576 ||
935
+ realpathSync(sliceManifestPath) !== sliceManifestPath ||
936
+ JSON.parse(readFileSync(sliceManifestPath, 'utf8')).devDependencies?.['@opennextjs/aws'] !== '${built_in_plan_shared_js_1.OPEN_NEXT_AWS_VERSION}') {
937
+ throw new Error('The Slice must declare the exact managed OpenNext dependency.');
938
+ }
939
+ // Only this declared Slice slot is authority. Canonicalizing it supports pnpm
940
+ // links without searching NODE_PATH, ancestor/global packages, or PATH shims.
941
+ const managedSlot = join(sliceRoot, 'node_modules/@opennextjs/aws');
942
+ if (!existsSync(managedSlot)) {
943
+ throw new Error(
944
+ 'The managed OpenNext ${built_in_plan_shared_js_1.OPEN_NEXT_AWS_VERSION} builder is not installed in this Slice. ' +
945
+ 'Install the workspace dependencies, including development dependencies ' +
946
+ '(pnpm install --frozen-lockfile), before building.',
947
+ );
948
+ }
949
+ const builderRoot = realpathSync(managedSlot);
950
+ const localCli = join(builderRoot, 'dist/index.js');
951
+ const builderManifestPath = join(builderRoot, 'package.json');
952
+ const builderManifestIdentity = lstatSync(builderManifestPath, { throwIfNoEntry: false });
953
+ if (!builderManifestIdentity?.isFile() || builderManifestIdentity.size > 65_536) {
954
+ throw new Error('The managed OpenNext package metadata has an invalid identity.');
955
+ }
956
+ const builder = JSON.parse(readFileSync(builderManifestPath, 'utf8'));
957
+ if (
958
+ builder.name !== '@opennextjs/aws' ||
959
+ builder.version !== '${built_in_plan_shared_js_1.OPEN_NEXT_AWS_VERSION}' ||
960
+ builder.bin?.['open-next'] !== './dist/index.js' ||
961
+ !lstatSync(localCli, { throwIfNoEntry: false })?.isFile() ||
962
+ realpathSync(localCli) !== localCli ||
963
+ realpathSync(builderManifestPath) !== builderManifestPath
964
+ ) {
965
+ throw new Error('The managed OpenNext builder must be exactly ${built_in_plan_shared_js_1.OPEN_NEXT_AWS_VERSION}.');
966
+ }
926
967
  const result = spawnSync(
927
- windows ? 'cmd.exe' : 'npx',
928
- windows
929
- ? ['/d', '/s', '/c', 'npx --yes @opennextjs/aws@3.9.14 build']
930
- : ['--yes', '@opennextjs/aws@3.9.14', 'build'],
968
+ process.execPath,
969
+ [localCli, 'build'],
931
970
  {
932
971
  cwd: process.cwd(),
933
972
  env: environment,
@@ -1000,7 +1039,7 @@ if (result.status !== 0) {
1000
1039
  }
1001
1040
  }
1002
1041
 
1003
- // OpenNext 3.9.14 installs the image optimizer dependencies in an npm
1042
+ // OpenNext installs the image optimizer dependencies in an npm
1004
1043
  // mkdtemp directory and copies npm's hidden package lock into the deployed
1005
1044
  // bundle. npm records that random directory basename as the lock name. The
1006
1045
  // name has no runtime meaning, but without this exact normalization two
@@ -1048,6 +1087,67 @@ if (result.status !== 0) {
1048
1087
  ) {
1049
1088
  throw new Error('The OpenNext image optimizer package lock shape is unsupported.');
1050
1089
  }
1090
+ // An upstream install failure can still exit zero. Require the actual
1091
+ // deployment target before normalizing or accepting the bundle. This is a
1092
+ // bounded metadata/ELF check, not execution of Linux code on the build host.
1093
+ const nativeFile = (entry, maximum, header = false) => {
1094
+ const path = join(lockParent, entry);
1095
+ const identity = lstatSync(path, { bigint: true, throwIfNoEntry: false });
1096
+ if (identity === undefined) {
1097
+ throw new Error('The OpenNext Sharp bundle is missing ' + entry +
1098
+ '; npm did not install the managed Linux arm64 glibc target.');
1099
+ }
1100
+ if (!identity.isFile() || identity.isSymbolicLink() || identity.nlink !== 1n ||
1101
+ identity.size < (header ? 64n : 1n) || identity.size > BigInt(maximum) ||
1102
+ realpathSync(path) !== path) {
1103
+ throw new Error('The OpenNext Sharp bundle file has an invalid identity.');
1104
+ }
1105
+ const descriptor = openSync(path, 'r');
1106
+ try {
1107
+ const opened = fstatSync(descriptor, { bigint: true });
1108
+ const length = header ? 64 : Number(identity.size);
1109
+ const bytes = Buffer.alloc(length);
1110
+ if (opened.dev !== identity.dev || opened.ino !== identity.ino ||
1111
+ opened.size !== identity.size || readSync(descriptor, bytes, 0, length, 0) !== length) {
1112
+ throw new Error('The OpenNext Sharp bundle file changed identity.');
1113
+ }
1114
+ if (!header) return bytes.toString('utf8');
1115
+ if (bytes.subarray(0, 4).toString('hex') !== '7f454c46' ||
1116
+ bytes[4] !== 2 || bytes[5] !== 1 || bytes[6] !== 1 ||
1117
+ bytes.readUInt16LE(16) !== 3 || bytes.readUInt16LE(18) !== 183) {
1118
+ throw new Error('The OpenNext Sharp native file must be Linux arm64 ELF64.');
1119
+ }
1120
+ } finally { closeSync(descriptor); }
1121
+ };
1122
+ const sharpPackage = (name, version, native = false) => {
1123
+ const metadata = JSON.parse(nativeFile(name + '/package.json', 65_536));
1124
+ const locked = parsed.packages['node_modules/' + name];
1125
+ if (metadata?.name !== name || metadata.version !== version ||
1126
+ locked?.version !== version ||
1127
+ (native && (JSON.stringify(metadata.os) !== '["linux"]' ||
1128
+ JSON.stringify(metadata.cpu) !== '["arm64"]' ||
1129
+ JSON.stringify(metadata.libc) !== '["glibc"]'))) {
1130
+ throw new Error('The OpenNext Sharp package metadata does not match the managed target.');
1131
+ }
1132
+ return metadata;
1133
+ };
1134
+ const sharp = sharpPackage('sharp', '${built_in_plan_shared_js_1.OPEN_NEXT_IMAGE_OPTIMIZATION_SHARP_VERSION}');
1135
+ const addon = sharpPackage('@img/sharp-linux-arm64', '${built_in_plan_shared_js_1.OPEN_NEXT_IMAGE_OPTIMIZATION_SHARP_VERSION}', true);
1136
+ const libvips = sharpPackage('@img/sharp-libvips-linux-arm64', '${built_in_plan_shared_js_1.OPEN_NEXT_IMAGE_OPTIMIZATION_LIBVIPS_VERSION}', true);
1137
+ if (sharp.optionalDependencies?.['@img/sharp-linux-arm64'] !== addon.version ||
1138
+ sharp.optionalDependencies?.['@img/sharp-libvips-linux-arm64'] !== libvips.version ||
1139
+ addon.optionalDependencies?.['@img/sharp-libvips-linux-arm64'] !== libvips.version ||
1140
+ libvips.exports?.['./binary'] !== './lib/${built_in_plan_shared_js_1.OPEN_NEXT_IMAGE_OPTIMIZATION_LIBVIPS_LIBRARY}') {
1141
+ throw new Error('The OpenNext Sharp native dependency metadata is incomplete.');
1142
+ }
1143
+ nativeFile('@img/sharp-linux-arm64/lib/sharp-linux-arm64-${built_in_plan_shared_js_1.OPEN_NEXT_IMAGE_OPTIMIZATION_SHARP_VERSION}.node', 32 * 1024 * 1024, true);
1144
+ nativeFile('@img/sharp-libvips-linux-arm64/lib/${built_in_plan_shared_js_1.OPEN_NEXT_IMAGE_OPTIMIZATION_LIBVIPS_LIBRARY}', 32 * 1024 * 1024, true);
1145
+ const imagePackages = readdirSync(join(lockParent, '@img'));
1146
+ if (imagePackages.length > 64 || imagePackages.some(name =>
1147
+ /^sharp(?:-libvips)?-(?:linux|darwin|win32)/u.test(name) &&
1148
+ !['sharp-linux-arm64', 'sharp-libvips-linux-arm64'].includes(name))) {
1149
+ throw new Error('The OpenNext Sharp bundle contains a foreign native platform.');
1150
+ }
1051
1151
  parsed.name = 'open-next-image-optimization-function';
1052
1152
  const normalized = JSON.stringify(parsed, null, 2) + '\\n';
1053
1153
  const temporaryPath = join(lockParent, '.package-lock.json.ebk-normalized');
@@ -44,6 +44,7 @@ function renderSliceProjectFiles(name, scope, runtimeVersion, ownership) {
44
44
  devDependencies: {
45
45
  '@axe-core/playwright': built_in_plan_shared_js_1.PRODUCT_VERSIONS.axePlaywright,
46
46
  '@playwright/test': built_in_plan_shared_js_1.PRODUCT_VERSIONS.playwright,
47
+ '@opennextjs/aws': built_in_plan_shared_js_1.OPEN_NEXT_AWS_VERSION,
47
48
  '@types/node': built_in_plan_shared_js_1.PRODUCT_VERSIONS.typesNode,
48
49
  ...(sql
49
50
  ? {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderProductReleaseFiles = renderProductReleaseFiles;
4
+ const built_in_plan_event_contract_literal_js_1 = require("./built-in-plan-event-contract-literal.js");
4
5
  const built_in_plan_shared_js_1 = require("./built-in-plan-shared.js");
5
6
  function configurationSeedDates(seed) {
6
7
  const createdAt = new Date(seed);
@@ -2632,49 +2633,7 @@ const eventContractContent = readFileSync(
2632
2633
  new URL('../contracts/events.ts', import.meta.url),
2633
2634
  'utf8',
2634
2635
  );
2635
- const eventLiteral = (node) => {
2636
- while (
2637
- ts.isAsExpression(node) ||
2638
- ts.isSatisfiesExpression(node) ||
2639
- ts.isParenthesizedExpression(node)
2640
- ) {
2641
- node = node.expression;
2642
- }
2643
- if (ts.isObjectLiteralExpression(node)) {
2644
- return Object.fromEntries(
2645
- node.properties.map((property) => {
2646
- if (
2647
- !ts.isPropertyAssignment(property) ||
2648
- !(
2649
- ts.isIdentifier(property.name) ||
2650
- ts.isStringLiteral(property.name)
2651
- )
2652
- ) {
2653
- throw new Error(
2654
- 'EventContractSchema accepts only explicit literal properties.',
2655
- );
2656
- }
2657
- return [property.name.text, eventLiteral(property.initializer)];
2658
- }),
2659
- );
2660
- }
2661
- if (ts.isArrayLiteralExpression(node)) {
2662
- return node.elements.map(eventLiteral);
2663
- }
2664
- if (ts.isStringLiteral(node) || ts.isNumericLiteral(node)) {
2665
- return ts.isNumericLiteral(node) ? Number(node.text) : node.text;
2666
- }
2667
- if (
2668
- node.kind === ts.SyntaxKind.TrueKeyword ||
2669
- node.kind === ts.SyntaxKind.FalseKeyword
2670
- ) {
2671
- return node.kind === ts.SyntaxKind.TrueKeyword;
2672
- }
2673
- throw new Error(
2674
- 'EventContractSchema must remain a canonical literal-only export.',
2675
- );
2676
- };
2677
- const parseEventContract = (source, path) => {
2636
+ ${built_in_plan_event_contract_literal_js_1.EVENT_CONTRACT_LITERAL_SOURCE}const parseEventContract = (source, path) => {
2678
2637
  const file = ts.createSourceFile(
2679
2638
  path,
2680
2639
  source,
@@ -6401,7 +6360,6 @@ if (['stopped', 'recovering'].includes(result.rollout.phase)) {
6401
6360
  sourceInputPaths: [
6402
6361
  `packages/${name}/configuration`,
6403
6362
  `packages/${name}/infra`,
6404
- `packages/${name}/web/next-env.d.ts`,
6405
6363
  `packages/${name}/web/next.config.ts`,
6406
6364
  `packages/${name}/web/open-next.config.ts`,
6407
6365
  `packages/${name}/web/src`,