@empire-builder-kit/nx 1.0.0-rc.45 → 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 +109 -9
- 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 +44 -3
- 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/github-bootstrap/github-bootstrap.d.ts +3 -0
- package/src/executors/github-bootstrap/github-bootstrap.js +28 -0
- package/src/executors/github-bootstrap/schema.json +14 -0
- 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 +52 -5
- package/src/generators/preset/workspace-files-thin-docs.js +33 -5
- package/src/generators/preset/workspace-files.js +238 -41
- 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 +126 -14
- 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 +25 -5
- 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-release-files.js +0 -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 -5
- package/src/generators/slice/built-in-plan-web-files.js +69 -5
- package/src/generators/slice/built-in-plan.js +1 -2
- 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 +347 -595
- package/src/generators/workload/reliability-registration.d.ts +1 -1
- package/src/generators/workload/reliability-registration.js +9 -9
- package/src/generators/workload/workload.d.ts +1 -1
- package/src/generators/workload/workload.js +87 -13
- package/src/git-policy/github-bootstrap.d.ts +24 -5
- package/src/git-policy/github-bootstrap.js +105 -10
- package/src/local-dev/fleet-process.d.ts +9 -2
- package/src/local-dev/fleet-process.js +27 -7
- package/src/local-dev/fleet-session.js +41 -4
- package/src/local-dev/fleet-supervisor-daemon.js +1 -5
- package/src/local-dev/fleet-supervisor.d.ts +1 -0
- package/src/local-dev/fleet-supervisor.js +34 -11
- 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 +42 -3
- package/src/supply-chain/generated-blueprint-trust-command.js +15 -0
- package/src/supply-chain/sbom.js +74 -12
- 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,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
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderSiteScriptFiles = renderSiteScriptFiles;
|
|
4
|
+
const index_js_1 = require("../../frontend-security/index.js");
|
|
5
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
6
|
+
const built_in_plan_frontend_header_proof_js_1 = require("../slice/built-in-plan-frontend-header-proof.js");
|
|
7
|
+
const built_in_plan_operations_files_js_1 = require("../slice/built-in-plan-operations-files.js");
|
|
8
|
+
const built_in_plan_shared_js_1 = require("../slice/built-in-plan-shared.js");
|
|
9
|
+
const deployed_smoke_readiness_js_1 = require("../slice/deployed-smoke-readiness.js");
|
|
10
|
+
const pnpm_launch_script_js_1 = require("../slice/pnpm-launch-script.js");
|
|
11
|
+
const built_in_site_shared_js_1 = require("./built-in-site-shared.js");
|
|
12
|
+
function sitePolicyWithWorkerSourceNone() {
|
|
13
|
+
const policy = (0, index_js_1.sliceFrontendSecurityHeaderPolicy)(root_site_js_1.ROOT_SITE_NAME);
|
|
14
|
+
// A worker served from /sw.js could take scope / and intercept every Slice
|
|
15
|
+
// page on the shared origin, which no Slice can do to another Slice.
|
|
16
|
+
for (const profile of Object.values(policy.profiles)) {
|
|
17
|
+
for (const header of profile.headers) {
|
|
18
|
+
if (header.name.toLowerCase() === 'content-security-policy') {
|
|
19
|
+
header.value = `${header.value}; worker-src 'none'`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return policy;
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
function renderSiteScriptFiles() {
|
|
27
|
+
return {
|
|
28
|
+
'frontend/security-headers.json': (0, built_in_plan_shared_js_1.json)(sitePolicyWithWorkerSourceNone()),
|
|
29
|
+
// The Slice web's managed header proof, for the site's policy owner.
|
|
30
|
+
'scripts/frontend-security-headers.mjs': (0, built_in_plan_frontend_header_proof_js_1.renderFrontendSecurityHeaderProof)(root_site_js_1.ROOT_SITE_NAME, 'root site'),
|
|
31
|
+
// The Slice readiness, rendered in its root site mode.
|
|
32
|
+
'scripts/deployed-smoke-readiness.mjs': (0, deployed_smoke_readiness_js_1.rootSiteDeployedSmokeReadinessScript)(),
|
|
33
|
+
'scripts/run-smoke-deployed.mjs': renderRunSmokeDeployed(),
|
|
34
|
+
'scripts/route-check.mjs': `import { lstatSync, readdirSync, readFileSync } from 'node:fs';
|
|
35
|
+
import { createRequire } from 'node:module';
|
|
36
|
+
import { dirname, join, resolve } from 'node:path';
|
|
37
|
+
import { fileURLToPath } from 'node:url';
|
|
38
|
+
|
|
39
|
+
const require = createRequire(import.meta.url);
|
|
40
|
+
const {
|
|
41
|
+
formatRootSiteRouteInventory,
|
|
42
|
+
inspectRootSiteRoutes,
|
|
43
|
+
} = require('@empire-builder-kit/nx/foundation');
|
|
44
|
+
|
|
45
|
+
const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
46
|
+
const webRoot = join(projectRoot, 'web');
|
|
47
|
+
const packagesRoot = resolve(projectRoot, '..');
|
|
48
|
+
const maximumEntries = ${String(root_site_js_1.ROOT_SITE_ROUTE_ENTRY_LIMIT).replace(/\B(?=(\d{3})+$)/g, '_')};
|
|
49
|
+
let observedEntries = 0;
|
|
50
|
+
|
|
51
|
+
function listFiles(relativeRoot) {
|
|
52
|
+
const root = join(webRoot, relativeRoot);
|
|
53
|
+
if (!lstatSync(root, { throwIfNoEntry: false })?.isDirectory()) return [];
|
|
54
|
+
const files = [];
|
|
55
|
+
const pending = [relativeRoot];
|
|
56
|
+
while (pending.length > 0) {
|
|
57
|
+
const current = pending.pop();
|
|
58
|
+
for (const entry of readdirSync(join(webRoot, current), {
|
|
59
|
+
withFileTypes: true,
|
|
60
|
+
})) {
|
|
61
|
+
observedEntries += 1;
|
|
62
|
+
if (observedEntries > maximumEntries) {
|
|
63
|
+
throw new Error('The root site source tree exceeds its entry bound.');
|
|
64
|
+
}
|
|
65
|
+
const path = current + '/' + entry.name;
|
|
66
|
+
if (entry.isDirectory()) pending.push(path);
|
|
67
|
+
else files.push(path);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return files;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const files = [${root_site_js_1.ROOT_SITE_ROUTE_ROOTS.map((path) => `'${path}'`).join(', ')}].flatMap(
|
|
74
|
+
listFiles,
|
|
75
|
+
);
|
|
76
|
+
const sliceNames = readdirSync(packagesRoot, { withFileTypes: true })
|
|
77
|
+
.filter((entry) => entry.isDirectory())
|
|
78
|
+
.flatMap(({ name }) => {
|
|
79
|
+
const projectPath = join(packagesRoot, name, 'project.json');
|
|
80
|
+
if (!lstatSync(projectPath, { throwIfNoEntry: false })?.isFile()) return [];
|
|
81
|
+
const project = JSON.parse(readFileSync(projectPath, 'utf8'));
|
|
82
|
+
return Array.isArray(project.tags) && project.tags.includes('type:slice')
|
|
83
|
+
? [project.name ?? name]
|
|
84
|
+
: [];
|
|
85
|
+
});
|
|
86
|
+
const inventory = inspectRootSiteRoutes({ files, sliceNames });
|
|
87
|
+
const report = formatRootSiteRouteInventory(inventory);
|
|
88
|
+
if (report) process.stdout.write(report + '\\n');
|
|
89
|
+
if (inventory.findings.length > 0) {
|
|
90
|
+
process.stderr.write(
|
|
91
|
+
'[route-check] The root site has ' +
|
|
92
|
+
inventory.findings.length +
|
|
93
|
+
' route finding(s); see above.\\n',
|
|
94
|
+
);
|
|
95
|
+
process.exitCode = 1;
|
|
96
|
+
} else {
|
|
97
|
+
process.stdout.write(
|
|
98
|
+
'[route-check] The root site serves ' +
|
|
99
|
+
inventory.segments.length +
|
|
100
|
+
' top-level path(s) beside ' +
|
|
101
|
+
sliceNames.length +
|
|
102
|
+
' Product Slice(s) without a collision.\\n',
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
`,
|
|
106
|
+
'tools/ebk-next-build-environment.mjs': (0, built_in_plan_operations_files_js_1.renderNextBuildEnvironmentWrapper)(built_in_site_shared_js_1.ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS, 'root site'),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// The site's deployed smoke makes HTTP requests only: it reads no AWS
|
|
110
|
+
// resource and holds no credential, so its children get a bounded
|
|
111
|
+
// environment without AWS or GitHub variables.
|
|
112
|
+
function renderRunSmokeDeployed() {
|
|
113
|
+
return `import { spawnSync } from 'node:child_process';
|
|
114
|
+
import { mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
115
|
+
import { join } from 'node:path';
|
|
116
|
+
import { waitForDeployedSmokeReadiness } from './deployed-smoke-readiness.mjs';
|
|
117
|
+
|
|
118
|
+
const projectRoot = process.cwd();
|
|
119
|
+
const evidenceRoot = join(projectRoot, '.ebk', 'evidence');
|
|
120
|
+
const resultPath = join(evidenceRoot, 'smoke-deployed.json');
|
|
121
|
+
const readinessPath = join(evidenceRoot, 'deployed-readiness.json');
|
|
122
|
+
const gitObjectId = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/;
|
|
123
|
+
mkdirSync(evidenceRoot, { recursive: true });
|
|
124
|
+
rmSync(resultPath, { force: true });
|
|
125
|
+
rmSync(readinessPath, { force: true });
|
|
126
|
+
|
|
127
|
+
const stage = process.env.EBK_STAGE ?? '';
|
|
128
|
+
const smokeUrl = process.env.EBK_SMOKE_URL ?? '';
|
|
129
|
+
const sourceCommit = process.env.EBK_SOURCE_COMMIT ?? '';
|
|
130
|
+
// The deployed server reports the release source of a promotion, which the
|
|
131
|
+
// lifecycle hands over as EBK_DEPLOYED_SOURCE_COMMIT.
|
|
132
|
+
const deployedSourceCommit = gitObjectId.test(
|
|
133
|
+
process.env.EBK_DEPLOYED_SOURCE_COMMIT ?? '',
|
|
134
|
+
)
|
|
135
|
+
? process.env.EBK_DEPLOYED_SOURCE_COMMIT
|
|
136
|
+
: sourceCommit;
|
|
137
|
+
const startedAt = new Date().toISOString();
|
|
138
|
+
const inheritedEnvironment = [
|
|
139
|
+
'APPDATA',
|
|
140
|
+
'CI',
|
|
141
|
+
'ComSpec',
|
|
142
|
+
'COMSPEC',
|
|
143
|
+
'HOME',
|
|
144
|
+
'LANG',
|
|
145
|
+
'LC_ALL',
|
|
146
|
+
'LOCALAPPDATA',
|
|
147
|
+
'PATH',
|
|
148
|
+
'PATHEXT',
|
|
149
|
+
'PLAYWRIGHT_BROWSERS_PATH',
|
|
150
|
+
'SystemRoot',
|
|
151
|
+
'SYSTEMROOT',
|
|
152
|
+
'TEMP',
|
|
153
|
+
'TMP',
|
|
154
|
+
'TMPDIR',
|
|
155
|
+
'USERPROFILE',
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
function writeEvidence(path, value) {
|
|
159
|
+
writeFileSync(path, JSON.stringify(value, null, 2) + '\\n', {
|
|
160
|
+
encoding: 'utf8',
|
|
161
|
+
mode: 0o600,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function finish(outcome, summary, steps, classification) {
|
|
166
|
+
writeEvidence(resultPath, {
|
|
167
|
+
...(classification ? { classification } : {}),
|
|
168
|
+
completedAt: new Date().toISOString(),
|
|
169
|
+
deployedSourceCommit,
|
|
170
|
+
kind: 'ebk-root-site-deployed-smoke',
|
|
171
|
+
outcome,
|
|
172
|
+
schemaVersion: 1,
|
|
173
|
+
service: '${root_site_js_1.ROOT_SITE_NAME}',
|
|
174
|
+
sourceCommit,
|
|
175
|
+
stage,
|
|
176
|
+
startedAt,
|
|
177
|
+
steps,
|
|
178
|
+
summary,
|
|
179
|
+
});
|
|
180
|
+
if (outcome !== 'passed') {
|
|
181
|
+
process.stderr.write('[site:smoke-deployed] ' + summary + '\\n');
|
|
182
|
+
process.exitCode = 1;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
${pnpm_launch_script_js_1.pnpmLaunchFunction}
|
|
187
|
+
function runStep(name, command, args, environment) {
|
|
188
|
+
const result = spawnSync(command, args, {
|
|
189
|
+
cwd: projectRoot,
|
|
190
|
+
encoding: 'utf8',
|
|
191
|
+
env: {
|
|
192
|
+
...Object.fromEntries(
|
|
193
|
+
inheritedEnvironment.flatMap((variable) =>
|
|
194
|
+
typeof process.env[variable] === 'string'
|
|
195
|
+
? [[variable, process.env[variable]]]
|
|
196
|
+
: [],
|
|
197
|
+
),
|
|
198
|
+
),
|
|
199
|
+
...environment,
|
|
200
|
+
},
|
|
201
|
+
shell: false,
|
|
202
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
203
|
+
windowsHide: true,
|
|
204
|
+
});
|
|
205
|
+
// A step that could not start or was signaled names a bounded code and
|
|
206
|
+
// signal only, never the error message.
|
|
207
|
+
if (result.error || result.signal) {
|
|
208
|
+
const code =
|
|
209
|
+
typeof result.error?.code === 'string' &&
|
|
210
|
+
/^[A-Z][A-Z0-9_]{0,31}$/.test(result.error.code)
|
|
211
|
+
? result.error.code
|
|
212
|
+
: 'unknown';
|
|
213
|
+
const signal =
|
|
214
|
+
typeof result.signal === 'string' && /^SIG[A-Z0-9]{1,16}$/.test(result.signal)
|
|
215
|
+
? ' (signal ' + result.signal + ')'
|
|
216
|
+
: '';
|
|
217
|
+
process.stderr.write(
|
|
218
|
+
'[site:smoke-deployed] The ' + name + ' step did not complete: ' + code + signal + '.\\n',
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
name,
|
|
223
|
+
outcome: !result.error && result.status === 0 ? 'passed' : 'failed',
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
let target;
|
|
228
|
+
try {
|
|
229
|
+
target = new URL(smokeUrl);
|
|
230
|
+
} catch {
|
|
231
|
+
target = undefined;
|
|
232
|
+
}
|
|
233
|
+
if (
|
|
234
|
+
process.argv.length > 2 ||
|
|
235
|
+
!['development', 'staging', 'production'].includes(stage) ||
|
|
236
|
+
!gitObjectId.test(sourceCommit) ||
|
|
237
|
+
target?.protocol !== 'https:' ||
|
|
238
|
+
target.pathname !== '/'
|
|
239
|
+
) {
|
|
240
|
+
finish(
|
|
241
|
+
'failed',
|
|
242
|
+
'The root site deployed smoke requires development, staging or production, one exact source commit and an HTTPS EBK_SMOKE_URL with path /, and accepts no arguments.',
|
|
243
|
+
[],
|
|
244
|
+
'prerequisite-missing',
|
|
245
|
+
);
|
|
246
|
+
} else {
|
|
247
|
+
const readiness = await waitForDeployedSmokeReadiness({
|
|
248
|
+
service: '${root_site_js_1.ROOT_SITE_NAME}',
|
|
249
|
+
sourceCommit: deployedSourceCommit,
|
|
250
|
+
stage,
|
|
251
|
+
webUrl: smokeUrl,
|
|
252
|
+
});
|
|
253
|
+
writeEvidence(readinessPath, {
|
|
254
|
+
deployedSourceCommit,
|
|
255
|
+
result: readiness,
|
|
256
|
+
schemaVersion: 1,
|
|
257
|
+
service: '${root_site_js_1.ROOT_SITE_NAME}',
|
|
258
|
+
source: sourceCommit,
|
|
259
|
+
stage,
|
|
260
|
+
});
|
|
261
|
+
if (readiness.outcome !== 'ready') {
|
|
262
|
+
finish('failed', readiness.summary, [], readiness.classification);
|
|
263
|
+
} else {
|
|
264
|
+
const environment = {
|
|
265
|
+
EBK_FRONTEND_SECURITY_PROFILE: 'deployed-https',
|
|
266
|
+
EBK_SMOKE_URL: smokeUrl,
|
|
267
|
+
EBK_SOURCE_COMMIT: deployedSourceCommit,
|
|
268
|
+
EBK_STAGE: stage,
|
|
269
|
+
};
|
|
270
|
+
const playwright = pnpmLaunch(['exec', 'playwright', 'test']);
|
|
271
|
+
const steps = [
|
|
272
|
+
runStep('playwright', playwright.command, playwright.args, environment),
|
|
273
|
+
];
|
|
274
|
+
if (steps[0].outcome === 'passed') {
|
|
275
|
+
steps.push(
|
|
276
|
+
runStep(
|
|
277
|
+
'frontend-security-headers',
|
|
278
|
+
process.execPath,
|
|
279
|
+
['scripts/frontend-security-headers.mjs', '--url=' + smokeUrl],
|
|
280
|
+
// Every admitted stage serves a production build, which the
|
|
281
|
+
// deployed server resolves as deployed-https; without NODE_ENV the
|
|
282
|
+
// shared resolver reads a development stage as local.
|
|
283
|
+
{ ...environment, NODE_ENV: 'production' },
|
|
284
|
+
),
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
const failed = steps.find(({ outcome }) => outcome !== 'passed');
|
|
288
|
+
if (failed) {
|
|
289
|
+
finish(
|
|
290
|
+
'failed',
|
|
291
|
+
'The root site ' + failed.name + ' step failed against the deployed URL.',
|
|
292
|
+
steps,
|
|
293
|
+
'smoke-failed',
|
|
294
|
+
);
|
|
295
|
+
} else {
|
|
296
|
+
finish(
|
|
297
|
+
'passed',
|
|
298
|
+
'The root site passed deployed readiness, its Playwright journey and the deployed header proof.',
|
|
299
|
+
steps,
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
`;
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=built-in-site-script-files.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The fixed local `site:dev` port, outside the Fleet's 16000-29999 range. */
|
|
2
|
+
export declare const ROOT_SITE_DEV_PORT = 3100;
|
|
3
|
+
/**
|
|
4
|
+
* Exactly the keys SST's Next.js build command may see. The canonical host is
|
|
5
|
+
* runtime-only: the build never depends on the stage's domain binding.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS: readonly ["CI", "EBK_LOCAL_SOURCE_TREE", "EBK_SOURCE_COMMIT", "EBK_STAGE", "NEXT_TELEMETRY_DISABLED", "SST", "SST_RESOURCE_App"];
|
|
8
|
+
/** The exact Git object ID pattern, as a JavaScript regular expression literal. */
|
|
9
|
+
export declare const SOURCE_COMMIT_PATTERN = "/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SOURCE_COMMIT_PATTERN = exports.ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS = exports.ROOT_SITE_DEV_PORT = void 0;
|
|
4
|
+
/** The fixed local `site:dev` port, outside the Fleet's 16000-29999 range. */
|
|
5
|
+
exports.ROOT_SITE_DEV_PORT = 3100;
|
|
6
|
+
/**
|
|
7
|
+
* Exactly the keys SST's Next.js build command may see. The canonical host is
|
|
8
|
+
* runtime-only: the build never depends on the stage's domain binding.
|
|
9
|
+
*/
|
|
10
|
+
exports.ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS = [
|
|
11
|
+
'CI',
|
|
12
|
+
'EBK_LOCAL_SOURCE_TREE',
|
|
13
|
+
'EBK_SOURCE_COMMIT',
|
|
14
|
+
'EBK_STAGE',
|
|
15
|
+
'NEXT_TELEMETRY_DISABLED',
|
|
16
|
+
'SST',
|
|
17
|
+
'SST_RESOURCE_App',
|
|
18
|
+
];
|
|
19
|
+
/** The exact Git object ID pattern, as a JavaScript regular expression literal. */
|
|
20
|
+
exports.SOURCE_COMMIT_PATTERN = '/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/';
|
|
21
|
+
//# sourceMappingURL=built-in-site-shared.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderSiteSmokeFiles = renderSiteSmokeFiles;
|
|
4
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
5
|
+
/** @internal */
|
|
6
|
+
function renderSiteSmokeFiles() {
|
|
7
|
+
return {
|
|
8
|
+
'playwright.config.ts': `import { defineConfig } from '@playwright/test';
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
forbidOnly: true,
|
|
11
|
+
retries: 0,
|
|
12
|
+
testDir: './e2e',
|
|
13
|
+
use: { trace: 'retain-on-failure' },
|
|
14
|
+
});
|
|
15
|
+
`,
|
|
16
|
+
// Seeded: the deployed smoke journey of the starting page. Extend it as
|
|
17
|
+
// the site grows.
|
|
18
|
+
'e2e/site.spec.ts': `import { expect, test } from '@playwright/test';
|
|
19
|
+
|
|
20
|
+
const smokeUrl = process.env.EBK_SMOKE_URL ?? '';
|
|
21
|
+
|
|
22
|
+
test('serves the root site home page on the deployed URL', async ({ page }) => {
|
|
23
|
+
expect(smokeUrl, 'EBK_SMOKE_URL is required').not.toBe('');
|
|
24
|
+
const response = await page.goto(smokeUrl);
|
|
25
|
+
expect(response?.status()).toBe(200);
|
|
26
|
+
const headers = response?.headers() ?? {};
|
|
27
|
+
expect(headers['content-type']).toContain('text/html');
|
|
28
|
+
expect(headers['${root_site_js_1.ROOT_SITE_ROUTE_HEADER}']).toBe('${root_site_js_1.ROOT_SITE_ROUTE_HEADER_VALUE}');
|
|
29
|
+
expect(headers['content-security-policy']).toContain("worker-src 'none'");
|
|
30
|
+
expect(new URL(page.url()).origin).toBe(new URL(smokeUrl).origin);
|
|
31
|
+
await expect(page).toHaveTitle(/\\S/);
|
|
32
|
+
await expect(page.getByRole('heading', { level: 1 })).toBeVisible();
|
|
33
|
+
});
|
|
34
|
+
`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=built-in-site-smoke-files.js.map
|