anhedral 0.10.1 → 0.11.1
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/README.md +79 -124
- package/assets/patches/LICENSE.braces +21 -0
- package/assets/patches/LICENSE.node-forge +50 -0
- package/assets/patches/audit-deps.mjs +167 -0
- package/assets/patches/braces@3.0.3.patch +127 -0
- package/assets/patches/node-forge@1.4.0.patch +41 -0
- package/dist/auth-schema.js +3 -3
- package/dist/bin.js +284 -163
- package/dist/capabilities.d.ts +4 -4
- package/dist/capabilities.js +6 -2
- package/dist/capability-contract.d.ts +47 -0
- package/dist/capability-contract.js +153 -0
- package/dist/catalog-model.d.ts +24 -0
- package/dist/catalog-model.js +1 -0
- package/dist/catalog-registration.d.ts +16 -0
- package/dist/catalog-registration.js +22 -0
- package/dist/catalog-snapshot.d.ts +5 -0
- package/dist/catalog-snapshot.js +97 -0
- package/dist/cli-arguments.d.ts +16 -0
- package/dist/cli-arguments.js +115 -0
- package/dist/cli-output.d.ts +8 -0
- package/dist/cli-output.js +236 -0
- package/dist/cloudflare.d.ts +14 -3
- package/dist/cloudflare.js +196 -36
- package/dist/command-schema.d.ts +21 -0
- package/dist/command-schema.js +418 -0
- package/dist/delivery.d.ts +12 -5
- package/dist/delivery.js +173 -39
- package/dist/dependencies.d.ts +24 -0
- package/dist/dependencies.js +48 -0
- package/dist/dependency-patches.d.ts +7 -0
- package/dist/dependency-patches.js +125 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +17 -1
- package/dist/inspector-model.d.ts +123 -0
- package/dist/inspector-model.js +1 -0
- package/dist/integration-service-readers.d.ts +13 -0
- package/dist/integration-service-readers.js +173 -0
- package/dist/lifecycle-model.d.ts +15 -0
- package/dist/lifecycle-model.js +20 -0
- package/dist/lifecycle.d.ts +11 -0
- package/dist/lifecycle.js +91 -0
- package/dist/mobile-delivery.d.ts +100 -0
- package/dist/mobile-delivery.js +319 -0
- package/dist/neon-service-data.d.ts +8 -0
- package/dist/neon-service-data.js +117 -0
- package/dist/platforms/mobile.js +8 -5
- package/dist/pnpm-policy.d.ts +2 -2
- package/dist/pnpm-policy.js +19 -45
- package/dist/project-catalog.d.ts +41 -0
- package/dist/project-catalog.js +288 -0
- package/dist/project-config.d.ts +14 -0
- package/dist/project-config.js +89 -0
- package/dist/project-inspector.d.ts +4 -0
- package/dist/project-inspector.js +702 -0
- package/dist/project-lifecycle.d.ts +25 -0
- package/dist/project-lifecycle.js +57 -0
- package/dist/project-state.d.ts +22 -1
- package/dist/project-state.js +361 -27
- package/dist/provider-auth.d.ts +41 -0
- package/dist/provider-auth.js +209 -0
- package/dist/provider-readiness.js +27 -10
- package/dist/providers/adapters.d.ts +17 -0
- package/dist/providers/adapters.js +272 -0
- package/dist/providers/api.d.ts +29 -0
- package/dist/providers/api.js +253 -0
- package/dist/providers/config.d.ts +15 -0
- package/dist/providers/config.js +182 -0
- package/dist/providers/definitions.d.ts +318 -0
- package/dist/providers/definitions.js +127 -0
- package/dist/providers/provision.d.ts +24 -0
- package/dist/providers/provision.js +76 -0
- package/dist/providers/receipts.d.ts +20 -0
- package/dist/providers/receipts.js +66 -0
- package/dist/providers/recovery-verification.d.ts +7 -0
- package/dist/providers/recovery-verification.js +112 -0
- package/dist/providers/recovery.d.ts +30 -0
- package/dist/providers/recovery.js +34 -0
- package/dist/providers/runtime.d.ts +10 -0
- package/dist/providers/runtime.js +254 -0
- package/dist/providers/schema.d.ts +28 -0
- package/dist/providers/schema.js +49 -0
- package/dist/providers/state.d.ts +55 -0
- package/dist/providers/state.js +289 -0
- package/dist/provision.d.ts +10 -1
- package/dist/provision.js +91 -4
- package/dist/r2-service-data.d.ts +2 -0
- package/dist/r2-service-data.js +136 -0
- package/dist/readiness.js +9 -13
- package/dist/registry/add.d.ts +6 -0
- package/dist/registry/add.js +93 -22
- package/dist/registry/commands.d.ts +3 -2
- package/dist/registry/commands.js +52 -15
- package/dist/registry/options.d.ts +1 -1
- package/dist/registry/options.js +5 -4
- package/dist/registry/preview.d.ts +11 -0
- package/dist/registry/preview.js +91 -0
- package/dist/registry/receipt.d.ts +1 -0
- package/dist/registry/receipt.js +19 -4
- package/dist/registry/resolve.js +5 -1
- package/dist/registry/usage.d.ts +10 -0
- package/dist/registry/usage.js +18 -37
- package/dist/render.d.ts +2 -0
- package/dist/render.js +6 -0
- package/dist/runtime-policy.d.ts +4 -0
- package/dist/runtime-policy.js +21 -0
- package/dist/scaffold/auth.js +3 -19
- package/dist/scaffold/bootstrap.js +2 -2
- package/dist/scaffold/compose.js +9 -3
- package/dist/scaffold/database.js +107 -25
- package/dist/scaffold/documentation.js +18 -13
- package/dist/scaffold/lint.d.ts +4 -0
- package/dist/scaffold/lint.js +56 -0
- package/dist/scaffold/neon-realtime.d.ts +2 -0
- package/dist/scaffold/neon-realtime.js +97 -0
- package/dist/scaffold/stack-documentation.js +1 -1
- package/dist/scaffold/void.d.ts +4 -0
- package/dist/scaffold/void.js +256 -0
- package/dist/scaffold/web.js +7 -1
- package/dist/scaffold/workspace.js +127 -25
- package/dist/service-deletion.d.ts +29 -0
- package/dist/service-deletion.js +195 -0
- package/dist/service-descriptor.d.ts +10 -0
- package/dist/service-descriptor.js +78 -0
- package/dist/service-model.d.ts +49 -0
- package/dist/service-model.js +8 -0
- package/dist/service-operations.d.ts +29 -0
- package/dist/service-operations.js +78 -0
- package/dist/service-readers.d.ts +8 -0
- package/dist/service-readers.js +247 -0
- package/dist/services-command.d.ts +39 -0
- package/dist/services-command.js +100 -0
- package/dist/ship.d.ts +348 -0
- package/dist/ship.js +237 -0
- package/dist/stack-registry.d.ts +4 -2
- package/dist/stack-registry.js +48 -12
- package/dist/standard.d.ts +2 -1
- package/dist/standard.js +33 -14
- package/dist/transaction.d.ts +2 -0
- package/dist/transaction.js +10 -0
- package/dist/util.js +17 -2
- package/dist/vercel.d.ts +5 -3
- package/dist/vercel.js +96 -14
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vinext.d.ts +1 -0
- package/dist/vinext.js +13 -1
- package/dist/void-execution.d.ts +10 -0
- package/dist/void-execution.js +94 -0
- package/dist/void-migrations.d.ts +6 -0
- package/dist/void-migrations.js +110 -0
- package/dist/void-state.d.ts +16 -0
- package/dist/void-state.js +65 -0
- package/dist/void.d.ts +3 -0
- package/dist/void.js +5 -0
- package/docs/cli-design.md +67 -0
- package/docs/delivery-workflow.md +32 -17
- package/docs/plugin-ui.md +102 -0
- package/docs/provider-configuration.md +116 -0
- package/docs/stack-standard.md +175 -0
- package/docs/void-verification.md +185 -0
- package/package.json +29 -23
- package/assets/anhedral-cli-init-technical.svg +0 -322
- package/assets/anhedral-cli-init.svg +0 -322
- package/assets/anhedral-mark.svg +0 -4
- package/assets/anhedral.svg +0 -4
- package/assets/favicon.ico +0 -0
- package/assets/security/LICENSES.txt +0 -63
- package/assets/security/audit-deps.mjs +0 -300
- package/assets/security/braces-regression.mjs +0 -102
- package/assets/security/braces@3.0.3.patch +0 -285
- package/assets/security/decode-uri-component@0.2.2.patch +0 -149
- package/assets/security/decoder-regression.mjs +0 -37
- package/assets/security/forge-regression.mjs +0 -46
- package/assets/security/manifest.json +0 -53
- package/assets/security/node-forge@1.4.0.patch +0 -26
- package/dist/managed-hosting.d.ts +0 -49
- package/dist/managed-hosting.js +0 -373
- package/dist/security-backports.d.ts +0 -3
- package/dist/security-backports.js +0 -26
- package/docs/application-stack-standard.md +0 -104
- package/docs/managed-hosting-architecture.md +0 -87
- package/docs/sponsorships.md +0 -25
package/dist/delivery.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { projectConfigPath, writeProjectSection } from './project-config.js';
|
|
2
|
+
import { deployVoidTarget, rollbackVoidTarget } from './void-execution.js';
|
|
3
|
+
import { voidLogSnapshot, readVoidDeploymentReceipt } from './void-state.js';
|
|
1
4
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
5
|
import { existsSync, mkdirSync, readFileSync, realpathSync, rmSync } from 'node:fs';
|
|
3
6
|
import { tmpdir } from 'node:os';
|
|
@@ -6,9 +9,9 @@ import { writeManagementOverview } from './management.js';
|
|
|
6
9
|
import { reconcileAccess, validatePrivateAudience } from './access.js';
|
|
7
10
|
import { inspectApplicationResources } from './provision.js';
|
|
8
11
|
import { cloudflareRequest } from './cloudflare.js';
|
|
9
|
-
import { atomicJson, authenticate, defaultRunner, environment, readApplication, readConfig, targetDirectory, withApplicationLock, } from './project-state.js';
|
|
12
|
+
import { atomicJson, configurationFile, usesVoid, authenticate, defaultRunner, environment, readApplication, readConfig, targetDirectory, withApplicationLock, } from './project-state.js';
|
|
10
13
|
export { registerApplication, readApplication, defaultRunner, environment, targetDirectory, } from './project-state.js';
|
|
11
|
-
const manifestName = 'anhedral.
|
|
14
|
+
const manifestName = 'anhedral.json';
|
|
12
15
|
const stateDirectory = '.anhedral';
|
|
13
16
|
const accountPattern = /^[a-f0-9]{32}$/i;
|
|
14
17
|
export async function connectApplication(root, accountId, audience, run = defaultRunner, emails = []) {
|
|
@@ -56,7 +59,7 @@ export async function connectApplication(root, accountId, audience, run = defaul
|
|
|
56
59
|
else if (emails.length)
|
|
57
60
|
throw new Error('--allow-email applies only to private delivery.');
|
|
58
61
|
await authenticate(root, connected, run);
|
|
59
|
-
|
|
62
|
+
writeProjectSection(root, 'cloudflare', connected);
|
|
60
63
|
return connected;
|
|
61
64
|
});
|
|
62
65
|
}
|
|
@@ -69,7 +72,7 @@ function history(root, project) {
|
|
|
69
72
|
throw new Error('Release history belongs to a different or unsupported project.');
|
|
70
73
|
return value;
|
|
71
74
|
}
|
|
72
|
-
function checkTargets(root, project) {
|
|
75
|
+
function checkTargets(root, project, allowResourcePlaceholders = false) {
|
|
73
76
|
if (!project.targets.length)
|
|
74
77
|
throw new Error('No Cloudflare targets; native applications require their platform delivery tools.');
|
|
75
78
|
for (const target of project.targets) {
|
|
@@ -80,7 +83,24 @@ function checkTargets(root, project) {
|
|
|
80
83
|
throw new Error('Worker name or environment changed; reconcile the application manifest before shipping.');
|
|
81
84
|
if (config.account_id && config.account_id !== project.accountId)
|
|
82
85
|
throw new Error('Wrangler configuration account conflicts with the registered account.');
|
|
83
|
-
|
|
86
|
+
const pending = structuredClone(config);
|
|
87
|
+
if (allowResourcePlaceholders) {
|
|
88
|
+
for (const [field, id] of [
|
|
89
|
+
['d1_databases', 'database_id'],
|
|
90
|
+
['kv_namespaces', 'id'],
|
|
91
|
+
['pipelines', 'stream'],
|
|
92
|
+
]) {
|
|
93
|
+
const entries = pending[field];
|
|
94
|
+
if (Array.isArray(entries))
|
|
95
|
+
for (const entry of entries) {
|
|
96
|
+
if (entry && typeof entry[id] === 'string' && entry[id].startsWith('REPLACE_WITH_'))
|
|
97
|
+
entry[id] = 'pending-resource';
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (/REPLACE_WITH_|YOUR_[A-Z_]+/.test(allowResourcePlaceholders || usesVoid(project)
|
|
102
|
+
? JSON.stringify(pending)
|
|
103
|
+
: readFileSync(configurationFile(directory), 'utf8')))
|
|
84
104
|
throw new Error('Configure selected resources before shipping; placeholder bindings remain.');
|
|
85
105
|
const pkg = JSON.parse(readFileSync(path.join(directory, 'package.json'), 'utf8'));
|
|
86
106
|
if (typeof pkg.scripts?.deploy !== 'string')
|
|
@@ -88,21 +108,41 @@ function checkTargets(root, project) {
|
|
|
88
108
|
}
|
|
89
109
|
}
|
|
90
110
|
function configurationFingerprint(root, project) {
|
|
91
|
-
const hash = createHash('sha256').update(
|
|
92
|
-
for (const target of project.targets)
|
|
93
|
-
|
|
111
|
+
const hash = createHash('sha256').update(readFileSync(projectConfigPath(root)));
|
|
112
|
+
for (const target of project.targets) {
|
|
113
|
+
const directory = targetDirectory(root, target);
|
|
114
|
+
hash.update(readFileSync(configurationFile(directory)));
|
|
115
|
+
if (usesVoid(project))
|
|
116
|
+
for (const name of ['void.config.ts', 'env.ts']) {
|
|
117
|
+
const file = path.join(directory, name);
|
|
118
|
+
hash.update(name).update(existsSync(file) ? readFileSync(file) : '<absent>');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
94
121
|
return hash.digest('hex');
|
|
95
122
|
}
|
|
96
|
-
export function planDelivery(root) {
|
|
123
|
+
export function planDelivery(root, allowResourcePlaceholders = false) {
|
|
97
124
|
const project = readApplication(root);
|
|
98
|
-
checkTargets(root, project);
|
|
125
|
+
checkTargets(root, project, allowResourcePlaceholders);
|
|
126
|
+
if (usesVoid(project)) {
|
|
127
|
+
const owners = project.targets.filter((target) => {
|
|
128
|
+
// Ownership is authored. Void may add a conventional migrations_dir to
|
|
129
|
+
// resolved consumer locks; those consumers must not become migration owners.
|
|
130
|
+
const config = JSON.parse(readFileSync(configurationFile(targetDirectory(root, target)), 'utf8'));
|
|
131
|
+
return (Array.isArray(config.d1_databases) &&
|
|
132
|
+
config.d1_databases.some((database) => database?.migrations_dir));
|
|
133
|
+
});
|
|
134
|
+
if (owners.length > 1)
|
|
135
|
+
throw new Error('Void delivery requires one D1 migration owner; other server targets must consume the shared database without deployment migrations.');
|
|
136
|
+
}
|
|
99
137
|
return {
|
|
100
138
|
project,
|
|
101
139
|
checks: [['pnpm', 'run', 'check']],
|
|
102
140
|
deployments: project.targets.map((target) => ({
|
|
103
141
|
target: target.id,
|
|
104
142
|
directory: target.directory,
|
|
105
|
-
command:
|
|
143
|
+
command: usesVoid(project)
|
|
144
|
+
? ['pnpm', 'exec', 'void', 'deploy', '--platform', 'cloudflare']
|
|
145
|
+
: ['pnpm', 'run', 'deploy'],
|
|
106
146
|
})),
|
|
107
147
|
resourcesProvisioned: false,
|
|
108
148
|
audience: project.audience,
|
|
@@ -158,6 +198,16 @@ function activeVersions(value) {
|
|
|
158
198
|
throw new Error('Invalid provider traffic allocation.');
|
|
159
199
|
return versions;
|
|
160
200
|
}
|
|
201
|
+
async function providerStatus(root, project, target, run, request) {
|
|
202
|
+
if (!usesVoid(project))
|
|
203
|
+
return JSON.parse(await run('pnpm', ['exec', 'wrangler', 'deployments', 'status', '--json'], targetDirectory(root, target), environment(project)));
|
|
204
|
+
const api = request ??
|
|
205
|
+
(await cloudflareRequest(project, targetDirectory(root, target), run, environment(project)));
|
|
206
|
+
const result = (await api('GET', `/workers/scripts/${encodeURIComponent(target.workerName)}/deployments`)).result;
|
|
207
|
+
if (!Array.isArray(result?.deployments) || !result.deployments.length)
|
|
208
|
+
throw new Error('No active Cloudflare deployment evidence.');
|
|
209
|
+
return result.deployments[0];
|
|
210
|
+
}
|
|
161
211
|
function fullyActive(versions, versionId) {
|
|
162
212
|
return (versions.length === 1 && versions[0].versionId === versionId && versions[0].percentage === 100);
|
|
163
213
|
}
|
|
@@ -192,9 +242,10 @@ function describeArchitecture(root, project) {
|
|
|
192
242
|
};
|
|
193
243
|
});
|
|
194
244
|
}
|
|
195
|
-
export async function shipApplication(root, run = defaultRunner, suppliedRequest) {
|
|
245
|
+
export async function shipApplication(root, run = defaultRunner, suppliedRequest, options = {}) {
|
|
196
246
|
root = realpathSync(root);
|
|
197
|
-
const
|
|
247
|
+
const registered = readApplication(root);
|
|
248
|
+
const { project } = planDelivery(root, usesVoid(registered));
|
|
198
249
|
if (project.audience === 'unconfigured')
|
|
199
250
|
throw new Error('Select an explicit audience before shipping: public or private with allowed members.');
|
|
200
251
|
const env = environment(project);
|
|
@@ -216,6 +267,22 @@ export async function shipApplication(root, run = defaultRunner, suppliedRequest
|
|
|
216
267
|
if (!/^[a-f0-9]{40,64}$/.test(commit))
|
|
217
268
|
throw new Error('Invalid source commit.');
|
|
218
269
|
const fingerprint = configurationFingerprint(root, project);
|
|
270
|
+
const lockChanges = new Set();
|
|
271
|
+
const sourceChanged = async () => {
|
|
272
|
+
const dirty = (await run('git', ['status', '--porcelain'], root, env)).trimEnd();
|
|
273
|
+
if (!dirty)
|
|
274
|
+
return false;
|
|
275
|
+
if (!usesVoid(project))
|
|
276
|
+
return true;
|
|
277
|
+
for (const line of dirty.split('\n')) {
|
|
278
|
+
const file = line.slice(3);
|
|
279
|
+
if (!/^ [M?]|^\?\?/.test(line) ||
|
|
280
|
+
!project.targets.some((target) => file === `${target.directory}/void.lock.json`))
|
|
281
|
+
return true;
|
|
282
|
+
lockChanges.add(file);
|
|
283
|
+
}
|
|
284
|
+
return false;
|
|
285
|
+
};
|
|
219
286
|
records = history(root, project);
|
|
220
287
|
release = {
|
|
221
288
|
operation: 'ship',
|
|
@@ -239,17 +306,61 @@ export async function shipApplication(root, run = defaultRunner, suppliedRequest
|
|
|
239
306
|
for (const target of project.targets) {
|
|
240
307
|
if (configurationFingerprint(root, readApplication(root)) !== fingerprint ||
|
|
241
308
|
(await run('git', ['rev-parse', 'HEAD'], root, env)).trim() !== commit ||
|
|
242
|
-
(await
|
|
309
|
+
(await sourceChanged()))
|
|
243
310
|
throw new Error('Source or configuration changed during delivery; preserve the release record and rebuild.');
|
|
244
311
|
const output = path.join(outputDirectory, `${target.id}.ndjson`);
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
312
|
+
let receipt;
|
|
313
|
+
if (usesVoid(project)) {
|
|
314
|
+
const before = voidLogSnapshot(options.voidLogsDirectory);
|
|
315
|
+
const startedAt = Date.now();
|
|
316
|
+
await deployVoidTarget(targetDirectory(root, target), run, env);
|
|
317
|
+
receipt = readVoidDeploymentReceipt(before, targetDirectory(root, target), target, startedAt, options.voidLogsDirectory);
|
|
318
|
+
release.targets.push(receipt);
|
|
319
|
+
save();
|
|
320
|
+
const api = suppliedRequest ??
|
|
321
|
+
(await cloudflareRequest(project, targetDirectory(root, target), run, env));
|
|
322
|
+
const visibility = (await api('GET', `/workers/scripts/${encodeURIComponent(target.workerName)}/subdomain`)).result;
|
|
323
|
+
const accountDomain = visibility?.enabled === true
|
|
324
|
+
? (await api('GET', '/workers/subdomain')).result
|
|
325
|
+
: undefined;
|
|
326
|
+
const workersDevUrl = typeof accountDomain?.subdomain === 'string' &&
|
|
327
|
+
/^[a-z0-9-]+$/i.test(accountDomain.subdomain)
|
|
328
|
+
? `https://${target.workerName}.${accountDomain.subdomain}.workers.dev`
|
|
329
|
+
: undefined;
|
|
330
|
+
const config = readConfig(targetDirectory(root, target));
|
|
331
|
+
const hasCustomDomains = Array.isArray(config.routes) &&
|
|
332
|
+
config.routes.some((route) => route?.custom_domain === true);
|
|
333
|
+
const domains = hasCustomDomains
|
|
334
|
+
? (await api('GET', `/workers/domains?service=${encodeURIComponent(target.workerName)}`)).result
|
|
335
|
+
: [];
|
|
336
|
+
if (!Array.isArray(domains))
|
|
337
|
+
throw new Error('Cloudflare custom-domain evidence is unavailable.');
|
|
338
|
+
receipt.urls = Array.isArray(config.routes)
|
|
339
|
+
? config.routes.flatMap((route) => {
|
|
340
|
+
if (!route || typeof route !== 'object')
|
|
341
|
+
return [];
|
|
342
|
+
const value = route;
|
|
343
|
+
return value.custom_domain === true &&
|
|
344
|
+
typeof value.pattern === 'string' &&
|
|
345
|
+
/^[a-z0-9.-]+$/i.test(value.pattern) &&
|
|
346
|
+
domains.some((domain) => domain?.hostname === value.pattern && domain?.service === target.workerName)
|
|
347
|
+
? [`https://${value.pattern}`]
|
|
348
|
+
: [];
|
|
349
|
+
})
|
|
350
|
+
: [];
|
|
351
|
+
if (workersDevUrl)
|
|
352
|
+
receipt.urls.push(workersDevUrl);
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
await run('pnpm', ['run', 'deploy'], targetDirectory(root, target), {
|
|
356
|
+
...env,
|
|
357
|
+
WRANGLER_OUTPUT_FILE_PATH: output,
|
|
358
|
+
});
|
|
359
|
+
receipt = parseDeploymentOutput(readFileSync(output, 'utf8'), target);
|
|
360
|
+
release.targets.push(receipt);
|
|
361
|
+
}
|
|
251
362
|
save();
|
|
252
|
-
const provider =
|
|
363
|
+
const provider = await providerStatus(root, project, target, run, suppliedRequest);
|
|
253
364
|
if (!fullyActive(activeVersions(provider), receipt.versionId))
|
|
254
365
|
throw new Error('Provider active version differs from the deployment receipt.');
|
|
255
366
|
if (accessRequest)
|
|
@@ -259,9 +370,16 @@ export async function shipApplication(root, run = defaultRunner, suppliedRequest
|
|
|
259
370
|
}
|
|
260
371
|
if (configurationFingerprint(root, readApplication(root)) !== fingerprint ||
|
|
261
372
|
(await run('git', ['rev-parse', 'HEAD'], root, env)).trim() !== commit ||
|
|
262
|
-
(await
|
|
373
|
+
(await sourceChanged()))
|
|
263
374
|
throw new Error('Source or configuration changed during deployment.');
|
|
264
|
-
|
|
375
|
+
if (usesVoid(project)) {
|
|
376
|
+
const api = suppliedRequest ??
|
|
377
|
+
(await cloudflareRequest(project, targetDirectory(root, project.targets[0]), run, env));
|
|
378
|
+
await inspectApplicationResources(root, api);
|
|
379
|
+
}
|
|
380
|
+
release.state = lockChanges.size ? 'configuration-required' : 'deployed';
|
|
381
|
+
if (lockChanges.size)
|
|
382
|
+
release.configurationChanges = [...lockChanges].sort();
|
|
265
383
|
release.finishedAt = new Date().toISOString();
|
|
266
384
|
save();
|
|
267
385
|
const managementFile = writeManagementOverview(root, await applicationStatus(root));
|
|
@@ -270,6 +388,14 @@ export async function shipApplication(root, run = defaultRunner, suppliedRequest
|
|
|
270
388
|
release,
|
|
271
389
|
managementFile,
|
|
272
390
|
productVerification: 'required',
|
|
391
|
+
...(lockChanges.size
|
|
392
|
+
? {
|
|
393
|
+
state: 'configuration-required',
|
|
394
|
+
deployed: false,
|
|
395
|
+
activated: true,
|
|
396
|
+
nextAction: 'Review and commit the recorded void.lock.json resource identities, then ship the clean committed configuration before running verify. Active target receipts are retained; product verification has not passed.',
|
|
397
|
+
}
|
|
398
|
+
: {}),
|
|
273
399
|
management: `https://dash.cloudflare.com/${project.accountId}/workers-and-pages`,
|
|
274
400
|
};
|
|
275
401
|
}
|
|
@@ -297,7 +423,7 @@ export async function applicationStatus(root, refresh = false, run = defaultRunn
|
|
|
297
423
|
checkTargets(root, project);
|
|
298
424
|
await authenticate(root, project, run);
|
|
299
425
|
for (const target of project.targets) {
|
|
300
|
-
const data =
|
|
426
|
+
const data = await providerStatus(root, project, target, run);
|
|
301
427
|
const receipt = current?.targets.find((item) => item.target === target.id);
|
|
302
428
|
const versions = activeVersions(data);
|
|
303
429
|
provider.push({
|
|
@@ -411,7 +537,9 @@ export async function rollbackApplication(root, releaseId, dataCompatible, run =
|
|
|
411
537
|
// Resolve every version before changing the first target; unavailable resources still make provider rollback fail closed.
|
|
412
538
|
for (const target of project.targets) {
|
|
413
539
|
const version = desired.targets.find((item) => item.target === target.id);
|
|
414
|
-
const data =
|
|
540
|
+
const data = usesVoid(project)
|
|
541
|
+
? (await (request ?? (await cloudflareRequest(project, targetDirectory(root, target), run, env)))('GET', `/workers/scripts/${encodeURIComponent(target.workerName)}/versions/${encodeURIComponent(version.versionId)}`)).result
|
|
542
|
+
: JSON.parse(await run('pnpm', ['exec', 'wrangler', 'versions', 'view', version.versionId, '--json'], targetDirectory(root, target), env));
|
|
415
543
|
if (data.id !== version.versionId)
|
|
416
544
|
throw new Error('Recorded Worker version is unavailable.');
|
|
417
545
|
}
|
|
@@ -430,18 +558,21 @@ export async function rollbackApplication(root, releaseId, dataCompatible, run =
|
|
|
430
558
|
try {
|
|
431
559
|
for (const target of [...project.targets].reverse()) {
|
|
432
560
|
const receipt = desired.targets.find((item) => item.target === target.id);
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
'
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
561
|
+
if (usesVoid(project))
|
|
562
|
+
await rollbackVoidTarget(targetDirectory(root, target), receipt.versionId, run, env);
|
|
563
|
+
else
|
|
564
|
+
await run('pnpm', [
|
|
565
|
+
'exec',
|
|
566
|
+
'wrangler',
|
|
567
|
+
'rollback',
|
|
568
|
+
receipt.versionId,
|
|
569
|
+
'--message',
|
|
570
|
+
`Anhedral restore ${desired.id}`,
|
|
571
|
+
], targetDirectory(root, target), env);
|
|
441
572
|
const restored = { ...receipt, providerConfirmed: false };
|
|
442
573
|
release.targets.push(restored);
|
|
443
574
|
save();
|
|
444
|
-
const provider =
|
|
575
|
+
const provider = await providerStatus(root, project, target, run);
|
|
445
576
|
if (!fullyActive(activeVersions(provider), receipt.versionId))
|
|
446
577
|
throw new Error('Rollback version did not become fully active.');
|
|
447
578
|
if (request)
|
|
@@ -493,12 +624,15 @@ export async function recoverApplication(root, run = defaultRunner, suppliedRequ
|
|
|
493
624
|
const commit = await source();
|
|
494
625
|
const fingerprint = configurationFingerprint(root, project);
|
|
495
626
|
if ((await run('git', ['show', `HEAD:${manifestName}`], root, env)) !==
|
|
496
|
-
readFileSync(
|
|
627
|
+
readFileSync(projectConfigPath(root), 'utf8'))
|
|
497
628
|
throw new Error('Recovery requires the exact committed application manifest.');
|
|
498
629
|
for (const target of project.targets) {
|
|
499
|
-
const file =
|
|
630
|
+
const file = path
|
|
631
|
+
.relative(root, configurationFile(targetDirectory(root, target)))
|
|
632
|
+
.split(path.sep)
|
|
633
|
+
.join('/');
|
|
500
634
|
if ((await run('git', ['show', `HEAD:${file}`], root, env)) !==
|
|
501
|
-
readFileSync(
|
|
635
|
+
readFileSync(configurationFile(targetDirectory(root, target)), 'utf8'))
|
|
502
636
|
throw new Error('Recovery requires exact committed Worker configuration.');
|
|
503
637
|
}
|
|
504
638
|
await authenticate(root, project, run);
|
|
@@ -545,7 +679,7 @@ export async function recoverApplication(root, run = defaultRunner, suppliedRequ
|
|
|
545
679
|
for (const field of ['queues', 'durable_objects', 'workflows', 'hyperdrive', 'pipelines'])
|
|
546
680
|
if (config[field])
|
|
547
681
|
unsupportedBindings.add(field);
|
|
548
|
-
const versions = activeVersions(
|
|
682
|
+
const versions = activeVersions(await providerStatus(root, project, target, run, request));
|
|
549
683
|
if (!versions.length)
|
|
550
684
|
throw new Error('No active Worker deployment to recover.');
|
|
551
685
|
provider.push({
|
|
@@ -562,7 +696,7 @@ export async function recoverApplication(root, run = defaultRunner, suppliedRequ
|
|
|
562
696
|
throw new Error('Source or configuration changed during recovery.');
|
|
563
697
|
const records = history(root, project);
|
|
564
698
|
for (const target of project.targets) {
|
|
565
|
-
const after = activeVersions(
|
|
699
|
+
const after = activeVersions(await providerStatus(root, project, target, run));
|
|
566
700
|
if (JSON.stringify(after) !==
|
|
567
701
|
JSON.stringify(provider.find((item) => item.target === target.id).versions))
|
|
568
702
|
throw new Error('Active deployment changed during recovery.');
|
package/dist/dependencies.d.ts
CHANGED
|
@@ -14,9 +14,16 @@ export declare const SHADCN_VERSION = "4.21.4";
|
|
|
14
14
|
export declare const NEXT_VERCEL_VERSION = "16.4.0";
|
|
15
15
|
export declare const NEXT_OPENNEXT_VERSION = "16.3.8";
|
|
16
16
|
export declare const STACK_DEPENDENCIES: {
|
|
17
|
+
readonly '@typescript-eslint/parser': "8.71.2";
|
|
18
|
+
readonly '@typescript-eslint/eslint-plugin': "8.71.2";
|
|
19
|
+
readonly '@next/eslint-plugin-next': "16.4.2";
|
|
20
|
+
readonly turbo: "2.11.7";
|
|
21
|
+
readonly tsx: "4.23.15";
|
|
17
22
|
readonly 'better-auth': "1.7.7";
|
|
18
23
|
readonly '@better-auth/drizzle-adapter': "1.7.7";
|
|
19
24
|
readonly '@neondatabase/serverless': "1.2.0";
|
|
25
|
+
readonly '@neon/realtime': "0.1.0";
|
|
26
|
+
readonly '@neon/realtime-drizzle': "0.1.0";
|
|
20
27
|
readonly 'drizzle-orm': "0.45.4";
|
|
21
28
|
readonly '@clerk/nextjs': "7.9.14";
|
|
22
29
|
readonly '@clerk/backend': "3.23.2";
|
|
@@ -62,3 +69,20 @@ export declare const WORKER_DEV_PORTS: {
|
|
|
62
69
|
readonly inspector: 9235;
|
|
63
70
|
};
|
|
64
71
|
};
|
|
72
|
+
/** Compatible security overrides are catalog pins and must be audited too. */
|
|
73
|
+
export declare const SECURITY_OVERRIDE_DEPENDENCIES: {
|
|
74
|
+
readonly '@vitejs/plugin-react': "5.2.0";
|
|
75
|
+
readonly sharp: "0.35.5";
|
|
76
|
+
readonly 'source-map-js': "1.2.2";
|
|
77
|
+
readonly 'shell-quote': "1.12.0";
|
|
78
|
+
readonly tmp: "0.2.7";
|
|
79
|
+
readonly 'adm-zip': "0.6.1";
|
|
80
|
+
readonly 'baseline-browser-mapping': "2.11.27";
|
|
81
|
+
readonly browserslist: "4.29.3";
|
|
82
|
+
readonly esbuild: "0.25.12";
|
|
83
|
+
};
|
|
84
|
+
export declare const GLOB_10_OVERRIDE_VERSION = "10.5.0";
|
|
85
|
+
export declare const GLOB_11_OVERRIDE_VERSION = "11.1.0";
|
|
86
|
+
export declare const BRACE_EXPANSION_1_OVERRIDE_VERSION = "1.1.21";
|
|
87
|
+
export declare const BRACE_EXPANSION_2_OVERRIDE_VERSION = "2.1.7";
|
|
88
|
+
export declare const BRACE_EXPANSION_5_OVERRIDE_VERSION = "5.0.12";
|
package/dist/dependencies.js
CHANGED
|
@@ -142,12 +142,26 @@ export const NEXT_VERCEL_VERSION = '16.4.0';
|
|
|
142
142
|
// renovate: datasource=npm depName=next
|
|
143
143
|
export const NEXT_OPENNEXT_VERSION = '16.3.8';
|
|
144
144
|
export const STACK_DEPENDENCIES = {
|
|
145
|
+
// renovate: datasource=npm depName=@typescript-eslint/parser
|
|
146
|
+
'@typescript-eslint/parser': '8.71.2',
|
|
147
|
+
// renovate: datasource=npm depName=@typescript-eslint/eslint-plugin
|
|
148
|
+
'@typescript-eslint/eslint-plugin': '8.71.2',
|
|
149
|
+
// renovate: datasource=npm depName=@next/eslint-plugin-next
|
|
150
|
+
'@next/eslint-plugin-next': '16.4.2',
|
|
151
|
+
// renovate: datasource=npm depName=turbo
|
|
152
|
+
turbo: '2.11.7',
|
|
153
|
+
// renovate: datasource=npm depName=tsx
|
|
154
|
+
tsx: '4.23.15',
|
|
145
155
|
// renovate: datasource=npm depName=better-auth
|
|
146
156
|
'better-auth': '1.7.7',
|
|
147
157
|
// renovate: datasource=npm depName=@better-auth/drizzle-adapter
|
|
148
158
|
'@better-auth/drizzle-adapter': '1.7.7',
|
|
149
159
|
// renovate: datasource=npm depName=@neondatabase/serverless
|
|
150
160
|
'@neondatabase/serverless': '1.2.0',
|
|
161
|
+
// renovate: datasource=npm depName=@neon/realtime
|
|
162
|
+
'@neon/realtime': '0.1.0',
|
|
163
|
+
// renovate: datasource=npm depName=@neon/realtime-drizzle
|
|
164
|
+
'@neon/realtime-drizzle': '0.1.0',
|
|
151
165
|
// renovate: datasource=npm depName=drizzle-orm
|
|
152
166
|
'drizzle-orm': '0.45.4',
|
|
153
167
|
// renovate: datasource=npm depName=@clerk/nextjs
|
|
@@ -220,3 +234,37 @@ export const WORKER_DEV_PORTS = {
|
|
|
220
234
|
scheduled: { http: 8790, inspector: 9234 },
|
|
221
235
|
workflows: { http: 8791, inspector: 9235 },
|
|
222
236
|
};
|
|
237
|
+
/** Compatible security overrides are catalog pins and must be audited too. */
|
|
238
|
+
export const SECURITY_OVERRIDE_DEPENDENCIES = {
|
|
239
|
+
// renovate: datasource=npm depName=@vitejs/plugin-react
|
|
240
|
+
'@vitejs/plugin-react': '5.2.0',
|
|
241
|
+
// renovate: datasource=npm depName=sharp
|
|
242
|
+
sharp: '0.35.5',
|
|
243
|
+
// renovate: datasource=npm depName=source-map-js
|
|
244
|
+
'source-map-js': '1.2.2',
|
|
245
|
+
// renovate: datasource=npm depName=shell-quote
|
|
246
|
+
'shell-quote': '1.12.0',
|
|
247
|
+
// renovate: datasource=npm depName=tmp
|
|
248
|
+
tmp: '0.2.7',
|
|
249
|
+
// renovate: datasource=npm depName=adm-zip
|
|
250
|
+
'adm-zip': '0.6.1',
|
|
251
|
+
// renovate: datasource=npm depName=baseline-browser-mapping
|
|
252
|
+
'baseline-browser-mapping': '2.11.27',
|
|
253
|
+
// renovate: datasource=npm depName=browserslist
|
|
254
|
+
browserslist: '4.29.3',
|
|
255
|
+
// renovate: datasource=npm depName=esbuild
|
|
256
|
+
esbuild: '0.25.12',
|
|
257
|
+
};
|
|
258
|
+
// Keep each compatible major independently reviewed.
|
|
259
|
+
// renovate: datasource=npm depName=glob
|
|
260
|
+
export const GLOB_10_OVERRIDE_VERSION = '10.5.0';
|
|
261
|
+
// renovate: datasource=npm depName=glob
|
|
262
|
+
export const GLOB_11_OVERRIDE_VERSION = '11.1.0';
|
|
263
|
+
// renovate: datasource=npm depName=brace-expansion
|
|
264
|
+
export const BRACE_EXPANSION_1_OVERRIDE_VERSION = '1.1.21';
|
|
265
|
+
// renovate: datasource=npm depName=brace-expansion
|
|
266
|
+
export const BRACE_EXPANSION_2_OVERRIDE_VERSION = '2.1.7';
|
|
267
|
+
// No blanket 3.x override: GHSA-3jxr-9vmj-r5cp lists no repaired 3.x
|
|
268
|
+
// release, and supported locked profiles do not consume that major.
|
|
269
|
+
// renovate: datasource=npm depName=brace-expansion
|
|
270
|
+
export const BRACE_EXPANSION_5_OVERRIDE_VERSION = '5.0.12';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply only explicitly reviewed temporary patches to the exact resolved
|
|
3
|
+
* package. Standard pnpm audit remains unchanged and reports its advisory.
|
|
4
|
+
*/
|
|
5
|
+
export declare function configureDependencyPatches(root: string): boolean;
|
|
6
|
+
/** Install the standard audit gate for every profile, including braces-free apps. */
|
|
7
|
+
export declare function writeDependencyAudit(root: string, replaceManaged?: boolean): void;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { existsSync, lstatSync, mkdirSync, realpathSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { readBoundedFile } from './bounded-file.js';
|
|
5
|
+
import { pnpmPatchPolicy } from './pnpm-policy.js';
|
|
6
|
+
import { writeFile } from './util.js';
|
|
7
|
+
// Additional coordinates require reviewed fixes for every shipped entry point.
|
|
8
|
+
const reviewedPatches = [
|
|
9
|
+
{ coordinate: 'braces@3.0.3', packageName: 'braces', license: 'LICENSE.braces' },
|
|
10
|
+
{ coordinate: 'node-forge@1.4.0', packageName: 'node-forge', license: 'LICENSE.node-forge' },
|
|
11
|
+
];
|
|
12
|
+
const lockMaximum = 16 * 1024 * 1024;
|
|
13
|
+
const policyMaximum = 2 * 1024 * 1024;
|
|
14
|
+
const patchMaximum = 256 * 1024;
|
|
15
|
+
const patchAssetMaximum = 2 * 1024 * 1024;
|
|
16
|
+
function patchAttributes(source, selected) {
|
|
17
|
+
const rules = selected.flatMap(({ coordinate, license }) => [
|
|
18
|
+
`/patches/${coordinate}.patch text eol=lf -whitespace`,
|
|
19
|
+
`/patches/${license} text eol=lf`,
|
|
20
|
+
]);
|
|
21
|
+
const newline = source.includes('\r\n') ? '\r\n' : '\n';
|
|
22
|
+
const lines = source.split(/(?<=\n)/);
|
|
23
|
+
// Keep every unrelated rule/comment byte-for-byte, then make these exact
|
|
24
|
+
// asset rules last so a customer wildcard cannot convert patch line endings.
|
|
25
|
+
const preserved = lines.filter((line) => !rules.includes(line.replace(/\r?\n$/, ''))).join('');
|
|
26
|
+
return (preserved +
|
|
27
|
+
(preserved && !/\r?\n$/.test(preserved) ? newline : '') +
|
|
28
|
+
rules.join(newline) +
|
|
29
|
+
newline);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Apply only explicitly reviewed temporary patches to the exact resolved
|
|
33
|
+
* package. Standard pnpm audit remains unchanged and reports its advisory.
|
|
34
|
+
*/
|
|
35
|
+
export function configureDependencyPatches(root) {
|
|
36
|
+
root = realpathSync(root);
|
|
37
|
+
const lock = readBoundedFile(path.join(root, 'pnpm-lock.yaml'), lockMaximum).toString('utf8');
|
|
38
|
+
const selected = reviewedPatches.filter(({ coordinate }) => {
|
|
39
|
+
const escaped = [...coordinate]
|
|
40
|
+
.map((character) => ('.^$|?*+()[]{}\\'.includes(character) ? `\\${character}` : character))
|
|
41
|
+
.join('');
|
|
42
|
+
return new RegExp(String.raw `^ ['"]?${escaped}(?:\([^'"\r\n]*\))?['"]?:[ \t]*(?:\r?\n|$)`, 'm').test(lock);
|
|
43
|
+
});
|
|
44
|
+
if (!selected.length)
|
|
45
|
+
return false;
|
|
46
|
+
const manifestFile = path.join(root, 'package.json');
|
|
47
|
+
if (existsSync(manifestFile)) {
|
|
48
|
+
const manifest = JSON.parse(readBoundedFile(manifestFile, policyMaximum).toString('utf8'));
|
|
49
|
+
if (manifest.pnpm && Object.hasOwn(manifest.pnpm, 'patchedDependencies'))
|
|
50
|
+
throw new Error('Review package-level pnpm.patchedDependencies before configuring a workspace patch; existing patch maps must not be shadowed.');
|
|
51
|
+
}
|
|
52
|
+
const workspaceFile = path.join(root, 'pnpm-workspace.yaml');
|
|
53
|
+
const before = readBoundedFile(workspaceFile, policyMaximum).toString('utf8');
|
|
54
|
+
const after = selected.reduce((policy, { coordinate }) => pnpmPatchPolicy(policy, coordinate, `patches/${coordinate}.patch`), before);
|
|
55
|
+
const attributesFile = path.join(root, '.gitattributes');
|
|
56
|
+
const attributesStat = lstatSync(attributesFile, { throwIfNoEntry: false });
|
|
57
|
+
const attributesBefore = attributesStat
|
|
58
|
+
? readBoundedFile(attributesFile, policyMaximum).toString('utf8')
|
|
59
|
+
: '';
|
|
60
|
+
const attributesAfter = patchAttributes(attributesBefore, selected);
|
|
61
|
+
const directory = path.join(root, 'patches');
|
|
62
|
+
const directoryStat = lstatSync(directory, { throwIfNoEntry: false });
|
|
63
|
+
if (directoryStat && (!directoryStat.isDirectory() || directoryStat.isSymbolicLink()))
|
|
64
|
+
throw new Error('Patch directory must be a real directory inside the project.');
|
|
65
|
+
const artifacts = selected
|
|
66
|
+
.flatMap(({ coordinate, packageName, license }) => [
|
|
67
|
+
{ name: `${coordinate}.patch`, packageName, label: 'patch' },
|
|
68
|
+
{ name: license, packageName, label: 'license notice' },
|
|
69
|
+
])
|
|
70
|
+
.map(({ name, label, packageName }) => ({
|
|
71
|
+
target: path.join(directory, name),
|
|
72
|
+
label,
|
|
73
|
+
packageName,
|
|
74
|
+
maximum: name.endsWith('.patch') ? patchAssetMaximum : patchMaximum,
|
|
75
|
+
bytes: readBoundedFile(fileURLToPath(new URL(`../assets/patches/${name}`, import.meta.url)), name.endsWith('.patch') ? patchAssetMaximum : patchMaximum),
|
|
76
|
+
}));
|
|
77
|
+
const missing = [];
|
|
78
|
+
// Validate every destination before writing any artifact or the YAML map.
|
|
79
|
+
for (const artifact of artifacts) {
|
|
80
|
+
if (lstatSync(artifact.target, { throwIfNoEntry: false })) {
|
|
81
|
+
if (!readBoundedFile(artifact.target, artifact.maximum).equals(artifact.bytes))
|
|
82
|
+
throw new Error(`The ${artifact.packageName} ${artifact.label} path already contains different customer content.`);
|
|
83
|
+
}
|
|
84
|
+
else
|
|
85
|
+
missing.push(artifact);
|
|
86
|
+
}
|
|
87
|
+
if (!missing.length && after === before && attributesAfter === attributesBefore)
|
|
88
|
+
return false;
|
|
89
|
+
if (missing.length)
|
|
90
|
+
mkdirSync(directory, { recursive: true });
|
|
91
|
+
for (const artifact of missing)
|
|
92
|
+
writeFileSync(artifact.target, artifact.bytes, { flag: 'wx', mode: 0o644 });
|
|
93
|
+
if (after !== before)
|
|
94
|
+
writeFile(workspaceFile, after);
|
|
95
|
+
if (attributesAfter !== attributesBefore) {
|
|
96
|
+
if (attributesStat)
|
|
97
|
+
writeFile(attributesFile, attributesAfter);
|
|
98
|
+
else
|
|
99
|
+
writeFileSync(attributesFile, attributesAfter, { flag: 'wx', mode: 0o644 });
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
/** Install the standard audit gate for every profile, including braces-free apps. */
|
|
104
|
+
export function writeDependencyAudit(root, replaceManaged = false) {
|
|
105
|
+
root = realpathSync(root);
|
|
106
|
+
const trusted = readBoundedFile(fileURLToPath(new URL('../assets/patches/audit-deps.mjs', import.meta.url)), patchMaximum);
|
|
107
|
+
const directory = path.join(root, 'scripts');
|
|
108
|
+
const directoryStat = lstatSync(directory, { throwIfNoEntry: false });
|
|
109
|
+
if (directoryStat && (!directoryStat.isDirectory() || directoryStat.isSymbolicLink()))
|
|
110
|
+
throw new Error('Audit script directory must be a real directory inside the project.');
|
|
111
|
+
const target = path.join(directory, 'audit-deps.mjs');
|
|
112
|
+
if (lstatSync(target, { throwIfNoEntry: false })) {
|
|
113
|
+
const current = readBoundedFile(target, patchMaximum);
|
|
114
|
+
if (current.equals(trusted))
|
|
115
|
+
return;
|
|
116
|
+
if (!replaceManaged)
|
|
117
|
+
throw new Error('The dependency audit script path contains different customer content.');
|
|
118
|
+
// Replacements occur only inside the add staging transaction. Its source
|
|
119
|
+
// fingerprints reject edited or untracked customer files before commit.
|
|
120
|
+
writeFile(target, trusted.toString('utf8'));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
mkdirSync(directory, { recursive: true });
|
|
124
|
+
writeFileSync(target, trusted, { flag: 'wx', mode: 0o644 });
|
|
125
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ export { inspectProject, validateSetupPlan } from './readiness.js';
|
|
|
7
7
|
export { registerApplication, readApplication, connectApplication, planDelivery, shipApplication, applicationStatus, verifyApplication, rollbackApplication, recoverApplication, } from './delivery.js';
|
|
8
8
|
export type { ApplicationProject, DeploymentTarget, DeliveryRunner } from './delivery.js';
|
|
9
9
|
export { planProvisioning, provisionApplication } from './provision.js';
|
|
10
|
+
export { supportsVoidRuntime, VOID_VERSION, VOID_NODE_ENGINE } from './void.js';
|
|
10
11
|
export { registerVercelApplication, connectVercelApplication, planVercelDelivery, shipVercelApplication, vercelApplicationStatus, verifyVercelApplication, rollbackVercelApplication, adoptVercelApplication, recoverVercelApplication, } from './vercel.js';
|
|
11
12
|
export { setupRepository, githubRepository } from './repository.js';
|
|
12
13
|
export { inspectProviderReadiness } from './provider-readiness.js';
|
|
13
|
-
export { registerManagedApplication, stageManagedVersion, saveManagedVersion, deployManagedVersion, managedApplicationStatus, } from './managed-hosting.js';
|
|
14
14
|
export { STACK_REGISTRY, STACK_ITEMS, getStackItem } from './stack-registry.js';
|
|
15
15
|
export type { StackItemId } from './stack-registry.js';
|
|
16
16
|
export type { StackRegistryItem } from './registry/types.js';
|
|
@@ -19,3 +19,28 @@ export { resolveStackRegistry } from './registry/resolve.js';
|
|
|
19
19
|
export type { ResolvedStackRegistry } from './registry/resolve.js';
|
|
20
20
|
export { addStackItems } from './registry/add.js';
|
|
21
21
|
export type { AddRequest } from './registry/add.js';
|
|
22
|
+
export { PROVIDER_AUTH, requiredProviders, authenticateProviders } from './provider-auth.js';
|
|
23
|
+
export type { ProviderAuth, AuthOptions, AuthCheck } from './provider-auth.js';
|
|
24
|
+
export { buildMobileApplication } from './mobile-delivery.js';
|
|
25
|
+
export type { MobileBuildOptions } from './mobile-delivery.js';
|
|
26
|
+
export { shipCloudflareApplication } from './ship.js';
|
|
27
|
+
export { shipSelectedStack, shipSelectedVercelApplication } from './ship.js';
|
|
28
|
+
export { planProviderProvisioning, provisionSelectedProviders } from './providers/provision.js';
|
|
29
|
+
export { providerConfigurationTemplate } from './providers/config.js';
|
|
30
|
+
export type { ProviderConfiguration, IntegrationProvider } from './providers/config.js';
|
|
31
|
+
export { validateProviderConfiguration } from './providers/config.js';
|
|
32
|
+
export { PROVIDER_CONFIGURATION_SCHEMA } from './providers/schema.js';
|
|
33
|
+
export { PROVIDER_DEFINITIONS } from './providers/definitions.js';
|
|
34
|
+
export type { ProviderSettingsById } from './providers/definitions.js';
|
|
35
|
+
export { applicationRuntime } from './providers/runtime.js';
|
|
36
|
+
export { readLifecycleOperation } from './lifecycle.js';
|
|
37
|
+
export type { LifecycleOperation, OperationState, PhaseState } from './lifecycle.js';
|
|
38
|
+
export { integrationStatus, recoverIntegrationResource } from './providers/recovery.js';
|
|
39
|
+
export type { IntegrationRecoveryRequest } from './providers/recovery.js';
|
|
40
|
+
export { CAPABILITY_CONTRACT, formatCapabilityContract } from './capability-contract.js';
|
|
41
|
+
export type { CapabilitySupport, CapabilityEvidence, CapabilityStage, ProductCapability, } from './capability-contract.js';
|
|
42
|
+
export { recoverDeliveryLock } from './project-state.js';
|
|
43
|
+
export { inspectApplication } from './project-inspector.js';
|
|
44
|
+
export type { ProjectInspection } from './inspector-model.js';
|
|
45
|
+
export { PROJECT_CONFIG_FILE, readProjectConfig, readProjectSection, writeProjectSection, hasProjectSection, } from './project-config.js';
|
|
46
|
+
export type { ProjectConfig, ProjectSection } from './project-config.js';
|