@orkestrel/scaffold 0.0.17 → 0.0.18
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/dist/host/tests/setupPolicy.ts +4 -3
- package/dist/src/core/index.cjs +27 -31
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +1 -1
- package/dist/src/core/index.d.ts +1 -1
- package/dist/src/core/index.js +27 -31
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +2 -2
- package/dist/src/server/index.cjs.map +1 -1
- package/package.json +4 -4
|
@@ -2275,7 +2275,7 @@ export declare function coreViteConfig(): string;
|
|
|
2275
2275
|
export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
|
|
2276
2276
|
|
|
2277
2277
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
2278
|
-
export declare const SCAFFOLD_RANGE = "^0.0.
|
|
2278
|
+
export declare const SCAFFOLD_RANGE = "^0.0.18";
|
|
2279
2279
|
|
|
2280
2280
|
/**
|
|
2281
2281
|
* Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -2275,7 +2275,7 @@ export declare function coreViteConfig(): string;
|
|
|
2275
2275
|
export declare function rootViteConfig(src: readonly Environment[], facts?: ViteFacts): string;
|
|
2276
2276
|
|
|
2277
2277
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
2278
|
-
export declare const SCAFFOLD_RANGE = "^0.0.
|
|
2278
|
+
export declare const SCAFFOLD_RANGE = "^0.0.18";
|
|
2279
2279
|
|
|
2280
2280
|
/**
|
|
2281
2281
|
* Carries a `ScaffoldErrorCode` + optional `context` (AGENTS §12).
|
package/dist/src/core/index.js
CHANGED
|
@@ -226,7 +226,7 @@ var DEFAULT_VERSION = "0.0.1";
|
|
|
226
226
|
/** The `engines.node` range the `blueprint` builder fills. */
|
|
227
227
|
var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
|
|
228
228
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
229
|
-
var SCAFFOLD_RANGE = "^0.0.
|
|
229
|
+
var SCAFFOLD_RANGE = "^0.0.18";
|
|
230
230
|
/** Tooling versions shared by scaffold and every generated workspace. */
|
|
231
231
|
var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
232
232
|
"@microsoft/api-extractor": "^7.58.12",
|
|
@@ -4466,9 +4466,7 @@ describe('createApplication', () => {
|
|
|
4466
4466
|
'x'.repeat(204),
|
|
4467
4467
|
\`\${' '.repeat(MAX_APPLICATION_NAME_INPUT_LENGTH)}x\`,
|
|
4468
4468
|
]) {
|
|
4469
|
-
expect(() => Reflect.apply(createApplication, undefined, [value])).
|
|
4470
|
-
ApplicationError,
|
|
4471
|
-
)
|
|
4469
|
+
expect(() => Reflect.apply(createApplication, undefined, [value])).toThrow(ApplicationError)
|
|
4472
4470
|
}
|
|
4473
4471
|
const error = new ApplicationError('CONFIG', 'invalid')
|
|
4474
4472
|
expect(isApplicationError(error)).toBe(true)
|
|
@@ -4543,7 +4541,7 @@ describe('createBrowserApplication', () => {
|
|
|
4543
4541
|
{ name: 'x'.repeat(204) },
|
|
4544
4542
|
{ name: \`\${' '.repeat(MAX_BROWSER_APPLICATION_NAME_INPUT_LENGTH)}x\` },
|
|
4545
4543
|
]) {
|
|
4546
|
-
expect(() => Reflect.apply(createBrowserApplication, undefined, [value])).
|
|
4544
|
+
expect(() => Reflect.apply(createBrowserApplication, undefined, [value])).toThrow(
|
|
4547
4545
|
BrowserApplicationError,
|
|
4548
4546
|
)
|
|
4549
4547
|
}
|
|
@@ -4568,14 +4566,14 @@ describe('createBrowserApplication', () => {
|
|
|
4568
4566
|
const revocable = Proxy.revocable({}, {})
|
|
4569
4567
|
revocable.revoke()
|
|
4570
4568
|
|
|
4571
|
-
expect(() => parseBrowserApplicationOptions(accessor)).
|
|
4569
|
+
expect(() => parseBrowserApplicationOptions(accessor)).toThrow(BrowserApplicationError)
|
|
4572
4570
|
expect(reads).toBe(0)
|
|
4573
|
-
expect(() => Reflect.apply(createBrowserApplication, undefined, [hostile])).
|
|
4571
|
+
expect(() => Reflect.apply(createBrowserApplication, undefined, [hostile])).toThrow(
|
|
4572
|
+
BrowserApplicationError,
|
|
4573
|
+
)
|
|
4574
|
+
expect(() => Reflect.apply(createBrowserApplication, undefined, [revocable.proxy])).toThrow(
|
|
4574
4575
|
BrowserApplicationError,
|
|
4575
4576
|
)
|
|
4576
|
-
expect(() =>
|
|
4577
|
-
Reflect.apply(createBrowserApplication, undefined, [revocable.proxy]),
|
|
4578
|
-
).toThrowError(BrowserApplicationError)
|
|
4579
4577
|
expect(isBrowserApplicationError(new BrowserApplicationError('CONFIG', 'invalid'))).toBe(true)
|
|
4580
4578
|
expect(isBrowserApplicationError(new Error('plain'))).toBe(false)
|
|
4581
4579
|
expect(isBrowserApplicationError(revocable.proxy)).toBe(false)
|
|
@@ -4678,20 +4676,20 @@ describe('ApplicationServer', () => {
|
|
|
4678
4676
|
})
|
|
4679
4677
|
|
|
4680
4678
|
it('validates direct options before allocating a listener', () => {
|
|
4681
|
-
expect(() => createApplicationServer({ host: ' ' })).
|
|
4679
|
+
expect(() => createApplicationServer({ host: ' ' })).toThrow(
|
|
4682
4680
|
expect.objectContaining({ code: 'CONFIG' }),
|
|
4683
4681
|
)
|
|
4684
|
-
expect(() => createApplicationServer({ port: Number.NaN })).
|
|
4682
|
+
expect(() => createApplicationServer({ port: Number.NaN })).toThrow(
|
|
4685
4683
|
expect.objectContaining({ code: 'CONFIG' }),
|
|
4686
4684
|
)
|
|
4687
|
-
expect(() => createApplicationServer({ port: -1 })).
|
|
4685
|
+
expect(() => createApplicationServer({ port: -1 })).toThrow(
|
|
4688
4686
|
expect.objectContaining({ code: 'CONFIG' }),
|
|
4689
4687
|
)
|
|
4690
|
-
expect(() => createApplicationServer({ timeout: 0 })).
|
|
4688
|
+
expect(() => createApplicationServer({ timeout: 0 })).toThrow(
|
|
4691
4689
|
expect.objectContaining({ code: 'CONFIG' }),
|
|
4692
4690
|
)
|
|
4693
4691
|
for (const value of [null, 42, [], { host: 42 }, { port: [42] }]) {
|
|
4694
|
-
expect(() => Reflect.apply(createApplicationServer, undefined, [value])).
|
|
4692
|
+
expect(() => Reflect.apply(createApplicationServer, undefined, [value])).toThrow(
|
|
4695
4693
|
expect.objectContaining({ code: 'CONFIG' }),
|
|
4696
4694
|
)
|
|
4697
4695
|
}
|
|
@@ -4711,14 +4709,10 @@ describe('ApplicationServer', () => {
|
|
|
4711
4709
|
expect(server.port).toBe(0)
|
|
4712
4710
|
|
|
4713
4711
|
process.env.APP_PORT = '1e3'
|
|
4714
|
-
expect(() => createApplicationServer()).
|
|
4715
|
-
expect.objectContaining({ code: 'CONFIG' }),
|
|
4716
|
-
)
|
|
4712
|
+
expect(() => createApplicationServer()).toThrow(expect.objectContaining({ code: 'CONFIG' }))
|
|
4717
4713
|
process.env.APP_PORT = '0'
|
|
4718
4714
|
process.env.APP_START_TIMEOUT = '0'
|
|
4719
|
-
expect(() => createApplicationServer()).
|
|
4720
|
-
expect.objectContaining({ code: 'CONFIG' }),
|
|
4721
|
-
)
|
|
4715
|
+
expect(() => createApplicationServer()).toThrow(expect.objectContaining({ code: 'CONFIG' }))
|
|
4722
4716
|
} finally {
|
|
4723
4717
|
if (previousHost === undefined) delete process.env.APP_HOST
|
|
4724
4718
|
else process.env.APP_HOST = previousHost
|
|
@@ -5087,15 +5081,13 @@ describe('application environment parsers', () => {
|
|
|
5087
5081
|
'999.999.999.999',
|
|
5088
5082
|
\`\${'a'.repeat(64)}.example\`,
|
|
5089
5083
|
])('rejects hostile APP_HOST value %s before listener allocation', (value) => {
|
|
5090
|
-
expect(() => parseApplicationHost(value)).
|
|
5091
|
-
expect.objectContaining({ code: 'CONFIG' }),
|
|
5092
|
-
)
|
|
5084
|
+
expect(() => parseApplicationHost(value)).toThrow(expect.objectContaining({ code: 'CONFIG' }))
|
|
5093
5085
|
})
|
|
5094
5086
|
|
|
5095
5087
|
it.each([null, 42, [], { port: [42] }, { timeout: 0 }])(
|
|
5096
5088
|
'rejects hostile option container or leaf value %#',
|
|
5097
5089
|
(value) => {
|
|
5098
|
-
expect(() => parseApplicationServerOptions(value)).
|
|
5090
|
+
expect(() => parseApplicationServerOptions(value)).toThrow(
|
|
5099
5091
|
expect.objectContaining({ code: 'CONFIG' }),
|
|
5100
5092
|
)
|
|
5101
5093
|
},
|
|
@@ -5118,7 +5110,7 @@ describe('application environment parsers', () => {
|
|
|
5118
5110
|
])(
|
|
5119
5111
|
'rejects inherited, unknown, symbolic, accessor, instance, and hostile proxy options %#',
|
|
5120
5112
|
(value) => {
|
|
5121
|
-
expect(() => parseApplicationServerOptions(value)).
|
|
5113
|
+
expect(() => parseApplicationServerOptions(value)).toThrow(
|
|
5122
5114
|
expect.objectContaining({ code: 'CONFIG' }),
|
|
5123
5115
|
)
|
|
5124
5116
|
},
|
|
@@ -5629,7 +5621,7 @@ function packageManifest(spec) {
|
|
|
5629
5621
|
}
|
|
5630
5622
|
if (spec.bin) scripts["test:src:bin"] = "vitest run --config vite.config.ts --no-cache --reporter=dot --project src:bin";
|
|
5631
5623
|
if (spec.integration) scripts["test:integration"] = "vitest run --config vite.config.ts --no-cache --reporter=dot --project integration";
|
|
5632
|
-
if (spec.bin && spec.integration) scripts["test:equivalence"] = "node -e \"const c=require('node:child_process'),
|
|
5624
|
+
if (spec.bin && spec.integration) scripts["test:equivalence"] = "node -e \"const c=require('node:child_process'),p=process.env.npm_execpath;if(p===undefined)process.exit(1);const r=c.spawnSync(process.execPath,[p,'run','test:integration'],{stdio:'inherit',env:{...process.env,SCAFFOLD_BOUNDARY_EQUIVALENCE:'1'}});process.exit(r.status??1)\"";
|
|
5633
5625
|
if (spec.service) scripts["test:service"] = "vitest run --config vite.config.ts --no-cache --reporter=dot --project service";
|
|
5634
5626
|
if (spec.app.length > 0) {
|
|
5635
5627
|
scripts["test:app"] = "vitest run --config vite.config.ts --no-cache --reporter=dot " + spec.app.map((environment) => `--project ${APP_MATRIX[environment].project}`).join(" ");
|
|
@@ -5723,6 +5715,7 @@ function rootTsconfig(src, app = []) {
|
|
|
5723
5715
|
target: "ESNext",
|
|
5724
5716
|
module: "ESNext",
|
|
5725
5717
|
moduleResolution: "bundler",
|
|
5718
|
+
allowImportingTsExtensions: true,
|
|
5726
5719
|
lib: [
|
|
5727
5720
|
"ESNext",
|
|
5728
5721
|
"DOM",
|
|
@@ -7823,6 +7816,7 @@ ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
|
7823
7816
|
outDir: 'dist/src/server',
|
|
7824
7817
|
target: 'node22',
|
|
7825
7818
|
rolldownOptions: {
|
|
7819
|
+
platform: 'node',
|
|
7826
7820
|
external: (id: string) => id.startsWith('node:') || id.startsWith('@orkestrel/'),
|
|
7827
7821
|
},
|
|
7828
7822
|
},
|
|
@@ -7946,6 +7940,7 @@ ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
|
7946
7940
|
outDir: 'dist/src/server',
|
|
7947
7941
|
target: 'node22',
|
|
7948
7942
|
rolldownOptions: {
|
|
7943
|
+
platform: 'node',
|
|
7949
7944
|
external: (id: string) =>
|
|
7950
7945
|
id === '@src/core' || id.startsWith('node:') || id.startsWith('@orkestrel/'),
|
|
7951
7946
|
output: [
|
|
@@ -8130,6 +8125,7 @@ ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
|
8130
8125
|
outDir: 'dist/src/server',
|
|
8131
8126
|
target: 'node22',
|
|
8132
8127
|
rolldownOptions: {
|
|
8128
|
+
platform: 'node',
|
|
8133
8129
|
external: (id: string) =>
|
|
8134
8130
|
${coreExternal}id.startsWith('node:') || id.startsWith('@orkestrel/'),${coreOutput}
|
|
8135
8131
|
},
|
|
@@ -8308,7 +8304,7 @@ import {
|
|
|
8308
8304
|
outputBoundary,
|
|
8309
8305
|
srcCore,
|
|
8310
8306
|
resolveWorkspacePath,
|
|
8311
|
-
} from '../../vite.config'
|
|
8307
|
+
} from '../../vite.config.ts'
|
|
8312
8308
|
|
|
8313
8309
|
export default defineConfig(
|
|
8314
8310
|
srcCore({
|
|
@@ -8393,7 +8389,7 @@ function srcViteConfig(environment) {
|
|
|
8393
8389
|
const anchor = environment === "browser" ? "srcBrowser" : "srcServer";
|
|
8394
8390
|
return `import { defineConfig } from 'vite'
|
|
8395
8391
|
import dts from 'vite-plugin-dts'
|
|
8396
|
-
import { ${anchor}, resolveWorkspacePath } from '../../vite.config'
|
|
8392
|
+
import { ${anchor}, resolveWorkspacePath } from '../../vite.config.ts'
|
|
8397
8393
|
|
|
8398
8394
|
// Types are bundled inline by vite-plugin-dts (see configs/src/vite.core.config.ts
|
|
8399
8395
|
// for the same pattern).
|
|
@@ -8446,7 +8442,7 @@ function binTsconfig() {
|
|
|
8446
8442
|
*/
|
|
8447
8443
|
function binViteConfig() {
|
|
8448
8444
|
return `import { defineConfig } from 'vite'
|
|
8449
|
-
import { srcBin } from '../../vite.config'
|
|
8445
|
+
import { srcBin } from '../../vite.config.ts'
|
|
8450
8446
|
|
|
8451
8447
|
// The \`scaffold\` executable build — a single ESM lib file, no declarations (an
|
|
8452
8448
|
// executable ships no types), with the \`#!/usr/bin/env node\` shebang re-emitted via
|
|
@@ -8513,7 +8509,7 @@ function appTsconfig(environment, hasCore) {
|
|
|
8513
8509
|
function appViteConfig(environment) {
|
|
8514
8510
|
const anchor = environment === "browser" ? "appBrowser" : "appServer";
|
|
8515
8511
|
return `import { defineConfig } from 'vite'
|
|
8516
|
-
import { ${anchor} } from '../../vite.config'
|
|
8512
|
+
import { ${anchor} } from '../../vite.config.ts'
|
|
8517
8513
|
|
|
8518
8514
|
export default defineConfig(${anchor}())
|
|
8519
8515
|
`;
|