@incajs/cli 0.0.7 → 0.0.9

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.
@@ -30,6 +30,18 @@ export interface RuntimeConfig {
30
30
  identifier?: string;
31
31
  window?: WindowConfig;
32
32
  }
33
+ /**
34
+ * Refuses an `outDir` that would hold the app's own sources. `inca dev` and
35
+ * `inca build` delete whatever a build didn't write under `outDir`. Symlinks
36
+ * are followed on both sides of the comparison.
37
+ *
38
+ * @param cwd - the app's root directory
39
+ * @param outDir - the `outDir`, absolute or relative to `cwd`
40
+ * @param entry - the resolved entry, if any
41
+ * @throws if it is, or contains, the app's root, `src/`, `node_modules/`, or
42
+ * the entry, or if a symlink on the way can't be resolved
43
+ */
44
+ export declare function assertOutDir(cwd: string, outDir: string, entry?: string): void;
33
45
  /**
34
46
  * Loads just `entry`/`outDir` from `inca.config.ts`, with derived defaults.
35
47
  * Never touches `package.json`.
package/dist/config.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, t } from "./chunks/defaults-DNvHueCI.js";
1
+ import { a as e, t } from "./chunks/defaults-Bl2pge8b.js";
2
2
  //#region src/config/index.mts
3
3
  var n = e();
4
4
  //#endregion
@@ -7,3 +7,9 @@
7
7
  * it failed to install.
8
8
  */
9
9
  export declare function resolveHostBin(): string;
10
+ /**
11
+ * Checks that a host binary is a file.
12
+ * @param bin - the path to check
13
+ * @throws if nothing is a file at `bin`
14
+ */
15
+ export declare function assertHostBin(bin: string): void;
@@ -4,6 +4,8 @@ export interface HostClientOptions {
4
4
  entryFile: string;
5
5
  /** Overrides which `inca-host` binary gets spawned, in place of automatic resolution. */
6
6
  hostBin?: string;
7
+ /** The environment the host starts with. Defaults to this process's own. */
8
+ env?: NodeJS.ProcessEnv;
7
9
  /**
8
10
  * Every diagnostic line the transport itself produces: the host's real
9
11
  * stderr, a stray stdout line, and a `ready` protocol mismatch. Defaults
@@ -40,8 +42,9 @@ export declare class HostClient {
40
42
  constructor(options: HostClientOptions);
41
43
  /**
42
44
  * Starts the child and wires up its streams. Resolves once the process
43
- * has actually spawned; rejects if it never does (e.g. the resolved
44
- * binary doesn't exist).
45
+ * has spawned. Rejects with `ERR_INCA_HOST_BIN_NOT_FOUND` if no file
46
+ * exists at the host binary's path, or with the spawn error if the
47
+ * process can't start.
45
48
  */
46
49
  start(): Promise<void>;
47
50
  /**
@@ -1,4 +1,4 @@
1
- export { resolveHostBin } from './hostBin.mts';
1
+ export { assertHostBin, resolveHostBin } from './hostBin.mts';
2
2
  export { HostError } from './hostError.mts';
3
3
  export { HostClient } from './hostClient.mts';
4
4
  export type { HostClientOptions } from './hostClient.mts';
@@ -2,9 +2,10 @@
2
2
  * Claims `cwd` for this process. Two `inca dev`s on one app watch the same
3
3
  * files and interleave their output on one terminal, and an orphan left by
4
4
  * an earlier run stays invisible until this says so. A lock whose pid is
5
- * gone is taken over.
5
+ * gone, or that an earlier run of this process left behind, is taken over.
6
6
  *
7
- * @returns a function releasing the lock.
7
+ * @param cwd - the app directory to claim
8
+ * @returns a function releasing the lock, safe to call more than once.
8
9
  * @throws if another live `inca dev` holds `cwd`.
9
10
  */
10
11
  export declare function acquireDevLock(cwd: string): Promise<() => Promise<void>>;
package/dist/dev.d.mts CHANGED
@@ -31,6 +31,9 @@ export interface DevOptions {
31
31
  * reloads it on every rebuild — until `options.signal` aborts or the host
32
32
  * exits on its own.
33
33
  *
34
- * @throws if another `inca dev` is already running for this app.
34
+ * @throws if another `inca dev` is already running for this app, or if the
35
+ * host binary can't be resolved or isn't a file. Both stop it before any build.
36
+ * Also throws if the host exits before it is ready, or exits non-zero or by
37
+ * a signal other than SIGINT/SIGTERM afterwards.
35
38
  */
36
39
  export declare function dev(options: DevOptions): Promise<void>;