@incajs/cli 0.0.14 → 0.0.16

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.
Files changed (42) hide show
  1. package/README.md +5 -5
  2. package/dist/chunks/{defaults-TOBTBbDy.js → defaults-Ct95BSBl.js} +1 -0
  3. package/dist/cli.js +893 -414
  4. package/dist/config.js +1 -1
  5. package/dist/hmr-runtime.js +14 -13
  6. package/dist/{adapter → src/adapter}/types.d.mts +20 -13
  7. package/dist/{adapter → src/adapter}/vite/build.d.mts +2 -3
  8. package/dist/{adapter → src/adapter}/vite/captureOutput.d.mts +2 -3
  9. package/dist/{adapter → src/adapter}/vite/config.d.mts +9 -8
  10. package/dist/{adapter → src/adapter}/vite/emitConfig.d.mts +1 -1
  11. package/dist/{adapter → src/adapter}/vite/hmr.d.mts +1 -1
  12. package/dist/{adapter → src/adapter}/vite/logger.d.mts +1 -1
  13. package/dist/{adapter → src/adapter}/vite/unsupported.d.mts +1 -1
  14. package/dist/{adapter → src/adapter}/vite/watch.d.mts +1 -1
  15. package/dist/{build.d.mts → src/build.d.mts} +5 -4
  16. package/dist/{config → src/config}/defaults.d.mts +4 -4
  17. package/dist/{config → src/config}/index.d.mts +2 -2
  18. package/dist/{config → src/config}/loader.d.mts +3 -1
  19. package/dist/{config → src/config}/types.d.mts +10 -4
  20. package/dist/src/defaultBundler.d.mts +7 -0
  21. package/dist/{dev-client → src/dev-client}/hostBin.d.mts +1 -1
  22. package/dist/{dev-client → src/dev-client}/hostClient.d.mts +11 -13
  23. package/dist/{dev-client → src/dev-client}/protocol.d.mts +1 -1
  24. package/dist/{dev.d.mts → src/dev.d.mts} +2 -2
  25. package/dist/{log.d.mts → src/log.d.mts} +5 -3
  26. package/dist/{package.d.mts → src/package.d.mts} +7 -5
  27. package/dist/{plist.d.mts → src/plist.d.mts} +1 -1
  28. package/package.json +7 -6
  29. package/dist/defaultBundler.d.mts +0 -8
  30. /package/dist/{adapter → src/adapter}/vite/createBundler.d.mts +0 -0
  31. /package/dist/{adapter → src/adapter}/vite/index.d.mts +0 -0
  32. /package/dist/{adapterCore.d.mts → src/adapterCore.d.mts} +0 -0
  33. /package/dist/{cli.d.mts → src/cli.d.mts} +0 -0
  34. /package/dist/{dev-client → src/dev-client}/hostError.d.mts +0 -0
  35. /package/dist/{dev-client → src/dev-client}/index.d.mts +0 -0
  36. /package/dist/{devLock.d.mts → src/devLock.d.mts} +0 -0
  37. /package/dist/{entry.d.mts → src/entry.d.mts} +0 -0
  38. /package/dist/{error.d.mts → src/error.d.mts} +0 -0
  39. /package/dist/{index.d.mts → src/index.d.mts} +0 -0
  40. /package/dist/{macosApp.d.mts → src/macosApp.d.mts} +0 -0
  41. /package/dist/{retryOnEdit.d.mts → src/retryOnEdit.d.mts} +0 -0
  42. /package/dist/{watchForEdit.d.mts → src/watchForEdit.d.mts} +0 -0
package/dist/config.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./chunks/defaults-TOBTBbDy.js";
1
+ import { t as e } from "./chunks/defaults-Ct95BSBl.js";
2
2
  //#region src/config/index.mts
3
3
  var t = (e) => e;
4
4
  //#endregion
@@ -1109,11 +1109,12 @@ function bt(e, t) {
1109
1109
  }
1110
1110
  //#endregion
1111
1111
  //#region src/adapter/vite/runtime/createIncaDevTransport.mts
1112
- function xt(e) {
1112
+ var xt = "this code needs a host that serves the development protocol. start the app with `inca dev`.";
1113
+ function St(e) {
1113
1114
  return {
1114
1115
  connect({ onMessage: t }) {
1115
1116
  let n = globalThis.__inca_dev__;
1116
- if (!n) throw Error("__inca_dev__ is not installed — this build is not a dev build");
1117
+ if (!n) throw Error(xt);
1117
1118
  n.receive = (n, r) => {
1118
1119
  if (n !== "vite") return;
1119
1120
  let i = JSON.parse(r);
@@ -1122,18 +1123,18 @@ function xt(e) {
1122
1123
  },
1123
1124
  send(e) {
1124
1125
  let t = globalThis.__inca_dev__;
1125
- if (!t) throw Error("__inca_dev__ is not installed — this build is not a dev build");
1126
+ if (!t) throw Error(xt);
1126
1127
  t.send("vite", JSON.stringify(e));
1127
1128
  }
1128
1129
  };
1129
1130
  }
1130
1131
  //#endregion
1131
1132
  //#region src/adapter/vite/runtime/createIncaEvaluator.mts
1132
- var St = class extends H {
1133
+ var Ct = class extends H {
1133
1134
  startOffset = 1;
1134
1135
  async runInlinedModule(e, t, n) {
1135
1136
  let r = globalThis.__inca_dev__;
1136
- if (!r?.compile) throw Error("__inca_dev__.compile is not installed");
1137
+ if (!r?.compile) throw Error("this code needs a host that compiles modules for the development protocol. start the app with `inca dev`.");
1137
1138
  let i = [
1138
1139
  F,
1139
1140
  B,
@@ -1145,18 +1146,18 @@ var St = class extends H {
1145
1146
  await r.compile(i, t.replaceAll("\0", "\\u0000"), n.id.replaceAll("\0", "\\u0000"))(...i.map((t) => e[t])), Object.seal(e[F]);
1146
1147
  }
1147
1148
  };
1148
- function Ct() {
1149
- return new St();
1149
+ function wt() {
1150
+ return new Ct();
1150
1151
  }
1151
1152
  //#endregion
1152
1153
  //#region src/adapter/vite/runtime/start.mts
1153
- function wt(e) {
1154
+ function Tt(e) {
1154
1155
  return typeof e == "object" && !!e && "runnerError" in e;
1155
1156
  }
1156
- async function Tt(e) {
1157
+ async function Et(e) {
1157
1158
  let t = () => {}, n = new yt({
1158
1159
  transport: {
1159
- ...xt(() => t()),
1160
+ ...St(() => t()),
1160
1161
  timeout: 0
1161
1162
  },
1162
1163
  hmr: { logger: {
@@ -1164,7 +1165,7 @@ async function Tt(e) {
1164
1165
  error: () => {}
1165
1166
  } },
1166
1167
  sourcemapInterceptor: !1
1167
- }, Ct());
1168
+ }, wt());
1168
1169
  for (;;) {
1169
1170
  let r = new Promise((e) => {
1170
1171
  t = e;
@@ -1172,10 +1173,10 @@ async function Tt(e) {
1172
1173
  try {
1173
1174
  return await n.import(e);
1174
1175
  } catch (e) {
1175
- wt(e) || Promise.reject(e), globalThis.__inca_dev__?.setLoadFailed?.(!0);
1176
+ Tt(e) || Promise.reject(e), globalThis.__inca_dev__?.setLoadFailed?.(!0);
1176
1177
  }
1177
1178
  await r, n.clearCache(), globalThis.__inca_dev__?.setLoadFailed?.(!1);
1178
1179
  }
1179
1180
  }
1180
1181
  //#endregion
1181
- export { Tt as start };
1182
+ export { Et as start };
@@ -1,16 +1,18 @@
1
- /** A running build watch — the value {@link Bundler.watch} resolves to. */
1
+ /** A running build watch. {@link Bundler.watch} resolves to this value. */
2
2
  export interface Watcher {
3
3
  /** Stops watching and releases the underlying build process. */
4
4
  close(): Promise<void>;
5
5
  }
6
6
  /** Options for {@link Bundler.build}. */
7
7
  export interface BuildOptions {
8
- /** The app's own entry point — may import `.vue` files. */
8
+ /** The app's own entry point. It may import `.vue` files. */
9
9
  entry: string;
10
10
  /** Where the build's output is written. */
11
11
  outDir: string;
12
+ /** Writes `bundle.js.map` beside the bundle. Defaults to `false`. */
13
+ sourcemap?: boolean;
12
14
  /**
13
- * Values the built app carries for `inca-host` to read — its name, id
15
+ * Values the built app carries for `inca-host` to read: its name, id
14
16
  * and window. Any JSON-serializable object.
15
17
  */
16
18
  runtimeConfig?: unknown;
@@ -42,13 +44,19 @@ export interface BuildFailure {
42
44
  /** An `ERR_INCA_*` identifier, when the failure has one to look up. */
43
45
  code?: string | null;
44
46
  }
45
- /** What a build wrote — the result of {@link Bundler.build}, and every {@link BundlerOptions.onBuild} call. */
47
+ /**
48
+ * What a build wrote. It is the result of {@link Bundler.build} and of every
49
+ * {@link BundlerOptions.onBuild} call.
50
+ */
46
51
  export interface BuildOutput {
47
52
  /** Directory holding every file this build emitted. */
48
53
  outDir: string;
49
54
  /** Absolute path to the entry module `inca-host` evaluates. */
50
55
  entryFile: string;
51
- /** Every file this build emitted, relative to `outDir` — may include chunks and assets besides the entry itself. */
56
+ /**
57
+ * Every file this build emitted, relative to `outDir`. It may include chunks and assets besides
58
+ * the entry itself.
59
+ */
52
60
  files: readonly string[];
53
61
  /** The change that triggered this rebuild. Absent from a one-shot build and a watch's first build. */
54
62
  changed?: {
@@ -58,12 +66,12 @@ export interface BuildOutput {
58
66
  }
59
67
  /** Options for {@link Bundler.hmr}. */
60
68
  export interface HmrOptions {
61
- /** The app's own entry point — may import `.vue` files. */
69
+ /** The app's own entry point. It may import `.vue` files. */
62
70
  entry: string;
63
- /** The app's root directory — where its dev-only scratch files are written. */
71
+ /** The app's root directory, where its dev-only scratch files are written. */
64
72
  cwd: string;
65
73
  /**
66
- * Values the built app carries for `inca-host` to read — its name, id
74
+ * Values the built app carries for `inca-host` to read: its name, id
67
75
  * and window. Any JSON-serializable object.
68
76
  */
69
77
  runtimeConfig?: unknown;
@@ -87,7 +95,7 @@ export interface HmrOptions {
87
95
  took: number;
88
96
  }) => void;
89
97
  }
90
- /** A running HMR session — the value {@link Bundler.hmr} resolves to. */
98
+ /** A running HMR session. {@link Bundler.hmr} resolves to this value. */
91
99
  export interface HmrChannel extends Watcher {
92
100
  /** The synthesized entry `inca-host` evaluates for this session. */
93
101
  entryFile: string;
@@ -96,16 +104,15 @@ export interface HmrChannel extends Watcher {
96
104
  }
97
105
  /**
98
106
  * The contract a bundler adapter satisfies. Supporting another bundler
99
- * means adding a sibling adapter module and injecting its `Bundler` here —
100
- * never editing this package's own types.
107
+ * means adding a sibling adapter module and injecting its `Bundler` here.
101
108
  */
102
109
  export interface Bundler {
103
110
  watch(options: BundlerOptions): Promise<Watcher>;
104
- /** One-shot production build, used by `inca build` — rejects on failure. */
111
+ /** One-shot production build, used by `inca build`. Rejects on failure. */
105
112
  build(options: BuildOptions): Promise<BuildOutput>;
106
113
  /**
107
114
  * Module-granular dev updates, used by `inca dev --experimental-hmr`.
108
- * Optional — a bundler adapter with no HMR support simply omits it.
115
+ * Optional: omit it when the adapter has no HMR support.
109
116
  */
110
117
  hmr?(options: HmrOptions): Promise<HmrChannel>;
111
118
  }
@@ -2,7 +2,6 @@ import { AdapterCore } from '../../adapterCore.mts';
2
2
  import { BuildOptions, BuildOutput } from '../types.mts';
3
3
  /**
4
4
  * Builds `entry` into a minified, production build under `outDir` once, and
5
- * rejects on failure rather than reporting it through a callback. Never
6
- * starts or talks to `inca-host` — that's `dev.mts`'s job.
5
+ * rejects on failure. Never starts or talks to `inca-host`.
7
6
  */
8
- export declare function build(core: AdapterCore, runtimeModuleName: string, { entry, outDir, runtimeConfig, stdout, stderr, quiet, }: BuildOptions): Promise<BuildOutput>;
7
+ export declare function build(core: AdapterCore, runtimeModuleName: string, { entry, outDir, sourcemap, runtimeConfig, stdout, stderr, quiet, }: BuildOptions): Promise<BuildOutput>;
@@ -12,8 +12,7 @@ export interface CapturedOutput {
12
12
  export declare function toBuildOutput(outDir: string, captured: CapturedOutput, changed?: BuildOutput["changed"]): BuildOutput;
13
13
  /**
14
14
  * A Vite plugin reporting `sink` the files a build wrote once they land on
15
- * disk, via `writeBundle` — the one hook that fires uniformly for a
16
- * one-shot build and every watch rebuild, so both read the bundler's real
17
- * output instead of assuming a file name or layout.
15
+ * disk, via `writeBundle`, the one hook that fires uniformly for a
16
+ * one-shot build and every watch rebuild.
18
17
  */
19
18
  export declare function captureOutput(core: AdapterCore, sink: (output: CapturedOutput) => void): Plugin;
@@ -6,12 +6,14 @@ export interface ResolveConfigOptions {
6
6
  core: AdapterCore;
7
7
  /** The module compiled `.vue` templates import their helpers from. */
8
8
  runtimeModuleName: string;
9
- /** The app's own entry point — may import `.vue` files. */
9
+ /** The app's own entry point. It may import `.vue` files. */
10
10
  entry: string;
11
11
  /** Where the build's output is written. */
12
12
  outDir: string;
13
13
  /** `"development"` keeps `@vue/runtime-core`'s own warnings; `"production"` strips them. */
14
14
  mode: "development" | "production";
15
+ /** Writes the map in a production build too. Development always writes it. */
16
+ sourcemap?: boolean;
15
17
  /** Whether Vite should keep rebuilding on file changes. */
16
18
  watch: boolean;
17
19
  /** Called with what each successful (re)build wrote. */
@@ -20,9 +22,9 @@ export interface ResolveConfigOptions {
20
22
  stdout: NodeJS.WritableStream;
21
23
  /** Where Vite's warnings and errors go. */
22
24
  stderr: NodeJS.WritableStream;
23
- /** Silences the bundler's progress output — see the `quiet` option in `../types.mts`. */
25
+ /** Silences the bundler's progress output. See the `quiet` option in `../types.mts`. */
24
26
  quiet: boolean;
25
- /** Written beside the entry — see the `runtimeConfig` option in `../types.mts`. */
27
+ /** Written beside the entry. See the `runtimeConfig` option in `../types.mts`. */
26
28
  runtimeConfig?: unknown;
27
29
  }
28
30
  /**
@@ -30,9 +32,8 @@ export interface ResolveConfigOptions {
30
32
  * files via `@vitejs/plugin-vue`. Compiled templates import their helpers
31
33
  * from `runtimeModuleName`.
32
34
  *
33
- * An import the entry doesn't inline — a dynamic `import()`, or a `.vue`
34
- * file's own `<style>` block — lands as its own chunk or asset alongside
35
- * the entry, named by `chunkFileNames`/`assetFileNames` below, rather than
36
- * failing the build.
35
+ * An import the entry doesn't inline (a dynamic `import()`, or a `.vue`
36
+ * file's own `<style>` block) lands as its own chunk or asset alongside
37
+ * the entry, named by `chunkFileNames`/`assetFileNames` below.
37
38
  */
38
- export declare function resolveViteConfig({ core, runtimeModuleName, entry, outDir, mode, watch, onOutput, stdout, stderr, quiet, runtimeConfig, }: ResolveConfigOptions): InlineConfig;
39
+ export declare function resolveViteConfig({ core, runtimeModuleName, entry, outDir, mode, sourcemap, watch, onOutput, stdout, stderr, quiet, runtimeConfig, }: ResolveConfigOptions): InlineConfig;
@@ -3,7 +3,7 @@ import { Plugin } from 'vite';
3
3
  export declare const CONFIG_FILE_NAME = "inca.json";
4
4
  /**
5
5
  * Serializes `config` the way `inca.json` is written: `undefined` for
6
- * anything that shouldn't produce a file — `undefined` itself, or an
6
+ * anything that shouldn't produce a file: `undefined` itself, or an
7
7
  * object with no keys.
8
8
  */
9
9
  export declare function serializeConfig(config: unknown): string | undefined;
@@ -1,7 +1,7 @@
1
1
  import { AdapterCore } from '../../adapterCore.mts';
2
2
  import { BuildFailure, HmrChannel, HmrOptions } from '../types.mts';
3
3
  /**
4
- * A failed update's detail — the same fields a Rollup/Vite plugin
4
+ * A failed update's detail: the same fields a Rollup/Vite plugin
5
5
  * error carries beyond `message`/`stack`, when it has them.
6
6
  */
7
7
  interface UpdateError {
@@ -1,7 +1,7 @@
1
1
  import { Logger } from 'vite';
2
2
  /**
3
3
  * A Vite {@link Logger} writing to the given streams: `info` to `stdout`,
4
- * `warn`/`error` to `stderr`, all unfiltered by Vite's own `LogOptions` — a
4
+ * `warn`/`error` to `stderr`, all unfiltered by Vite's own `LogOptions`. A
5
5
  * custom logger bypasses those. `quiet` drops `info` only; `warn`/`error`
6
6
  * still write, since they report something broken, not just what changed.
7
7
  */
@@ -8,7 +8,7 @@ export interface UnsupportedFeature {
8
8
  name: string;
9
9
  /** Whether a module id is a use of the feature. */
10
10
  matches: (id: string) => boolean;
11
- /** What happens instead, and what to reach for — appended to the error. */
11
+ /** What happens instead, and what to reach for. Appended to the error. */
12
12
  hint: string;
13
13
  }
14
14
  /**
@@ -3,6 +3,6 @@ import { BundlerOptions, Watcher } from '../types.mts';
3
3
  /**
4
4
  * Builds `entry` into a build under `outDir` and rebuilds it on every
5
5
  * change, calling `onBuild` with what each rebuild wrote. Never starts,
6
- * reloads, or talks to `inca-host` — that's `dev.mts`'s job.
6
+ * reloads, or talks to `inca-host`.
7
7
  */
8
8
  export declare function watch(core: AdapterCore, runtimeModuleName: string, { onBuild, onError, stdout, stderr, quiet, ...buildOptions }: BundlerOptions): Promise<Watcher>;
@@ -8,10 +8,12 @@ export interface BuildAppOptions {
8
8
  * committed `src/main.mts`, `src/main.ts` or `src/main.js`, or `src/App.vue` wrapped in a synthesized one.
9
9
  */
10
10
  entry?: string;
11
- /** Overrides the bundler — see {@link defaultBundler} for what's wired in by default. */
11
+ /** Overrides the bundler. See {@link defaultBundler} for what's wired in by default. */
12
12
  bundler?: Bundler;
13
- /** An already-resolved config — lets `packageApp` avoid loading it twice. */
13
+ /** An already-resolved config. It lets `packageApp` avoid loading it twice. */
14
14
  config?: ResolvedBuildConfig;
15
+ /** Writes `bundle.js.map` beside the bundle. Overrides the config's `sourcemap` when set. */
16
+ sourcemap?: boolean;
15
17
  /** What the build carries for `inca-host` to read. Resolved from the app's config when absent. */
16
18
  runtimeConfig?: RuntimeConfig;
17
19
  /** Where the bundler's own output goes. Defaults to `process.stdout`. */
@@ -21,7 +23,6 @@ export interface BuildAppOptions {
21
23
  }
22
24
  /**
23
25
  * Builds the app once through the same bundler `dev` uses, and returns what
24
- * it wrote. Rejects on failure — deciding what that means for the process
25
- * is `cli.mts`'s job.
26
+ * it wrote. Rejects on failure.
26
27
  */
27
28
  export declare function build(options?: BuildAppOptions): Promise<BuildOutput>;
@@ -1,7 +1,7 @@
1
1
  import { IncaConfig } from './types.mts';
2
2
  /**
3
3
  * The `IncaConfig` fields whose default is a fixed value rather than one
4
- * derived from `package.json` or the filesystem — importable alongside
4
+ * derived from `package.json` or the filesystem. Importable alongside
5
5
  * `defineConfig` for an app that wants to inherit or reference them.
6
6
  *
7
7
  * @example
@@ -14,7 +14,7 @@ import { IncaConfig } from './types.mts';
14
14
  * });
15
15
  * ```
16
16
  */
17
- export declare const defaultConfig: Required<Pick<IncaConfig, "outDir" | "version">>;
17
+ export declare const defaultConfig: Required<Pick<IncaConfig, "outDir" | "sourcemap" | "version">>;
18
18
  /**
19
19
  * Strips an npm scope off a package name.
20
20
  *
@@ -34,8 +34,8 @@ export declare function unscopedName(name: string): string;
34
34
  export declare function slugify(name: string): string;
35
35
  /**
36
36
  * @param pkgName - `package.json`'s own `"name"`, if it has one
37
- * @returns the `productName` a plain `package.json` implies — its name with
38
- * any scope stripped — or `undefined` if it has none
37
+ * @returns the `productName` a plain `package.json` implies: its name with
38
+ * any scope stripped, or `undefined` if it has none
39
39
  */
40
40
  export declare function defaultProductName(pkgName: string | undefined): string | undefined;
41
41
  /**
@@ -2,8 +2,8 @@ import { IncaConfig } from './types.mts';
2
2
  export { defaultConfig } from './defaults.mts';
3
3
  export type { IncaConfig } from './types.mts';
4
4
  /**
5
- * Type-completion helper for `inca.config.ts` — an identity function at
6
- * runtime, the same way `defineConfig` from `vite` or `vitest/config` works.
5
+ * Type-completion helper for `inca.config.ts`. An identity function at
6
+ * runtime.
7
7
  *
8
8
  * @example
9
9
  * ```ts
@@ -1,10 +1,12 @@
1
1
  import { WindowConfig } from './types.mts';
2
- /** `entry`/`outDir` only — what `build()`/`dev()` need, with no `package.json` requirement. */
2
+ /** `entry`/`outDir` only: what `build()`/`dev()` need, with no `package.json` requirement. */
3
3
  export interface ResolvedBuildConfig {
4
4
  /** Absolute path, if `inca.config.ts` set one. */
5
5
  entry?: string;
6
6
  /** Absolute path. */
7
7
  outDir: string;
8
+ /** Whether `build`/`package` write `bundle.js.map`. */
9
+ sourcemap: boolean;
8
10
  }
9
11
  /** An app's full config, as `inca package` needs it. */
10
12
  export interface ResolvedAppConfig extends ResolvedBuildConfig {
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * An app's own `inca.config.ts` (or `.js`/`.json`), loaded by `@incajs/cli`.
3
3
  * `package.json`'s `"inca"` key still works as a fallback, but is
4
- * deprecated — this file wins where both are present.
4
+ * deprecated. This file wins where both are present.
5
5
  */
6
6
  export interface IncaConfig {
7
7
  /** Path to an icon file, resolved from the app's root directory. */
8
8
  icon?: string;
9
9
  /**
10
- * A reverse-DNS-style unique id — e.g. macOS's `CFBundleIdentifier`.
10
+ * A reverse-DNS-style unique id, e.g. macOS's `CFBundleIdentifier`.
11
11
  * @default a generated `org.inca.<slug>`
12
12
  */
13
13
  identifier?: string;
@@ -23,7 +23,7 @@ export interface IncaConfig {
23
23
  version?: string;
24
24
  /**
25
25
  * The app's entry point.
26
- * @default resolved automatically — a committed `src/main.mts`,
26
+ * @default resolved automatically: a committed `src/main.mts`,
27
27
  * `src/main.ts` or `src/main.js`, or `src/App.vue` wrapped in a
28
28
  * synthesized one
29
29
  */
@@ -33,10 +33,16 @@ export interface IncaConfig {
33
33
  * @default "dist"
34
34
  */
35
35
  outDir?: string;
36
+ /**
37
+ * Whether `inca build` and `inca package` write `bundle.js.map` beside
38
+ * the bundle. `inca dev` always writes it.
39
+ * @default false
40
+ */
41
+ sourcemap?: boolean;
36
42
  /** The window the app opens in. */
37
43
  window?: WindowConfig;
38
44
  }
39
- /** What an app declares about its window — see {@link IncaConfig.window}. */
45
+ /** What an app declares about its window. See {@link IncaConfig.window}. */
40
46
  export interface WindowConfig {
41
47
  /**
42
48
  * Initial width, in pixels. Falls back to the width the app's root
@@ -0,0 +1,7 @@
1
+ import { Bundler } from './adapter/types.mts';
2
+ /**
3
+ * `adapter/vite` wired in as the one adapter `dev` and `build` share by
4
+ * default: a single place to swap bundlers. Compiled `.vue` templates import
5
+ * their helpers from `incajs/vue/runtime`.
6
+ */
7
+ export declare const defaultBundler: Bundler;
@@ -2,7 +2,7 @@
2
2
  * Where `inca-host` itself lives: `INCA_HOST_BIN` if set, otherwise the
3
3
  * per-platform npm package for this OS/arch (`@incajs/host-<os>-<arch>`, an
4
4
  * `optionalDependency` of this package).
5
- * @throws if neither resolves — no override is set, and either this
5
+ * @throws if neither resolves: no override is set, and either this
6
6
  * platform has no published binary, or the optional dependency carrying
7
7
  * it failed to install.
8
8
  */
@@ -28,16 +28,15 @@ export interface HostClientOptions {
28
28
  onExit?: (code: number | null, signal: NodeJS.Signals | null) => void;
29
29
  /**
30
30
  * Handlers for notification `method`s this package doesn't implement
31
- * itself (e.g. a future Vite integration), keyed by method name —
32
- * `params` forwarded untouched.
31
+ * itself (e.g. a future Vite integration), keyed by method name.
32
+ * `params` are forwarded untouched.
33
33
  */
34
34
  integrations?: Record<string, (params: unknown) => void>;
35
35
  }
36
36
  /**
37
37
  * Spawns `inca-host --dev <entryFile>` and speaks newline-delimited
38
38
  * JSON-RPC 2.0 on its stdin/stdout. One instance owns exactly one child
39
- * process for its whole lifetime — a reload is a `reload` call on the same
40
- * child, never a respawn.
39
+ * process for its whole lifetime. A reload is a `reload` call on that child.
41
40
  */
42
41
  export declare class HostClient {
43
42
  #private;
@@ -51,22 +50,21 @@ export declare class HostClient {
51
50
  start(): Promise<void>;
52
51
  /**
53
52
  * Sends a request and resolves with its result once the host answers.
54
- * With `timeoutMs`, rejects once that much time passes with no answer —
55
- * the host answers on the same thread that runs the app's JS, so a
56
- * wedged app leaves a call pending forever otherwise.
53
+ * With `timeoutMs`, rejects once that much time passes with no answer.
54
+ * The host answers on the same thread that runs the app's JS, so a
55
+ * wedged app never answers.
57
56
  */
58
57
  call(method: string, params?: unknown, timeoutMs?: number): Promise<unknown>;
59
58
  /**
60
- * Sends a fire-and-forget notification — no `id`, so no reply is ever
59
+ * Sends a fire-and-forget notification: no `id`, so no reply is ever
61
60
  * awaited. Used for traffic a bundler integration owns (e.g. Vite's HMR
62
- * payloads), which answers itself over the same named channel rather than
63
- * through this client's request/reply bookkeeping.
61
+ * payloads).
64
62
  */
65
63
  notify(method: string, params?: unknown): void;
66
64
  /**
67
- * Asks the host to `shutdown` and waits for the child to actually exit —
68
- * that exit is the real acknowledgement, not the response. Kills it once
69
- * `timeoutMs` passes without that, so a wedged app can't block teardown.
65
+ * Asks the host to `shutdown` and waits for the child to actually exit.
66
+ * That exit is the acknowledgement. Kills it once `timeoutMs` passes without
67
+ * that, so a wedged app can't block teardown.
70
68
  */
71
69
  stop(timeoutMs?: number): Promise<void>;
72
70
  }
@@ -1,7 +1,7 @@
1
1
  export declare const JSONRPC = "2.0";
2
2
  /**
3
3
  * The host method-set revision this package expects, checked against
4
- * `ready`'s `params.protocol` — a mismatch means an incompatible host
4
+ * `ready`'s `params.protocol`: a mismatch means an incompatible host
5
5
  * build.
6
6
  */
7
7
  export declare const HOST_PROTOCOL_VERSION = 0;
@@ -7,11 +7,11 @@ export interface DevOptions {
7
7
  * committed `src/main.mts`, `src/main.ts` or `src/main.js`, or `src/App.vue` wrapped in a synthesized one.
8
8
  */
9
9
  entry?: string;
10
- /** Overrides the bundler — see {@link defaultBundler} for what's wired in by default. */
10
+ /** Overrides the bundler. See {@link defaultBundler} for what's wired in by default. */
11
11
  bundler?: Bundler;
12
12
  /**
13
13
  * Delivers module-granular updates instead of a full reload on every
14
- * change, over `bundler.hmr` — see `--experimental-hmr`.
14
+ * change, over `bundler.hmr`. See `--experimental-hmr`.
15
15
  */
16
16
  experimentalHmr?: boolean;
17
17
  /**
@@ -9,6 +9,8 @@ export declare const STAMPED: {
9
9
  };
10
10
  /** Writes one `[inca] <message>` line to `stream`. */
11
11
  export declare function log(stream: NodeJS.WritableStream, message: string, options?: LogOptions): void;
12
+ /** Writes one `[inca] <message>` line to `stream`, with the tag in yellow. */
13
+ export declare function warn(stream: NodeJS.WritableStream, message: string, options?: LogOptions): void;
12
14
  /** A failure reduced to the message and stack worth printing. */
13
15
  export interface Fault {
14
16
  message: string;
@@ -17,8 +19,8 @@ export interface Fault {
17
19
  code?: string | null;
18
20
  }
19
21
  /**
20
- * Reduces an error a bundler re-wrapped: its text is kept whole — the
21
- * excerpt a compiler points at is the useful part — while the error class
22
+ * Reduces an error a bundler re-wrapped: its text is kept whole. The
23
+ * excerpt a compiler points at is the useful part, while the error class
22
24
  * and any `ERR_INCA_*` marker are lifted off the first line, the latter
23
25
  * into the fault's code.
24
26
  */
@@ -27,7 +29,7 @@ export declare function bundlerFault(message: string): Fault;
27
29
  export declare function toFault(error: unknown): Fault;
28
30
  /**
29
31
  * Writes the stack (when there is one) followed by `[inca] <label>
30
- * (<code>): <message>` to `stream` — the code only when the failure
32
+ * (<code>): <message>` to `stream`. The code appears only when the failure
31
33
  * carries one. The tagged line goes last so it stays the thing visible
32
34
  * without scrolling back through the stack above it.
33
35
  */
@@ -11,14 +11,16 @@ export interface PackageAppOptions {
11
11
  * in a synthesized one.
12
12
  */
13
13
  entry?: string;
14
- /** Overrides the bundler — see {@link build}'s default. */
14
+ /** Overrides the bundler. See {@link build}'s default. */
15
15
  bundler?: Bundler;
16
16
  /**
17
17
  * Overrides which `inca-host` binary gets embedded in the packaged
18
18
  * app, in place of automatic resolution (`INCA_HOST_BIN`, then the
19
- * per-platform `@incajs/host-*` package — see {@link resolveHostBin}).
19
+ * per-platform `@incajs/host-*` package. See {@link resolveHostBin}).
20
20
  */
21
21
  hostBin?: string;
22
+ /** Writes `bundle.js.map` beside the bundle. Overrides the config's `sourcemap` when set. */
23
+ sourcemap?: boolean;
22
24
  /**
23
25
  * The platform to package for. Defaults to whichever one the current
24
26
  * process is running on.
@@ -31,13 +33,13 @@ export interface PackageAppOptions {
31
33
  }
32
34
  /** The result of a successful {@link packageApp} call. */
33
35
  export interface PackageResult {
34
- /** The packaged app's path — a `.app` directory on macOS, a plain directory on Linux. */
36
+ /** The packaged app's path: a `.app` directory on macOS, a plain directory on Linux. */
35
37
  appPath: string;
36
38
  }
37
39
  /**
38
40
  * Builds the app and pairs it with the prebuilt `inca-host` into a
39
- * distributable, platform-native application — a `.app` on macOS, a plain
40
- * directory on Linux — written alongside the build output, under the
41
+ * distributable, platform-native application: a `.app` on macOS, a plain
42
+ * directory on Linux, written alongside the build output, under the
41
43
  * app's own `dist/`. The app launches with no arguments and no terminal,
42
44
  * since `inca-host` finds its own bundle beside its executable.
43
45
  *
@@ -1,4 +1,4 @@
1
- /** A macOS `Info.plist`'s value types — the only ones `inca package` writes. */
1
+ /** A macOS `Info.plist`'s value types. These are the only ones `inca package` writes. */
2
2
  export type PlistValue = string | boolean;
3
3
  /** Encodes a flat key/value dict as an `Info.plist` XML document. */
4
4
  export declare function encodePlist(dict: Record<string, PlistValue>): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@incajs/cli",
3
- "version": "0.0.14",
4
- "description": "Dev server, bundler, and packager for Incarnative.js apps.",
3
+ "version": "0.0.16",
4
+ "description": "Commands to develop, bundle, and package Incarnative.js apps.",
5
5
  "keywords": [
6
6
  "bundler",
7
7
  "cli",
@@ -56,6 +56,7 @@
56
56
  "@types/node": "^26.6.4",
57
57
  "@vue/runtime-core": "^3.5.43",
58
58
  "c12": "4.0.0-rc.2",
59
+ "citty": "0.2.2",
59
60
  "oxfmt": "^0.72.0",
60
61
  "oxlint": "^1.87.0",
61
62
  "rolldown": "~1.2.13",
@@ -70,10 +71,10 @@
70
71
  }
71
72
  },
72
73
  "optionalDependencies": {
73
- "@incajs/host-darwin-arm64": "0.0.14",
74
- "@incajs/host-darwin-x64": "0.0.14",
75
- "@incajs/host-linux-arm64": "0.0.14",
76
- "@incajs/host-linux-x64": "0.0.14"
74
+ "@incajs/host-darwin-arm64": "0.0.16",
75
+ "@incajs/host-darwin-x64": "0.0.16",
76
+ "@incajs/host-linux-arm64": "0.0.16",
77
+ "@incajs/host-linux-x64": "0.0.16"
77
78
  },
78
79
  "engines": {
79
80
  "node": ">=22.18"
@@ -1,8 +0,0 @@
1
- import { Bundler } from './adapter/types.mts';
2
- /**
3
- * `adapter/vite` wired in as the one adapter `dev` and `build` share by
4
- * default — a single place to swap bundlers, and the reason they can't
5
- * drift onto different ones. Compiled `.vue` templates import their helpers
6
- * from `incajs/vue/runtime`.
7
- */
8
- export declare const defaultBundler: Bundler;
File without changes
File without changes