@empire-builder-kit/nx 1.0.0-rc.46 → 1.0.0-rc.47
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/generators.json +11 -1
- package/package.json +3 -3
- package/src/aws-authority/stage-authority.d.ts +30 -2
- package/src/aws-authority/stage-authority.js +220 -25
- package/src/developer-agent/generator-planning.js +99 -6
- package/src/developer-agent/model.d.ts +7 -3
- package/src/developer-agent/model.js +1 -0
- package/src/developer-agent/operation-registry.d.ts +1 -0
- package/src/developer-agent/operation-registry.js +43 -2
- package/src/developer-agent/planning.js +5 -2
- package/src/developer-agent/preview-changes.js +10 -0
- package/src/developer-agent/validation.js +7 -3
- package/src/developer-agent/workspace-inspection.js +51 -4
- package/src/executors/deployment-plan/deployment-plan.js +3 -0
- package/src/executors/dev-doctor/dev-doctor.d.ts +25 -3
- package/src/executors/dev-doctor/dev-doctor.js +136 -49
- package/src/executors/dev-setup/dev-setup.d.ts +18 -1
- package/src/executors/dev-setup/dev-setup.js +320 -196
- package/src/executors/foundation-preflight/foundation-preflight.js +9 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +2 -2
- package/src/executors/infrastructure-plan/infrastructure-plan.js +10 -3
- package/src/executors/local-deploy/local-deploy.d.ts +15 -0
- package/src/executors/local-deploy/local-deploy.js +96 -14
- package/src/executors/sst-lifecycle/logging-preflight.js +12 -1
- package/src/executors/sst-lifecycle/run-sst-command.js +51 -5
- package/src/foundation/cost-estimate.js +1 -1
- package/src/foundation/identity-domain-parent-ready.d.ts +91 -0
- package/src/foundation/identity-domain-parent-ready.js +333 -0
- package/src/foundation/identity-domain.d.ts +94 -0
- package/src/foundation/identity-domain.js +115 -0
- package/src/foundation/index.d.ts +2 -0
- package/src/foundation/index.js +7 -0
- package/src/foundation/preflight.js +17 -1
- package/src/foundation/root-site-readiness.d.ts +27 -0
- package/src/foundation/root-site-readiness.js +78 -0
- package/src/foundation/root-site.d.ts +81 -0
- package/src/foundation/root-site.js +268 -0
- package/src/generators/framework-prerequisites.d.ts +2 -0
- package/src/generators/framework-prerequisites.js +34 -0
- package/src/generators/function/function-registration.d.ts +24 -0
- package/src/generators/function/function-registration.js +66 -0
- package/src/generators/function/function.d.ts +16 -1
- package/src/generators/function/function.js +101 -18
- package/src/generators/function/schema.d.ts +1 -0
- package/src/generators/function/schema.json +6 -0
- package/src/generators/function-access/function-access.d.ts +14 -0
- package/src/generators/function-access/function-access.js +141 -0
- package/src/generators/function-access/schema.d.ts +6 -0
- package/src/generators/function-access/schema.json +25 -0
- package/src/generators/post-generation-install.d.ts +1 -1
- package/src/generators/post-generation-install.js +1 -1
- package/src/generators/preset/dependency-overrides.d.ts +1 -1
- package/src/generators/preset/dependency-overrides.js +1 -1
- package/src/generators/preset/workspace-files-adopter-skills.js +14 -0
- package/src/generators/preset/workspace-files-developer-agent.js +17 -11
- package/src/generators/preset/workspace-files-stage-authority.js +58 -1
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +11 -0
- package/src/generators/preset/workspace-files-thin-deploy.js +47 -4
- package/src/generators/preset/workspace-files-thin-docs.js +33 -5
- package/src/generators/preset/workspace-files.js +207 -13
- package/src/generators/repository-policy/repository-policy.js +2 -1
- package/src/generators/repository-policy/schema.d.ts +2 -0
- package/src/generators/repository-policy/schema.json +7 -2
- package/src/generators/site/built-in-site-documentation-files.d.ts +2 -0
- package/src/generators/site/built-in-site-documentation-files.js +92 -0
- package/src/generators/site/built-in-site-files.d.ts +8 -0
- package/src/generators/site/built-in-site-files.js +40 -0
- package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -0
- package/src/generators/site/built-in-site-infrastructure-files.js +275 -0
- package/src/generators/site/built-in-site-plan.d.ts +19 -0
- package/src/generators/site/built-in-site-plan.js +65 -0
- package/src/generators/site/built-in-site-project-files.d.ts +3 -0
- package/src/generators/site/built-in-site-project-files.js +258 -0
- package/src/generators/site/built-in-site-script-files.d.ts +2 -0
- package/src/generators/site/built-in-site-script-files.js +306 -0
- package/src/generators/site/built-in-site-shared.d.ts +9 -0
- package/src/generators/site/built-in-site-shared.js +21 -0
- package/src/generators/site/built-in-site-smoke-files.d.ts +2 -0
- package/src/generators/site/built-in-site-smoke-files.js +37 -0
- package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -0
- package/src/generators/site/built-in-site-sst-config-files.js +39 -0
- package/src/generators/site/built-in-site-web-files.d.ts +2 -0
- package/src/generators/site/built-in-site-web-files.js +284 -0
- package/src/generators/site/schema.d.ts +4 -0
- package/src/generators/site/schema.json +20 -0
- package/src/generators/site/site.d.ts +13 -0
- package/src/generators/site/site.js +221 -0
- package/src/generators/slice/built-in-plan-alarm-identity.d.ts +9 -0
- package/src/generators/slice/built-in-plan-alarm-identity.js +8 -1
- package/src/generators/slice/built-in-plan-api-contract-files.js +18 -0
- package/src/generators/slice/built-in-plan-async-work-files.js +18 -0
- package/src/generators/slice/built-in-plan-data-files.js +116 -11
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +12 -0
- package/src/generators/slice/built-in-plan-foundation-files.js +114 -5
- package/src/generators/slice/built-in-plan-frontend-files.js +2 -271
- package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +6 -0
- package/src/generators/slice/built-in-plan-frontend-header-proof.js +282 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.js +151 -237
- package/src/generators/slice/built-in-plan-key-value-cleanup.js +4 -3
- package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +29 -0
- package/src/generators/slice/built-in-plan-log-group-helpers.js +130 -0
- package/src/generators/slice/built-in-plan-metadata-files.js +21 -4
- package/src/generators/slice/built-in-plan-next-build-authority.d.ts +5 -0
- package/src/generators/slice/built-in-plan-next-build-authority.js +124 -0
- package/src/generators/slice/built-in-plan-operations-files.d.ts +6 -0
- package/src/generators/slice/built-in-plan-operations-files.js +107 -219
- package/src/generators/slice/built-in-plan-performance-files.js +6 -1
- package/src/generators/slice/built-in-plan-reliability-files.js +12 -8
- package/src/generators/slice/built-in-plan-shared.d.ts +1 -1
- package/src/generators/slice/built-in-plan-shared.js +1 -1
- package/src/generators/slice/built-in-plan-sst-config.d.ts +49 -0
- package/src/generators/slice/built-in-plan-sst-config.js +160 -0
- package/src/generators/slice/built-in-plan-testing-files.js +92 -49
- package/src/generators/slice/built-in-plan-verification-files.js +15 -4
- package/src/generators/slice/built-in-plan-web-files.js +65 -0
- package/src/generators/slice/deployed-smoke-diagnostics.d.ts +35 -0
- package/src/generators/slice/deployed-smoke-diagnostics.js +189 -0
- package/src/generators/slice/deployed-smoke-readiness.d.ts +7 -0
- package/src/generators/slice/deployed-smoke-readiness.js +118 -23
- package/src/generators/slice/persistence-contract.js +2 -2
- package/src/generators/slice/pnpm-launch-script.d.ts +13 -0
- package/src/generators/slice/pnpm-launch-script.js +28 -0
- package/src/generators/slice/slice.js +27 -0
- package/src/generators/upgrade/custom-domain-notice.d.ts +19 -0
- package/src/generators/upgrade/custom-domain-notice.js +38 -0
- package/src/generators/upgrade/external-blueprint-compositions.d.ts +84 -0
- package/src/generators/upgrade/external-blueprint-compositions.js +478 -0
- package/src/generators/upgrade/framework-package-upgrade.d.ts +58 -0
- package/src/generators/upgrade/framework-package-upgrade.js +78 -0
- package/src/generators/upgrade/function-authentication-notice.d.ts +29 -0
- package/src/generators/upgrade/function-authentication-notice.js +74 -0
- package/src/generators/upgrade/schema.json +2 -2
- package/src/generators/upgrade/upgrade-plan.d.ts +52 -0
- package/src/generators/upgrade/upgrade-plan.js +406 -0
- package/src/generators/upgrade/upgrade.d.ts +1 -35
- package/src/generators/upgrade/upgrade.js +259 -593
- package/src/generators/workload/workload.js +60 -4
- package/src/git-policy/github-bootstrap.d.ts +6 -5
- package/src/git-policy/github-bootstrap.js +6 -4
- package/src/local-dev/fleet-process.d.ts +9 -2
- package/src/local-dev/fleet-process.js +27 -7
- package/src/local-dev/gateway-daemon.d.ts +1 -1
- package/src/local-dev/gateway-daemon.js +6 -4
- package/src/local-dev/portless.d.ts +5 -0
- package/src/local-dev/portless.js +5 -0
- package/src/local-dev/process-group.d.ts +10 -0
- package/src/local-dev/process-group.js +33 -0
- package/src/local-dev/tls.js +31 -2
- package/src/local-dev/trust-store.d.ts +42 -0
- package/src/local-dev/trust-store.js +87 -0
- package/src/ownership/composition.d.ts +7 -0
- package/src/ownership/composition.js +64 -56
- package/src/ownership/index.d.ts +1 -0
- package/src/ownership/index.js +1 -0
- package/src/ownership/record.d.ts +19 -0
- package/src/ownership/record.js +26 -2
- package/src/ownership/site-record.d.ts +18 -0
- package/src/ownership/site-record.js +105 -0
- package/src/repository-policy/deployment-plan.d.ts +3 -0
- package/src/repository-policy/deployment-plan.js +33 -4
- package/src/repository-policy/index.d.ts +1 -0
- package/src/repository-policy/index.js +1 -0
- package/src/repository-policy/policy.d.ts +13 -1
- package/src/repository-policy/policy.js +55 -1
- package/src/repository-policy/public-dns.d.ts +65 -0
- package/src/repository-policy/public-dns.js +168 -0
- package/src/schemas/generated-ownership-v2.json +6 -0
- package/src/schemas/repository-policy-v1.json +67 -1
- package/src/supply-chain/blueprint-trust-git.js +24 -0
- package/src/supply-chain/blueprint-verification-authority.js +21 -3
- package/src/supply-chain/generated-blueprint-trust-command.js +15 -0
- package/src/work-markers/work-markers.js +4 -1
- package/src/workspace-deployment/ownership.d.ts +15 -0
- package/src/workspace-deployment/ownership.js +19 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS = exports.ROOT_SITE_DEV_PORT = exports.ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS = void 0;
|
|
4
|
+
exports.renderBuiltInSiteFiles = renderBuiltInSiteFiles;
|
|
5
|
+
const built_in_site_documentation_files_js_1 = require("./built-in-site-documentation-files.js");
|
|
6
|
+
const built_in_site_infrastructure_files_js_1 = require("./built-in-site-infrastructure-files.js");
|
|
7
|
+
const built_in_site_project_files_js_1 = require("./built-in-site-project-files.js");
|
|
8
|
+
const built_in_site_script_files_js_1 = require("./built-in-site-script-files.js");
|
|
9
|
+
const built_in_site_smoke_files_js_1 = require("./built-in-site-smoke-files.js");
|
|
10
|
+
const built_in_site_sst_config_files_js_1 = require("./built-in-site-sst-config-files.js");
|
|
11
|
+
const built_in_site_web_files_js_1 = require("./built-in-site-web-files.js");
|
|
12
|
+
var built_in_site_project_files_js_2 = require("./built-in-site-project-files.js");
|
|
13
|
+
Object.defineProperty(exports, "ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS", { enumerable: true, get: function () { return built_in_site_project_files_js_2.ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS; } });
|
|
14
|
+
var built_in_site_shared_js_1 = require("./built-in-site-shared.js");
|
|
15
|
+
Object.defineProperty(exports, "ROOT_SITE_DEV_PORT", { enumerable: true, get: function () { return built_in_site_shared_js_1.ROOT_SITE_DEV_PORT; } });
|
|
16
|
+
Object.defineProperty(exports, "ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS", { enumerable: true, get: function () { return built_in_site_shared_js_1.ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS; } });
|
|
17
|
+
/** Every file of a generated root site, keyed by its path in packages/site. */
|
|
18
|
+
function renderBuiltInSiteFiles(input) {
|
|
19
|
+
const workspace = input.scope.slice(1);
|
|
20
|
+
const groups = [
|
|
21
|
+
(0, built_in_site_project_files_js_1.renderSiteProjectFiles)(input.scope),
|
|
22
|
+
(0, built_in_site_sst_config_files_js_1.renderSiteSstConfigFiles)(workspace, input.runtimeVersion),
|
|
23
|
+
(0, built_in_site_infrastructure_files_js_1.renderSiteInfrastructureFiles)(workspace),
|
|
24
|
+
(0, built_in_site_web_files_js_1.renderSiteWebFiles)(),
|
|
25
|
+
(0, built_in_site_script_files_js_1.renderSiteScriptFiles)(),
|
|
26
|
+
(0, built_in_site_documentation_files_js_1.renderSiteDocumentationFiles)(),
|
|
27
|
+
(0, built_in_site_smoke_files_js_1.renderSiteSmokeFiles)(),
|
|
28
|
+
];
|
|
29
|
+
const files = {};
|
|
30
|
+
for (const group of groups) {
|
|
31
|
+
for (const [path, contents] of Object.entries(group)) {
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(files, path)) {
|
|
33
|
+
throw new Error(`Root site renderer duplicates ${path}.`);
|
|
34
|
+
}
|
|
35
|
+
files[path] = contents;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return files;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=built-in-site-files.js.map
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderSiteInfrastructureFiles = renderSiteInfrastructureFiles;
|
|
4
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
5
|
+
const built_in_plan_alarm_identity_js_1 = require("../slice/built-in-plan-alarm-identity.js");
|
|
6
|
+
const built_in_plan_foundation_files_js_1 = require("../slice/built-in-plan-foundation-files.js");
|
|
7
|
+
const built_in_plan_log_group_helpers_js_1 = require("../slice/built-in-plan-log-group-helpers.js");
|
|
8
|
+
const built_in_plan_next_build_authority_js_1 = require("../slice/built-in-plan-next-build-authority.js");
|
|
9
|
+
const built_in_site_shared_js_1 = require("./built-in-site-shared.js");
|
|
10
|
+
/** The root site's alarms; both name the README's Site recovery section. */
|
|
11
|
+
const SITE_SERVER_ERRORS_ALARM = {
|
|
12
|
+
businessSymptom: 'The root site is failing requests.',
|
|
13
|
+
id: 'site-server-errors',
|
|
14
|
+
runbook: 'site-recovery',
|
|
15
|
+
};
|
|
16
|
+
const SITE_DATA_PROTECTION_ALARM = {
|
|
17
|
+
// The symptom every Slice log group's findings alarm reports.
|
|
18
|
+
businessSymptom: (0, built_in_plan_alarm_identity_js_1.sliceAlarmIdentity)(root_site_js_1.ROOT_SITE_NAME, 'data-protection-findings').businessSymptom,
|
|
19
|
+
id: 'site-data-protection-findings',
|
|
20
|
+
runbook: 'site-recovery',
|
|
21
|
+
};
|
|
22
|
+
/** @internal */
|
|
23
|
+
function renderSiteInfrastructureFiles(workspace) {
|
|
24
|
+
// The Slice's managed log-group helpers: each group gets the Slice's
|
|
25
|
+
// contract, data protection policy and findings alarm.
|
|
26
|
+
const logHelpers = (0, built_in_plan_log_group_helpers_js_1.renderManagedLogHelpers)({
|
|
27
|
+
dataProtectionAlarm: SITE_DATA_PROTECTION_ALARM,
|
|
28
|
+
name: root_site_js_1.ROOT_SITE_NAME,
|
|
29
|
+
workspace,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
'infra/foundation.ts': `import {
|
|
33
|
+
foundationSsmPath,
|
|
34
|
+
productSliceRegistrationPath,
|
|
35
|
+
resolveFoundationStages,
|
|
36
|
+
} from '@empire-builder-kit/nx/foundation';
|
|
37
|
+
|
|
38
|
+
const stages = resolveFoundationStages({
|
|
39
|
+
consumerStage: $app.stage,
|
|
40
|
+
foundationStage: process.env.EBK_FOUNDATION_STAGE,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
function foundationParameter(name: Parameters<typeof foundationSsmPath>[1]) {
|
|
44
|
+
return aws.ssm.getParameterOutput({
|
|
45
|
+
name: foundationSsmPath(stages.foundationStage, name),
|
|
46
|
+
}).value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// The root site reads only the Router discovery it attaches to.
|
|
50
|
+
export function getFoundation() {
|
|
51
|
+
return {
|
|
52
|
+
alertTopicArn: foundationParameter('alertTopicArn'),
|
|
53
|
+
hasPublicDomain: foundationParameter('hasPublicDomain').apply(
|
|
54
|
+
(value: string) => value === 'true',
|
|
55
|
+
),
|
|
56
|
+
rootDomain: foundationParameter('rootDomain').apply((value: string) =>
|
|
57
|
+
value === 'none' ? undefined : value,
|
|
58
|
+
),
|
|
59
|
+
routerDistributionId: foundationParameter('routerDistributionId'),
|
|
60
|
+
routerUrl: foundationParameter('routerUrl'),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
${(0, built_in_plan_foundation_files_js_1.renderFoundationRouterWebUrl)({
|
|
65
|
+
comment: `// SST derives a referenced Router's url from the distribution's first alias,
|
|
66
|
+
// which can be the wildcard alias when the Foundation serves a custom domain.
|
|
67
|
+
// The root site's deployed URL comes only from the Foundation's published
|
|
68
|
+
// routerUrl, never from the referenced Router or the Next.js component. The
|
|
69
|
+
// host check refuses a '*' and any character outside letters, digits, '.' and
|
|
70
|
+
// '-'; it is not a hostname validator.
|
|
71
|
+
`,
|
|
72
|
+
functionName: 'foundationSiteWebUrl',
|
|
73
|
+
path: '/',
|
|
74
|
+
subject: 'the root site',
|
|
75
|
+
})}
|
|
76
|
+
export function getFoundationInfrastructure() {
|
|
77
|
+
const discovery = getFoundation();
|
|
78
|
+
const router = sst.aws.Router.get(
|
|
79
|
+
'FoundationRouter',
|
|
80
|
+
discovery.routerDistributionId,
|
|
81
|
+
);
|
|
82
|
+
return { discovery, router };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// The Foundation's remove fails closed while this registration exists, so
|
|
86
|
+
// the Foundation cannot be removed from under a deployed root site.
|
|
87
|
+
export function registerRootSite() {
|
|
88
|
+
return new aws.ssm.Parameter('SiteRegistration', {
|
|
89
|
+
name: productSliceRegistrationPath(
|
|
90
|
+
stages.foundationStage,
|
|
91
|
+
stages.consumerStage,
|
|
92
|
+
'${root_site_js_1.ROOT_SITE_NAME}',
|
|
93
|
+
),
|
|
94
|
+
type: 'String',
|
|
95
|
+
value: JSON.stringify({
|
|
96
|
+
consumerStage: stages.consumerStage,
|
|
97
|
+
foundationContract: '^2.0.0',
|
|
98
|
+
foundationStage: stages.foundationStage,
|
|
99
|
+
kind: 'root-site',
|
|
100
|
+
name: '${root_site_js_1.ROOT_SITE_NAME}',
|
|
101
|
+
registrationVersion: 1,
|
|
102
|
+
}),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
`,
|
|
106
|
+
'infra/index.ts': `import { registerRootSite } from './foundation.js';
|
|
107
|
+
import { site } from './site.js';
|
|
108
|
+
|
|
109
|
+
export function app(accountId: string) {
|
|
110
|
+
const registration = registerRootSite();
|
|
111
|
+
const resources = site(accountId);
|
|
112
|
+
return {
|
|
113
|
+
kind: 'site',
|
|
114
|
+
name: '${root_site_js_1.ROOT_SITE_NAME}',
|
|
115
|
+
registration: registration.name,
|
|
116
|
+
stage: $app.stage,
|
|
117
|
+
webUrl: resources.webUrl,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
`,
|
|
121
|
+
// The Slice web's managed Finder-metadata seal.
|
|
122
|
+
'infra/next-build-authority.ts': (0, built_in_plan_next_build_authority_js_1.renderNextBuildAuthority)(),
|
|
123
|
+
'infra/site.ts': `import {
|
|
124
|
+
createManagedLogGroupContract,
|
|
125
|
+
resolveObservabilityPolicy,
|
|
126
|
+
} from '@empire-builder-kit/nx/foundation';
|
|
127
|
+
import observabilityPolicy from '../../../ebk.observability.json';
|
|
128
|
+
import {
|
|
129
|
+
foundationSiteWebUrl,
|
|
130
|
+
getFoundationInfrastructure,
|
|
131
|
+
} from './foundation.js';
|
|
132
|
+
import { removeFinderMetadataFromBuiltFunction } from './next-build-authority.js';
|
|
133
|
+
|
|
134
|
+
const observability = resolveObservabilityPolicy({
|
|
135
|
+
policy: observabilityPolicy,
|
|
136
|
+
stage: $app.stage,
|
|
137
|
+
productionProfile: process.env.EBK_PRODUCTION_FOUNDATION_PROFILE,
|
|
138
|
+
local: false,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
${logHelpers.managedLogGroup}
|
|
142
|
+
${logHelpers.managedLogContract}
|
|
143
|
+
${logHelpers.operationalAlarmDescription}
|
|
144
|
+
${logHelpers.managedLogDataProtection}
|
|
145
|
+
${logHelpers.lambdaLogging}
|
|
146
|
+
const builtFunctionHook = {
|
|
147
|
+
async postbuild(directory: string) {
|
|
148
|
+
removeFinderMetadataFromBuiltFunction(directory);
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export function site(accountId: string) {
|
|
153
|
+
// Readiness compares the health route's sourceCommit with the release
|
|
154
|
+
// source: a promoted deploy runs one commit and serves the release it
|
|
155
|
+
// promotes, as a Product Slice's web does.
|
|
156
|
+
const sourceCommit = process.env.EBK_SOURCE_COMMIT ?? '';
|
|
157
|
+
const releaseSourceCommit =
|
|
158
|
+
process.env.EBK_RELEASE_SOURCE_COMMIT ?? sourceCommit;
|
|
159
|
+
if (
|
|
160
|
+
!${built_in_site_shared_js_1.SOURCE_COMMIT_PATTERN}.test(sourceCommit) ||
|
|
161
|
+
!${built_in_site_shared_js_1.SOURCE_COMMIT_PATTERN}.test(releaseSourceCommit)
|
|
162
|
+
) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
'The root site requires exact deployment and release source Git object IDs.',
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
const resourceNames = {
|
|
168
|
+
webAssetsBucket: [
|
|
169
|
+
'ebk',
|
|
170
|
+
accountId,
|
|
171
|
+
$app.stage,
|
|
172
|
+
'${root_site_js_1.ROOT_SITE_NAME}',
|
|
173
|
+
'web-assets',
|
|
174
|
+
].join('-'),
|
|
175
|
+
webRevalidationQueue:
|
|
176
|
+
['ebk', $app.stage, '${root_site_js_1.ROOT_SITE_NAME}', 'web-revalidation'].join('-') +
|
|
177
|
+
'.fifo',
|
|
178
|
+
webRevalidationTable: [
|
|
179
|
+
'ebk',
|
|
180
|
+
$app.stage,
|
|
181
|
+
'${root_site_js_1.ROOT_SITE_NAME}',
|
|
182
|
+
'web-revalidation',
|
|
183
|
+
].join('-'),
|
|
184
|
+
};
|
|
185
|
+
$transform(aws.dynamodb.Table, (args: any, _opts: any, logicalName: string) => {
|
|
186
|
+
if (logicalName === 'SiteWebRevalidationTable') {
|
|
187
|
+
args.name = resourceNames.webRevalidationTable;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
$transform(aws.sqs.Queue, (args: any, _opts: any, logicalName: string) => {
|
|
191
|
+
if (logicalName === 'SiteWebRevalidationEventsQueue') {
|
|
192
|
+
args.name = resourceNames.webRevalidationQueue;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
const foundation = getFoundationInfrastructure();
|
|
196
|
+
// Under a custom domain SST's own URL for the Next.js component names the
|
|
197
|
+
// wildcard alias host; the published URL is the Foundation's routerUrl with
|
|
198
|
+
// path '/'.
|
|
199
|
+
const webUrl = foundationSiteWebUrl(foundation.discovery);
|
|
200
|
+
// On a bound stage the site answers only on the root domain; every other
|
|
201
|
+
// alias host is redirected there. Unbound, it answers on the Router host.
|
|
202
|
+
const canonicalHost = $resolve({
|
|
203
|
+
hasPublicDomain: foundation.discovery.hasPublicDomain,
|
|
204
|
+
webUrl,
|
|
205
|
+
}).apply(({ hasPublicDomain, webUrl }) =>
|
|
206
|
+
hasPublicDomain ? new URL(webUrl).hostname : '',
|
|
207
|
+
);
|
|
208
|
+
${root_site_js_1.ROOT_SITE_LOG_COMPONENTS.map((component) => ` const ${component.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase())}Logs = managedLogGroup(
|
|
209
|
+
'Site${component
|
|
210
|
+
.split('-')
|
|
211
|
+
.map((part) => part[0]?.toUpperCase() + part.slice(1))
|
|
212
|
+
.join('')}Logs',
|
|
213
|
+
'${component}',
|
|
214
|
+
foundation.discovery.alertTopicArn,
|
|
215
|
+
);
|
|
216
|
+
`).join('')}\
|
|
217
|
+
const webServerLogging = lambdaLogging(nextServerLogs.logGroup.name);
|
|
218
|
+
const web = new sst.aws.Nextjs('SiteWeb', {
|
|
219
|
+
buildCommand: 'node ../tools/ebk-next-build-environment.mjs',
|
|
220
|
+
environment: {
|
|
221
|
+
EBK_SITE_CANONICAL_HOST: canonicalHost,
|
|
222
|
+
EBK_SOURCE_COMMIT: releaseSourceCommit,
|
|
223
|
+
EBK_STAGE: $app.stage,
|
|
224
|
+
},
|
|
225
|
+
invalidation: { wait: true },
|
|
226
|
+
path: 'web',
|
|
227
|
+
// A host-less root route: every Slice path is longer, so the Router
|
|
228
|
+
// gives each Slice precedence on every host.
|
|
229
|
+
router: { instance: foundation.router, path: '/' },
|
|
230
|
+
transform: {
|
|
231
|
+
assets: {
|
|
232
|
+
transform: {
|
|
233
|
+
bucket: { bucket: resourceNames.webAssetsBucket },
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
imageOptimizer: {
|
|
237
|
+
hook: builtFunctionHook,
|
|
238
|
+
...lambdaLogging(nextImageOptimizerLogs.logGroup.name),
|
|
239
|
+
},
|
|
240
|
+
revalidationEventsSubscriber: lambdaLogging(
|
|
241
|
+
nextRevalidationSubscriberLogs.logGroup.name,
|
|
242
|
+
),
|
|
243
|
+
revalidationSeeder: lambdaLogging(
|
|
244
|
+
nextRevalidationSeederLogs.logGroup.name,
|
|
245
|
+
),
|
|
246
|
+
server(args: Record<string, unknown>) {
|
|
247
|
+
args.hook = builtFunctionHook;
|
|
248
|
+
Object.assign(args, webServerLogging);
|
|
249
|
+
args.transform = { ...webServerLogging.transform };
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
const serverErrors = new aws.cloudwatch.MetricAlarm('SiteWebServerErrors', {
|
|
254
|
+
alarmActions: [foundation.discovery.alertTopicArn],
|
|
255
|
+
alarmDescription: operationalAlarmDescription(${(0, built_in_plan_alarm_identity_js_1.renderAlarmDescriptionInput)(SITE_SERVER_ERRORS_ALARM, ' ')}),
|
|
256
|
+
comparisonOperator: 'GreaterThanOrEqualToThreshold',
|
|
257
|
+
dimensions: {
|
|
258
|
+
FunctionName: web.nodes.server.apply(
|
|
259
|
+
(server: any) => server.nodes.function.name,
|
|
260
|
+
),
|
|
261
|
+
},
|
|
262
|
+
evaluationPeriods: 1,
|
|
263
|
+
metricName: 'Errors',
|
|
264
|
+
namespace: 'AWS/Lambda',
|
|
265
|
+
period: 300,
|
|
266
|
+
statistic: 'Sum',
|
|
267
|
+
threshold: 1,
|
|
268
|
+
treatMissingData: 'notBreaching',
|
|
269
|
+
});
|
|
270
|
+
return { serverErrors, web, webUrl };
|
|
271
|
+
}
|
|
272
|
+
`,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=built-in-site-infrastructure-files.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type SiteOwnershipRecord } from '../../ownership/index.js';
|
|
2
|
+
/** Starting files that belong to the adopter after generation. */
|
|
3
|
+
export declare const ROOT_SITE_SEEDED_PATHS: readonly ["README.md", "e2e/site.spec.ts", "frontend/security-headers.json", "web/src/app/globals.css", "web/src/app/icon.svg", "web/src/app/layout.tsx", "web/src/app/not-found.tsx", "web/src/app/page.tsx"];
|
|
4
|
+
export interface BuiltInSitePlan {
|
|
5
|
+
files: Readonly<Record<string, string>>;
|
|
6
|
+
ownership: SiteOwnershipRecord;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The deterministic file plan and ownership record of the workspace root site
|
|
10
|
+
* at packages/site.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createBuiltInSitePlan(input: {
|
|
13
|
+
/** The installed @empire-builder-kit/nx version, recorded in ownership. */
|
|
14
|
+
frameworkVersion: string;
|
|
15
|
+
/** The workspace runtime version, stamped into resource tags. */
|
|
16
|
+
runtimeVersion: string;
|
|
17
|
+
/** The workspace package scope, such as `@sample-product`. */
|
|
18
|
+
scope: string;
|
|
19
|
+
}): BuiltInSitePlan;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ROOT_SITE_SEEDED_PATHS = void 0;
|
|
4
|
+
exports.createBuiltInSitePlan = createBuiltInSitePlan;
|
|
5
|
+
const deterministic_order_js_1 = require("../../deterministic-order.js");
|
|
6
|
+
const index_js_1 = require("../../ownership/index.js");
|
|
7
|
+
const built_in_site_files_js_1 = require("./built-in-site-files.js");
|
|
8
|
+
/** Starting files that belong to the adopter after generation. */
|
|
9
|
+
exports.ROOT_SITE_SEEDED_PATHS = [
|
|
10
|
+
'README.md',
|
|
11
|
+
'e2e/site.spec.ts',
|
|
12
|
+
'frontend/security-headers.json',
|
|
13
|
+
'web/src/app/globals.css',
|
|
14
|
+
'web/src/app/icon.svg',
|
|
15
|
+
'web/src/app/layout.tsx',
|
|
16
|
+
'web/src/app/not-found.tsx',
|
|
17
|
+
'web/src/app/page.tsx',
|
|
18
|
+
];
|
|
19
|
+
/** Files SST owns and rewrites; generated once, never hash-checked. */
|
|
20
|
+
const TOOL_OWNED_PATHS = new Set(['sst-env.d.ts']);
|
|
21
|
+
function classifyPaths(files) {
|
|
22
|
+
const seeded = new Set(exports.ROOT_SITE_SEEDED_PATHS);
|
|
23
|
+
return Object.entries(files)
|
|
24
|
+
.filter(([path]) => !TOOL_OWNED_PATHS.has(path))
|
|
25
|
+
.map(([path, contents]) => {
|
|
26
|
+
const managedJsonPointers = path === 'package.json'
|
|
27
|
+
? [...built_in_site_files_js_1.ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS]
|
|
28
|
+
: undefined;
|
|
29
|
+
if (managedJsonPointers) {
|
|
30
|
+
(0, index_js_1.assertManagedJsonPointersExist)(contents, managedJsonPointers, `Root site ${path}`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
...(managedJsonPointers ? { managedJsonPointers } : {}),
|
|
34
|
+
mode: seeded.has(path) ? 'seeded' : 'managed',
|
|
35
|
+
origin: 'framework',
|
|
36
|
+
path,
|
|
37
|
+
sha256: (0, index_js_1.hashOwnedContent)(contents, { managedJsonPointers }),
|
|
38
|
+
};
|
|
39
|
+
})
|
|
40
|
+
.sort((left, right) => (0, deterministic_order_js_1.compareUtf16)(left.path, right.path));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The deterministic file plan and ownership record of the workspace root site
|
|
44
|
+
* at packages/site.
|
|
45
|
+
*/
|
|
46
|
+
function createBuiltInSitePlan(input) {
|
|
47
|
+
const files = (0, built_in_site_files_js_1.renderBuiltInSiteFiles)({
|
|
48
|
+
runtimeVersion: input.runtimeVersion,
|
|
49
|
+
scope: input.scope,
|
|
50
|
+
});
|
|
51
|
+
const ownership = {
|
|
52
|
+
frameworkVersion: input.frameworkVersion,
|
|
53
|
+
kind: 'site',
|
|
54
|
+
paths: classifyPaths(files),
|
|
55
|
+
schemaVersion: index_js_1.SITE_OWNERSHIP_SCHEMA_VERSION,
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
files: {
|
|
59
|
+
...files,
|
|
60
|
+
'.ebk/ownership.json': `${JSON.stringify(ownership, null, 2)}\n`,
|
|
61
|
+
},
|
|
62
|
+
ownership,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=built-in-site-plan.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS: readonly ["/name", "/version", "/private", "/type", "/dependencies/next", "/dependencies/react", "/dependencies/react-dom", "/devDependencies/@opennextjs~1aws", "/devDependencies/@playwright~1test", "/devDependencies/@types~1node", "/devDependencies/@types~1react", "/devDependencies/@types~1react-dom", "/devDependencies/vitest"];
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare function renderSiteProjectFiles(scope: string): Record<string, string>;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS = void 0;
|
|
4
|
+
exports.renderSiteProjectFiles = renderSiteProjectFiles;
|
|
5
|
+
const discovery_js_1 = require("../../foundation/discovery.js");
|
|
6
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
7
|
+
const built_in_plan_shared_js_1 = require("../slice/built-in-plan-shared.js");
|
|
8
|
+
const built_in_site_shared_js_1 = require("./built-in-site-shared.js");
|
|
9
|
+
exports.ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS = [
|
|
10
|
+
'/name',
|
|
11
|
+
'/version',
|
|
12
|
+
'/private',
|
|
13
|
+
'/type',
|
|
14
|
+
'/dependencies/next',
|
|
15
|
+
'/dependencies/react',
|
|
16
|
+
'/dependencies/react-dom',
|
|
17
|
+
'/devDependencies/@opennextjs~1aws',
|
|
18
|
+
'/devDependencies/@playwright~1test',
|
|
19
|
+
'/devDependencies/@types~1node',
|
|
20
|
+
'/devDependencies/@types~1react',
|
|
21
|
+
'/devDependencies/@types~1react-dom',
|
|
22
|
+
'/devDependencies/vitest',
|
|
23
|
+
];
|
|
24
|
+
/** @internal */
|
|
25
|
+
function renderSiteProjectFiles(scope) {
|
|
26
|
+
const consumerTarget = (executor) => ({
|
|
27
|
+
executor,
|
|
28
|
+
options: {
|
|
29
|
+
cwd: 'packages/site',
|
|
30
|
+
stage: 'development',
|
|
31
|
+
stageMode: 'consumer',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
'package.json': (0, built_in_plan_shared_js_1.json)({
|
|
36
|
+
name: `${scope}/site`,
|
|
37
|
+
version: '0.0.0',
|
|
38
|
+
private: true,
|
|
39
|
+
type: 'module',
|
|
40
|
+
dependencies: {
|
|
41
|
+
next: built_in_plan_shared_js_1.PRODUCT_VERSIONS.next,
|
|
42
|
+
react: built_in_plan_shared_js_1.PRODUCT_VERSIONS.react,
|
|
43
|
+
'react-dom': built_in_plan_shared_js_1.PRODUCT_VERSIONS.reactDom,
|
|
44
|
+
},
|
|
45
|
+
devDependencies: {
|
|
46
|
+
'@opennextjs/aws': built_in_plan_shared_js_1.OPEN_NEXT_AWS_VERSION,
|
|
47
|
+
'@playwright/test': built_in_plan_shared_js_1.PRODUCT_VERSIONS.playwright,
|
|
48
|
+
'@types/node': built_in_plan_shared_js_1.PRODUCT_VERSIONS.typesNode,
|
|
49
|
+
'@types/react': built_in_plan_shared_js_1.PRODUCT_VERSIONS.typesReact,
|
|
50
|
+
'@types/react-dom': built_in_plan_shared_js_1.PRODUCT_VERSIONS.typesReactDom,
|
|
51
|
+
vitest: built_in_plan_shared_js_1.PRODUCT_VERSIONS.vitest,
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
'project.json': (0, built_in_plan_shared_js_1.json)({
|
|
55
|
+
name: root_site_js_1.ROOT_SITE_NAME,
|
|
56
|
+
$schema: '../../node_modules/nx/schemas/project-schema.json',
|
|
57
|
+
projectType: 'application',
|
|
58
|
+
root: 'packages/site',
|
|
59
|
+
sourceRoot: 'packages/site/infra',
|
|
60
|
+
implicitDependencies: ['foundation'],
|
|
61
|
+
tags: ['scope:site', 'type:site', 'type:sst'],
|
|
62
|
+
targets: {
|
|
63
|
+
build: {
|
|
64
|
+
executor: 'nx:run-commands',
|
|
65
|
+
dependsOn: ['route-check', 'typecheck'],
|
|
66
|
+
outputs: ['{projectRoot}/web/.next'],
|
|
67
|
+
options: {
|
|
68
|
+
command: 'next build --webpack web',
|
|
69
|
+
cwd: 'packages/site',
|
|
70
|
+
env: { NODE_ENV: 'production' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
deploy: {
|
|
74
|
+
...consumerTarget('@empire-builder-kit/nx:deploy'),
|
|
75
|
+
dependsOn: [
|
|
76
|
+
'verify',
|
|
77
|
+
{ target: 'foundation-ready', params: 'forward' },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
dev: {
|
|
81
|
+
continuous: true,
|
|
82
|
+
executor: 'nx:run-commands',
|
|
83
|
+
options: {
|
|
84
|
+
command: `next dev web --hostname 127.0.0.1 --port ${built_in_site_shared_js_1.ROOT_SITE_DEV_PORT}`,
|
|
85
|
+
cwd: 'packages/site',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
// The Slice's foundation-ready shape. The executor schema defaults
|
|
89
|
+
// contract to ^1.0.0, so the site names the Foundation contract; it
|
|
90
|
+
// leaves capabilities to the executor's base Foundation requirement.
|
|
91
|
+
'foundation-ready': {
|
|
92
|
+
executor: '@empire-builder-kit/nx:foundation-preflight',
|
|
93
|
+
dependsOn: [
|
|
94
|
+
{ projects: ['foundation'], target: 'verify', params: 'ignore' },
|
|
95
|
+
],
|
|
96
|
+
options: {
|
|
97
|
+
contract: discovery_js_1.STANDARD_FOUNDATION_REQUIREMENT.contract,
|
|
98
|
+
deployIfMissing: true,
|
|
99
|
+
foundationProject: 'foundation',
|
|
100
|
+
stage: 'development',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
'frontend-security-headers': {
|
|
104
|
+
cache: false,
|
|
105
|
+
executor: 'nx:run-commands',
|
|
106
|
+
outputs: [
|
|
107
|
+
'{projectRoot}/.ebk/evidence/frontend/security-headers.json',
|
|
108
|
+
],
|
|
109
|
+
options: {
|
|
110
|
+
command: 'node scripts/frontend-security-headers.mjs',
|
|
111
|
+
cwd: 'packages/site',
|
|
112
|
+
forwardAllArgs: true,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
'infrastructure-plan': {
|
|
116
|
+
cache: false,
|
|
117
|
+
...consumerTarget('@empire-builder-kit/nx:infrastructure-plan'),
|
|
118
|
+
},
|
|
119
|
+
lint: {
|
|
120
|
+
executor: 'nx:run-commands',
|
|
121
|
+
options: { command: 'eslint .', cwd: 'packages/site' },
|
|
122
|
+
},
|
|
123
|
+
refresh: consumerTarget('@empire-builder-kit/nx:refresh'),
|
|
124
|
+
remove: {
|
|
125
|
+
cache: false,
|
|
126
|
+
...consumerTarget('@empire-builder-kit/nx:remove'),
|
|
127
|
+
},
|
|
128
|
+
'route-check': {
|
|
129
|
+
executor: 'nx:run-commands',
|
|
130
|
+
inputs: [
|
|
131
|
+
'{projectRoot}/web/**/*',
|
|
132
|
+
'{workspaceRoot}/packages/*/project.json',
|
|
133
|
+
],
|
|
134
|
+
options: {
|
|
135
|
+
command: 'node scripts/route-check.mjs',
|
|
136
|
+
cwd: 'packages/site',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
// Readiness, the seeded Playwright journey, then the header proof on
|
|
140
|
+
// the deployed URL; local-deploy and the Deploy workflow run it after
|
|
141
|
+
// the site deploys.
|
|
142
|
+
'smoke-deployed': {
|
|
143
|
+
cache: false,
|
|
144
|
+
executor: 'nx:run-commands',
|
|
145
|
+
outputs: [
|
|
146
|
+
'{projectRoot}/.ebk/evidence/deployed-readiness.json',
|
|
147
|
+
'{projectRoot}/.ebk/evidence/smoke-deployed.json',
|
|
148
|
+
],
|
|
149
|
+
options: {
|
|
150
|
+
command: 'node scripts/run-smoke-deployed.mjs',
|
|
151
|
+
cwd: 'packages/site',
|
|
152
|
+
forwardAllArgs: false,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
'smoke-deployed-check': {
|
|
156
|
+
executor: 'nx:run-commands',
|
|
157
|
+
options: {
|
|
158
|
+
command: 'playwright test --list',
|
|
159
|
+
cwd: 'packages/site',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
test: {
|
|
163
|
+
executor: 'nx:run-commands',
|
|
164
|
+
options: { command: 'vitest run', cwd: 'packages/site' },
|
|
165
|
+
},
|
|
166
|
+
typecheck: {
|
|
167
|
+
executor: 'nx:run-commands',
|
|
168
|
+
options: {
|
|
169
|
+
command: 'tsc --noEmit -p tsconfig.json',
|
|
170
|
+
cwd: 'packages/site',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
unlock: consumerTarget('@empire-builder-kit/nx:unlock'),
|
|
174
|
+
verify: {
|
|
175
|
+
executor: 'nx:noop',
|
|
176
|
+
dependsOn: [
|
|
177
|
+
'build',
|
|
178
|
+
'lint',
|
|
179
|
+
'route-check',
|
|
180
|
+
'smoke-deployed-check',
|
|
181
|
+
'test',
|
|
182
|
+
'typecheck',
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
}),
|
|
187
|
+
'tsconfig.json': (0, built_in_plan_shared_js_1.json)({
|
|
188
|
+
extends: '../../tsconfig.base.json',
|
|
189
|
+
compilerOptions: {
|
|
190
|
+
allowJs: true,
|
|
191
|
+
esModuleInterop: true,
|
|
192
|
+
jsx: 'react-jsx',
|
|
193
|
+
lib: ['dom', 'dom.iterable', 'es2022'],
|
|
194
|
+
module: 'esnext',
|
|
195
|
+
moduleResolution: 'bundler',
|
|
196
|
+
plugins: [{ name: 'next' }],
|
|
197
|
+
resolveJsonModule: true,
|
|
198
|
+
types: ['node'],
|
|
199
|
+
},
|
|
200
|
+
include: [
|
|
201
|
+
'infra/**/*.ts',
|
|
202
|
+
'web/**/*.ts',
|
|
203
|
+
'web/**/*.tsx',
|
|
204
|
+
'vitest.config.ts',
|
|
205
|
+
'playwright.config.ts',
|
|
206
|
+
'e2e/**/*.ts',
|
|
207
|
+
'sst.config.ts',
|
|
208
|
+
'sst-env.d.ts',
|
|
209
|
+
'ebk-globals.d.ts',
|
|
210
|
+
],
|
|
211
|
+
exclude: ['.sst', 'dist', 'node_modules'],
|
|
212
|
+
}),
|
|
213
|
+
'vitest.config.ts': `import { configDefaults, defineConfig } from 'vitest/config';
|
|
214
|
+
export default defineConfig({
|
|
215
|
+
test: {
|
|
216
|
+
environment: 'node',
|
|
217
|
+
env: { EBK_STAGE: 'development' },
|
|
218
|
+
exclude: [...configDefaults.exclude, '**/dist/**', 'e2e/**'],
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
`,
|
|
222
|
+
'sst-env.d.ts': `// Bootstrap placeholder. SST overwrites this file after install, dev, or deploy.
|
|
223
|
+
export {};
|
|
224
|
+
`,
|
|
225
|
+
'ebk-globals.d.ts': `// Next.js ambient types, independent of the gitignored web/next-env.d.ts.
|
|
226
|
+
/// <reference types="next" />
|
|
227
|
+
/// <reference types="next/image-types/global" />
|
|
228
|
+
import 'sst/resource';
|
|
229
|
+
|
|
230
|
+
declare global {
|
|
231
|
+
type EbkSstOutput<T> = {
|
|
232
|
+
apply<U>(operation: (value: T) => U): EbkSstOutput<U>;
|
|
233
|
+
};
|
|
234
|
+
type EbkSstUnwrap<T> = T extends EbkSstOutput<infer U>
|
|
235
|
+
? EbkSstUnwrap<U>
|
|
236
|
+
: T extends readonly (infer U)[]
|
|
237
|
+
? EbkSstUnwrap<U>[]
|
|
238
|
+
: T extends Record<string, unknown>
|
|
239
|
+
? { [K in keyof T]: EbkSstUnwrap<T[K]> }
|
|
240
|
+
: T;
|
|
241
|
+
const sst: any;
|
|
242
|
+
const aws: any;
|
|
243
|
+
const $app: { name: string; stage: string };
|
|
244
|
+
const $config: any;
|
|
245
|
+
const $dev: boolean;
|
|
246
|
+
const $output: (value: unknown) => any;
|
|
247
|
+
function $resolve<T extends Record<string, any>>(
|
|
248
|
+
value: T,
|
|
249
|
+
): EbkSstOutput<EbkSstUnwrap<T>>;
|
|
250
|
+
const $transform: any;
|
|
251
|
+
const $util: any;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export {};
|
|
255
|
+
`,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=built-in-site-project-files.js.map
|