@orkestrel/scaffold 0.0.9 → 0.0.11
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/bin/scaffold.js +47 -21
- package/dist/bin/scaffold.js.map +1 -1
- package/dist/host/guides/src/scaffold.md +64 -29
- package/dist/host/tests/setupPolicy.ts +87 -2
- package/dist/src/core/index.cjs +78 -54
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +51 -21
- package/dist/src/core/index.d.ts +51 -21
- package/dist/src/core/index.js +77 -55
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +9 -3
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +2 -1
- package/dist/src/server/index.d.ts +2 -1
- package/dist/src/server/index.js +11 -5
- package/dist/src/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/src/core/index.js
CHANGED
|
@@ -142,6 +142,8 @@ var HOST_PATHS = Object.freeze([
|
|
|
142
142
|
]);
|
|
143
143
|
/** The consumer-owned live-service provisioner expected only by service workspaces. */
|
|
144
144
|
var SERVICE_SCRIPT_PATH = "scripts/service.sh";
|
|
145
|
+
/** The consumer-owned Vitest global-setup module shared by its independently selected projects. */
|
|
146
|
+
var GLOBAL_SETUP_PATH = "tests/setupGlobal.ts";
|
|
145
147
|
/** The package-name RegExp — lowercase alphanumeric-with-hyphens, letter-first. */
|
|
146
148
|
var NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
147
149
|
/** Maximum bare workspace name length beneath the generated `@orkestrel/` scope. */
|
|
@@ -224,7 +226,7 @@ var DEFAULT_VERSION = "0.0.1";
|
|
|
224
226
|
/** The `engines.node` range the `blueprint` builder fills. */
|
|
225
227
|
var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
|
|
226
228
|
/** The devDependency range generated packages pin `@orkestrel/scaffold` at. */
|
|
227
|
-
var SCAFFOLD_RANGE = "^0.0.
|
|
229
|
+
var SCAFFOLD_RANGE = "^0.0.11";
|
|
228
230
|
/** Tooling versions shared by scaffold and every generated workspace. */
|
|
229
231
|
var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
230
232
|
"@microsoft/api-extractor": "^7.58.12",
|
|
@@ -241,7 +243,7 @@ var BASE_DEV_DEPENDENCIES = Object.freeze({
|
|
|
241
243
|
/** Additional development dependency required by a published browser source environment. */
|
|
242
244
|
var SOURCE_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
243
245
|
"@vitest/browser-playwright": "^4.1.10",
|
|
244
|
-
playwright: "^1.
|
|
246
|
+
playwright: "^1.62.0"
|
|
245
247
|
});
|
|
246
248
|
/** Additional development dependencies required by a private Vue browser application. */
|
|
247
249
|
var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
|
|
@@ -424,8 +426,8 @@ function member(name, category, summary, environment = "core") {
|
|
|
424
426
|
* `version` / `engines` default `DEFAULT_VERSION` / `DEFAULT_ENGINES`,
|
|
425
427
|
* `src` defaults `['core']`, and `app` / `keywords` / `dependencies` /
|
|
426
428
|
* `peers` / `extras` / `overrides` default `[]`, and `bin` / `integration` /
|
|
427
|
-
* `service` default `false`. `description` is OMITTED entirely
|
|
428
|
-
* the result round-trips the exact-record `Blueprint` guard.
|
|
429
|
+
* `service` / `global` default `false`. `description` is OMITTED entirely
|
|
430
|
+
* when absent, so the result round-trips the exact-record `Blueprint` guard.
|
|
429
431
|
* @returns A complete `Blueprint`.
|
|
430
432
|
*
|
|
431
433
|
* @example
|
|
@@ -449,7 +451,8 @@ function blueprint(name, options) {
|
|
|
449
451
|
overrides: options?.overrides ?? [],
|
|
450
452
|
bin: options?.bin ?? false,
|
|
451
453
|
integration: options?.integration ?? false,
|
|
452
|
-
service: options?.service ?? false
|
|
454
|
+
service: options?.service ?? false,
|
|
455
|
+
global: options?.global ?? false
|
|
453
456
|
};
|
|
454
457
|
return options?.description === void 0 ? base : {
|
|
455
458
|
...base,
|
|
@@ -1598,6 +1601,22 @@ function computeColumnWidth(text) {
|
|
|
1598
1601
|
return width;
|
|
1599
1602
|
}
|
|
1600
1603
|
/**
|
|
1604
|
+
* Test whether a complete rendered line fits the fleet formatter's print width.
|
|
1605
|
+
*
|
|
1606
|
+
* @param text - The complete rendered line, including indentation and trailing punctuation.
|
|
1607
|
+
* @returns Whether the line fits within `JSON_PRINT_WIDTH`.
|
|
1608
|
+
*
|
|
1609
|
+
* @example
|
|
1610
|
+
* ```ts
|
|
1611
|
+
* import { fitsPrintWidth } from '@orkestrel/scaffold'
|
|
1612
|
+
*
|
|
1613
|
+
* fitsPrintWidth('\t["ESNext"],') // true
|
|
1614
|
+
* ```
|
|
1615
|
+
*/
|
|
1616
|
+
function fitsPrintWidth(text) {
|
|
1617
|
+
return computeColumnWidth(text) <= 100;
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1601
1620
|
* Render a JSON array through `formatJson`'s inline-or-broken rule — inline
|
|
1602
1621
|
* when the rendered width (via `computeColumnWidth`) fits `JSON_PRINT_WIDTH`, one
|
|
1603
1622
|
* item per line otherwise.
|
|
@@ -1619,7 +1638,7 @@ function renderArray(entries, indent, prefix, suffix) {
|
|
|
1619
1638
|
if (entries.length === 0) return "[]";
|
|
1620
1639
|
const items = entries.map((entry) => renderValue(entry, indent, "", ""));
|
|
1621
1640
|
const inline = `[${items.join(", ")}]`;
|
|
1622
|
-
if (
|
|
1641
|
+
if (fitsPrintWidth(`${prefix}${inline}${suffix}`)) return inline;
|
|
1623
1642
|
const childIndent = `${indent}\t`;
|
|
1624
1643
|
return `[\n${items.map((item) => `${childIndent}${item}`).join(",\n")}\n${indent}]`;
|
|
1625
1644
|
}
|
|
@@ -1802,7 +1821,8 @@ function blueprintShape() {
|
|
|
1802
1821
|
overrides: arrayShape(overrideShape(), { max: MAX_COLLECTION_ITEMS }),
|
|
1803
1822
|
bin: booleanShape(),
|
|
1804
1823
|
integration: booleanShape(),
|
|
1805
|
-
service: booleanShape()
|
|
1824
|
+
service: booleanShape(),
|
|
1825
|
+
global: booleanShape()
|
|
1806
1826
|
});
|
|
1807
1827
|
}
|
|
1808
1828
|
/**
|
|
@@ -5772,7 +5792,7 @@ function viteMachinery(src, app = [], bin = false) {
|
|
|
5772
5792
|
*
|
|
5773
5793
|
* @param src - The declared published environments.
|
|
5774
5794
|
* @param app - The declared application environments.
|
|
5775
|
-
* @param
|
|
5795
|
+
* @param facts - Optional structural facts.
|
|
5776
5796
|
* @returns Source projects, application projects, proof projects, then optional axis projects.
|
|
5777
5797
|
*
|
|
5778
5798
|
* @example
|
|
@@ -5781,7 +5801,7 @@ function viteMachinery(src, app = [], bin = false) {
|
|
|
5781
5801
|
* // [{ project: 'srcCore' }, { project: 'policy' }, { project: 'guides' }, { project: 'integration' }]
|
|
5782
5802
|
* ```
|
|
5783
5803
|
*/
|
|
5784
|
-
function viteProjectRegistrations(src, app = [],
|
|
5804
|
+
function viteProjectRegistrations(src, app = [], facts = {}) {
|
|
5785
5805
|
const registrations = [];
|
|
5786
5806
|
for (const environment of ENVIRONMENTS) {
|
|
5787
5807
|
if (!src.includes(environment)) continue;
|
|
@@ -5802,15 +5822,15 @@ function viteProjectRegistrations(src, app = [], axes = {}) {
|
|
|
5802
5822
|
if (environment === "server") registrations.push({ project: "appServer" });
|
|
5803
5823
|
}
|
|
5804
5824
|
registrations.push({ project: "policy" }, { project: "guides" });
|
|
5805
|
-
if (
|
|
5806
|
-
if (
|
|
5807
|
-
if (
|
|
5825
|
+
if (facts.bin === true) registrations.push({ project: "srcBin" });
|
|
5826
|
+
if (facts.integration === true) registrations.push({ project: "integration" });
|
|
5827
|
+
if (facts.service === true) registrations.push({ project: "service" });
|
|
5808
5828
|
return registrations;
|
|
5809
5829
|
}
|
|
5810
5830
|
/**
|
|
5811
5831
|
* Render the one ordered proof and structural-axis project definition block.
|
|
5812
5832
|
*
|
|
5813
|
-
* @param
|
|
5833
|
+
* @param facts - Optional structural facts.
|
|
5814
5834
|
* @returns Policy, guides, then selected axis project definitions, separated by one blank line.
|
|
5815
5835
|
*
|
|
5816
5836
|
* @example
|
|
@@ -5818,11 +5838,11 @@ function viteProjectRegistrations(src, app = [], axes = {}) {
|
|
|
5818
5838
|
* viteProjectDefinitions({ bin: true }).includes('export const srcBin =') // true
|
|
5819
5839
|
* ```
|
|
5820
5840
|
*/
|
|
5821
|
-
function viteProjectDefinitions(
|
|
5841
|
+
function viteProjectDefinitions(facts = {}) {
|
|
5822
5842
|
const definitions = [policyViteProject(), guidesViteProject()];
|
|
5823
|
-
if (
|
|
5824
|
-
if (
|
|
5825
|
-
if (
|
|
5843
|
+
if (facts.bin === true) definitions.push(binViteProject());
|
|
5844
|
+
if (facts.integration === true) definitions.push(integrationViteProject(facts));
|
|
5845
|
+
if (facts.service === true) definitions.push(serviceViteProject());
|
|
5826
5846
|
return definitions.join("\n");
|
|
5827
5847
|
}
|
|
5828
5848
|
/**
|
|
@@ -5842,16 +5862,18 @@ function viteProjectDefinitions(axes = {}) {
|
|
|
5842
5862
|
function renderViteTest(registrations, browser) {
|
|
5843
5863
|
const projects = registrations.map((registration) => registration.project);
|
|
5844
5864
|
const inlineProjects = ` projects: [${projects.join(", ")}],`;
|
|
5845
|
-
const renderedProjects =
|
|
5865
|
+
const renderedProjects = fitsPrintWidth(inlineProjects) ? inlineProjects : ` projects: [
|
|
5846
5866
|
${projects.map((project) => ` ${project},`).join("\n")}
|
|
5847
5867
|
],`;
|
|
5848
5868
|
if (!browser) return ` test: {
|
|
5849
5869
|
${renderedProjects}
|
|
5850
5870
|
},`;
|
|
5871
|
+
const renderedRegistrations = registrations.map((registration) => registration.browser === void 0 ? `{ project: ${registration.project} }` : `{ project: ${registration.project}, browser: ${serializeTypeScriptString(registration.browser)} }`);
|
|
5872
|
+
const inlineRegistrations = ` [${renderedRegistrations.join(", ")}],`;
|
|
5851
5873
|
return ` test: gateBrowserProjects(
|
|
5852
|
-
[
|
|
5853
|
-
${
|
|
5854
|
-
]
|
|
5874
|
+
${fitsPrintWidth(inlineRegistrations) ? inlineRegistrations : ` [
|
|
5875
|
+
${renderedRegistrations.map((registration) => ` ${registration},`).join("\n")}
|
|
5876
|
+
],`}
|
|
5855
5877
|
hasChromium,
|
|
5856
5878
|
process.argv,
|
|
5857
5879
|
),`;
|
|
@@ -7448,17 +7470,17 @@ function binViteProject() {
|
|
|
7448
7470
|
/**
|
|
7449
7471
|
* Build the standalone Node-only installed-consumer integration proof project.
|
|
7450
7472
|
*
|
|
7451
|
-
* @param
|
|
7473
|
+
* @param facts - Optional structural facts controlling the shared global setup.
|
|
7452
7474
|
* @returns The emitted `integration` project definition.
|
|
7453
7475
|
*
|
|
7454
7476
|
* @example
|
|
7455
7477
|
* ```ts
|
|
7456
|
-
* integrationViteProject({ bin: true, integration: true }).includes(
|
|
7457
|
-
* "globalSetup: ['./tests/
|
|
7478
|
+
* integrationViteProject({ bin: true, integration: true, global: true }).includes(
|
|
7479
|
+
* "globalSetup: ['./tests/setupGlobal.ts']",
|
|
7458
7480
|
* ) // true
|
|
7459
7481
|
* ```
|
|
7460
7482
|
*/
|
|
7461
|
-
function integrationViteProject(
|
|
7483
|
+
function integrationViteProject(facts = {}) {
|
|
7462
7484
|
return `${EXPORT_KEYWORD} const integration = (config?: UserConfig): UserConfig =>
|
|
7463
7485
|
mergeConfig(
|
|
7464
7486
|
{
|
|
@@ -7467,8 +7489,8 @@ function integrationViteProject(axes = {}) {
|
|
|
7467
7489
|
name: { label: 'integration', color: 'blue' },
|
|
7468
7490
|
include: ['tests/integration/**/*.test.ts'],
|
|
7469
7491
|
setupFiles: ['./tests/setup.ts'],
|
|
7470
|
-
${
|
|
7471
|
-
globalSetup: ['
|
|
7492
|
+
${facts.bin === true && facts.integration === true && facts.global === true ? ` // Wire the template registry for the generated-consumer proof.
|
|
7493
|
+
globalSetup: ['./${GLOBAL_SETUP_PATH}'],
|
|
7472
7494
|
` : ""} environment: 'node',
|
|
7473
7495
|
browser: { enabled: false },
|
|
7474
7496
|
testTimeout: 120_000,
|
|
@@ -7519,7 +7541,7 @@ function serviceViteProject() {
|
|
|
7519
7541
|
* projects.
|
|
7520
7542
|
*
|
|
7521
7543
|
* @param environment - The sole declared non-`core` environment.
|
|
7522
|
-
* @param
|
|
7544
|
+
* @param facts - Optional structural facts.
|
|
7523
7545
|
* @returns The root `vite.config.ts` file content for a single non-`core` environment, newline-terminated.
|
|
7524
7546
|
*
|
|
7525
7547
|
* @example
|
|
@@ -7527,11 +7549,11 @@ function serviceViteProject() {
|
|
|
7527
7549
|
* singleSrcViteConfig('server').includes('srcServer') // true
|
|
7528
7550
|
* ```
|
|
7529
7551
|
*/
|
|
7530
|
-
function singleSrcViteConfig(environment,
|
|
7552
|
+
function singleSrcViteConfig(environment, facts = {}) {
|
|
7531
7553
|
const machinery = viteMachinery([environment]);
|
|
7532
7554
|
const header = viteHeader(machinery);
|
|
7533
|
-
const renderedTest = renderViteTest(viteProjectRegistrations([environment], [],
|
|
7534
|
-
const definitions = viteProjectDefinitions(
|
|
7555
|
+
const renderedTest = renderViteTest(viteProjectRegistrations([environment], [], facts), machinery.browser);
|
|
7556
|
+
const definitions = viteProjectDefinitions(facts);
|
|
7535
7557
|
if (environment === "browser") return `${header}
|
|
7536
7558
|
${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
7537
7559
|
mergeConfig(
|
|
@@ -7558,7 +7580,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7558
7580
|
test: {
|
|
7559
7581
|
name: { label: 'src:browser', color: 'yellow' },
|
|
7560
7582
|
include: ['tests/src/browser/**/*.test.ts'],
|
|
7561
|
-
setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
|
|
7583
|
+
${facts.global === true ? `globalSetup: ['./${GLOBAL_SETUP_PATH}'],\n\t\t\t\t` : ""}setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
|
|
7562
7584
|
...(config?.test?.browser?.enabled === false
|
|
7563
7585
|
? {}
|
|
7564
7586
|
: {
|
|
@@ -7647,9 +7669,9 @@ ${renderedTest}
|
|
|
7647
7669
|
* environment is `browser` (it must run its own tests in a real browser).
|
|
7648
7670
|
*
|
|
7649
7671
|
* @param src - The declared `Environment[]`.
|
|
7650
|
-
* @param
|
|
7651
|
-
*
|
|
7652
|
-
*
|
|
7672
|
+
* @param facts - Optional structural facts. `bin` appends the standalone executable
|
|
7673
|
+
* build-and-test project; `integration` and `service` append their standalone
|
|
7674
|
+
* proof projects; `global` wires the shared global-setup module.
|
|
7653
7675
|
* @returns The root `vite.config.ts` file content, newline-terminated.
|
|
7654
7676
|
*
|
|
7655
7677
|
* @example
|
|
@@ -7657,14 +7679,14 @@ ${renderedTest}
|
|
|
7657
7679
|
* rootViteConfig(['core']).includes('srcCore') // true
|
|
7658
7680
|
* ```
|
|
7659
7681
|
*/
|
|
7660
|
-
function rootViteConfig(src,
|
|
7682
|
+
function rootViteConfig(src, facts = {}) {
|
|
7661
7683
|
const hasCore = src.includes("core");
|
|
7662
7684
|
const nonCore = ENVIRONMENTS.filter((environment) => environment !== "core" && src.includes(environment));
|
|
7663
7685
|
const machinery = viteMachinery(src);
|
|
7664
7686
|
const header = viteHeader(machinery);
|
|
7665
7687
|
if (!hasCore) {
|
|
7666
7688
|
const [onlyEnvironment] = nonCore;
|
|
7667
|
-
if (onlyEnvironment === "browser" || onlyEnvironment === "server") return singleSrcViteConfig(onlyEnvironment,
|
|
7689
|
+
if (onlyEnvironment === "browser" || onlyEnvironment === "server") return singleSrcViteConfig(onlyEnvironment, facts);
|
|
7668
7690
|
}
|
|
7669
7691
|
const browserBlock = `
|
|
7670
7692
|
${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
@@ -7691,7 +7713,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7691
7713
|
name: { label: 'src:browser', color: 'yellow' },
|
|
7692
7714
|
include: ['tests/src/browser/**/*.test.ts'],
|
|
7693
7715
|
exclude: ['tests/src/core/**/*.test.ts'],
|
|
7694
|
-
setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
|
|
7716
|
+
${facts.global === true ? `globalSetup: ['./${GLOBAL_SETUP_PATH}'],\n\t\t\t\t\t` : ""}setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
|
|
7695
7717
|
...(config?.test?.browser?.enabled === false
|
|
7696
7718
|
? {}
|
|
7697
7719
|
: {
|
|
@@ -7759,7 +7781,7 @@ ${EXPORT_KEYWORD} const srcServer = (config?: UserConfig): UserConfig =>
|
|
|
7759
7781
|
)
|
|
7760
7782
|
`;
|
|
7761
7783
|
const blocks = nonCore.map((environment) => environment === "browser" ? browserBlock : serverBlock).join("");
|
|
7762
|
-
const renderedTest = renderViteTest(viteProjectRegistrations(src, [],
|
|
7784
|
+
const renderedTest = renderViteTest(viteProjectRegistrations(src, [], facts), machinery.browser);
|
|
7763
7785
|
return `${header}
|
|
7764
7786
|
${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
|
|
7765
7787
|
mergeConfig(
|
|
@@ -7782,7 +7804,7 @@ ${EXPORT_KEYWORD} const srcCore = (config?: UserConfig): UserConfig =>
|
|
|
7782
7804
|
config ?? {},
|
|
7783
7805
|
)
|
|
7784
7806
|
${blocks}
|
|
7785
|
-
${viteProjectDefinitions(
|
|
7807
|
+
${viteProjectDefinitions(facts)}
|
|
7786
7808
|
export default defineConfig({
|
|
7787
7809
|
resolve,
|
|
7788
7810
|
${renderedTest}
|
|
@@ -7795,7 +7817,7 @@ ${renderedTest}
|
|
|
7795
7817
|
*
|
|
7796
7818
|
* @param src - Published src environments.
|
|
7797
7819
|
* @param app - Private app environments.
|
|
7798
|
-
* @param
|
|
7820
|
+
* @param facts - Optional structural facts.
|
|
7799
7821
|
* @returns The root `vite.config.ts` content.
|
|
7800
7822
|
*
|
|
7801
7823
|
* @example
|
|
@@ -7803,9 +7825,9 @@ ${renderedTest}
|
|
|
7803
7825
|
* applicationViteConfig([], ['core', 'server']).includes('appServer') // true
|
|
7804
7826
|
* ```
|
|
7805
7827
|
*/
|
|
7806
|
-
function applicationViteConfig(src, app,
|
|
7828
|
+
function applicationViteConfig(src, app, facts = {}) {
|
|
7807
7829
|
const hasSourceCore = src.includes("core");
|
|
7808
|
-
const machinery = viteMachinery(src, app,
|
|
7830
|
+
const machinery = viteMachinery(src, app, facts.bin === true);
|
|
7809
7831
|
const header = viteHeader(machinery);
|
|
7810
7832
|
const blocks = [];
|
|
7811
7833
|
if (src.includes("core")) blocks.push(`
|
|
@@ -7857,7 +7879,7 @@ ${EXPORT_KEYWORD} const srcBrowser = (config?: UserConfig): UserConfig =>
|
|
|
7857
7879
|
test: {
|
|
7858
7880
|
name: { label: 'src:browser', color: 'yellow' },
|
|
7859
7881
|
include: ['tests/src/browser/**/*.test.ts'],
|
|
7860
|
-
${hasSourceCore ? "exclude: ['tests/src/core/**/*.test.ts'],\n " : ""}setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
|
|
7882
|
+
${hasSourceCore ? "exclude: ['tests/src/core/**/*.test.ts'],\n " : ""}${facts.global === true ? `globalSetup: ['./${GLOBAL_SETUP_PATH}'],\n\t\t\t\t` : ""}setupFiles: ['./tests/setup.ts', './tests/setupBrowser.ts'],
|
|
7861
7883
|
...(config?.test?.browser?.enabled === false
|
|
7862
7884
|
? {}
|
|
7863
7885
|
: {
|
|
@@ -8040,8 +8062,8 @@ ${EXPORT_KEYWORD} const appServer = (config?: UserConfig): UserConfig =>
|
|
|
8040
8062
|
config ?? {},
|
|
8041
8063
|
)
|
|
8042
8064
|
`);
|
|
8043
|
-
const renderedTest = renderViteTest(viteProjectRegistrations(src, app,
|
|
8044
|
-
const definitions = viteProjectDefinitions(
|
|
8065
|
+
const renderedTest = renderViteTest(viteProjectRegistrations(src, app, facts), machinery.browser);
|
|
8066
|
+
const definitions = viteProjectDefinitions(facts);
|
|
8045
8067
|
return `${header}${blocks.join("")}
|
|
8046
8068
|
${definitions}
|
|
8047
8069
|
export default defineConfig({
|
|
@@ -8454,7 +8476,7 @@ function configArtifacts(spec) {
|
|
|
8454
8476
|
*/
|
|
8455
8477
|
function sourceArtifacts(spec, pascal) {
|
|
8456
8478
|
const inlineTypeImport = `import type { ${pascal}Interface, ${pascal}Options } from './types.js'`;
|
|
8457
|
-
const typeImport =
|
|
8479
|
+
const typeImport = fitsPrintWidth(inlineTypeImport) ? inlineTypeImport : `import type {
|
|
8458
8480
|
${pascal}Interface,
|
|
8459
8481
|
${pascal}Options,
|
|
8460
8482
|
} from './types.js'`;
|
|
@@ -8462,7 +8484,7 @@ function sourceArtifacts(spec, pascal) {
|
|
|
8462
8484
|
const inlineSignature = `function create${pascal}(options: ${pascal}Options): ${pascal}Interface`;
|
|
8463
8485
|
const values = {
|
|
8464
8486
|
pascal,
|
|
8465
|
-
signature:
|
|
8487
|
+
signature: fitsPrintWidth(`export ${inlineSignature} {`) ? inlineSignature : `function create${pascal}(
|
|
8466
8488
|
options: ${pascal}Options,
|
|
8467
8489
|
): ${pascal}Interface`,
|
|
8468
8490
|
typeImport,
|
|
@@ -8536,7 +8558,7 @@ function paritySpecifiers(spec) {
|
|
|
8536
8558
|
for (const environment of spec.app) modules[`@app/${environment}`] = `app/${environment}`;
|
|
8537
8559
|
const specifierItems = selfSpecifiers.map((specifier) => `'${specifier}'`);
|
|
8538
8560
|
const inlineSpecifierList = `[${specifierItems.join(", ")}]`;
|
|
8539
|
-
return `${EXPORT_KEYWORD} ${CONST_KEYWORD} SELF_SPECIFIERS = ${
|
|
8561
|
+
return `${EXPORT_KEYWORD} ${CONST_KEYWORD} SELF_SPECIFIERS = ${fitsPrintWidth(`const SELF_SPECIFIERS = ${inlineSpecifierList}`) ? inlineSpecifierList : `[
|
|
8540
8562
|
${specifierItems.map((specifier) => `\t${specifier},`).join("\n")}
|
|
8541
8563
|
]`}
|
|
8542
8564
|
|
|
@@ -8615,25 +8637,25 @@ function testArtifacts(spec, pascal) {
|
|
|
8615
8637
|
const multilineExplicitInstance = `instance: ${pascal}Interface = new ${pascal}({
|
|
8616
8638
|
id: 'example',
|
|
8617
8639
|
})`;
|
|
8618
|
-
const explicitInstance =
|
|
8640
|
+
const explicitInstance = fitsPrintWidth(`\t\tconst ${inlineExplicitInstance}`) ? inlineExplicitInstance : fitsPrintWidth(`\t\tconst instance: ${pascal}Interface = new ${pascal}({`) ? multilineExplicitInstance : `instance: ${pascal}Interface =
|
|
8619
8641
|
new ${pascal}({
|
|
8620
8642
|
id: 'example',
|
|
8621
8643
|
})`;
|
|
8622
8644
|
const inlineValueImport = `import { create${pascal}, ${pascal} } from '@src/core'`;
|
|
8623
|
-
const valueImport =
|
|
8645
|
+
const valueImport = fitsPrintWidth(inlineValueImport) ? inlineValueImport : `import {
|
|
8624
8646
|
create${pascal},
|
|
8625
8647
|
${pascal},
|
|
8626
8648
|
} from '@src/core'`;
|
|
8627
8649
|
const inlineTestTypeImport = `import type { ${pascal}Interface } from '@src/core'`;
|
|
8628
|
-
const testTypeImport =
|
|
8650
|
+
const testTypeImport = fitsPrintWidth(inlineTestTypeImport) ? inlineTestTypeImport : `import type {
|
|
8629
8651
|
${pascal}Interface,
|
|
8630
8652
|
} from '@src/core'`;
|
|
8631
8653
|
const inlineFactoryInstance = `instance = create${pascal}({ id: 'example' })`;
|
|
8632
|
-
const factoryInstance =
|
|
8654
|
+
const factoryInstance = fitsPrintWidth(`\t\tconst ${inlineFactoryInstance}`) ? inlineFactoryInstance : `instance = create${pascal}({
|
|
8633
8655
|
id: 'example',
|
|
8634
8656
|
})`;
|
|
8635
8657
|
const inlineTypeExpectation = `expectTypeOf(create${pascal}({ id: 'example' })).toEqualTypeOf<${pascal}Interface>()`;
|
|
8636
|
-
const typeExpectation =
|
|
8658
|
+
const typeExpectation = fitsPrintWidth(`\t\t${inlineTypeExpectation}`) ? inlineTypeExpectation : `expectTypeOf(
|
|
8637
8659
|
create${pascal}({ id: 'example' }),
|
|
8638
8660
|
).toEqualTypeOf<${pascal}Interface>()`;
|
|
8639
8661
|
for (const environment of spec.src) {
|
|
@@ -9565,6 +9587,6 @@ function createBlueprint(data) {
|
|
|
9565
9587
|
return candidate;
|
|
9566
9588
|
}
|
|
9567
9589
|
//#endregion
|
|
9568
|
-
export { APP_BROWSER_DEV_DEPENDENCIES, APP_MATRIX, BASE_DEV_DEPENDENCIES, BIN_CONFIGS, CATEGORIES, CHECKOUT_ACTION_SHA, COMPILER_ID, COMPILE_STAGES, CONST_KEYWORD, CONTROL_CHARACTER_PATTERN, Compiler, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, ENGINES_PATTERN, ENVIRONMENTS, EXPORT_KEYWORD, EXTRA_NAME_PATTERN, EXTRA_RANGE_PATTERN, FRESHNESS, FUNCTION_KEYWORD, GROUPS, HEX_PATTERN, HOST_PATHS, IMPORT_KEYWORD, INVALID_PATH_CHARACTER_PATTERN, JSON_PRINT_WIDTH, JSON_TAB_WIDTH, MAX_ARTIFACT_BYTES, MAX_ARTIFACT_HEX_LENGTH, MAX_COLLECTION_ITEMS, MAX_DATA_GRAPH_KEYS, MAX_DATA_GRAPH_NODES, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_NAME_LENGTH, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_SERIALIZED_INPUT_BYTES, MAX_TOTAL_ARTIFACT_BYTES, MINIMUM_NODE_VERSION, NAME_PATTERN, ORIGINS, ORKESTREL_RANGE_PATTERN, PlanManager, SCAFFOLD_RANGE, SERVICE_SCRIPT_PATH, SETUP_NODE_ACTION_SHA, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, SYNC_BASELINE_PATTERN, ScaffoldError, TEMPLATES, TYPESCRIPT_EXTENSIONS, VERSION_PATTERN, alignTable, appTsconfig, appViteConfig, applicationArtifacts, applicationViteConfig, applyOverrides, artifactShape, auditToReview, binTsconfig, binViteConfig, binViteProject, blueprint, blueprintShape, blueprintToMembers, blueprintToPlan, bytesToHex, catalogNames, catalogToBlock, ciWorkflow, compareCodeUnit, computeColumnWidth, computeHash, configArtifacts, contentByteLength, contentCodePoint, contentToBytes, contentToHex, coreTsconfig, coreViteConfig, createBlueprint, createCompiler, createPlanManager, delimiterCell, dependency, dependencyShape, devDependenciesFor, diffPlan, dualCondition, entryFields, escapeHtmlText, exportsMap, fillArtifact, findFileConflict, findPathConflict, formatJson, guideArtifacts, guideMemberTable, guideMethods, guideTests, guideUsage, guidesViteProject, hasBlueprintEnvironment, hasOnlyDataProperties, hasValidArtifactBytes, hasValidArtifactHex, hasValidAuditBytes, hasValidBlueprintBytes, hasValidOverrideBytes, hasValidPlanBytes, hasValidPlanHex, hasValidSnapshotBytes, hasValidSyncReportBytes, hostGroup, inferGroup, integrationViteProject, isArtifact, isBehind, isBlueprint, isCompilerEventHooks, isDenseDataArray, isDependency, isEmitterErrorHandler, isMember, isOverride, isPlan, isPlanManagerEventHooks, isScaffoldError, isSyncReport, isWorkspaceName, manifestToDependencies, manifestToName, member, memberShape, override, overrideShape, ownDataValue, packageManifest, padCell, paritySpecifiers, parseBlueprint, parseBoundedJSON, parseCompilerOptions, parsePlan, parsePlanIds, parsePlanManagerOptions, parseSyncReport, pascalCase, pinPlan, planPayload, planShape, planToReview, planToSummary, policyViteProject, rangeToFreshness, renderArray, renderObject, renderValue, renderViteTest, rootTsconfig, rootViteConfig, selectHostPaths, serializeTypeScriptString, serviceViteProject, singleSrcViteConfig, snapshotOf, snapshotPlan, sourceArtifacts, splitTableRow, srcTsconfig, srcVariant, srcViteConfig, stableStringify, syncReportShape, syncToReview, testArtifacts, validateBlueprint, validateDependencyArray, validatePlan, viteHeader, viteMachinery, viteProjectDefinitions, viteProjectRegistrations };
|
|
9590
|
+
export { APP_BROWSER_DEV_DEPENDENCIES, APP_MATRIX, BASE_DEV_DEPENDENCIES, BIN_CONFIGS, CATEGORIES, CHECKOUT_ACTION_SHA, COMPILER_ID, COMPILE_STAGES, CONST_KEYWORD, CONTROL_CHARACTER_PATTERN, Compiler, DEFAULT_ENGINES, DEFAULT_VERSION, DEPENDENCY_NAME_PATTERN, ENGINES_PATTERN, ENVIRONMENTS, EXPORT_KEYWORD, EXTRA_NAME_PATTERN, EXTRA_RANGE_PATTERN, FRESHNESS, FUNCTION_KEYWORD, GLOBAL_SETUP_PATH, GROUPS, HEX_PATTERN, HOST_PATHS, IMPORT_KEYWORD, INVALID_PATH_CHARACTER_PATTERN, JSON_PRINT_WIDTH, JSON_TAB_WIDTH, MAX_ARTIFACT_BYTES, MAX_ARTIFACT_HEX_LENGTH, MAX_COLLECTION_ITEMS, MAX_DATA_GRAPH_KEYS, MAX_DATA_GRAPH_NODES, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_NAME_LENGTH, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_SERIALIZED_INPUT_BYTES, MAX_TOTAL_ARTIFACT_BYTES, MINIMUM_NODE_VERSION, NAME_PATTERN, ORIGINS, ORKESTREL_RANGE_PATTERN, PlanManager, SCAFFOLD_RANGE, SERVICE_SCRIPT_PATH, SETUP_NODE_ACTION_SHA, SOURCE_BROWSER_DEV_DEPENDENCIES, SRC_MATRIX, SYNC_BASELINE_PATTERN, ScaffoldError, TEMPLATES, TYPESCRIPT_EXTENSIONS, VERSION_PATTERN, alignTable, appTsconfig, appViteConfig, applicationArtifacts, applicationViteConfig, applyOverrides, artifactShape, auditToReview, binTsconfig, binViteConfig, binViteProject, blueprint, blueprintShape, blueprintToMembers, blueprintToPlan, bytesToHex, catalogNames, catalogToBlock, ciWorkflow, compareCodeUnit, computeColumnWidth, computeHash, configArtifacts, contentByteLength, contentCodePoint, contentToBytes, contentToHex, coreTsconfig, coreViteConfig, createBlueprint, createCompiler, createPlanManager, delimiterCell, dependency, dependencyShape, devDependenciesFor, diffPlan, dualCondition, entryFields, escapeHtmlText, exportsMap, fillArtifact, findFileConflict, findPathConflict, fitsPrintWidth, formatJson, guideArtifacts, guideMemberTable, guideMethods, guideTests, guideUsage, guidesViteProject, hasBlueprintEnvironment, hasOnlyDataProperties, hasValidArtifactBytes, hasValidArtifactHex, hasValidAuditBytes, hasValidBlueprintBytes, hasValidOverrideBytes, hasValidPlanBytes, hasValidPlanHex, hasValidSnapshotBytes, hasValidSyncReportBytes, hostGroup, inferGroup, integrationViteProject, isArtifact, isBehind, isBlueprint, isCompilerEventHooks, isDenseDataArray, isDependency, isEmitterErrorHandler, isMember, isOverride, isPlan, isPlanManagerEventHooks, isScaffoldError, isSyncReport, isWorkspaceName, manifestToDependencies, manifestToName, member, memberShape, override, overrideShape, ownDataValue, packageManifest, padCell, paritySpecifiers, parseBlueprint, parseBoundedJSON, parseCompilerOptions, parsePlan, parsePlanIds, parsePlanManagerOptions, parseSyncReport, pascalCase, pinPlan, planPayload, planShape, planToReview, planToSummary, policyViteProject, rangeToFreshness, renderArray, renderObject, renderValue, renderViteTest, rootTsconfig, rootViteConfig, selectHostPaths, serializeTypeScriptString, serviceViteProject, singleSrcViteConfig, snapshotOf, snapshotPlan, sourceArtifacts, splitTableRow, srcTsconfig, srcVariant, srcViteConfig, stableStringify, syncReportShape, syncToReview, testArtifacts, validateBlueprint, validateDependencyArray, validatePlan, viteHeader, viteMachinery, viteProjectDefinitions, viteProjectRegistrations };
|
|
9569
9591
|
|
|
9570
9592
|
//# sourceMappingURL=index.js.map
|