@incajs/cli 0.0.2 → 0.0.3
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/adapter/types.d.mts +26 -0
- package/dist/adapter/vite/build.d.mts +1 -1
- package/dist/adapter/vite/config.d.mts +7 -1
- package/dist/adapter/vite/logger.d.mts +7 -0
- package/dist/adapter/vite/unsupported.d.mts +23 -0
- package/dist/adapter/vite/watch.d.mts +1 -1
- package/dist/build.d.mts +4 -0
- package/dist/chunks/{defaults-EWjAFeZ3.js → defaults-D_1rymg4.js} +95 -95
- package/dist/chunks/{dist-BVKUE9C4.js → dist-DZ5asakr.js} +1 -1
- package/dist/cli.js +368 -212
- package/dist/config.js +1 -1
- package/dist/dev-client/hostClient.d.mts +5 -0
- package/dist/dev-lock.d.mts +10 -0
- package/dist/dev.d.mts +4 -1
- package/dist/error.d.mts +11 -0
- package/dist/log.d.mts +28 -0
- package/dist/package.d.mts +3 -1
- package/package.json +4 -4
- package/dist/fault.d.mts +0 -6
package/dist/config.js
CHANGED
|
@@ -17,6 +17,11 @@ export interface HostClientOptions {
|
|
|
17
17
|
onReady?: () => void;
|
|
18
18
|
/** An app's own event listener threw; the host caught it and kept rendering. */
|
|
19
19
|
onAppError?: (error: AppErrorParams) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The host exited on its own — its window was closed, or it crashed.
|
|
22
|
+
* Not called for the exit `stop()` asks for.
|
|
23
|
+
*/
|
|
24
|
+
onExit?: (code: number | null, signal: NodeJS.Signals | null) => void;
|
|
20
25
|
/**
|
|
21
26
|
* Handlers for notification `method`s this package doesn't implement
|
|
22
27
|
* itself (e.g. a future Vite integration), keyed by method name —
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claims `cwd` for this process. Two `inca dev`s on one app watch the same
|
|
3
|
+
* files and interleave their output on one terminal, and an orphan left by
|
|
4
|
+
* an earlier run stays invisible until this says so. A lock whose pid is
|
|
5
|
+
* gone is taken over.
|
|
6
|
+
*
|
|
7
|
+
* @returns a function releasing the lock.
|
|
8
|
+
* @throws if another live `inca dev` holds `cwd`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function acquireDevLock(cwd: string): Promise<() => Promise<void>>;
|
package/dist/dev.d.mts
CHANGED
|
@@ -20,6 +20,9 @@ export interface DevOptions {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Builds the app, starts `inca-host` once the first build lands, and
|
|
23
|
-
* reloads it on every rebuild — until `options.signal` aborts
|
|
23
|
+
* reloads it on every rebuild — until `options.signal` aborts or the host
|
|
24
|
+
* exits on its own.
|
|
25
|
+
*
|
|
26
|
+
* @throws if another `inca dev` is already running for this app.
|
|
24
27
|
*/
|
|
25
28
|
export declare function dev(options: DevOptions): Promise<void>;
|
package/dist/error.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A failure the CLI raises itself, identified by an `ERR_INCA_*` code the
|
|
3
|
+
* way Node's own errors carry one. The code is what a user searches for
|
|
4
|
+
* and what `printFault` names alongside the message, so every distinct
|
|
5
|
+
* cause gets its own.
|
|
6
|
+
*/
|
|
7
|
+
export declare class IncaError extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly name = "IncaError";
|
|
10
|
+
constructor(code: string, message: string);
|
|
11
|
+
}
|
package/dist/log.d.mts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Shared by {@link log} and {@link printFault}. */
|
|
2
|
+
export interface LogOptions {
|
|
3
|
+
/** Prefixes the line with `HH:MM:SS`, the way Vite's dev server stamps its own. */
|
|
4
|
+
timestamp?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Writes one `[inca] <message>` line to `stream`. */
|
|
7
|
+
export declare function log(stream: NodeJS.WritableStream, message: string, options?: LogOptions): void;
|
|
8
|
+
/** A failure reduced to the message and stack worth printing. */
|
|
9
|
+
export interface Fault {
|
|
10
|
+
message: string;
|
|
11
|
+
stack: string | null;
|
|
12
|
+
/** An `ERR_INCA_*` identifier, when the failure has one to look up. */
|
|
13
|
+
code?: string | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reduces an error a bundler re-wrapped: its text is kept whole — the
|
|
17
|
+
* excerpt a compiler points at is the useful part — while the error class
|
|
18
|
+
* and any `ERR_INCA_*` marker are lifted off the first line, the latter
|
|
19
|
+
* into the fault's code.
|
|
20
|
+
*/
|
|
21
|
+
export declare function bundlerFault(message: string): Fault;
|
|
22
|
+
/** Reduces a thrown value to a {@link Fault}. A `HostError` carries the host process's stack. */
|
|
23
|
+
export declare function toFault(error: unknown): Fault;
|
|
24
|
+
/**
|
|
25
|
+
* Writes `[inca] <label> (<code>): <message>` to `stream` — the code only
|
|
26
|
+
* when the failure carries one — followed by the stack when there is one.
|
|
27
|
+
*/
|
|
28
|
+
export declare function printFault(stream: NodeJS.WritableStream, label: string, fault: Fault, options?: LogOptions): void;
|
package/dist/package.d.mts
CHANGED
|
@@ -24,8 +24,10 @@ export interface PackageAppOptions {
|
|
|
24
24
|
* process is running on.
|
|
25
25
|
*/
|
|
26
26
|
target?: PackageTarget;
|
|
27
|
-
/** Where progress notes go. Defaults to `process.stdout`. */
|
|
27
|
+
/** Where progress notes and the bundler's own output go. Defaults to `process.stdout`. */
|
|
28
28
|
stdout?: NodeJS.WritableStream;
|
|
29
|
+
/** Where the bundler's warnings and errors go. Defaults to `process.stderr`. */
|
|
30
|
+
stderr?: NodeJS.WritableStream;
|
|
29
31
|
}
|
|
30
32
|
/** The result of a successful {@link packageApp} call. */
|
|
31
33
|
export interface PackageResult {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incajs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "The inca CLI: watches an app's entry point through a bundler adapter, starts inca-host once the first bundle lands, and reloads it on every rebuild.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundler",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"optionalDependencies": {
|
|
71
|
-
"@incajs/host-darwin-arm64": "0.0.
|
|
72
|
-
"@incajs/host-linux-arm64": "0.0.
|
|
73
|
-
"@incajs/host-linux-x64": "0.0.
|
|
71
|
+
"@incajs/host-darwin-arm64": "0.0.3",
|
|
72
|
+
"@incajs/host-linux-arm64": "0.0.3",
|
|
73
|
+
"@incajs/host-linux-x64": "0.0.3"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=22.18"
|