typeflake 0.0.1-alpha.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/LICENSE +21 -0
- package/README.md +167 -0
- package/bin/typeflake.js +3 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +123 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +341 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +43 -0
- package/dist/index.mjs.map +1 -0
- package/dist/options-CE3YO7EL.mjs +760 -0
- package/dist/options-CE3YO7EL.mjs.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options-CE3YO7EL.mjs","names":["indentation"],"sources":["../src/errors.ts","../src/process.ts","../src/nix/expr.ts","../src/nix/render.ts","../src/flake.ts","../src/tooling.ts","../src/sync.ts","../src/check.ts","../src/doctor.ts","../src/options/generate.ts","../src/options/probe.ts","../src/options/document.ts","../src/options/commands.ts"],"sourcesContent":["import * as Data from \"effect/Data\";\n\nexport class FlakeImportError extends Data.TaggedError(\"FlakeImportError\")<{\n readonly cause: unknown;\n readonly specifier: string;\n}> {}\n\nexport class NixCheckFailed extends Data.TaggedError(\"NixCheckFailed\")<{\n readonly exitCode: number;\n readonly target: string;\n}> {}\n\nexport class TypeScriptCheckFailed extends Data.TaggedError(\"TypeScriptCheckFailed\")<{\n readonly exitCode: number;\n readonly project: string;\n}> {}\n\nexport class DoctorFailed extends Data.TaggedError(\"DoctorFailed\")<{\n readonly failedChecks: readonly string[];\n}> {}\n\nexport class OptionMetadataParseError extends Data.TaggedError(\"OptionMetadataParseError\")<{\n readonly cause: unknown;\n readonly path?: string;\n}> {}\n\nexport class UnsupportedOptionsFound extends Data.TaggedError(\"UnsupportedOptionsFound\")<{\n readonly options: readonly string[];\n}> {}\n","import * as Effect from \"effect/Effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/unstable/process\";\n\nexport type ProcessStdio = \"ignore\" | \"inherit\";\n\nexport interface RunCommandOptions {\n readonly command: string;\n readonly args: readonly string[];\n readonly stderr?: ProcessStdio;\n readonly stdin?: ProcessStdio;\n readonly stdout?: ProcessStdio;\n}\n\nexport const runCommandExitCode = (options: RunCommandOptions) =>\n Effect.gen(function* () {\n const process = yield* ChildProcessSpawner.ChildProcessSpawner;\n const command = ChildProcess.make(options.command, options.args, {\n stderr: options.stderr ?? \"ignore\",\n stdin: options.stdin ?? \"ignore\",\n stdout: options.stdout ?? \"ignore\",\n });\n const exitCode = yield* process.exitCode(command);\n\n return Number(exitCode);\n });\n\nexport const runCommandString = (options: RunCommandOptions) =>\n Effect.gen(function* () {\n const process = yield* ChildProcessSpawner.ChildProcessSpawner;\n const command = ChildProcess.make(options.command, options.args, {\n stdin: options.stdin ?? \"ignore\",\n });\n\n return yield* process.string(command, { includeStderr: options.stderr === \"inherit\" });\n });\n","const nixValueSymbol = Symbol(\"typeflake.nixValue\");\n\nexport interface NixExpr<Kind extends string = string> {\n readonly [nixValueSymbol]: true;\n readonly tag: \"raw\";\n readonly kind: Kind;\n readonly code: string;\n}\n\nexport interface NixString {\n readonly [nixValueSymbol]: true;\n readonly tag: \"string\";\n readonly value: string;\n}\n\nexport interface NixNumber {\n readonly [nixValueSymbol]: true;\n readonly tag: \"number\";\n readonly value: number;\n}\n\nexport interface NixBoolean {\n readonly [nixValueSymbol]: true;\n readonly tag: \"boolean\";\n readonly value: boolean;\n}\n\nexport interface NixNull {\n readonly [nixValueSymbol]: true;\n readonly tag: \"null\";\n}\n\nexport interface NixList {\n readonly [nixValueSymbol]: true;\n readonly tag: \"list\";\n readonly items: readonly NixValue[];\n}\n\nexport interface NixAttrSet {\n readonly [nixValueSymbol]: true;\n readonly tag: \"attrset\";\n readonly attrs: Readonly<Record<string, NixValue | undefined>>;\n}\n\nexport type NixValue =\n | NixExpr\n | NixString\n | NixNumber\n | NixBoolean\n | NixNull\n | NixList\n | NixAttrSet;\n\nexport type NixInput =\n | NixValue\n | string\n | number\n | boolean\n | null\n | readonly NixInput[]\n | { readonly [key: string]: NixInput | undefined };\n\nexport const rawNix = (code: string): NixExpr<\"raw\"> => ({\n [nixValueSymbol]: true,\n tag: \"raw\",\n kind: \"raw\",\n code,\n});\n\nexport const nixExpr = <Kind extends string>(kind: Kind, code: string): NixExpr<Kind> => ({\n [nixValueSymbol]: true,\n tag: \"raw\",\n kind,\n code,\n});\n\nexport const nixAttrPath = <Kind extends string>(\n kind: Kind,\n parts: readonly string[],\n): NixExpr<Kind> => ({\n [nixValueSymbol]: true,\n tag: \"raw\",\n kind,\n code: parts.map(renderAttrPathSegment).join(\".\"),\n});\n\nexport const nixString = (value: string): NixString => ({\n [nixValueSymbol]: true,\n tag: \"string\",\n value,\n});\n\nexport const nixNumber = (value: number): NixNumber => ({\n [nixValueSymbol]: true,\n tag: \"number\",\n value,\n});\n\nexport const nixBoolean = (value: boolean): NixBoolean => ({\n [nixValueSymbol]: true,\n tag: \"boolean\",\n value,\n});\n\nexport const nixNull: NixNull = {\n [nixValueSymbol]: true,\n tag: \"null\",\n};\n\nexport const nixList = (items: readonly unknown[]): NixList => ({\n [nixValueSymbol]: true,\n tag: \"list\",\n items: items.map(normalizeNixInput),\n});\n\nexport const nixAttrSet = (attrs: object): NixAttrSet => ({\n [nixValueSymbol]: true,\n tag: \"attrset\",\n attrs: Object.fromEntries(\n Object.entries(attrs).map(([key, value]) => [\n key,\n value === undefined ? undefined : normalizeNixInput(value),\n ]),\n ),\n});\n\nexport const normalizeNixInput = (value: unknown): NixValue => {\n if (isNixValue(value)) return value;\n\n switch (typeof value) {\n case \"string\":\n return nixString(value);\n case \"number\":\n return nixNumber(value);\n case \"boolean\":\n return nixBoolean(value);\n case \"object\":\n if (value === null) return nixNull;\n if (isReadonlyArray(value)) return nixList(value);\n return nixAttrSet(value);\n case \"undefined\":\n case \"bigint\":\n case \"function\":\n case \"symbol\":\n throw new Error(`Cannot normalize ${typeof value} as Nix`);\n }\n\n throw new Error(`Cannot normalize unsupported value as Nix: ${String(value)}`);\n};\n\nexport const renderAttrName = (name: string): string =>\n /^[A-Za-z_][A-Za-z0-9_'-]*$/.test(name) ? name : JSON.stringify(name);\n\nconst renderAttrPathSegment = renderAttrName;\n\nconst isNixValue = (value: unknown): value is NixValue =>\n typeof value === \"object\" &&\n value !== null &&\n nixValueSymbol in value &&\n value[nixValueSymbol] === true &&\n \"tag\" in value &&\n (value.tag === \"raw\" ||\n value.tag === \"string\" ||\n value.tag === \"number\" ||\n value.tag === \"boolean\" ||\n value.tag === \"null\" ||\n value.tag === \"list\" ||\n value.tag === \"attrset\");\n\nconst isReadonlyArray = (value: object): value is readonly unknown[] => Array.isArray(value);\n","import { normalizeNixInput, renderAttrName, type NixExpr, type NixValue } from \"./expr.ts\";\n\nexport interface RenderOptions {\n readonly indent?: number;\n}\n\nexport const renderNixValue = (value: unknown, options: RenderOptions = {}): string =>\n renderValue(normalizeNixInput(value), options.indent ?? 0);\n\nconst renderValue = (value: NixValue, indent: number): string => {\n switch (value.tag) {\n case \"raw\":\n return indentRaw(value.code, indent);\n case \"string\":\n return JSON.stringify(value.value);\n case \"number\":\n if (!Number.isFinite(value.value)) {\n throw new Error(`Cannot render non-finite number as Nix: ${value.value}`);\n }\n return String(value.value);\n case \"boolean\":\n return value.value ? \"true\" : \"false\";\n case \"null\":\n return \"null\";\n case \"list\":\n return renderList(value.items, indent);\n case \"attrset\":\n return renderAttrSet(value.attrs, indent);\n }\n\n return absurd(value);\n};\n\nexport const renderList = (items: readonly unknown[], indent: number): string => {\n const normalized = items.map(normalizeNixInput);\n if (normalized.length === 0) return \"[]\";\n\n const childIndent = indent + 1;\n const pad = indentation(indent);\n const childPad = indentation(childIndent);\n const rendered = normalized\n .map((item) => `${childPad}${renderValue(item, childIndent)}`)\n .join(\"\\n\");\n\n return `[\\n${rendered}\\n${pad}]`;\n};\n\nexport const renderAttrSet = (\n attrs: { readonly [key: string]: unknown },\n indent: number,\n): string => {\n const entries = Object.entries(attrs).filter(\n (entry): entry is [string, unknown] => entry[1] !== undefined,\n );\n if (entries.length === 0) return \"{}\";\n\n const childIndent = indent + 1;\n const pad = indentation(indent);\n const childPad = indentation(childIndent);\n const rendered = entries\n .toSorted(([left], [right]) => left.localeCompare(right))\n .map(\n ([key, value]) =>\n `${childPad}${renderAttrName(key)} = ${renderValue(normalizeNixInput(value), childIndent)};`,\n )\n .join(\"\\n\");\n\n return `{\\n${rendered}\\n${pad}}`;\n};\n\nexport const renderModule = (module: NixExpr<\"module\">): string => module.code;\n\nconst indentation = (level: number): string => \" \".repeat(level);\n\nconst indentRaw = (code: string, indent: number): string => {\n const lines = code.split(\"\\n\");\n if (lines.length === 1) return code;\n\n const pad = indentation(indent);\n const [first, ...rest] = lines;\n return [first, ...rest.map((line) => (line.length === 0 ? line : `${pad}${line}`))].join(\"\\n\");\n};\n\nconst absurd = (value: never): never => {\n throw new Error(`Unexpected Nix expression: ${String(value)}`);\n};\n","import * as Effect from \"effect/Effect\";\nimport { nixExpr, rawNix, renderAttrName, type NixExpr, type NixInput } from \"./nix/expr.ts\";\nimport { renderNixValue } from \"./nix/render.ts\";\n\nexport interface FlakeInput<Name extends string = string> extends NixExpr<\"input\"> {\n readonly name: Name;\n readonly url: string;\n}\n\nexport type FlakeInputSpec = FlakeInput;\n\nexport type FlakeInputs = Readonly<Record<string, FlakeInput>>;\n\nexport type NamedFlakeInputs<Inputs extends FlakeInputs> = {\n readonly [Name in keyof Inputs & string]: FlakeInput<Name>;\n};\n\nexport type CheckedFlakeInputs<Inputs extends FlakeInputs> = Inputs & NamedFlakeInputs<Inputs>;\n\nexport interface DevShell {\n readonly packages?: readonly NixInput[];\n}\n\nexport interface FlakeOutputs {\n readonly nixosConfigurations?: Record<string, NixInput>;\n readonly devShells?: Record<string, Record<string, DevShell>>;\n}\n\nexport interface FlakeSpec<Inputs extends FlakeInputs = FlakeInputs> {\n readonly description?: string;\n readonly inputs: CheckedFlakeInputs<Inputs>;\n readonly outputs: (inputs: CheckedFlakeInputs<Inputs>) => FlakeOutputs;\n}\n\nexport type FlakeTaint = \"effect\" | \"impure\" | \"pure\";\n\nexport interface TypeflakeFlake<\n Inputs extends FlakeInputs = FlakeInputs,\n Taint extends FlakeTaint = \"pure\",\n E = never,\n R = never,\n> {\n readonly taint: Taint;\n readonly spec: Effect.Effect<FlakeSpec<Inputs>, E, R>;\n}\n\nexport type AnyTypeflakeFlake = TypeflakeFlake<FlakeInputs, FlakeTaint, unknown, unknown>;\n\nexport interface FlakeModule {\n readonly default: AnyTypeflakeFlake;\n}\n\nexport const Flake = {\n input<const Name extends string>(name: Name, url: string): FlakeInput<Name> {\n return {\n ...nixExpr(\"input\", renderAttrName(name)),\n name,\n url,\n };\n },\n\n inputs<const Inputs extends FlakeInputs>(\n inputs: CheckedFlakeInputs<Inputs>,\n ): CheckedFlakeInputs<Inputs> {\n return inputs;\n },\n\n make<const Inputs extends FlakeInputs>(spec: FlakeSpec<Inputs>): TypeflakeFlake<Inputs> {\n return {\n taint: \"pure\",\n spec: Effect.succeed(spec),\n };\n },\n\n effect<const Inputs extends FlakeInputs, E, R>(\n spec: Effect.Effect<FlakeSpec<Inputs>, E, R>,\n ): TypeflakeFlake<Inputs, \"effect\", E, R> {\n return { spec, taint: \"effect\" };\n },\n\n impure<const Inputs extends FlakeInputs, E, R>(\n spec: Effect.Effect<FlakeSpec<Inputs>, E, R>,\n ): TypeflakeFlake<Inputs, \"impure\", E, R> {\n return { spec, taint: \"impure\" };\n },\n};\n\nexport const resolveFlakeSpec = <Inputs extends FlakeInputs, Taint extends FlakeTaint, E, R>(\n flake: TypeflakeFlake<Inputs, Taint, E, R>,\n): Effect.Effect<FlakeSpec<Inputs>, E, R> => flake.spec;\n\nexport const renderFlake = (spec: FlakeSpec): string => {\n const outputs = spec.outputs(spec.inputs);\n\n return `${renderNixValue({\n description: spec.description ?? \"Generated by Typeflake\",\n inputs: renderInputs(spec.inputs),\n outputs: rawNix(renderOutputs(spec.inputs, outputs)),\n })}\\n`;\n};\n\nconst renderInputs = (inputs: FlakeInputs): NixInput =>\n Object.fromEntries(\n Object.entries(inputs).map(([name, input]) => [\n name,\n {\n url: input.url,\n },\n ]),\n );\n\nconst renderOutputs = (inputs: FlakeInputs, outputs: FlakeOutputs): string => {\n const args = [\"self\", ...Object.keys(inputs)].join(\", \");\n const body = renderNixValue({\n devShells: outputs.devShells === undefined ? undefined : renderDevShells(outputs.devShells),\n nixosConfigurations: outputs.nixosConfigurations,\n });\n\n return `{ ${args} }: ${body}`;\n};\n\nconst renderDevShells = (systems: Record<string, Record<string, DevShell>>): NixInput =>\n Object.fromEntries(\n Object.entries(systems).map(([system, shells]) => [\n system,\n Object.fromEntries(\n Object.entries(shells).map(([name, shell]) => [\n name,\n rawNix(\n `let pkgs = nixpkgs.legacyPackages.${renderAttrName(system)}; in pkgs.mkShell ${renderNixValue(\n {\n packages: shell.packages ?? [],\n },\n )}`,\n ),\n ]),\n ),\n ]),\n );\n","import { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nexport const effectTsgoCommand = (): string =>\n resolvePackageBin(\"@effect/tsgo/package.json\", \"dist/effect-tsgo.js\");\n\nexport const tsgoCommand = (): string =>\n resolvePackageBin(\"@typescript/native-preview/package.json\", \"bin/tsgo\");\n\nconst resolvePackageBin = (packageJsonSpecifier: string, binPath: string): string => {\n const packageJsonPath = fileURLToPath(import.meta.resolve(packageJsonSpecifier));\n return join(dirname(packageJsonPath), binPath);\n};\n","import * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport { FlakeImportError, TypeScriptCheckFailed } from \"./errors.ts\";\nimport { type FlakeModule, renderFlake, resolveFlakeSpec } from \"./flake.ts\";\nimport { runCommandExitCode } from \"./process.ts\";\nimport { tsgoCommand } from \"./tooling.ts\";\n\nexport interface SyncOptions {\n readonly input: string;\n readonly output: string;\n}\n\nexport const sync = (options: SyncOptions) =>\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const inputPath = path.resolve(options.input);\n const outputPath = path.resolve(options.output);\n const moduleUrl = yield* path.toFileUrl(inputPath);\n\n yield* runTypeScriptCheck(\"tsconfig.json\");\n\n const loaded = yield* loadFlakeModule(moduleUrl);\n const spec = yield* resolveFlakeSpec(loaded.default);\n const rendered = renderFlake(spec);\n\n yield* fs.makeDirectory(path.dirname(outputPath), { recursive: true });\n yield* fs.writeFileString(outputPath, rendered);\n });\n\nconst loadFlakeModule = (moduleUrl: URL) =>\n Effect.gen(function* () {\n const cacheBust = yield* Clock.currentTimeMillis;\n const specifier = `${moduleUrl.href}?typeflake=${cacheBust}`;\n\n return yield* Effect.tryPromise({\n try: () => importFlakeModule(specifier),\n catch: (cause) => new FlakeImportError({ cause, specifier }),\n });\n });\n\nconst importFlakeModule: (specifier: string) => Promise<FlakeModule> = (specifier) =>\n import(specifier);\n\nconst runTypeScriptCheck = (project: string) =>\n Effect.gen(function* () {\n const exitCode = yield* runCommandExitCode({\n args: [\"--noEmit\", \"--project\", project],\n command: tsgoCommand(),\n stderr: \"inherit\",\n stdin: \"inherit\",\n stdout: \"inherit\",\n });\n\n if (exitCode !== 0) {\n return yield* new TypeScriptCheckFailed({ exitCode, project });\n }\n\n return undefined;\n });\n","import * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport { NixCheckFailed } from \"./errors.ts\";\nimport { runCommandExitCode } from \"./process.ts\";\nimport { sync, type SyncOptions } from \"./sync.ts\";\n\nexport interface CheckOptions extends SyncOptions {\n readonly noBuild?: boolean;\n}\n\nexport const check = (options: CheckOptions) =>\n Effect.gen(function* () {\n yield* sync(options);\n\n const target = yield* prepareFlakeTarget(options.output);\n yield* runNixFlakeCheck(target, options.noBuild ?? true);\n });\n\nconst prepareFlakeTarget = (output: string) =>\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const outputPath = path.resolve(output);\n\n if (path.basename(outputPath) === \"flake.nix\") {\n return path.dirname(outputPath);\n }\n\n const directory = yield* fs.makeTempDirectory({ prefix: \"typeflake-check-\" });\n yield* fs.copyFile(outputPath, path.join(directory, \"flake.nix\"));\n return directory;\n });\n\nconst runNixFlakeCheck = (target: string, noBuild: boolean) =>\n Effect.gen(function* () {\n const args = noBuild ? [\"flake\", \"check\", \"--no-build\", target] : [\"flake\", \"check\", target];\n const exitCode = yield* runCommandExitCode({\n args,\n command: \"nix\",\n stderr: \"inherit\",\n stdin: \"inherit\",\n stdout: \"inherit\",\n });\n\n if (exitCode !== 0) {\n return yield* new NixCheckFailed({ exitCode, target });\n }\n\n return undefined;\n });\n","import * as Effect from \"effect/Effect\";\nimport { runCommandExitCode } from \"./process.ts\";\nimport { effectTsgoCommand, tsgoCommand } from \"./tooling.ts\";\n\nexport interface DoctorOptions {\n readonly project?: string;\n}\n\nexport interface DoctorCheck {\n readonly name: string;\n readonly ok: boolean;\n readonly detail: string;\n}\n\nexport interface DoctorReport {\n readonly checks: readonly DoctorCheck[];\n readonly ok: boolean;\n}\n\nexport const doctor = (options: DoctorOptions = {}) =>\n Effect.gen(function* () {\n const project = options.project ?? \"tsconfig.json\";\n const checks = yield* Effect.all(\n [\n checkCommand(\"Nix\", \"nix\", [\"--version\"]),\n checkCommand(\"Node\", \"node\", [\"--version\"]),\n checkCommand(\"TypeScript-Go\", tsgoCommand(), [\"--version\"]),\n checkCommand(\"Effect TSGO\", effectTsgoCommand(), [\"get-exe-path\"]),\n checkCommand(\"Project TypeScript\", tsgoCommand(), [\"--noEmit\", \"--project\", project]),\n ],\n { concurrency: \"unbounded\" },\n );\n\n return {\n checks,\n ok: checks.every((check) => check.ok),\n };\n });\n\nexport const renderDoctorReport = (report: DoctorReport): string =>\n [\n \"Typeflake doctor\",\n ...report.checks.map((check) => `${check.ok ? \"OK\" : \"FAIL\"} ${check.name}: ${check.detail}`),\n ].join(\"\\n\");\n\nconst checkCommand = (name: string, command: string, args: readonly string[]) =>\n runCommandExitCode({ args, command }).pipe(\n Effect.match({\n onFailure: (cause): DoctorCheck => ({\n detail: String(cause),\n name,\n ok: false,\n }),\n onSuccess: (exitCode): DoctorCheck => ({\n detail: exitCode === 0 ? `${command} ${args.join(\" \")}` : `exit code ${exitCode}`,\n name,\n ok: exitCode === 0,\n }),\n }),\n );\n","import type { OptionIR, OptionPath, OptionScope, OptionTypeIR } from \"./ir.ts\";\n\nexport interface GenerateOptionTypesOptions {\n readonly importPath: string;\n readonly options: readonly OptionIR[];\n readonly rootTypeName: string;\n readonly scope: OptionScope;\n}\n\nexport interface GenerateOptionTypeFileOptions {\n readonly fixtureScope?: string;\n readonly importPath: string;\n readonly roots: readonly OptionTypeRoot[];\n readonly options: readonly OptionIR[];\n}\n\nexport interface OptionTypeRoot {\n readonly rootTypeName: string;\n readonly scope: OptionScope;\n}\n\ninterface OptionTree {\n readonly children: Map<string, OptionTree>;\n option?: OptionIR;\n}\n\nexport const generateOptionTypes = (options: GenerateOptionTypesOptions): string => {\n const body = renderRootInterface(options.rootTypeName, options.scope, options.options);\n\n return `${renderGeneratedHeader()}\nimport type { NixExpr, NixInput } from ${JSON.stringify(options.importPath)};\n\n${renderSharedTypes()}\n\n${body}\n`;\n};\n\nexport const generateOptionTypeFile = (options: GenerateOptionTypeFileOptions): string => {\n const interfaces = options.roots\n .map((root) => renderRootInterface(root.rootTypeName, root.scope, options.options))\n .join(\"\\n\\n\");\n\n return `${renderGeneratedHeader(options.fixtureScope)}\nimport type { NixExpr, NixInput } from ${JSON.stringify(options.importPath)};\n\n${renderSharedTypes()}\n\n${interfaces}\n`;\n};\n\nconst renderRootInterface = (\n rootTypeName: string,\n scope: OptionScope,\n options: readonly OptionIR[],\n): string => {\n const tree = buildOptionTree(\n options.filter((option) => option.scope === scope).map((option) => option),\n );\n\n return `export interface ${rootTypeName} ${renderTree(tree, 0)}`;\n};\n\nconst renderGeneratedHeader = (fixtureScope?: string): string => {\n const lines = [\"// Generated by Typeflake from real Nix option metadata.\"];\n if (fixtureScope !== undefined) lines.push(`// Fixture scope: ${fixtureScope}`);\n\n return lines.join(\"\\n\");\n};\n\nconst renderSharedTypes = (): string => `export type NixOptionValue<T> = T | NixExpr;\n\nexport type UnsupportedNixOption<Description extends string> = NixExpr<\"unsupported\"> & {\n readonly __unsupportedNixOption: Description;\n};`;\n\nconst buildOptionTree = (options: readonly OptionIR[]): OptionTree => {\n const root = createTree();\n\n for (const option of options) {\n insertOption(root, option.path, option);\n }\n\n return root;\n};\n\nconst createTree = (): OptionTree => ({ children: new Map() });\n\nconst insertOption = (root: OptionTree, path: OptionPath, option: OptionIR): void => {\n let current = root;\n\n for (const segment of path) {\n const existing = current.children.get(segment);\n if (existing !== undefined) {\n current = existing;\n } else {\n const next = createTree();\n current.children.set(segment, next);\n current = next;\n }\n }\n\n current.option = option;\n};\n\nconst renderTree = (tree: OptionTree, depth: number): string => {\n const entries = [...tree.children.entries()].toSorted(([left], [right]) =>\n left.localeCompare(right),\n );\n\n if (entries.length === 0) {\n return tree.option === undefined ? \"{}\" : toOptionValueType(tree.option);\n }\n\n const pad = indentation(depth);\n const childPad = indentation(depth + 1);\n const rendered = entries\n .map(\n ([key, child]) =>\n `${childPad}readonly ${quoteProperty(key)}?: ${renderTree(child, depth + 1)};`,\n )\n .join(\"\\n\");\n\n return `{\\n${rendered}\\n${pad}}`;\n};\n\nconst toOptionValueType = (option: OptionIR): string =>\n `NixOptionValue<${toTypeScriptType(option.type, option.path)}>`;\n\nexport const toTypeScriptType = (nixType: OptionTypeIR, path: readonly string[] = []): string => {\n const normalized = normalizeTypeName(nixType.name);\n const description = nixType.description?.toLowerCase() ?? \"\";\n\n if (normalized === \"bool\" || normalized === \"boolean\") return \"boolean\";\n if (normalized === \"nullor\") return renderNullableType(nixType, path);\n if (normalized === \"listof\") return renderListType(nixType, path);\n if (normalized === \"attrsof\") return renderAttrsType(nixType, path);\n if (\n normalized === \"str\" ||\n normalized === \"string\" ||\n normalized === \"enum\" ||\n normalized.startsWith(\"strmatching\")\n ) {\n return \"string\";\n }\n if (isNumberType(normalized, description)) return \"number\";\n if (normalized === \"package\") return \"NixInput\";\n if (normalized === \"path\") return \"string\";\n if (normalized === \"submodule\") return \"NixInput\";\n\n if (description.includes(\"list of package\")) return \"readonly NixInput[]\";\n if (description.includes(\"list of string\")) return \"readonly string[]\";\n if (description.includes(\"attribute set\")) return \"Readonly<Record<string, NixInput>>\";\n\n return unsupportedType(nixType);\n};\n\nexport const collectUnsupportedOptions = (options: readonly OptionIR[]): readonly OptionIR[] =>\n options.filter((option) => toTypeScriptType(option.type, option.path).startsWith(\"Unsupported\"));\n\nconst renderNullableType = (nixType: OptionTypeIR, path: readonly string[]): string => {\n const nested = nixType.nestedTypes.elemType ?? nixType.nestedTypes.valueType;\n if (nested === undefined) return `${unsupportedType(nixType)} | null`;\n\n return `${toTypeScriptType(nested, path)} | null`;\n};\n\nconst renderListType = (nixType: OptionTypeIR, path: readonly string[]): string => {\n const elemType = nixType.nestedTypes.elemType;\n if (elemType === undefined) return \"readonly NixInput[]\";\n\n return `readonly ${toCollectionElementType(elemType, path)}[]`;\n};\n\nconst renderAttrsType = (nixType: OptionTypeIR, path: readonly string[]): string => {\n const elemType = nixType.nestedTypes.elemType;\n if (elemType === undefined) return \"Readonly<Record<string, NixInput>>\";\n\n return `Readonly<Record<string, ${toCollectionElementType(elemType, path)}>>`;\n};\n\nconst toCollectionElementType = (nixType: OptionTypeIR, path: readonly string[]): string => {\n const normalized = normalizeTypeName(nixType.name);\n if (normalized === \"submodule\") return \"NixInput\";\n\n return toTypeScriptType(nixType, path);\n};\n\nconst isNumberType = (normalized: string, description: string): boolean =>\n normalized.includes(\"int\") ||\n normalized === \"number\" ||\n description.includes(\"integer\") ||\n description.includes(\"signed integer\");\n\nconst unsupportedType = (nixType: OptionTypeIR): string =>\n `UnsupportedNixOption<${JSON.stringify(renderUnsupportedDescription(nixType))}>`;\n\nconst renderUnsupportedDescription = (nixType: OptionTypeIR): string =>\n nixType.description === null ? nixType.name : `${nixType.name}: ${nixType.description}`;\n\nconst normalizeTypeName = (name: string): string => name.toLowerCase().replaceAll(/[^a-z0-9]/g, \"\");\n\nconst quoteProperty = (key: string): string =>\n /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? key : JSON.stringify(key);\n\nconst indentation = (depth: number): string => \" \".repeat(depth);\n","import { nixExpr, type NixExpr } from \"../nix/expr.ts\";\nimport { renderNixValue } from \"../nix/render.ts\";\nimport type { OptionPath } from \"./ir.ts\";\n\nexport interface OptionProbeScope {\n readonly optionPaths: readonly OptionPath[];\n}\n\nexport interface OptionProbeOptions {\n readonly homeManager?: NixExpr;\n readonly homeManagerOptions?: OptionProbeScope;\n readonly nixosOptions?: OptionProbeScope;\n readonly nixpkgs: NixExpr;\n readonly system: string;\n}\n\nexport const defaultNixOSOptionPaths = [\n [\"boot\", \"loader\", \"grub\", \"devices\"],\n [\"environment\", \"systemPackages\"],\n [\"fileSystems\"],\n [\"networking\", \"firewall\", \"allowedTCPPorts\"],\n [\"networking\", \"hostName\"],\n [\"services\", \"nginx\", \"enable\"],\n [\"services\", \"openssh\", \"enable\"],\n [\"services\", \"openssh\", \"ports\"],\n [\"system\", \"stateVersion\"],\n [\"users\", \"users\"],\n] as const satisfies readonly OptionPath[];\n\nexport const defaultHomeManagerOptionPaths = [\n [\"home\", \"stateVersion\"],\n [\"home\", \"packages\"],\n [\"programs\", \"git\", \"enable\"],\n] as const satisfies readonly OptionPath[];\n\nexport const renderOptionProbeExpression = (options: OptionProbeOptions): string => {\n const nixosPaths = options.nixosOptions?.optionPaths ?? [];\n const homeManagerPaths = options.homeManagerOptions?.optionPaths ?? [];\n\n return `let\n nixpkgs = ${options.nixpkgs.code};\n system = ${renderNixValue(options.system)};\n nixpkgsPath = nixpkgs.outPath or nixpkgs;\n pkgs = import nixpkgsPath { inherit system; };\n\n renderDoc = value:\n if value == null then null\n else if builtins.isString value then value\n else if builtins.isAttrs value && value ? text then value.text\n else builtins.toJSON value;\n\n getPath = options: path:\n builtins.foldl' (value: key: value.\\${key}) options path;\n\n typeToIR = type: {\n name = type.name or \"unknown\";\n description = renderDoc (type.description or null);\n nestedTypes = builtins.mapAttrs (_: nestedType: typeToIR nestedType) (type.nestedTypes or {});\n };\n\n optionToIR = scope: options: path:\n let option = getPath options path; in {\n inherit path scope;\n declarations = map toString (option.declarations or []);\n defaultText = renderDoc (option.defaultText or null);\n description = renderDoc (option.description or null);\n exampleText = renderDoc (option.example or null);\n internal = option.internal or false;\n readOnly = option.readOnly or false;\n type = typeToIR option.type;\n visible = option.visible or true;\n };\n\n nixosEval = import \"\\${nixpkgsPath}/nixos/lib/eval-config.nix\" {\n inherit system;\n modules = [];\n };\n${renderHomeManagerBinding(options)}\nin {\n nixos = map (optionToIR \"nixos\" nixosEval.options) ${renderPathList(nixosPaths)};\n homeManager = ${renderHomeManagerOptions(options, homeManagerPaths)};\n}`;\n};\n\nexport const flakeInput = (name: string): NixExpr<\"flakeInput\"> =>\n nixExpr(\n \"flakeInput\",\n `(builtins.getFlake (\"git+file://\" + toString ./.))\n .inputs.${name}`,\n );\n\nexport const projectFlakeInput = (flakeReference: string, name: string): NixExpr<\"flakeInput\"> =>\n nixExpr(\n \"flakeInput\",\n `(builtins.getFlake ${renderNixValue(flakeReference)})\n .inputs.${name}`,\n );\n\nconst renderPathList = (paths: readonly OptionPath[]): string => renderNixValue(paths);\n\nconst renderHomeManagerBinding = (options: OptionProbeOptions): string => {\n if (options.homeManager === undefined) return \"\";\n\n return ` homeManager = ${options.homeManager.code};\n homeManagerEval = homeManager.lib.homeManagerConfiguration {\n inherit pkgs;\n modules = [{\n home.homeDirectory = \"/home/typeflake\";\n home.stateVersion = \"25.11\";\n home.username = \"typeflake\";\n }];\n };\n`;\n};\n\nconst renderHomeManagerOptions = (\n options: OptionProbeOptions,\n paths: readonly OptionPath[],\n): string => {\n if (options.homeManager === undefined) return \"[]\";\n\n return `map (optionToIR \"home-manager\" homeManagerEval.options) ${renderPathList(paths)}`;\n};\n","import type { OptionIR, OptionPath, OptionScope, OptionTypeIR } from \"./ir.ts\";\n\nexport interface OptionMetadataDocument {\n readonly options: readonly OptionIR[];\n readonly source: OptionMetadataSource;\n readonly version: 1;\n}\n\nexport interface OptionMetadataSource {\n readonly flake: string;\n readonly homeManagerInput: string | null;\n readonly nixpkgsInput: string;\n readonly scopes: readonly OptionScope[];\n readonly system: string;\n}\n\nexport interface OptionProbePayload {\n readonly homeManager: readonly OptionIR[];\n readonly nixos: readonly OptionIR[];\n}\n\nexport const makeOptionMetadataDocument = (\n source: OptionMetadataSource,\n payload: OptionProbePayload,\n): OptionMetadataDocument => ({\n options: sortOptions([...payload.nixos, ...payload.homeManager]),\n source: {\n flake: source.flake,\n homeManagerInput: source.homeManagerInput,\n nixpkgsInput: source.nixpkgsInput,\n scopes: sortScopes(source.scopes),\n system: source.system,\n },\n version: 1,\n});\n\nexport const optionMetadataDocumentToJson = (document: OptionMetadataDocument): string =>\n `${JSON.stringify(document, null, 2)}\\n`;\n\nexport const parseOptionMetadataDocument = (value: unknown): OptionMetadataDocument => {\n const record = requireRecord(value, \"Option metadata document\");\n const version = record.version;\n if (version !== 1) {\n throw new Error(`Unsupported option metadata version: ${String(version)}`);\n }\n\n return {\n options: requireArray(record.options, \"options\").map(parseOptionIR),\n source: parseSource(record.source),\n version,\n };\n};\n\nexport const parseOptionProbePayload = (value: unknown): OptionProbePayload => {\n const record = requireRecord(value, \"Option probe payload\");\n\n return {\n homeManager: requireArray(record.homeManager, \"homeManager\").map(parseOptionIR),\n nixos: requireArray(record.nixos, \"nixos\").map(parseOptionIR),\n };\n};\n\nconst parseSource = (value: unknown): OptionMetadataSource => {\n const record = requireRecord(value, \"source\");\n\n return {\n flake: requireString(record.flake, \"source.flake\"),\n homeManagerInput:\n record.homeManagerInput === null\n ? null\n : requireString(record.homeManagerInput, \"source.homeManagerInput\"),\n nixpkgsInput: requireString(record.nixpkgsInput, \"source.nixpkgsInput\"),\n scopes: requireArray(record.scopes, \"source.scopes\").map(parseScope),\n system: requireString(record.system, \"source.system\"),\n };\n};\n\nconst parseOptionIR = (value: unknown): OptionIR => {\n const record = requireRecord(value, \"option\");\n\n return {\n declarations: requireArray(record.declarations, \"option.declarations\").map((item) =>\n requireString(item, \"option.declarations[]\"),\n ),\n defaultText: requireNullableString(record.defaultText, \"option.defaultText\"),\n description: requireNullableString(record.description, \"option.description\"),\n exampleText: requireNullableString(record.exampleText, \"option.exampleText\"),\n internal: requireBoolean(record.internal, \"option.internal\"),\n path: parsePath(record.path),\n readOnly: requireBoolean(record.readOnly, \"option.readOnly\"),\n scope: parseScope(record.scope),\n type: parseType(record.type),\n visible: parseVisible(record.visible),\n };\n};\n\nconst parseType = (value: unknown): OptionTypeIR => {\n const record = requireRecord(value, \"option.type\");\n const nestedTypes = requireRecord(record.nestedTypes, \"option.type.nestedTypes\");\n\n return {\n description: requireNullableString(record.description, \"option.type.description\"),\n name: requireString(record.name, \"option.type.name\"),\n nestedTypes: Object.fromEntries(\n Object.entries(nestedTypes).map(([key, nestedType]) => [key, parseType(nestedType)]),\n ),\n };\n};\n\nconst parsePath = (value: unknown): OptionPath => {\n const path = requireArray(value, \"option.path\").map((item) =>\n requireString(item, \"option.path[]\"),\n );\n const [first, ...rest] = path;\n if (first === undefined) {\n throw new Error(\"Option paths must contain at least one segment\");\n }\n\n return [first, ...rest];\n};\n\nconst parseScope = (value: unknown): OptionScope => {\n switch (value) {\n case \"home-manager\":\n case \"nixos\":\n return value;\n default:\n throw new Error(`Unexpected option scope: ${String(value)}`);\n }\n};\n\nconst parseVisible = (value: unknown): OptionIR[\"visible\"] => {\n if (value === true || value === false || value === \"shallow\") return value;\n\n throw new Error(`Unexpected option visibility: ${String(value)}`);\n};\n\nconst sortOptions = (options: readonly OptionIR[]): readonly OptionIR[] =>\n options.toSorted((left, right) => {\n const scopeOrder = left.scope.localeCompare(right.scope);\n if (scopeOrder !== 0) return scopeOrder;\n\n return left.path.join(\".\").localeCompare(right.path.join(\".\"));\n });\n\nconst sortScopes = (scopes: readonly OptionScope[]): readonly OptionScope[] =>\n [...new Set(scopes)].toSorted((left, right) => left.localeCompare(right));\n\nconst requireRecord = (value: unknown, name: string): Readonly<Record<string, unknown>> => {\n if (isRecord(value)) return value;\n\n throw new Error(`${name} must be an object`);\n};\n\nconst isRecord = (value: unknown): value is Readonly<Record<string, unknown>> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst requireArray = (value: unknown, name: string): readonly unknown[] => {\n if (Array.isArray(value)) return value;\n\n throw new Error(`${name} must be an array`);\n};\n\nconst requireString = (value: unknown, name: string): string => {\n if (typeof value === \"string\") return value;\n\n throw new Error(`${name} must be a string`);\n};\n\nconst requireNullableString = (value: unknown, name: string): string | null => {\n if (value === null || typeof value === \"string\") return value;\n\n throw new Error(`${name} must be a string or null`);\n};\n\nconst requireBoolean = (value: unknown, name: string): boolean => {\n if (typeof value === \"boolean\") return value;\n\n throw new Error(`${name} must be a boolean`);\n};\n","import * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport { OptionMetadataParseError, UnsupportedOptionsFound } from \"../errors.ts\";\nimport { runCommandString } from \"../process.ts\";\nimport {\n collectUnsupportedOptions,\n generateOptionTypeFile,\n type OptionTypeRoot,\n} from \"./generate.ts\";\nimport type { OptionPath, OptionScope } from \"./ir.ts\";\nimport {\n defaultHomeManagerOptionPaths,\n defaultNixOSOptionPaths,\n projectFlakeInput,\n renderOptionProbeExpression,\n type OptionProbeOptions,\n} from \"./probe.ts\";\nimport {\n makeOptionMetadataDocument,\n optionMetadataDocumentToJson,\n parseOptionMetadataDocument,\n parseOptionProbePayload,\n type OptionMetadataDocument,\n} from \"./document.ts\";\n\nexport interface ProbeProjectOptions {\n readonly flake: string;\n readonly homeManagerInput: string;\n readonly homeManagerOptionPaths?: readonly OptionPath[];\n readonly nixosOptionPaths?: readonly OptionPath[];\n readonly nixpkgsInput: string;\n readonly output: string;\n readonly scopes: readonly OptionScope[];\n readonly system: string;\n}\n\nexport interface GenerateProjectOptions {\n readonly input: string;\n readonly output: string;\n readonly strict?: boolean;\n}\n\nexport const defaultOptionScopes = [\n \"nixos\",\n \"home-manager\",\n] as const satisfies readonly OptionScope[];\n\nexport const probeProjectOptions = (options: ProbeProjectOptions) =>\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const flakeRoot = path.resolve(options.flake);\n const flakeReference = yield* resolveFlakeReference(flakeRoot);\n const scopes = normalizeScopes(options.scopes);\n const includesNixOS = scopes.includes(\"nixos\");\n const includesHomeManager = scopes.includes(\"home-manager\");\n\n const probeOptions: OptionProbeOptions = {\n nixpkgs: projectFlakeInput(flakeReference, options.nixpkgsInput),\n system: options.system,\n ...(includesHomeManager\n ? {\n homeManager: projectFlakeInput(flakeReference, options.homeManagerInput),\n homeManagerOptions: {\n optionPaths: options.homeManagerOptionPaths ?? defaultHomeManagerOptionPaths,\n },\n }\n : {}),\n ...(includesNixOS\n ? {\n nixosOptions: {\n optionPaths: options.nixosOptionPaths ?? defaultNixOSOptionPaths,\n },\n }\n : {}),\n };\n const expression = renderOptionProbeExpression(probeOptions);\n const output = yield* runCommandString({\n args: [\"eval\", \"--impure\", \"--json\", \"--expr\", expression],\n command: \"nix\",\n });\n const payload = yield* parseProbeOutput(output);\n const document = makeOptionMetadataDocument(\n {\n flake: flakeReference,\n homeManagerInput: includesHomeManager ? options.homeManagerInput : null,\n nixpkgsInput: options.nixpkgsInput,\n scopes,\n system: options.system,\n },\n payload,\n );\n const outputPath = path.resolve(options.output);\n\n yield* fs.makeDirectory(path.dirname(outputPath), { recursive: true });\n yield* fs.writeFileString(outputPath, optionMetadataDocumentToJson(document));\n\n return document;\n });\n\nexport const generateProjectOptionTypes = (options: GenerateProjectOptions) =>\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const inputPath = path.resolve(options.input);\n const outputPath = path.resolve(options.output);\n const document = yield* readOptionMetadataDocument(inputPath);\n const unsupported = collectUnsupportedOptions(document.options);\n\n if (options.strict === true && unsupported.length > 0) {\n return yield* new UnsupportedOptionsFound({\n options: unsupported.map((option) => `${option.scope}:${option.path.join(\".\")}`),\n });\n }\n\n yield* fs.makeDirectory(path.dirname(outputPath), { recursive: true });\n yield* fs.writeFileString(outputPath, renderGeneratedOptions(document));\n\n return { document, unsupported };\n });\n\nexport const readOptionMetadataDocument = (inputPath: string) =>\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const text = yield* fs.readFileString(inputPath);\n\n return yield* parseMetadataText(text, inputPath);\n });\n\nexport const renderGeneratedOptions = (document: OptionMetadataDocument): string =>\n generateOptionTypeFile({\n fixtureScope: `project-local ${document.source.scopes.join(\" + \")} options from ${document.source.flake}.`,\n importPath: \"typeflake\",\n options: document.options,\n roots: rootsForScopes(document.source.scopes),\n });\n\nexport const resolveFlakeReference = (flakeRoot: string) =>\n Effect.gen(function* () {\n const path = yield* Path.Path;\n const gitRoot = yield* findGitRoot(flakeRoot);\n if (gitRoot === null) return `path:${flakeRoot}`;\n\n const relative = path.relative(gitRoot, flakeRoot);\n const base = `git+file://${gitRoot}`;\n if (relative === \"\") return base;\n\n return `${base}?dir=${encodeFlakeDir(relative, path.sep)}`;\n });\n\nconst rootsForScopes = (scopes: readonly OptionScope[]): readonly OptionTypeRoot[] =>\n normalizeScopes(scopes).map((scope) =>\n scope === \"nixos\"\n ? { rootTypeName: \"NixOSGeneratedConfig\", scope }\n : { rootTypeName: \"HomeManagerGeneratedConfig\", scope },\n );\n\nconst normalizeScopes = (scopes: readonly OptionScope[]): readonly OptionScope[] => {\n const normalized = [...new Set(scopes)];\n return normalized.length === 0 ? defaultOptionScopes : normalized;\n};\n\nconst findGitRoot = (start: string) =>\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n let current = path.resolve(start);\n\n while (true) {\n if (yield* fs.exists(path.join(current, \".git\"))) return current;\n\n const parent = path.dirname(current);\n if (parent === current) return null;\n\n current = parent;\n }\n });\n\nconst encodeFlakeDir = (relative: string, separator: string): string =>\n relative.split(separator).map(encodeURIComponent).join(\"/\");\n\nconst parseProbeOutput = (text: string) =>\n Effect.try({\n try: () => parseOptionProbePayload(JSON.parse(text)),\n catch: (cause) => new OptionMetadataParseError({ cause }),\n });\n\nconst parseMetadataText = (text: string, path: string) =>\n Effect.try({\n try: () => parseOptionMetadataDocument(JSON.parse(text)),\n catch: (cause) => new OptionMetadataParseError({ cause, path }),\n });\n"],"mappings":";;;;;;;;;AAEA,IAAa,mBAAb,cAAsC,KAAK,YAAY,kBAAkB,CAAC,CAGvE,CAAC;AAEJ,IAAa,iBAAb,cAAoC,KAAK,YAAY,gBAAgB,CAAC,CAGnE,CAAC;AAEJ,IAAa,wBAAb,cAA2C,KAAK,YAAY,uBAAuB,CAAC,CAGjF,CAAC;AAEJ,IAAa,eAAb,cAAkC,KAAK,YAAY,cAAc,CAAC,CAE/D,CAAC;AAEJ,IAAa,2BAAb,cAA8C,KAAK,YAAY,0BAA0B,CAAC,CAGvF,CAAC;AAEJ,IAAa,0BAAb,cAA6C,KAAK,YAAY,yBAAyB,CAAC,CAErF,CAAC;;;ACfJ,MAAa,sBAAsB,YACjC,OAAO,IAAI,aAAa;CACtB,MAAM,UAAU,OAAO,oBAAoB;CAC3C,MAAM,UAAU,aAAa,KAAK,QAAQ,SAAS,QAAQ,MAAM;EAC/D,QAAQ,QAAQ,UAAU;EAC1B,OAAO,QAAQ,SAAS;EACxB,QAAQ,QAAQ,UAAU;CAC5B,CAAC;CACD,MAAM,WAAW,OAAO,QAAQ,SAAS,OAAO;CAEhD,OAAO,OAAO,QAAQ;AACxB,CAAC;AAEH,MAAa,oBAAoB,YAC/B,OAAO,IAAI,aAAa;CACtB,MAAM,UAAU,OAAO,oBAAoB;CAC3C,MAAM,UAAU,aAAa,KAAK,QAA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,WAAW,wBAAwB,KAAK,MAAM,IAAI,CAAC;CACnD,QAAQ,UAAU,IAAI,yBAAyB,EAAE,MAAM,CAAC;AAC1D,CAAC;AAEH,MAAM,qBAAqB,MAAc,SACvC,OAAO,IAAI;CACT,WAAW,4BAA4B,KAAK,MAAM,IAAI,CAAC;CACvD,QAAQ,UAAU,IAAI,yBAAyB;EAAE;EAAO;CAAK,CAAC;AAChE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "typeflake",
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"description": "TypeScript and Effect authoring for real Nix flakes.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"effect",
|
|
7
|
+
"flakes",
|
|
8
|
+
"nix",
|
|
9
|
+
"nixos",
|
|
10
|
+
"typescript"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://git.schnau.dev/schnau/typeflake",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://git.schnau.dev/schnau/typeflake/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Hauke Schnau <hauke@schnau.dev>",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+ssh://git@git.schnau.dev/schnau/typeflake.git"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"typeflake": "bin/typeflake.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin",
|
|
27
|
+
"dist",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"types": "./dist/index.d.mts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.mts",
|
|
36
|
+
"import": "./dist/index.mjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsdown src/index.ts src/cli.ts --format esm --dts --out-dir dist --clean --target node22 --platform node",
|
|
44
|
+
"check": "nub run check:types && nub run check:effect && nub run lint && nub run test && nub run format:check",
|
|
45
|
+
"check:effect": "tsgo --noEmit --project tsconfig.json",
|
|
46
|
+
"check:types": "oxlint . --type-aware --type-check --deny-warnings",
|
|
47
|
+
"format": "oxfmt .",
|
|
48
|
+
"format:check": "oxfmt . --check",
|
|
49
|
+
"lint": "oxlint . --type-aware --deny-warnings --report-unused-disable-directives",
|
|
50
|
+
"pack:dry": "npm pack --dry-run",
|
|
51
|
+
"prepack": "nub run build",
|
|
52
|
+
"prepublishOnly": "nub run check",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"tsgo:patch": "effect-tsgo patch",
|
|
55
|
+
"typeflake": "nub src/cli.ts"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@effect/platform-node": "4.0.0-beta.93",
|
|
59
|
+
"@effect/tsgo": "0.16.0",
|
|
60
|
+
"@typescript/native-preview": "7.0.0-dev.20260703.1",
|
|
61
|
+
"effect": "4.0.0-beta.93"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@arktype/attest": "0.56.2",
|
|
65
|
+
"@effect/vitest": "4.0.0-beta.93",
|
|
66
|
+
"@types/node": "24.10.0",
|
|
67
|
+
"@vitest/runner": "4.1.4",
|
|
68
|
+
"oxfmt": "0.57.0",
|
|
69
|
+
"oxlint": "1.72.0",
|
|
70
|
+
"oxlint-tsgolint": "0.24.0",
|
|
71
|
+
"tsdown": "0.22.3",
|
|
72
|
+
"typescript": "5.9.3",
|
|
73
|
+
"vitest": "4.1.4"
|
|
74
|
+
},
|
|
75
|
+
"engines": {
|
|
76
|
+
"node": ">=22"
|
|
77
|
+
},
|
|
78
|
+
"packageManager": "pnpm@11.9.0"
|
|
79
|
+
}
|