@znight/cli 0.6.4 → 0.6.6

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as main } from "./main-CLoS12u4.mjs";
2
+ import { n as main } from "./main-CoWyMPKl.mjs";
3
3
  // src/cli.ts
4
4
  /**
5
5
  * The `znight` binary. Everything lives in `main()`; this file only wires the process: arguments,
package/dist/index.d.mts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * `@znight/cli`: the `znight` command (`znight new`, `generate`, `g`, `dev`, `build`, `start`).
3
+ *
4
+ * The programmatic API runs the CLI in-process (`main(['build'])`) and exposes the pure building
5
+ * blocks: project templates, schematics and the restart supervisor of `znight dev`.
6
+ */
1
7
  import { ArgsDef, ParsedArgs } from "citty";
2
8
  import picocolors from "picocolors";
3
9
  import { InlineConfig, Plugin } from "vite";
@@ -694,5 +700,4 @@ export declare function main(argv: readonly string[], options?: CliContextOption
694
700
  * Projects created by `znight new` depend on `@znight/*` packages at `^<version>`.
695
701
  */
696
702
  export declare function cliVersion(): string;
697
- export type { AppSupervisorOptions, CheckResultLike, ChildHandle, CliContext, CliContextOptions, CliServices, Command, CommandDefinition, CommandMeta, CommandRunContext, CompileResultLike, CompilerApi, CompilerChanges, CompilerModule, Diagnostic, DiagnosticLocation, ExecveFunction, ExitStatus, Feature, FileWatcher, FormatDiagnosticsOptions, GenerateResultLike, HostRuntime, HttpAdapterName, IncrementalCompiler, OpenApiEmitApi, OpenApiEmitOptionsLike, OpenApiEmitResultLike, OpenApiViteApi, OpenApiVitePluginOptionsLike, OpenApiWarningLike, OutputStream, PackageManager, PlanSchematicOptions, ProcessService, ProjectFile, ProjectOptions, PromptChoice, Prompts, Reporter, RunOptions, RunResult, RuntimeName, RuntimeOption, Schematic, SchematicContext, SchematicName, SchematicNames, SchematicPlan, SignalSource, SpawnOptions, SupervisorEvents, WatchFactory, WatchTarget, ZnightConfigLike, ZnightOptions };
698
- //# sourceMappingURL=index.d.mts.map
703
+ export type { AppSupervisorOptions, CheckResultLike, ChildHandle, CliContext, CliContextOptions, CliServices, Command, CommandDefinition, CommandMeta, CommandRunContext, CompileResultLike, CompilerApi, CompilerChanges, CompilerModule, Diagnostic, DiagnosticLocation, ExecveFunction, ExitStatus, Feature, FileWatcher, FormatDiagnosticsOptions, GenerateResultLike, HostRuntime, HttpAdapterName, IncrementalCompiler, OpenApiEmitApi, OpenApiEmitOptionsLike, OpenApiEmitResultLike, OpenApiViteApi, OpenApiVitePluginOptionsLike, OpenApiWarningLike, OutputStream, PackageManager, PlanSchematicOptions, ProcessService, ProjectFile, ProjectOptions, PromptChoice, Prompts, Reporter, RunOptions, RunResult, RuntimeName, RuntimeOption, Schematic, SchematicContext, SchematicName, SchematicNames, SchematicPlan, SignalSource, SpawnOptions, SupervisorEvents, WatchFactory, WatchTarget, ZnightConfigLike, ZnightOptions };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { d as AppSupervisor, t as COMMANDS, _ as CancelledError, v as CliError, s as DEFAULT_FEATURES, y as ExitCode, c as FEATURES, l as HTTP_ADAPTERS, u as PACKAGE_MANAGERS, r as SCHEMATICS, b as UsageError, m as adaptCompilerModule, p as cliVersion, f as createContext, g as defineCommand, i as findSchematic, h as loadCompiler, n as main, a as planSchematic, o as renderProject } from "./main-CLoS12u4.mjs";
1
+ export { d as AppSupervisor, t as COMMANDS, _ as CancelledError, v as CliError, s as DEFAULT_FEATURES, y as ExitCode, c as FEATURES, l as HTTP_ADAPTERS, u as PACKAGE_MANAGERS, r as SCHEMATICS, b as UsageError, m as adaptCompilerModule, p as cliVersion, f as createContext, g as defineCommand, i as findSchematic, h as loadCompiler, n as main, a as planSchematic, o as renderProject } from "./main-CoWyMPKl.mjs";
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  import { parseArgs } from "citty";
4
4
  import { stripVTControlCharacters } from "node:util";
5
5
  import picocolors from "picocolors";
6
- import { accessSync, constants, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, watch, writeFileSync } from "node:fs";
6
+ import { accessSync, constants, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, watch as watch$1, writeFileSync } from "node:fs";
7
7
  import { basename, delimiter, dirname, isAbsolute, join, normalize, posix, relative, resolve, sep } from "node:path";
8
8
  import { pathToFileURL } from "node:url";
9
9
  import { spawn } from "node:child_process";
@@ -1049,7 +1049,7 @@ const watchFiles = (targets, onChange) => {
1049
1049
  if (!existsSync(target.path)) continue;
1050
1050
  let watcher;
1051
1051
  try {
1052
- watcher = watch(target.path, { recursive: target.recursive }, (_event, filename) => {
1052
+ watcher = watch$1(target.path, { recursive: target.recursive }, (_event, filename) => {
1053
1053
  if (filename === null) {
1054
1054
  onChange(target.path);
1055
1055
  return;
@@ -1928,7 +1928,7 @@ const generateCommand = defineCommand({
1928
1928
  const configLoader = args["config-loader"];
1929
1929
  const options = await compilerOptions(cli, compiler, root, args.config, configLoader);
1930
1930
  if (args.check === true) return check(cli, compiler, options);
1931
- if (args.watch === true) return watch$1(cli, compiler, options);
1931
+ if (args.watch === true) return watch(cli, compiler, options);
1932
1932
  return hasErrors((await generateOnce(cli, compiler, options)).diagnostics) ? 1 : 0;
1933
1933
  }
1934
1934
  });
@@ -2059,7 +2059,7 @@ async function check(cli, compiler, options) {
2059
2059
  cli.reporter.success(`${cli.colors.bold(file)} is up to date ${cli.colors.dim(`(${statsOf(result, performance.now() - started)})`)}`);
2060
2060
  return 0;
2061
2061
  }
2062
- async function watch$1(cli, compiler, options) {
2062
+ async function watch(cli, compiler, options) {
2063
2063
  const root = options.root ?? cli.cwd;
2064
2064
  const realRoot = realPath(root);
2065
2065
  const incremental = compiler.createIncremental(options);
@@ -4262,4 +4262,4 @@ function stackOf(error) {
4262
4262
  }
4263
4263
  export { CancelledError as _, planSchematic as a, UsageError as b, FEATURES as c, AppSupervisor as d, createContext as f, defineCommand as g, loadCompiler as h, findSchematic as i, HTTP_ADAPTERS as l, adaptCompilerModule as m, main as n, renderProject as o, cliVersion as p, SCHEMATICS as r, DEFAULT_FEATURES as s, COMMANDS as t, PACKAGE_MANAGERS as u, CliError as v, ExitCode as y };
4264
4264
 
4265
- //# sourceMappingURL=main-CLoS12u4.mjs.map
4265
+ //# sourceMappingURL=main-CoWyMPKl.mjs.map