vize 0.442.0 → 0.454.0
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/cli.mjs +28 -73
- package/dist/cli.mjs.map +1 -1
- package/dist/config-BzFi1lsl.mjs +474 -0
- package/dist/config-BzFi1lsl.mjs.map +1 -0
- package/dist/{config-Cd_SsYdd.d.mts → config-D6OxWiSS.d.mts} +22 -5
- package/dist/config-D6OxWiSS.d.mts.map +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
- package/pkl/CompilerConfig.pkl +1 -1
- package/pkl/jsonschema/ConfigArtifactDefinitions.pkl +1 -1
- package/pkl/vize.pkl +1 -1
- package/schemas/vize.config.schema.json +1 -1
- package/src/config/vite-runtime.d.mts +1 -0
- package/src/config/vite-runtime.mjs +2 -0
- package/src/config.ts +48 -10
- package/src/index.ts +4 -0
- package/src/init/detect.ts +20 -0
- package/src/init/plan-project.ts +17 -30
- package/src/init/plan.ts +2 -2
- package/src/init/templates.ts +0 -51
- package/src/setup/config.ts +0 -20
- package/src/setup.ts +14 -4
- package/src/types/generated.ts +1 -1
- package/src/types/index.ts +2 -0
- package/src/types/rules.ts +4 -0
- package/src/types/runtime.ts +26 -0
- package/dist/config-Cd_SsYdd.d.mts.map +0 -1
- package/dist/config-ld0utx-D.mjs +0 -237
- package/dist/config-ld0utx-D.mjs.map +0 -1
package/src/init/plan-project.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { DEFAULT_SCRIPTS, detectJsonIndent, parsePackageJson } from "../setup/co
|
|
|
5
5
|
import type { ProjectDetection } from "./detect.js";
|
|
6
6
|
import { skipped, type PlanDraft } from "./plan-types.js";
|
|
7
7
|
import type { FeatureId, FeatureSelection } from "./select.js";
|
|
8
|
-
import { renderTypecheckTsconfig
|
|
8
|
+
import { renderTypecheckTsconfig } from "./templates.js";
|
|
9
9
|
|
|
10
10
|
/** Scripts each feature contributes, reusing the command strings `setup` ships. */
|
|
11
11
|
const FEATURE_SCRIPTS: Readonly<Record<FeatureId, readonly string[]>> = {
|
|
@@ -17,14 +17,13 @@ const FEATURE_SCRIPTS: Readonly<Record<FeatureId, readonly string[]>> = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Plans
|
|
20
|
+
* Plans the typecheck scaffold and the fmt/typecheck feature results.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* guess that loses their settings.
|
|
22
|
+
* CLI tools use project settings and sensible defaults without a dedicated
|
|
23
|
+
* config. Only typechecking needs a tsconfig scaffold; existing project and Vize
|
|
24
|
+
* configs keep their exact contents.
|
|
26
25
|
*/
|
|
27
|
-
export function
|
|
26
|
+
export function planToolSettings(
|
|
28
27
|
detection: ProjectDetection,
|
|
29
28
|
selection: FeatureSelection,
|
|
30
29
|
draft: PlanDraft,
|
|
@@ -46,34 +45,22 @@ export function planVizeConfig(
|
|
|
46
45
|
continue;
|
|
47
46
|
}
|
|
48
47
|
const scaffoldsTsconfig = id === "typecheck" && detection.tsconfig === null;
|
|
48
|
+
const addsScripts = FEATURE_SCRIPTS[id].some((name) => !(name in detection.scripts));
|
|
49
|
+
const detail = scaffoldsTsconfig
|
|
50
|
+
? "writes tsconfig.json"
|
|
51
|
+
: id === "typecheck"
|
|
52
|
+
? "uses tsconfig.json and project settings"
|
|
53
|
+
: "uses project settings and formatter defaults";
|
|
49
54
|
draft.features.push({
|
|
50
55
|
id,
|
|
51
|
-
outcome: scaffoldsTsconfig ||
|
|
52
|
-
detail:
|
|
53
|
-
|
|
54
|
-
?
|
|
55
|
-
:
|
|
56
|
-
: detection.vizeConfig === null
|
|
57
|
-
? "writes vize.config.ts"
|
|
58
|
-
: `${detection.vizeConfig} already exists and was left unchanged`,
|
|
56
|
+
outcome: scaffoldsTsconfig || addsScripts ? "configured" : "unchanged",
|
|
57
|
+
detail:
|
|
58
|
+
detection.vizeConfig === null
|
|
59
|
+
? detail
|
|
60
|
+
: `${detail}; ${detection.vizeConfig} already exists and was left unchanged`,
|
|
59
61
|
snippet: null,
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
|
-
|
|
63
|
-
const needsConfig = selection.lint || selection.fmt || selection.typecheck;
|
|
64
|
-
if (!needsConfig || detection.vizeConfig !== null) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
draft.files.push({
|
|
68
|
-
filename: path.join(detection.root, "vize.config.ts"),
|
|
69
|
-
source: renderVizeConfig({
|
|
70
|
-
lint: selection.lint,
|
|
71
|
-
fmt: selection.fmt,
|
|
72
|
-
typecheck: selection.typecheck,
|
|
73
|
-
vite: detection.framework === "vite",
|
|
74
|
-
}),
|
|
75
|
-
});
|
|
76
|
-
draft.createdFiles.push("vize.config.ts");
|
|
77
64
|
}
|
|
78
65
|
|
|
79
66
|
/**
|
package/src/init/plan.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { resolveLintTarget } from "./lint-target.js";
|
|
|
6
6
|
import { planBundler } from "./plan-bundler.js";
|
|
7
7
|
import { planEditorFile } from "./plan-editor.js";
|
|
8
8
|
import { planLint } from "./plan-lint.js";
|
|
9
|
-
import { planScripts,
|
|
9
|
+
import { planScripts, planToolSettings } from "./plan-project.js";
|
|
10
10
|
import {
|
|
11
11
|
createPlanDraft,
|
|
12
12
|
skipped,
|
|
@@ -80,7 +80,7 @@ export function planInit(options: PlanInitOptions): InitPlan {
|
|
|
80
80
|
draft.updatedFiles.push(filename);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
planToolSettings(detection, selection, draft);
|
|
84
84
|
for (const id of ["fmt", "typecheck"] as const) {
|
|
85
85
|
if (selection[id]) {
|
|
86
86
|
addAll(draft.dependencies, FEATURE_DEPENDENCIES[id]);
|
package/src/init/templates.ts
CHANGED
|
@@ -15,57 +15,6 @@ export const INIT_LINT_HELP_LEVEL = "short";
|
|
|
15
15
|
/** VS Code extension id published from `editors/vscode`. */
|
|
16
16
|
export const VSCODE_EXTENSION_ID = "ubugeeei.vize";
|
|
17
17
|
|
|
18
|
-
export interface VizeConfigFeatures {
|
|
19
|
-
readonly lint: boolean;
|
|
20
|
-
readonly fmt: boolean;
|
|
21
|
-
readonly typecheck: boolean;
|
|
22
|
-
readonly vite: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Builds `vize.config.ts` from the selected features.
|
|
27
|
-
*
|
|
28
|
-
* Only selected features contribute a block, so a project that asked for the
|
|
29
|
-
* formatter alone does not silently get a type checker it never opted into.
|
|
30
|
-
*/
|
|
31
|
-
export function renderVizeConfig(features: VizeConfigFeatures): string {
|
|
32
|
-
const blocks: string[] = [
|
|
33
|
-
` compiler: {
|
|
34
|
-
templateSyntax: "standard",
|
|
35
|
-
},`,
|
|
36
|
-
];
|
|
37
|
-
if (features.lint) {
|
|
38
|
-
blocks.push(` linter: {
|
|
39
|
-
enabled: true,
|
|
40
|
-
preset: "${INIT_LINT_PRESET}",
|
|
41
|
-
},`);
|
|
42
|
-
}
|
|
43
|
-
if (features.fmt) {
|
|
44
|
-
blocks.push(` formatter: {
|
|
45
|
-
singleAttributePerLine: false,
|
|
46
|
-
sortBlocks: true,
|
|
47
|
-
},`);
|
|
48
|
-
}
|
|
49
|
-
if (features.typecheck) {
|
|
50
|
-
blocks.push(` typeChecker: {
|
|
51
|
-
enabled: true,
|
|
52
|
-
strict: true,
|
|
53
|
-
jsxTypecheck: true,
|
|
54
|
-
},`);
|
|
55
|
-
}
|
|
56
|
-
if (features.vite) {
|
|
57
|
-
blocks.push(` vite: {
|
|
58
|
-
scanPatterns: ["src/**/*.vue"],
|
|
59
|
-
},`);
|
|
60
|
-
}
|
|
61
|
-
return `import { defineConfig } from "vize";
|
|
62
|
-
|
|
63
|
-
export default defineConfig({
|
|
64
|
-
${blocks.join("\n")}
|
|
65
|
-
});
|
|
66
|
-
`;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
18
|
/** Minimum project config written only when typechecking is selected and no config exists. */
|
|
70
19
|
export function renderTypecheckTsconfig(typescript: boolean, nuxtMajor?: number | null): string {
|
|
71
20
|
if (nuxtMajor !== undefined) {
|
package/src/setup/config.ts
CHANGED
|
@@ -51,26 +51,6 @@ export const DEFAULT_SCRIPTS = {
|
|
|
51
51
|
"vize:ready": "vize ready src",
|
|
52
52
|
} as const;
|
|
53
53
|
|
|
54
|
-
export const DEFAULT_VIZE_CONFIG = `import { defineConfig } from "vize";
|
|
55
|
-
|
|
56
|
-
export default defineConfig({
|
|
57
|
-
compiler: {
|
|
58
|
-
templateSyntax: "standard",
|
|
59
|
-
},
|
|
60
|
-
linter: {
|
|
61
|
-
preset: "happy-path",
|
|
62
|
-
},
|
|
63
|
-
typeChecker: {
|
|
64
|
-
enabled: true,
|
|
65
|
-
strict: true,
|
|
66
|
-
jsxTypecheck: true,
|
|
67
|
-
},
|
|
68
|
-
vite: {
|
|
69
|
-
scanPatterns: ["src/**/*.vue"],
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
54
|
export const DEFAULT_OXLINT_CONFIG = `import { defineConfig } from "oxlint";
|
|
75
55
|
import { configs } from "oxlint-plugin-vize";
|
|
76
56
|
|
package/src/setup.ts
CHANGED
|
@@ -2,11 +2,12 @@ import { execFileSync } from "node:child_process";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
import { detectProject } from "./init/detect.js";
|
|
6
|
+
import { renderTypecheckTsconfig } from "./init/templates.js";
|
|
5
7
|
import {
|
|
6
8
|
addDefaultScripts,
|
|
7
9
|
atomicWriteFile,
|
|
8
10
|
DEFAULT_OXLINT_CONFIG,
|
|
9
|
-
DEFAULT_VIZE_CONFIG,
|
|
10
11
|
dependencyNames,
|
|
11
12
|
detectJsonIndent,
|
|
12
13
|
DISCOVERED_OXLINT_CONFIG_FILES,
|
|
@@ -58,11 +59,20 @@ export function setupProject(options: SetupOptions): SetupResult {
|
|
|
58
59
|
const createdFiles: string[] = [];
|
|
59
60
|
const preservedFiles: string[] = [];
|
|
60
61
|
const plannedFiles: PlannedFile[] = [];
|
|
62
|
+
const detection = detectProject(root);
|
|
63
|
+
for (const filename of VIZE_CONFIG_FILES) {
|
|
64
|
+
if (fs.existsSync(path.join(root, filename))) {
|
|
65
|
+
preservedFiles.push(filename);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
61
68
|
planGeneratedConfig(
|
|
62
69
|
root,
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
70
|
+
["tsconfig.json"],
|
|
71
|
+
"tsconfig.json",
|
|
72
|
+
renderTypecheckTsconfig(
|
|
73
|
+
detection.typescript,
|
|
74
|
+
detection.framework === "nuxt" ? detection.nuxtMajor : undefined,
|
|
75
|
+
),
|
|
66
76
|
plannedFiles,
|
|
67
77
|
createdFiles,
|
|
68
78
|
preservedFiles,
|
package/src/types/generated.ts
CHANGED
|
@@ -112,7 +112,7 @@ export interface CompilerConfig {
|
|
|
112
112
|
/**
|
|
113
113
|
* Vue template whitespace strategy or opt-in Vue 2 line-break migration mode
|
|
114
114
|
*/
|
|
115
|
-
whitespace?: "condense" | "preserve" | "vue2-line-breaks";
|
|
115
|
+
whitespace?: "condense" | "preserve" | "vue2-line-breaks" | "vue2-preserve";
|
|
116
116
|
/**
|
|
117
117
|
* Enable source map generation
|
|
118
118
|
*/
|
package/src/types/index.ts
CHANGED
package/src/types/rules.ts
CHANGED
|
@@ -174,6 +174,7 @@ export const LINT_RULE_NAMES = [
|
|
|
174
174
|
"vue/no-deprecated-slot-attribute",
|
|
175
175
|
"vue/no-deprecated-slot-scope-attribute",
|
|
176
176
|
"vue/no-deprecated-v-bind-sync",
|
|
177
|
+
"vue/no-deprecated-v-is",
|
|
177
178
|
"vue/no-deprecated-v-on-native-modifier",
|
|
178
179
|
"vue/no-deprecated-v-on-number-modifiers",
|
|
179
180
|
"vue/no-dupe-v-else-if",
|
|
@@ -242,13 +243,16 @@ export const LINT_RULE_NAMES = [
|
|
|
242
243
|
"vue/valid-v-bind",
|
|
243
244
|
"vue/valid-v-cloak",
|
|
244
245
|
"vue/valid-v-else",
|
|
246
|
+
"vue/valid-v-else-if",
|
|
245
247
|
"vue/valid-v-for",
|
|
246
248
|
"vue/valid-v-html",
|
|
247
249
|
"vue/valid-v-if",
|
|
250
|
+
"vue/valid-v-is",
|
|
248
251
|
"vue/valid-v-memo",
|
|
249
252
|
"vue/valid-v-model",
|
|
250
253
|
"vue/valid-v-on",
|
|
251
254
|
"vue/valid-v-once",
|
|
255
|
+
"vue/valid-v-pre",
|
|
252
256
|
"vue/valid-v-show",
|
|
253
257
|
"vue/valid-v-slot",
|
|
254
258
|
"vue/valid-v-text",
|
package/src/types/runtime.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface ConfigEnv {
|
|
|
10
10
|
mode: string;
|
|
11
11
|
command: "serve" | "build" | "check" | "lint" | "fmt";
|
|
12
12
|
isSsrBuild?: boolean;
|
|
13
|
+
isPreview?: boolean;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export type VueConfig = {
|
|
@@ -19,6 +20,28 @@ export type VueConfig = {
|
|
|
19
20
|
version?: VueVersion;
|
|
20
21
|
};
|
|
21
22
|
|
|
23
|
+
/** Native Vue settings shared by Vite, Vite+, the CLI projection and the editor. */
|
|
24
|
+
type VueOptionKeys =
|
|
25
|
+
| "compiler"
|
|
26
|
+
| "typeChecker"
|
|
27
|
+
| "linter"
|
|
28
|
+
| "formatter"
|
|
29
|
+
| "languageServer"
|
|
30
|
+
| "globalTypes"
|
|
31
|
+
| "files"
|
|
32
|
+
| "ignores"
|
|
33
|
+
| "basePath"
|
|
34
|
+
| "lib";
|
|
35
|
+
|
|
36
|
+
/** Scoped policy currently supported by the native configuration model. */
|
|
37
|
+
export type VueOptionsEntry = Pick<VizeConfigEntry, "basePath" | "files" | "ignores" | "linter">;
|
|
38
|
+
|
|
39
|
+
/** Section option values reuse the native types rather than a second schema. */
|
|
40
|
+
export type VueOptions = Pick<VizeConfig, VueOptionKeys> & {
|
|
41
|
+
version?: VueVersion;
|
|
42
|
+
entries?: VueOptionsEntry[];
|
|
43
|
+
};
|
|
44
|
+
|
|
22
45
|
export type UserConfigEntry = VizeConfigEntry & {
|
|
23
46
|
/**
|
|
24
47
|
* Shared Vue dialect section accepted by the Rust config model.
|
|
@@ -75,6 +98,9 @@ export interface LoadConfigOptions {
|
|
|
75
98
|
*/
|
|
76
99
|
configFile?: string;
|
|
77
100
|
|
|
101
|
+
/** Read Vite settings during discovery. Integrations with an already loaded Vite config use false. */
|
|
102
|
+
viteConfig?: boolean;
|
|
103
|
+
|
|
78
104
|
/**
|
|
79
105
|
* Config environment for dynamic config resolution
|
|
80
106
|
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-Cd_SsYdd.d.mts","names":[],"sources":["../src/types/generated.ts","../src/types/rules.ts","../src/types/runtime.ts","../src/types/index.ts","../src/config.ts"],"mappings":";;AAOA;;;;KAAY,UAAA;AAAA,KAQA,YAAA;AAAA,KAEA,YAAA;;;AAFY;KAOZ,UAAA;;;;UAKK,UAAA;EALL;;;EASV,IAAA;EAToB;AAKtB;;EAQE,QAAA;EAiBW;;;EAbX,KAAA;EAyBY;;;EArBZ,OAAA;EAyBc;;;EArBd,OAAA;EA0ByB;;;EAtBzB,OAAA;EACA,QAAA,GAAW,cAAA;EACX,aAAA;IAAA,CACG,CAAA;MAAA,CAGM,CAAA;IAAA;EAAA;EAIT,IAAA,GAAO,gBAAA;EACP,MAAA,GAAS,YAAA;EACT,WAAA,GAAc,iBAAA;EACd,SAAA,GAAY,eAAA;EACZ,cAAA,GAAiB,oBAAA;EACjB,GAAA,GAAM,oBAAA;EACN,KAAA,GAAQ,WAAA;EACR,WAAA,GAAc,iBAAA;EACd,GAAA,GAAM,SAAA;EALM;;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eAAA;AAAA,UAMrB,iBAAA;EFVJ;;;;;;;EEkBX,IAAA;EFPA;;;EEYA,UAAA;EFVA;;;EEeA,GAAA,GAAM,SAAS;AAAA;;;;;;KCjDL,SAAA,GAAS,oBAAgD;;;cCVxD,iBAAA;AAAA,cAeA,4BAAA;AAAA,cAMA,2BAAA;;AJnCS;AAQtB;;iBIiCgB,YAAA,CAAa,MAAA,EAAQ,gBAAA,GAAmB,gBAAgB;;AJjChD;AAExB;iBIsCsB,UAAA,CACpB,IAAA,UACA,OAAA,GAAS,iBAAA,GACR,OAAA,CAAQ,kBAAA;AAAA,iBA0FW,mBAAA,CACpB,QAAA,EAAU,gBAAA,EACV,GAAA,GAAM,SAAA,GACL,OAAA,CAAQ,kBAAA;;AJtIa;AAKxB;iBI+NgB,oBAAA,CACd,MAAA,EAAQ,iBAAA,GACP,MAAA,SAAe,qBAAA"}
|
package/dist/config-ld0utx-D.mjs
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
import * as fs$1 from "node:fs";
|
|
3
|
-
import * as path$1 from "node:path";
|
|
4
|
-
import { randomUUID } from "node:crypto";
|
|
5
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
-
import { execFileSync } from "node:child_process";
|
|
7
|
-
//#region src/config/pkl.js
|
|
8
|
-
const PACKAGE_ROOT$1 = path$1.resolve(fileURLToPath(new URL(".", import.meta.url)), "../..");
|
|
9
|
-
const DOCUMENTED_PKL_SCHEMA_IMPORT_RE = /^(\s*(?:amends|import)\s+)(["'])node_modules\/vize\/pkl\/(VizeConfig\.pkl|vize\.pkl)\2/gm;
|
|
10
|
-
/**
|
|
11
|
-
* Evaluate a `vize.config.pkl` file and return its JSON representation.
|
|
12
|
-
*
|
|
13
|
-
* The npm-facing loader keeps PKL execution in Node because it needs package
|
|
14
|
-
* resolution for `@pkl-community/pkl`, but all structural config normalization
|
|
15
|
-
* happens in Rust after this function returns. A missing PKL runtime returns
|
|
16
|
-
* `null` so config discovery can fall through to lower-priority formats; an
|
|
17
|
-
* evaluation failure throws because a present PKL config should not silently be
|
|
18
|
-
* ignored.
|
|
19
|
-
*/
|
|
20
|
-
function loadPklConfigJson(filePath) {
|
|
21
|
-
const pklBin = findPklBinary();
|
|
22
|
-
if (!pklBin) {
|
|
23
|
-
console.warn("[vize] pkl CLI not found. Install @pkl-community/pkl or add pkl to PATH. Falling back to the next config format.");
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
const patchedFilePath = createPklConfigWithBundledSchemaImports(filePath);
|
|
27
|
-
const evalFilePath = patchedFilePath ?? filePath;
|
|
28
|
-
try {
|
|
29
|
-
return execFileSync(pklBin, [
|
|
30
|
-
"eval",
|
|
31
|
-
"-f",
|
|
32
|
-
"json",
|
|
33
|
-
evalFilePath
|
|
34
|
-
], {
|
|
35
|
-
cwd: path$1.dirname(filePath),
|
|
36
|
-
encoding: "utf-8",
|
|
37
|
-
stdio: [
|
|
38
|
-
"ignore",
|
|
39
|
-
"pipe",
|
|
40
|
-
"pipe"
|
|
41
|
-
],
|
|
42
|
-
timeout: 3e4
|
|
43
|
-
});
|
|
44
|
-
} catch (error) {
|
|
45
|
-
throw new Error(`Failed to evaluate vize PKL config at ${filePath}: ${getErrorMessage$1(error)}`);
|
|
46
|
-
} finally {
|
|
47
|
-
if (patchedFilePath) fs$1.rmSync(patchedFilePath, { force: true });
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function findPklBinary() {
|
|
51
|
-
try {
|
|
52
|
-
const pklPkgPath = import.meta.resolve?.("@pkl-community/pkl");
|
|
53
|
-
if (pklPkgPath) {
|
|
54
|
-
const pklLibDir = path$1.dirname(fileURLToPath(pklPkgPath));
|
|
55
|
-
const pklPackageDir = path$1.dirname(pklLibDir);
|
|
56
|
-
const candidates = [
|
|
57
|
-
path$1.join(pklLibDir, "main.js"),
|
|
58
|
-
path$1.join(pklPackageDir, "pkl"),
|
|
59
|
-
path$1.join(pklPackageDir, "pkl.exe")
|
|
60
|
-
];
|
|
61
|
-
for (const candidate of candidates) if (fs$1.existsSync(candidate)) try {
|
|
62
|
-
execFileSync(candidate, ["--version"], { stdio: "ignore" });
|
|
63
|
-
return candidate;
|
|
64
|
-
} catch {}
|
|
65
|
-
}
|
|
66
|
-
} catch {}
|
|
67
|
-
try {
|
|
68
|
-
execFileSync("pkl", ["--version"], { stdio: "ignore" });
|
|
69
|
-
return "pkl";
|
|
70
|
-
} catch {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function createPklConfigWithBundledSchemaImports(filePath) {
|
|
75
|
-
const configDir = path$1.dirname(filePath);
|
|
76
|
-
const source = fs$1.readFileSync(filePath, "utf-8");
|
|
77
|
-
let patched = false;
|
|
78
|
-
const content = source.replace(DOCUMENTED_PKL_SCHEMA_IMPORT_RE, (match, prefix, quote, schemaFile) => {
|
|
79
|
-
const projectSchemaPath = path$1.join(configDir, "node_modules", "vize", "pkl", schemaFile);
|
|
80
|
-
if (fs$1.existsSync(projectSchemaPath)) return match;
|
|
81
|
-
const bundledSchemaPath = path$1.join(PACKAGE_ROOT$1, "pkl", schemaFile);
|
|
82
|
-
if (!fs$1.existsSync(bundledSchemaPath)) return match;
|
|
83
|
-
patched = true;
|
|
84
|
-
return `${prefix}${quote}${pathToFileURL(bundledSchemaPath).href}${quote}`;
|
|
85
|
-
});
|
|
86
|
-
if (!patched) return null;
|
|
87
|
-
const tempFile = path$1.join(configDir, `.vize-config-${process.pid}-${Date.now()}-${randomUUID()}.pkl`);
|
|
88
|
-
fs$1.writeFileSync(tempFile, content, {
|
|
89
|
-
flag: "wx",
|
|
90
|
-
mode: 384
|
|
91
|
-
});
|
|
92
|
-
return tempFile;
|
|
93
|
-
}
|
|
94
|
-
function getErrorMessage$1(error) {
|
|
95
|
-
if (error instanceof Error) return error.message;
|
|
96
|
-
return String(error);
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/config.ts
|
|
100
|
-
const require = createRequire(import.meta.url);
|
|
101
|
-
const CONFIG_FILE_NAMES = [
|
|
102
|
-
"vize.config.pkl",
|
|
103
|
-
"vize.config.ts",
|
|
104
|
-
"vize.config.js",
|
|
105
|
-
"vize.config.mjs",
|
|
106
|
-
"vize.config.json"
|
|
107
|
-
];
|
|
108
|
-
const DEFAULT_CONFIG_ENV = {
|
|
109
|
-
mode: "development",
|
|
110
|
-
command: "serve"
|
|
111
|
-
};
|
|
112
|
-
const PACKAGE_ROOT = path$1.resolve(fileURLToPath(new URL(".", import.meta.url)), "..");
|
|
113
|
-
const VIZE_CONFIG_JSON_SCHEMA_PATH = path$1.join(PACKAGE_ROOT, "schemas", "vize.config.schema.json");
|
|
114
|
-
const VIZE_CONFIG_PKL_SCHEMA_PATH = path$1.join(PACKAGE_ROOT, "pkl", "vize.pkl");
|
|
115
|
-
/**
|
|
116
|
-
* Define a Vize configuration with type checking.
|
|
117
|
-
* Accepts a plain object or a function that receives ConfigEnv.
|
|
118
|
-
*/
|
|
119
|
-
function defineConfig(config) {
|
|
120
|
-
return config;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Load `vize.config.*` from the specified directory.
|
|
124
|
-
*/
|
|
125
|
-
async function loadConfig(root, options = {}) {
|
|
126
|
-
const { mode = "root", configFile, env } = options;
|
|
127
|
-
if (mode === "none") return null;
|
|
128
|
-
if (configFile) {
|
|
129
|
-
const absolutePath = path$1.isAbsolute(configFile) ? configFile : path$1.resolve(root, configFile);
|
|
130
|
-
if (fs$1.existsSync(absolutePath)) return loadConfigFile(absolutePath, env);
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
if (mode === "auto") return loadConfigFromDirAuto(root, env);
|
|
134
|
-
return loadConfigFromDir(root, env);
|
|
135
|
-
}
|
|
136
|
-
async function loadConfigFromDir(dir, env) {
|
|
137
|
-
for (const name of CONFIG_FILE_NAMES) {
|
|
138
|
-
const filePath = path$1.join(dir, name);
|
|
139
|
-
if (!fs$1.existsSync(filePath)) continue;
|
|
140
|
-
const config = await loadConfigFile(filePath, env);
|
|
141
|
-
if (config !== null) return config;
|
|
142
|
-
}
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
async function loadConfigFromDirAuto(startDir, env) {
|
|
146
|
-
let currentDir = path$1.resolve(startDir);
|
|
147
|
-
while (true) {
|
|
148
|
-
const config = await loadConfigFromDir(currentDir, env);
|
|
149
|
-
if (config !== null) return config;
|
|
150
|
-
const parentDir = path$1.dirname(currentDir);
|
|
151
|
-
if (parentDir === currentDir) return null;
|
|
152
|
-
currentDir = parentDir;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
async function loadConfigFile(filePath, env) {
|
|
156
|
-
const absolutePath = path$1.resolve(filePath);
|
|
157
|
-
if (!fs$1.existsSync(absolutePath)) return null;
|
|
158
|
-
const ext = path$1.extname(absolutePath);
|
|
159
|
-
if (ext === ".pkl") return loadPklConfig(absolutePath);
|
|
160
|
-
if (ext === ".json") return parseJsonConfig(fs$1.readFileSync(absolutePath, "utf-8"), absolutePath);
|
|
161
|
-
if (ext === ".ts") return loadTypeScriptConfig(absolutePath, env);
|
|
162
|
-
return loadESMConfig(absolutePath, env);
|
|
163
|
-
}
|
|
164
|
-
function loadPklConfig(filePath) {
|
|
165
|
-
const output = loadPklConfigJson(filePath);
|
|
166
|
-
return output === null ? null : parseJsonConfig(output, filePath);
|
|
167
|
-
}
|
|
168
|
-
async function resolveConfigExport(exported, env) {
|
|
169
|
-
if (typeof exported === "function") return normalizeLoadedConfig(await exported(env ?? DEFAULT_CONFIG_ENV));
|
|
170
|
-
return normalizeLoadedConfig(exported);
|
|
171
|
-
}
|
|
172
|
-
async function loadTypeScriptConfig(filePath, env) {
|
|
173
|
-
const source = fs$1.readFileSync(filePath, "utf-8");
|
|
174
|
-
const code = rewriteSelfConfigImports((await (await import("oxc-transform")).transform(filePath, source, { typescript: { onlyRemoveTypeImports: true } })).code);
|
|
175
|
-
const tempFile = path$1.join(path$1.dirname(filePath), `.vize-config-${process.pid}-${Date.now()}-${randomUUID()}.mjs`);
|
|
176
|
-
fs$1.writeFileSync(tempFile, code, {
|
|
177
|
-
flag: "wx",
|
|
178
|
-
mode: 384
|
|
179
|
-
});
|
|
180
|
-
try {
|
|
181
|
-
const module = await importFresh(tempFile);
|
|
182
|
-
return resolveConfigExport(module.default || module, env);
|
|
183
|
-
} finally {
|
|
184
|
-
fs$1.rmSync(tempFile, { force: true });
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
async function loadESMConfig(filePath, env) {
|
|
188
|
-
const module = await importFresh(filePath);
|
|
189
|
-
return resolveConfigExport(module.default || module, env);
|
|
190
|
-
}
|
|
191
|
-
async function importFresh(filePath) {
|
|
192
|
-
const fileUrl = pathToFileURL(filePath);
|
|
193
|
-
fileUrl.searchParams.set("t", String(fs$1.statSync(filePath).mtimeMs));
|
|
194
|
-
return import(fileUrl.href);
|
|
195
|
-
}
|
|
196
|
-
function rewriteSelfConfigImports(code) {
|
|
197
|
-
return code.replace(/\bfrom\s+(["'])(vize(?:\/config)?)\1/gu, (_match, quote, specifier) => {
|
|
198
|
-
return `from ${quote}${resolveSelfConfigImportUrl(specifier)}${quote}`;
|
|
199
|
-
}).replace(/\bimport\s+(["'])(vize(?:\/config)?)\1/gu, (_match, quote, specifier) => {
|
|
200
|
-
return `import ${quote}${resolveSelfConfigImportUrl(specifier)}${quote}`;
|
|
201
|
-
}).replace(/\bimport\s*\(\s*(["'])(vize(?:\/config)?)\1\s*\)/gu, (_match, quote, specifier) => {
|
|
202
|
-
return `import(${quote}${resolveSelfConfigImportUrl(specifier)}${quote})`;
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function resolveSelfConfigImportUrl(specifier) {
|
|
206
|
-
const distTarget = specifier === "vize" ? path$1.join(PACKAGE_ROOT, "dist", "index.mjs") : path$1.join(PACKAGE_ROOT, "dist", "config.mjs");
|
|
207
|
-
const sourceTarget = path$1.join(PACKAGE_ROOT, "src", "config.ts");
|
|
208
|
-
return pathToFileURL(fs$1.existsSync(distTarget) ? distTarget : sourceTarget).href;
|
|
209
|
-
}
|
|
210
|
-
function parseJsonConfig(content, filePath) {
|
|
211
|
-
try {
|
|
212
|
-
return normalizeLoadedConfig(JSON.parse(content));
|
|
213
|
-
} catch (error) {
|
|
214
|
-
throw new Error(`Failed to parse vize config JSON at ${filePath}: ${getErrorMessage(error)}`);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function normalizeLoadedConfig(config) {
|
|
218
|
-
return require("@vizejs/native").normalizeVizeConfig(config ?? null);
|
|
219
|
-
}
|
|
220
|
-
function getErrorMessage(error) {
|
|
221
|
-
if (error instanceof Error) return error.message;
|
|
222
|
-
return String(error);
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Normalize GlobalTypesConfig shorthand strings to GlobalTypeDeclaration objects
|
|
226
|
-
*/
|
|
227
|
-
function normalizeGlobalTypes(config) {
|
|
228
|
-
const resolvedConfig = "types" in config && typeof config.types === "object" && config.types !== null && !Array.isArray(config.types) ? config.types : config;
|
|
229
|
-
const result = {};
|
|
230
|
-
for (const [key, value] of Object.entries(resolvedConfig)) if (typeof value === "string") result[key] = { type: value };
|
|
231
|
-
else result[key] = value;
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
//#endregion
|
|
235
|
-
export { loadConfig as a, defineConfig as i, VIZE_CONFIG_JSON_SCHEMA_PATH as n, normalizeGlobalTypes as o, VIZE_CONFIG_PKL_SCHEMA_PATH as r, resolveConfigExport as s, CONFIG_FILE_NAMES as t };
|
|
236
|
-
|
|
237
|
-
//# sourceMappingURL=config-ld0utx-D.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-ld0utx-D.mjs","names":["PACKAGE_ROOT","path","getErrorMessage","fs","path","fs"],"sources":["../src/config/pkl.js","../src/config.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { execFileSync } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\n\nconst PACKAGE_ROOT = path.resolve(fileURLToPath(new URL(\".\", import.meta.url)), \"../..\");\n\nconst DOCUMENTED_PKL_SCHEMA_IMPORT_RE =\n /^(\\s*(?:amends|import)\\s+)([\"'])node_modules\\/vize\\/pkl\\/(VizeConfig\\.pkl|vize\\.pkl)\\2/gm;\n\n/**\n * Evaluate a `vize.config.pkl` file and return its JSON representation.\n *\n * The npm-facing loader keeps PKL execution in Node because it needs package\n * resolution for `@pkl-community/pkl`, but all structural config normalization\n * happens in Rust after this function returns. A missing PKL runtime returns\n * `null` so config discovery can fall through to lower-priority formats; an\n * evaluation failure throws because a present PKL config should not silently be\n * ignored.\n */\nexport function loadPklConfigJson(filePath) {\n const pklBin = findPklBinary();\n if (!pklBin) {\n console.warn(\n \"[vize] pkl CLI not found. Install @pkl-community/pkl or add pkl to PATH. \" +\n \"Falling back to the next config format.\",\n );\n return null;\n }\n\n const patchedFilePath = createPklConfigWithBundledSchemaImports(filePath);\n const evalFilePath = patchedFilePath ?? filePath;\n try {\n return execFileSync(pklBin, [\"eval\", \"-f\", \"json\", evalFilePath], {\n cwd: path.dirname(filePath),\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n timeout: 30_000,\n });\n } catch (error) {\n throw new Error(`Failed to evaluate vize PKL config at ${filePath}: ${getErrorMessage(error)}`);\n } finally {\n if (patchedFilePath) {\n fs.rmSync(patchedFilePath, { force: true });\n }\n }\n}\n\nfunction findPklBinary() {\n try {\n const pklPkgPath = import.meta.resolve?.(\"@pkl-community/pkl\");\n if (pklPkgPath) {\n const pklLibDir = path.dirname(fileURLToPath(pklPkgPath));\n const pklPackageDir = path.dirname(pklLibDir);\n const candidates = [\n path.join(pklLibDir, \"main.js\"),\n path.join(pklPackageDir, \"pkl\"),\n path.join(pklPackageDir, \"pkl.exe\"),\n ];\n\n for (const candidate of candidates) {\n if (fs.existsSync(candidate)) {\n try {\n execFileSync(candidate, [\"--version\"], { stdio: \"ignore\" });\n return candidate;\n } catch {\n // Keep looking: the shim can exist when its runtime is unavailable.\n }\n }\n }\n }\n } catch {\n // Fall back to PATH below.\n }\n\n try {\n execFileSync(\"pkl\", [\"--version\"], { stdio: \"ignore\" });\n return \"pkl\";\n } catch {\n return null;\n }\n}\n\nfunction createPklConfigWithBundledSchemaImports(filePath) {\n const configDir = path.dirname(filePath);\n const source = fs.readFileSync(filePath, \"utf-8\");\n let patched = false;\n\n const content = source.replace(\n DOCUMENTED_PKL_SCHEMA_IMPORT_RE,\n (match, prefix, quote, schemaFile) => {\n const projectSchemaPath = path.join(configDir, \"node_modules\", \"vize\", \"pkl\", schemaFile);\n if (fs.existsSync(projectSchemaPath)) {\n return match;\n }\n\n const bundledSchemaPath = path.join(PACKAGE_ROOT, \"pkl\", schemaFile);\n if (!fs.existsSync(bundledSchemaPath)) {\n return match;\n }\n\n patched = true;\n return `${prefix}${quote}${pathToFileURL(bundledSchemaPath).href}${quote}`;\n },\n );\n\n if (!patched) {\n return null;\n }\n\n const tempFile = path.join(\n configDir,\n `.vize-config-${process.pid}-${Date.now()}-${randomUUID()}.pkl`,\n );\n fs.writeFileSync(tempFile, content, { flag: \"wx\", mode: 0o600 });\n return tempFile;\n}\n\nfunction getErrorMessage(error) {\n if (error instanceof Error) {\n return error.message;\n }\n\n return String(error);\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { randomUUID } from \"node:crypto\";\nimport { createRequire } from \"node:module\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport type {\n ResolvedVizeConfig,\n LoadConfigOptions,\n UserConfigExport,\n ConfigEnv,\n GlobalTypesConfig,\n GlobalTypeDeclaration,\n} from \"./types/index.js\";\nimport { loadPklConfigJson } from \"./config/pkl.js\";\n\ntype NativeConfigHelpers = {\n normalizeVizeConfig(value: unknown): unknown;\n};\n\nconst require = createRequire(import.meta.url);\n\nexport const CONFIG_FILE_NAMES = [\n \"vize.config.pkl\",\n \"vize.config.ts\",\n \"vize.config.js\",\n \"vize.config.mjs\",\n \"vize.config.json\",\n] as const;\n\nconst DEFAULT_CONFIG_ENV: ConfigEnv = {\n mode: \"development\",\n command: \"serve\",\n};\n\nconst PACKAGE_ROOT = path.resolve(fileURLToPath(new URL(\".\", import.meta.url)), \"..\");\n\nexport const VIZE_CONFIG_JSON_SCHEMA_PATH = path.join(\n PACKAGE_ROOT,\n \"schemas\",\n \"vize.config.schema.json\",\n);\n\nexport const VIZE_CONFIG_PKL_SCHEMA_PATH = path.join(PACKAGE_ROOT, \"pkl\", \"vize.pkl\");\n\n/**\n * Define a Vize configuration with type checking.\n * Accepts a plain object or a function that receives ConfigEnv.\n */\nexport function defineConfig(config: UserConfigExport): UserConfigExport {\n return config;\n}\n\n/**\n * Load `vize.config.*` from the specified directory.\n */\nexport async function loadConfig(\n root: string,\n options: LoadConfigOptions = {},\n): Promise<ResolvedVizeConfig | null> {\n const { mode = \"root\", configFile, env } = options;\n\n if (mode === \"none\") {\n return null;\n }\n\n if (configFile) {\n const absolutePath = path.isAbsolute(configFile) ? configFile : path.resolve(root, configFile);\n if (fs.existsSync(absolutePath)) {\n return loadConfigFile(absolutePath, env);\n }\n return null;\n }\n\n if (mode === \"auto\") {\n return loadConfigFromDirAuto(root, env);\n }\n\n return loadConfigFromDir(root, env);\n}\n\nasync function loadConfigFromDir(dir: string, env?: ConfigEnv): Promise<ResolvedVizeConfig | null> {\n for (const name of CONFIG_FILE_NAMES) {\n const filePath = path.join(dir, name);\n if (!fs.existsSync(filePath)) {\n continue;\n }\n\n const config = await loadConfigFile(filePath, env);\n if (config !== null) {\n return config;\n }\n }\n return null;\n}\n\nasync function loadConfigFromDirAuto(\n startDir: string,\n env?: ConfigEnv,\n): Promise<ResolvedVizeConfig | null> {\n let currentDir = path.resolve(startDir);\n\n while (true) {\n const config = await loadConfigFromDir(currentDir, env);\n if (config !== null) {\n return config;\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) {\n return null;\n }\n\n currentDir = parentDir;\n }\n}\n\nasync function loadConfigFile(\n filePath: string,\n env?: ConfigEnv,\n): Promise<ResolvedVizeConfig | null> {\n const absolutePath = path.resolve(filePath);\n if (!fs.existsSync(absolutePath)) {\n return null;\n }\n\n const ext = path.extname(absolutePath);\n\n if (ext === \".pkl\") {\n return loadPklConfig(absolutePath);\n }\n\n if (ext === \".json\") {\n const content = fs.readFileSync(absolutePath, \"utf-8\");\n return parseJsonConfig(content, absolutePath);\n }\n\n if (ext === \".ts\") {\n return loadTypeScriptConfig(absolutePath, env);\n }\n\n return loadESMConfig(absolutePath, env);\n}\n\nfunction loadPklConfig(filePath: string): ResolvedVizeConfig | null {\n const output = loadPklConfigJson(filePath);\n return output === null ? null : parseJsonConfig(output, filePath);\n}\n\nexport async function resolveConfigExport(\n exported: UserConfigExport,\n env?: ConfigEnv,\n): Promise<ResolvedVizeConfig> {\n if (typeof exported === \"function\") {\n return normalizeLoadedConfig(await exported(env ?? DEFAULT_CONFIG_ENV));\n }\n\n return normalizeLoadedConfig(exported);\n}\n\nasync function loadTypeScriptConfig(\n filePath: string,\n env?: ConfigEnv,\n): Promise<ResolvedVizeConfig> {\n const source = fs.readFileSync(filePath, \"utf-8\");\n const oxcTransform = await import(\"oxc-transform\");\n const result = await oxcTransform.transform(filePath, source, {\n typescript: {\n onlyRemoveTypeImports: true,\n },\n });\n const code = rewriteSelfConfigImports(result.code);\n\n const tempFile = path.join(\n path.dirname(filePath),\n `.vize-config-${process.pid}-${Date.now()}-${randomUUID()}.mjs`,\n );\n fs.writeFileSync(tempFile, code, { flag: \"wx\", mode: 0o600 });\n\n try {\n const module = await importFresh(tempFile);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n } finally {\n fs.rmSync(tempFile, { force: true });\n }\n}\n\nasync function loadESMConfig(filePath: string, env?: ConfigEnv): Promise<ResolvedVizeConfig> {\n const module = await importFresh(filePath);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n}\n\nasync function importFresh(filePath: string): Promise<Record<string, unknown>> {\n const fileUrl = pathToFileURL(filePath);\n fileUrl.searchParams.set(\"t\", String(fs.statSync(filePath).mtimeMs));\n return import(fileUrl.href);\n}\n\nfunction rewriteSelfConfigImports(code: string): string {\n return code\n .replace(/\\bfrom\\s+([\"'])(vize(?:\\/config)?)\\1/gu, (_match, quote, specifier) => {\n return `from ${quote}${resolveSelfConfigImportUrl(specifier)}${quote}`;\n })\n .replace(/\\bimport\\s+([\"'])(vize(?:\\/config)?)\\1/gu, (_match, quote, specifier) => {\n return `import ${quote}${resolveSelfConfigImportUrl(specifier)}${quote}`;\n })\n .replace(/\\bimport\\s*\\(\\s*([\"'])(vize(?:\\/config)?)\\1\\s*\\)/gu, (_match, quote, specifier) => {\n return `import(${quote}${resolveSelfConfigImportUrl(specifier)}${quote})`;\n });\n}\n\nfunction resolveSelfConfigImportUrl(specifier: string): string {\n const distTarget =\n specifier === \"vize\"\n ? path.join(PACKAGE_ROOT, \"dist\", \"index.mjs\")\n : path.join(PACKAGE_ROOT, \"dist\", \"config.mjs\");\n const sourceTarget = path.join(PACKAGE_ROOT, \"src\", \"config.ts\");\n return pathToFileURL(fs.existsSync(distTarget) ? distTarget : sourceTarget).href;\n}\n\nfunction parseJsonConfig(content: string, filePath: string): ResolvedVizeConfig {\n try {\n return normalizeLoadedConfig(JSON.parse(content));\n } catch (error) {\n throw new Error(`Failed to parse vize config JSON at ${filePath}: ${getErrorMessage(error)}`);\n }\n}\n\nfunction normalizeLoadedConfig(config: unknown): ResolvedVizeConfig {\n const native = require(\"@vizejs/native\") as NativeConfigHelpers;\n return native.normalizeVizeConfig(config ?? null) as ResolvedVizeConfig;\n}\n\nfunction getErrorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n\n return String(error);\n}\n\n/**\n * Normalize GlobalTypesConfig shorthand strings to GlobalTypeDeclaration objects\n */\nexport function normalizeGlobalTypes(\n config: GlobalTypesConfig,\n): Record<string, GlobalTypeDeclaration> {\n const resolvedConfig =\n \"types\" in config &&\n typeof config.types === \"object\" &&\n config.types !== null &&\n !Array.isArray(config.types)\n ? config.types\n : config;\n\n const result: Record<string, GlobalTypeDeclaration> = {};\n for (const [key, value] of Object.entries(resolvedConfig)) {\n if (typeof value === \"string\") {\n result[key] = { type: value };\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n"],"mappings":";;;;;;;AAMA,MAAMA,iBAAeC,OAAK,QAAQ,cAAc,IAAI,IAAI,KAAK,OAAO,KAAK,GAAG,CAAC,GAAG,OAAO;AAEvF,MAAM,kCACJ;;;;;;;;;;;AAYF,SAAgB,kBAAkB,UAAU;CAC1C,MAAM,SAAS,cAAc;CAC7B,IAAI,CAAC,QAAQ;EACX,QAAQ,KACN,kHAEF;EACA,OAAO;CACT;CAEA,MAAM,kBAAkB,wCAAwC,QAAQ;CACxE,MAAM,eAAe,mBAAmB;CACxC,IAAI;EACF,OAAO,aAAa,QAAQ;GAAC;GAAQ;GAAM;GAAQ;EAAY,GAAG;GAChE,KAAKA,OAAK,QAAQ,QAAQ;GAC1B,UAAU;GACV,OAAO;IAAC;IAAU;IAAQ;GAAM;GAChC,SAAS;EACX,CAAC;CACH,SAAS,OAAO;EACd,MAAM,IAAI,MAAM,yCAAyC,SAAS,IAAIC,kBAAgB,KAAK,GAAG;CAChG,UAAU;EACR,IAAI,iBACF,KAAG,OAAO,iBAAiB,EAAE,OAAO,KAAK,CAAC;CAE9C;AACF;AAEA,SAAS,gBAAgB;CACvB,IAAI;EACF,MAAM,aAAa,OAAO,KAAK,UAAU,oBAAoB;EAC7D,IAAI,YAAY;GACd,MAAM,YAAYD,OAAK,QAAQ,cAAc,UAAU,CAAC;GACxD,MAAM,gBAAgBA,OAAK,QAAQ,SAAS;GAC5C,MAAM,aAAa;IACjBA,OAAK,KAAK,WAAW,SAAS;IAC9BA,OAAK,KAAK,eAA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