@orkestrel/scaffold 0.0.13 → 0.0.15
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/claude/agents/orkestrel.md +41 -38
- package/dist/host/guides/src/scaffold.md +28 -17
- package/dist/src/core/index.cjs +57 -57
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +10 -8
- package/dist/src/core/index.d.ts +10 -8
- package/dist/src/core/index.js +57 -57
- package/dist/src/core/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -29,44 +29,47 @@ descriptions never enter agent instruction context.
|
|
|
29
29
|
|
|
30
30
|
| Package | Version |
|
|
31
31
|
| --------------------- | ------- |
|
|
32
|
-
| @orkestrel/abort | 0.0.
|
|
33
|
-
| @orkestrel/agent | 0.0.
|
|
34
|
-
| @orkestrel/browser | 0.0.
|
|
35
|
-
| @orkestrel/budget | 0.0.
|
|
36
|
-
| @orkestrel/console | 0.0.
|
|
37
|
-
| @orkestrel/contract | 0.0.
|
|
38
|
-
| @orkestrel/csv | 0.0.
|
|
39
|
-
| @orkestrel/database | 0.0.
|
|
40
|
-
| @orkestrel/emitter | 0.0.
|
|
41
|
-
| @orkestrel/guide | 0.0.
|
|
42
|
-
| @orkestrel/
|
|
43
|
-
| @orkestrel/
|
|
44
|
-
| @orkestrel/
|
|
45
|
-
| @orkestrel/
|
|
46
|
-
| @orkestrel/
|
|
47
|
-
| @orkestrel/
|
|
48
|
-
| @orkestrel/
|
|
49
|
-
| @orkestrel/
|
|
50
|
-
| @orkestrel/
|
|
51
|
-
| @orkestrel/
|
|
52
|
-
| @orkestrel/
|
|
53
|
-
| @orkestrel/
|
|
54
|
-
| @orkestrel/
|
|
55
|
-
| @orkestrel/
|
|
56
|
-
| @orkestrel/
|
|
57
|
-
| @orkestrel/
|
|
58
|
-
| @orkestrel/
|
|
59
|
-
| @orkestrel/
|
|
60
|
-
| @orkestrel/
|
|
61
|
-
| @orkestrel/
|
|
62
|
-
| @orkestrel/
|
|
63
|
-
| @orkestrel/
|
|
64
|
-
| @orkestrel/
|
|
65
|
-
| @orkestrel/
|
|
66
|
-
| @orkestrel/
|
|
67
|
-
| @orkestrel/
|
|
68
|
-
| @orkestrel/
|
|
69
|
-
| @orkestrel/
|
|
32
|
+
| @orkestrel/abort | 0.0.4 |
|
|
33
|
+
| @orkestrel/agent | 0.0.11 |
|
|
34
|
+
| @orkestrel/browser | 0.0.8 |
|
|
35
|
+
| @orkestrel/budget | 0.0.4 |
|
|
36
|
+
| @orkestrel/console | 0.0.4 |
|
|
37
|
+
| @orkestrel/contract | 0.0.9 |
|
|
38
|
+
| @orkestrel/csv | 0.0.2 |
|
|
39
|
+
| @orkestrel/database | 0.0.6 |
|
|
40
|
+
| @orkestrel/emitter | 0.0.5 |
|
|
41
|
+
| @orkestrel/guide | 0.0.8 |
|
|
42
|
+
| @orkestrel/html | 0.0.1 |
|
|
43
|
+
| @orkestrel/indexeddb | 0.0.6 |
|
|
44
|
+
| @orkestrel/interpret | 0.0.7 |
|
|
45
|
+
| @orkestrel/markdown | 0.0.7 |
|
|
46
|
+
| @orkestrel/mcp | 0.0.7 |
|
|
47
|
+
| @orkestrel/middleware | 0.0.6 |
|
|
48
|
+
| @orkestrel/msg | 0.0.5 |
|
|
49
|
+
| @orkestrel/ndjson | 0.0.5 |
|
|
50
|
+
| @orkestrel/ollama | 0.0.7 |
|
|
51
|
+
| @orkestrel/pool | 0.0.4 |
|
|
52
|
+
| @orkestrel/program | 0.0.6 |
|
|
53
|
+
| @orkestrel/qualifier | 0.0.7 |
|
|
54
|
+
| @orkestrel/queue | 0.0.4 |
|
|
55
|
+
| @orkestrel/rater | 0.0.8 |
|
|
56
|
+
| @orkestrel/reason | 0.0.4 |
|
|
57
|
+
| @orkestrel/relation | 0.0.6 |
|
|
58
|
+
| @orkestrel/router | 0.0.6 |
|
|
59
|
+
| @orkestrel/scaffold | 0.0.13 |
|
|
60
|
+
| @orkestrel/sea | 0.0.4 |
|
|
61
|
+
| @orkestrel/server | 0.0.7 |
|
|
62
|
+
| @orkestrel/sqlite | 0.0.6 |
|
|
63
|
+
| @orkestrel/sse | 0.0.4 |
|
|
64
|
+
| @orkestrel/template | 0.0.2 |
|
|
65
|
+
| @orkestrel/terminal | 0.0.5 |
|
|
66
|
+
| @orkestrel/timeout | 0.0.4 |
|
|
67
|
+
| @orkestrel/tool | 0.0.7 |
|
|
68
|
+
| @orkestrel/toolbox | 0.0.1 |
|
|
69
|
+
| @orkestrel/websocket | 0.0.7 |
|
|
70
|
+
| @orkestrel/worker | 0.0.4 |
|
|
71
|
+
| @orkestrel/workflow | 0.0.7 |
|
|
72
|
+
| @orkestrel/workspace | 0.0.1 |
|
|
70
73
|
|
|
71
74
|
<!-- catalog:end -->
|
|
72
75
|
|
|
@@ -187,10 +187,12 @@ environment contributes, its test-project label, and — on the `src` axis — i
|
|
|
187
187
|
and build formats, or — on the `app` axis — its optional runtime entry.
|
|
188
188
|
|
|
189
189
|
`ViteMachinery` names the three host-specific pipelines a workspace's generated `vite.config.ts` may
|
|
190
|
-
carry: `browser`
|
|
190
|
+
carry: `browser` selects the shared root CSS-analysis and Playwright machinery, `vue` selects the
|
|
191
191
|
single-file-component, HTML, and development-server machinery an application browser environment
|
|
192
|
-
needs, and `output`
|
|
193
|
-
|
|
192
|
+
needs, and `output` selects build-output containment. The root machinery selection never attaches a
|
|
193
|
+
`css` property to a nonbrowser project: only the `srcBrowser` and `appBrowser` factories own
|
|
194
|
+
`ENVIRONMENT_CSS`. It never selects a boundary guarantee — those ship in every shape, as the
|
|
195
|
+
compilers section sets out.
|
|
194
196
|
|
|
195
197
|
`ViteFacts` is the optional structural-fact slice shared by every root Vite compiler:
|
|
196
198
|
`bin`, `integration`, and `service` each select their matching standalone project when `true`;
|
|
@@ -449,7 +451,10 @@ form. `HEX_PATTERN` requires whole lowercase byte pairs, and `SYNC_BASELINE_PATT
|
|
|
449
451
|
`0.0.1`. `BASE_DEV_DEPENDENCIES` is the host-neutral tooling baseline every generated workspace
|
|
450
452
|
gets; `SOURCE_BROWSER_DEV_DEPENDENCIES` adds the real browser providers a published browser environment
|
|
451
453
|
needs, and `APP_BROWSER_DEV_DEPENDENCIES` extends that with the Vue toolchain a private browser
|
|
452
|
-
application needs.
|
|
454
|
+
application needs. Vite is minor-pinned at `~8.2.0`: the generated boundary consumes the reviewed
|
|
455
|
+
8.2 `CSSOptions`, `preprocessCSS`, and `isCSSRequest` surface, while the selected
|
|
456
|
+
`css.transformer` / `lightningcss` path is experimental and must not float into an unreviewed minor.
|
|
457
|
+
`SCAFFOLD_RANGE` is the range generated workspaces pin this package at.
|
|
453
458
|
`CHECKOUT_ACTION_SHA` and `SETUP_NODE_ACTION_SHA` pin the two official CI actions to immutable
|
|
454
459
|
commits. `TYPESCRIPT_EXTENSIONS` is the module extension set every generated scoped check covers.
|
|
455
460
|
`JSON_PRINT_WIDTH` and `JSON_TAB_WIDTH` mirror the formatter configuration, so computed JSON is
|
|
@@ -1081,8 +1086,9 @@ streams, `URL`, `AbortController`, the text encoders, `crypto`, timers, `console
|
|
|
1081
1086
|
is one declaration set for a host-independent module, not a host. `viteHeader` renders the shared
|
|
1082
1087
|
header — the alias block
|
|
1083
1088
|
derived from the tsconfig paths, plus the environment-boundary plugin — and `viteMachinery` is the
|
|
1084
|
-
one place the header's axes are derived, read by `rootViteConfig`, `singleSrcViteConfig`,
|
|
1085
|
-
`applicationViteConfig
|
|
1089
|
+
one place the root header's axes are derived, read by `rootViteConfig`, `singleSrcViteConfig`, and
|
|
1090
|
+
`applicationViteConfig`; `configArtifacts` delegates to those roots rather than deriving another
|
|
1091
|
+
answer.
|
|
1086
1092
|
|
|
1087
1093
|
**The boundary guarantees do not vary by blueprint.** Every generated `vite.config.ts` — a
|
|
1088
1094
|
`core`-only library, an application of `app/core` alone, or the full six-environment workspace —
|
|
@@ -1095,12 +1101,12 @@ module graph never records — has no other enforcement point in workspace-owned
|
|
|
1095
1101
|
and toolchain modules are outside that ownership boundary. Only host-specific pipelines vary,
|
|
1096
1102
|
along the three `ViteMachinery` axes:
|
|
1097
1103
|
|
|
1098
|
-
| Machinery
|
|
1099
|
-
|
|
|
1100
|
-
| CSS
|
|
1101
|
-
| Playwright provider and `resolveChromium`
|
|
1102
|
-
| Vue plugin, HTML boundary, browser development server
|
|
1103
|
-
| Output containment (`outputBoundary`, `enforceOutputPath`)
|
|
1104
|
+
| Machinery | Emitted when |
|
|
1105
|
+
| ------------------------------------------------------------------------ | ------------------------------------ |
|
|
1106
|
+
| Shared CSS analysis (`ENVIRONMENT_CSS`, `preprocessCSS`, `isCSSRequest`) | a `src` or `app` browser environment |
|
|
1107
|
+
| Playwright provider and `resolveChromium` | a `src` or `app` browser environment |
|
|
1108
|
+
| Vue plugin, HTML boundary, browser development server | an `app` browser environment |
|
|
1109
|
+
| Output containment (`outputBoundary`, `enforceOutputPath`) | anything the workspace builds |
|
|
1104
1110
|
|
|
1105
1111
|
An application of `app/core` alone is the sole shape that builds nothing, so it is the sole shape
|
|
1106
1112
|
without output containment — and it still carries every boundary guarantee above.
|
|
@@ -1120,7 +1126,9 @@ slice carries `global` to integration and the source-browser compiler without ad
|
|
|
1120
1126
|
project.
|
|
1121
1127
|
|
|
1122
1128
|
`coreViteConfig`, `srcViteConfig`, `binViteConfig`, and `appViteConfig` emit the thin per-target
|
|
1123
|
-
wrappers
|
|
1129
|
+
wrappers. `coreViteConfig()` is parameterless and never imports or attaches browser CSS machinery;
|
|
1130
|
+
the root `srcCore` factory and its wrapper stay host-independent even when the workspace also owns a
|
|
1131
|
+
browser target. `binTsconfig` emits the executable declaration scope; `rootViteConfig`,
|
|
1124
1132
|
`singleSrcViteConfig`, and `applicationViteConfig` emit the root configuration for a library-only,
|
|
1125
1133
|
single non-core `src` environment, and application-bearing workspace respectively; and
|
|
1126
1134
|
`policyViteProject`, `guidesViteProject`, `integrationViteProject`, and `serviceViteProject` emit
|
|
@@ -1671,10 +1679,13 @@ What it rejects is equally deliberate:
|
|
|
1671
1679
|
Unsupported stylesheet `@import` or `url()` syntax is an error rather than a silently skipped
|
|
1672
1680
|
dependency. **`publicDir` is disabled on every generated build target**: an asset that is not
|
|
1673
1681
|
reachable through the module graph is not silently copied past the boundary. The output plugin
|
|
1674
|
-
fails during configuration when a caller attempts to enable `publicDir
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1682
|
+
fails during configuration when a caller attempts to enable `publicDir`. Published `srcBrowser`
|
|
1683
|
+
targets use Vite library mode, where assets are always inlined and `assetsInlineLimit` is ignored,
|
|
1684
|
+
so their generated shapes omit that ineffective option. The normal `appBrowser` build retains
|
|
1685
|
+
`assetsInlineLimit: 0`, and the output plugin rejects a nonzero limit only for that non-library
|
|
1686
|
+
browser build, keeping application asset bytes external and visible to output auditing before any
|
|
1687
|
+
output directory mutation. A caller-supplied Rolldown `output.dir` or `output.file` is also rejected
|
|
1688
|
+
during configuration; the exact generated `build.outDir` is the sole write root.
|
|
1678
1689
|
|
|
1679
1690
|
**The policy suite.** [`tests/setupPolicy.ts`](../../tests/setupPolicy.ts) is a narrow structural
|
|
1680
1691
|
policy pass built on the official TypeScript compiler. It exists for exactly the laws a linter
|
package/dist/src/core/index.cjs
CHANGED
|
@@ -227,7 +227,7 @@ var DEFAULT_VERSION = "0.0.1";
|
|
|
227
227
|
/** The `engines.node` range the `blueprint` builder fills. */
|
|
228
228
|
var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
|
|
229
229
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
230
|
-
var SCAFFOLD_RANGE = "^0.0.
|
|
230
|
+
var SCAFFOLD_RANGE = "^0.0.15";
|
|
231
231
|
/** Tooling versions shared by scaffold and every generated workspace. */
|
|
232
232
|
var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
233
233
|
"@microsoft/api-extractor": "^7.58.12",
|
|
@@ -237,14 +237,14 @@ var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
|
237
237
|
oxfmt: "^0.61.0",
|
|
238
238
|
oxlint: "^1.76.0",
|
|
239
239
|
typescript: "^6.0.3",
|
|
240
|
-
vite: "
|
|
240
|
+
vite: "~8.2.0",
|
|
241
241
|
"vite-plugin-dts": "^5.0.3",
|
|
242
242
|
vitest: "^4.1.10"
|
|
243
243
|
});
|
|
244
244
|
/** Additional development dependency required by a published browser source environment. */
|
|
245
245
|
var SOURCE_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
246
246
|
"@vitest/browser-playwright": "^4.1.10",
|
|
247
|
-
playwright: "^1.62.
|
|
247
|
+
playwright: "^1.62.1"
|
|
248
248
|
});
|
|
249
249
|
/** Additional development dependencies required by a private Vue browser application. */
|
|
250
250
|
var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
@@ -5937,7 +5937,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
5937
5937
|
if (isCSSRequest(id)) {
|
|
5938
5938
|
const config = resolvedConfig
|
|
5939
5939
|
if (config === undefined) {
|
|
5940
|
-
this.error('Environment boundary requires resolved Vite configuration')
|
|
5940
|
+
return this.error('Environment boundary requires resolved Vite configuration')
|
|
5941
5941
|
}
|
|
5942
5942
|
const stylesheet = await preprocessCSS(restored, id, config)
|
|
5943
5943
|
for (const dependency of stylesheet.deps ?? []) {
|
|
@@ -5983,7 +5983,9 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
5983
5983
|
? undefined
|
|
5984
5984
|
: packageRootOf(packageName, physicalSource)
|
|
5985
5985
|
if (packageRoot === undefined || !containedPath(packageRoot, physicalSource)) {
|
|
5986
|
-
this.error(
|
|
5986
|
+
return this.error(
|
|
5987
|
+
'Resolved dependencies must remain inside their physical package root',
|
|
5988
|
+
)
|
|
5987
5989
|
}
|
|
5988
5990
|
trustedPackageRoots.add(packageRoot)
|
|
5989
5991
|
}
|
|
@@ -5991,7 +5993,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
5991
5993
|
}
|
|
5992
5994
|
const resolvedSource = workspacePath(physicalSource)
|
|
5993
5995
|
if (resolvedSource === undefined) {
|
|
5994
|
-
this.error('Environment modules cannot import files outside the workspace')
|
|
5996
|
+
return this.error('Environment modules cannot import files outside the workspace')
|
|
5995
5997
|
}
|
|
5996
5998
|
const assetError = environmentPathError(owner, resolvedSource)
|
|
5997
5999
|
if (assetError !== undefined) this.error(assetError)
|
|
@@ -6020,7 +6022,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
6020
6022
|
)
|
|
6021
6023
|
const resolvedSource = workspacePath(resolution?.id ?? fallbackSource)
|
|
6022
6024
|
if (resolvedSource === undefined) {
|
|
6023
|
-
this.error('Environment modules cannot import files outside the workspace')
|
|
6025
|
+
return this.error('Environment modules cannot import files outside the workspace')
|
|
6024
6026
|
}
|
|
6025
6027
|
const pathError = environmentPathError('app/browser', resolvedSource)
|
|
6026
6028
|
if (pathError !== undefined) this.error(pathError)
|
|
@@ -6038,7 +6040,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
6038
6040
|
if (source === undefined) continue
|
|
6039
6041
|
const decodedSource = decodeAssetSource(source)
|
|
6040
6042
|
if (decodedSource === undefined) {
|
|
6041
|
-
this.error('Vue block URLs must use valid URI encoding')
|
|
6043
|
+
return this.error('Vue block URLs must use valid URI encoding')
|
|
6042
6044
|
}
|
|
6043
6045
|
const normalizedSource = decodedSource.replaceAll('\\\\', '/')
|
|
6044
6046
|
const sourceError = environmentSourceError('app/browser', normalizedSource)
|
|
@@ -6096,7 +6098,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
6096
6098
|
if (isCSSRequest(id)) {
|
|
6097
6099
|
const config = resolvedConfig
|
|
6098
6100
|
if (config === undefined) {
|
|
6099
|
-
this.error('Environment boundary requires resolved Vite configuration')
|
|
6101
|
+
return this.error('Environment boundary requires resolved Vite configuration')
|
|
6100
6102
|
}
|
|
6101
6103
|
const stylesheet = await preprocessCSS(code, id, config)
|
|
6102
6104
|
for (const dependency of stylesheet.deps ?? []) {
|
|
@@ -6142,7 +6144,9 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
6142
6144
|
? undefined
|
|
6143
6145
|
: packageRootOf(packageName, physicalSource)
|
|
6144
6146
|
if (packageRoot === undefined || !containedPath(packageRoot, physicalSource)) {
|
|
6145
|
-
this.error(
|
|
6147
|
+
return this.error(
|
|
6148
|
+
'Resolved dependencies must remain inside their physical package root',
|
|
6149
|
+
)
|
|
6146
6150
|
}
|
|
6147
6151
|
trustedPackageRoots.add(packageRoot)
|
|
6148
6152
|
}
|
|
@@ -6150,7 +6154,7 @@ import { parse as parseVue } from 'vue/compiler-sfc'
|
|
|
6150
6154
|
}
|
|
6151
6155
|
const resolvedSource = workspacePath(physicalSource)
|
|
6152
6156
|
if (resolvedSource === undefined) {
|
|
6153
|
-
this.error('Environment modules cannot import files outside the workspace')
|
|
6157
|
+
return this.error('Environment modules cannot import files outside the workspace')
|
|
6154
6158
|
}
|
|
6155
6159
|
const assetError = environmentPathError(owner, resolvedSource)
|
|
6156
6160
|
if (assetError !== undefined) this.error(assetError)
|
|
@@ -6709,7 +6713,11 @@ ${EXPORT_KEYWORD} function outputBoundary(output: string): Plugin {
|
|
|
6709
6713
|
'[orkestrel-output-boundary] Public directories are disabled; every output must come from the audited graph',
|
|
6710
6714
|
)
|
|
6711
6715
|
}
|
|
6712
|
-
if (
|
|
6716
|
+
if (
|
|
6717
|
+
output.endsWith('/browser') &&
|
|
6718
|
+
config.build.lib === false &&
|
|
6719
|
+
config.build.assetsInlineLimit !== 0
|
|
6720
|
+
) {
|
|
6713
6721
|
throw new Error(
|
|
6714
6722
|
'[orkestrel-output-boundary] Browser assets must remain external for output auditing',
|
|
6715
6723
|
)
|
|
@@ -7112,7 +7120,7 @@ ${needsVue ? ` configureServer(server) {
|
|
|
7112
7120
|
? packageRootForResolved(physicalResolution)
|
|
7113
7121
|
: undefined
|
|
7114
7122
|
if (mappedPackageRoot === undefined) {
|
|
7115
|
-
this.error(
|
|
7123
|
+
return this.error(
|
|
7116
7124
|
'Dependency package imports must resolve inside an exact physical package root',
|
|
7117
7125
|
)
|
|
7118
7126
|
}
|
|
@@ -7131,7 +7139,7 @@ ${needsVue ? ` configureServer(server) {
|
|
|
7131
7139
|
const packageRoot =
|
|
7132
7140
|
packageName === undefined ? undefined : packageRootOf(packageName, physicalResolution)
|
|
7133
7141
|
if (packageRoot === undefined || !containedPath(packageRoot, physicalResolution)) {
|
|
7134
|
-
this.error('Resolved dependencies must remain inside their physical package root')
|
|
7142
|
+
return this.error('Resolved dependencies must remain inside their physical package root')
|
|
7135
7143
|
}
|
|
7136
7144
|
trustedPackageRoots.add(packageRoot)
|
|
7137
7145
|
}
|
|
@@ -7162,7 +7170,7 @@ ${needsVue ? ` configureServer(server) {
|
|
|
7162
7170
|
}
|
|
7163
7171
|
const code = readBoundedFile(physicalImporter, ENVIRONMENT_MODULE_BYTES)
|
|
7164
7172
|
if (code === undefined) {
|
|
7165
|
-
this.error('Dependency module source must be a bounded regular file')
|
|
7173
|
+
return this.error('Dependency module source must be a bounded regular file')
|
|
7166
7174
|
}
|
|
7167
7175
|
for (const source of await environmentAssetSources(code, id)) {
|
|
7168
7176
|
const normalizedSource = source.replaceAll('\\\\', '/')
|
|
@@ -7399,7 +7407,7 @@ ${EXPORT_KEYWORD} ${CONST_KEYWORD} ENVIRONMENT_CSS = Object.freeze({
|
|
|
7399
7407
|
'value' in rule && rule.value !== null && 'loc' in rule.value
|
|
7400
7408
|
? sources[rule.value.loc.source_index]
|
|
7401
7409
|
: undefined
|
|
7402
|
-
if (rule.type !== 'import') return
|
|
7410
|
+
if (rule.type !== 'import' || rule.value === null) return
|
|
7403
7411
|
const error = stylesheetAssetError(source, rule.value.url)
|
|
7404
7412
|
if (error !== undefined) {
|
|
7405
7413
|
throw new Error(\`[orkestrel-environment-boundary] \${error}\`)
|
|
@@ -7620,7 +7628,6 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7620
7628
|
publicDir: false,
|
|
7621
7629
|
plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser')],
|
|
7622
7630
|
build: {
|
|
7623
|
-
assetsInlineLimit: 0,
|
|
7624
7631
|
emptyOutDir: true,
|
|
7625
7632
|
sourcemap: true,
|
|
7626
7633
|
minify: false,
|
|
@@ -7671,7 +7678,7 @@ ${renderedTest}
|
|
|
7671
7678
|
${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
7672
7679
|
mergeConfig(
|
|
7673
7680
|
{
|
|
7674
|
-
resolve
|
|
7681
|
+
resolve,
|
|
7675
7682
|
publicDir: false,
|
|
7676
7683
|
plugins: [outputBoundary('dist/src/server'), environmentBoundary('src/server')],
|
|
7677
7684
|
build: {
|
|
@@ -7754,7 +7761,6 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7754
7761
|
publicDir: false,
|
|
7755
7762
|
plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser')],
|
|
7756
7763
|
build: {
|
|
7757
|
-
assetsInlineLimit: 0,
|
|
7758
7764
|
lib: {
|
|
7759
7765
|
entry: resolveWorkspacePath('src/browser/index.ts'),
|
|
7760
7766
|
formats: ['es'],
|
|
@@ -7799,7 +7805,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7799
7805
|
${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
7800
7806
|
srcCore(
|
|
7801
7807
|
mergeConfig(
|
|
7802
|
-
{
|
|
7808
|
+
{
|
|
7803
7809
|
publicDir: false,
|
|
7804
7810
|
plugins: [outputBoundary('dist/src/server'), environmentBoundary('src/server')],
|
|
7805
7811
|
build: {
|
|
@@ -7891,7 +7897,7 @@ function applicationViteConfig(src, app, facts = {}) {
|
|
|
7891
7897
|
${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
|
|
7892
7898
|
mergeConfig(
|
|
7893
7899
|
{
|
|
7894
|
-
resolve
|
|
7900
|
+
resolve,
|
|
7895
7901
|
publicDir: false,
|
|
7896
7902
|
plugins: [environmentBoundary('src/core')],
|
|
7897
7903
|
build: { emptyOutDir: true, sourcemap: true, minify: false },
|
|
@@ -7919,7 +7925,6 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7919
7925
|
publicDir: false,
|
|
7920
7926
|
plugins: [outputBoundary('dist/src/browser'), environmentBoundary('src/browser')],
|
|
7921
7927
|
build: {
|
|
7922
|
-
assetsInlineLimit: 0,
|
|
7923
7928
|
emptyOutDir: true,
|
|
7924
7929
|
sourcemap: true,
|
|
7925
7930
|
minify: false,
|
|
@@ -7981,7 +7986,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7981
7986
|
${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
7982
7987
|
mergeConfig(
|
|
7983
7988
|
{
|
|
7984
|
-
resolve
|
|
7989
|
+
resolve,
|
|
7985
7990
|
publicDir: false,
|
|
7986
7991
|
plugins: [outputBoundary('dist/src/server'), environmentBoundary('src/server')],
|
|
7987
7992
|
build: {
|
|
@@ -8015,7 +8020,7 @@ ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
|
8015
8020
|
${EXPORT_KEYWORD} const appCore = (config?: UserConfig): UserConfig =>
|
|
8016
8021
|
mergeConfig(
|
|
8017
8022
|
{
|
|
8018
|
-
resolve
|
|
8023
|
+
resolve,
|
|
8019
8024
|
publicDir: false,
|
|
8020
8025
|
plugins: [environmentBoundary('app/core')],
|
|
8021
8026
|
test: {
|
|
@@ -8092,7 +8097,7 @@ ${EXPORT_KEYWORD} function appBrowser(...config: readonly never[]): UserConfig {
|
|
|
8092
8097
|
${EXPORT_KEYWORD} const appServer = (config?: UserConfig): UserConfig =>
|
|
8093
8098
|
mergeConfig(
|
|
8094
8099
|
{
|
|
8095
|
-
resolve
|
|
8100
|
+
resolve,
|
|
8096
8101
|
publicDir: false,
|
|
8097
8102
|
plugins: [outputBoundary('dist/app/server'), environmentBoundary('app/server')],
|
|
8098
8103
|
build: {
|
|
@@ -8158,7 +8163,6 @@ function coreTsconfig() {
|
|
|
8158
8163
|
* `configs/src/vite.core.config.ts` — inlines its own `build.lib` /
|
|
8159
8164
|
* `rolldownOptions` (core's `srcCore` root export carries no build.lib).
|
|
8160
8165
|
*
|
|
8161
|
-
* @param browser - Whether a declared browser environment enables the shared CSS pipeline.
|
|
8162
8166
|
* @returns The core environment `vite.config.ts` file content, newline-terminated.
|
|
8163
8167
|
*
|
|
8164
8168
|
* @example
|
|
@@ -8166,11 +8170,11 @@ function coreTsconfig() {
|
|
|
8166
8170
|
* coreViteConfig().includes('srcCore(') // true
|
|
8167
8171
|
* ```
|
|
8168
8172
|
*/
|
|
8169
|
-
function coreViteConfig(
|
|
8173
|
+
function coreViteConfig() {
|
|
8170
8174
|
return `import { defineConfig } from 'vite'
|
|
8171
8175
|
import dts from 'vite-plugin-dts'
|
|
8172
8176
|
import {
|
|
8173
|
-
|
|
8177
|
+
environmentBoundary,
|
|
8174
8178
|
outputBoundary,
|
|
8175
8179
|
srcCore,
|
|
8176
8180
|
resolveWorkspacePath,
|
|
@@ -8178,7 +8182,7 @@ ${browser ? " ENVIRONMENT_CSS,\n" : ""} environmentBoundary,
|
|
|
8178
8182
|
|
|
8179
8183
|
export default defineConfig(
|
|
8180
8184
|
srcCore({
|
|
8181
|
-
|
|
8185
|
+
publicDir: false,
|
|
8182
8186
|
plugins: [
|
|
8183
8187
|
outputBoundary('dist/src/core'),
|
|
8184
8188
|
environmentBoundary('src/core'),
|
|
@@ -8467,7 +8471,6 @@ ${browser}
|
|
|
8467
8471
|
* ```
|
|
8468
8472
|
*/
|
|
8469
8473
|
function configArtifacts(spec) {
|
|
8470
|
-
const machinery = viteMachinery(spec.src, spec.app, spec.bin);
|
|
8471
8474
|
const artifacts = [{
|
|
8472
8475
|
path: "tsconfig.json",
|
|
8473
8476
|
group: "configs",
|
|
@@ -8483,7 +8486,7 @@ function configArtifacts(spec) {
|
|
|
8483
8486
|
const row = SRC_MATRIX[environment];
|
|
8484
8487
|
for (const path of row.configs) {
|
|
8485
8488
|
const isTsconfig = path.endsWith(".json");
|
|
8486
|
-
const content = environment === "core" ? isTsconfig ? coreTsconfig() : coreViteConfig(
|
|
8489
|
+
const content = environment === "core" ? isTsconfig ? coreTsconfig() : coreViteConfig() : isTsconfig ? srcTsconfig(environment) : srcViteConfig(environment);
|
|
8487
8490
|
artifacts.push({
|
|
8488
8491
|
path,
|
|
8489
8492
|
group: "configs",
|
|
@@ -8615,24 +8618,20 @@ function paritySpecifiers(spec) {
|
|
|
8615
8618
|
for (const environment of spec.app) modules[`@app/${environment}`] = `app/${environment}`;
|
|
8616
8619
|
const specifierItems = selfSpecifiers.map((specifier) => `'${specifier}'`);
|
|
8617
8620
|
const inlineSpecifierList = `[${specifierItems.join(", ")}]`;
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
if (source === undefined) {
|
|
8631
|
-
|
|
8632
|
-
SPECIFIER_SOURCES.set(module, source)
|
|
8633
|
-
}
|
|
8634
|
-
return source.exports().map((symbol) => symbol.name)
|
|
8635
|
-
}`;
|
|
8621
|
+
const lines = fitsPrintWidth(`const SELF_SPECIFIERS = ${inlineSpecifierList}`) ? [`${EXPORT_KEYWORD} ${CONST_KEYWORD} SELF_SPECIFIERS = ${inlineSpecifierList}`] : [
|
|
8622
|
+
`${EXPORT_KEYWORD} ${CONST_KEYWORD} SELF_SPECIFIERS = [`,
|
|
8623
|
+
...specifierItems.map((specifier) => `\t${specifier},`),
|
|
8624
|
+
"]"
|
|
8625
|
+
];
|
|
8626
|
+
lines.push("", [
|
|
8627
|
+
EXPORT_KEYWORD,
|
|
8628
|
+
CONST_KEYWORD,
|
|
8629
|
+
"SPECIFIER_MODULES:",
|
|
8630
|
+
"Readonly<Record<string, string>>",
|
|
8631
|
+
"=",
|
|
8632
|
+
"{"
|
|
8633
|
+
].join(" "), ...Object.entries(modules).map(([specifier, module]) => `\t'${specifier}': '${module}',`), "}", `${EXPORT_KEYWORD} ${CONST_KEYWORD} SPECIFIER_SOURCES = new Map<string, ReturnType<typeof createSource>>()`, `${EXPORT_KEYWORD} ${FUNCTION_KEYWORD} exportsFor(specifier: string): readonly string[] {`, " const module = SPECIFIER_MODULES[specifier]", " if (module === undefined) return []", " let source = SPECIFIER_SOURCES.get(module)", " if (source === undefined) {", " source = createSource({ files: GUIDE_FILES, module })", " SPECIFIER_SOURCES.set(module, source)", " }", " return source.exports().map((symbol) => symbol.name)", "}");
|
|
8634
|
+
return lines.join("\n");
|
|
8636
8635
|
}
|
|
8637
8636
|
/**
|
|
8638
8637
|
* Draft the `tests` group's `template` artifacts — the shared recorder
|
|
@@ -8653,8 +8652,8 @@ ${EXPORT_KEYWORD} ${FUNCTION_KEYWORD} exportsFor(specifier: string): readonly st
|
|
|
8653
8652
|
function testArtifacts(spec, pascal) {
|
|
8654
8653
|
const hasBrowser = spec.src.includes("browser") || spec.app.includes("browser");
|
|
8655
8654
|
const hasVue = spec.app.includes("browser");
|
|
8656
|
-
const browserPolicySpecifier = hasBrowser ? ",
|
|
8657
|
-
const browserPolicyImport = hasBrowser ? "import { chromium } from 'playwright'" : "";
|
|
8655
|
+
const browserPolicySpecifier = hasBrowser ? ", accessSync, constants as FS_CONSTANTS, statSync" : "";
|
|
8656
|
+
const browserPolicyImport = hasBrowser ? "import { chromium } from 'playwright'\nimport { resolveChromium } from '../vite.config.js'" : "";
|
|
8658
8657
|
const vuePolicyImport = hasVue ? "import { parse as parseVue } from 'vue/compiler-sfc'" : "";
|
|
8659
8658
|
const workspacePolicyAssertion = hasVue ? `expect(
|
|
8660
8659
|
inspectCodingWorkspace(process.cwd(), (path, content) => {
|
|
@@ -8666,12 +8665,13 @@ function testArtifacts(spec, pascal) {
|
|
|
8666
8665
|
}),
|
|
8667
8666
|
).toEqual([])` : "expect(inspectCodingWorkspace(process.cwd())).toEqual([])";
|
|
8668
8667
|
const browserPolicyTest = hasBrowser ? `
|
|
8669
|
-
it
|
|
8670
|
-
|
|
8671
|
-
()
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8668
|
+
it('resolves Chromium only to a real executable file', () => {
|
|
8669
|
+
const chromiumPath = resolveChromium(chromium.executablePath())
|
|
8670
|
+
if (chromiumPath === undefined) return
|
|
8671
|
+
|
|
8672
|
+
expect(statSync(chromiumPath).isFile()).toBe(true)
|
|
8673
|
+
expect(() => accessSync(chromiumPath, FS_CONSTANTS.X_OK)).not.toThrow()
|
|
8674
|
+
})` : "";
|
|
8675
8675
|
const artifacts = [fillArtifact("tests/setup.ts", "tests", "setup", {}), fillArtifact("tests/policy.test.ts", "tests", "policyTest", {
|
|
8676
8676
|
browserPolicySpecifier,
|
|
8677
8677
|
browserPolicyImport,
|