@dunx/create-app 3.0.3 → 3.0.5
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/README.md +71 -17
- package/dist/banner.d.ts +14 -0
- package/dist/{chunk-x7s3axkt.js → chunk-5tn3ybzv.js} +62 -73
- package/dist/cli.js +745 -72
- package/dist/features.d.ts +2 -2
- package/dist/generate.d.ts +0 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -1
- package/dist/keys.d.ts +48 -0
- package/dist/prompt.d.ts +43 -0
- package/dist/prompts.d.ts +53 -0
- package/dist/scaffold.d.ts +17 -0
- package/dist/style.d.ts +26 -0
- package/dist/tty.d.ts +58 -0
- package/dist/wizard.d.ts +35 -0
- package/package.json +1 -1
- package/templates/features/assets/assets.module.ts +1 -1
- package/templates/features/auth/auth.module.ts +1 -1
- package/templates/features/http/http.module.ts +1 -1
- package/templates/minimal/package.json +3 -2
- package/dist/stdin.d.ts +0 -14
package/dist/features.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* rots. `bun run sync:templates` copies them in and `features.test.ts` fails on
|
|
5
5
|
* drift.
|
|
6
6
|
*
|
|
7
|
-
* The wiring is not copied: `app.module.ts`, `config.ts
|
|
8
|
-
*
|
|
7
|
+
* The wiring is not copied: `app.module.ts`, `config.ts` and `main.ts` name every
|
|
8
|
+
* feature at once, so they are generated from the selection.
|
|
9
9
|
*/
|
|
10
10
|
export interface Feature {
|
|
11
11
|
/** Flag name, and the directory under `templates/features/`. */
|
package/dist/generate.d.ts
CHANGED
|
@@ -12,9 +12,6 @@ export declare const manifest: (features: readonly Feature[]) => string;
|
|
|
12
12
|
export declare const THIRD_PARTY: Readonly<Record<string, string>>;
|
|
13
13
|
export declare const appModule: (name: string, features: readonly Feature[]) => string;
|
|
14
14
|
export declare const config: (name: string, groups: readonly string[]) => string;
|
|
15
|
-
export declare const bootstrap: (name: string, features: readonly Feature[]) => string;
|
|
16
15
|
export declare const main: (name: string, features: readonly Feature[]) => string;
|
|
17
|
-
/** The queue worker, only when a queue was asked for. */
|
|
18
|
-
export declare const worker: (name: string) => string;
|
|
19
16
|
export declare const envExample: (groups: readonly string[]) => string;
|
|
20
17
|
export declare const readme: (name: string, features: readonly Feature[]) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FEATURES, featureNames, type Feature } from './features.js';
|
|
2
|
+
export { blockingEntries, isValidPackageName, scaffold, ScaffoldError, TEMPLATES, VERSION_PLACEHOLDER, type ScaffoldOptions, type ScaffoldResult, type TemplateName, } from './scaffold.js';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
+
FEATURES,
|
|
3
4
|
ScaffoldError,
|
|
4
5
|
TEMPLATES,
|
|
5
6
|
VERSION_PLACEHOLDER,
|
|
7
|
+
blockingEntries,
|
|
8
|
+
featureNames,
|
|
9
|
+
isValidPackageName,
|
|
6
10
|
scaffold
|
|
7
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5tn3ybzv.js";
|
|
8
12
|
export {
|
|
13
|
+
FEATURES,
|
|
9
14
|
ScaffoldError,
|
|
10
15
|
TEMPLATES,
|
|
11
16
|
VERSION_PLACEHOLDER,
|
|
17
|
+
blockingEntries,
|
|
18
|
+
featureNames,
|
|
19
|
+
isValidPackageName,
|
|
12
20
|
scaffold
|
|
13
21
|
};
|
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys a prompt acts on. Everything else a terminal can send decodes to
|
|
3
|
+
* `Char` when it is printable and `Unknown` when it is not, so a prompt never has
|
|
4
|
+
* to know what a function key looks like.
|
|
5
|
+
*/
|
|
6
|
+
export declare const KeyName: Readonly<{
|
|
7
|
+
readonly Up: 'up';
|
|
8
|
+
readonly Down: 'down';
|
|
9
|
+
readonly Left: 'left';
|
|
10
|
+
readonly Right: 'right';
|
|
11
|
+
readonly Home: 'home';
|
|
12
|
+
readonly End: 'end';
|
|
13
|
+
readonly Enter: 'enter';
|
|
14
|
+
readonly Space: 'space';
|
|
15
|
+
readonly Tab: 'tab';
|
|
16
|
+
readonly ShiftTab: 'shiftTab';
|
|
17
|
+
readonly Backspace: 'backspace';
|
|
18
|
+
readonly ClearLine: 'clearLine';
|
|
19
|
+
readonly Escape: 'escape';
|
|
20
|
+
readonly Interrupt: 'interrupt';
|
|
21
|
+
readonly Char: 'char';
|
|
22
|
+
readonly Unknown: 'unknown';
|
|
23
|
+
}>;
|
|
24
|
+
export type KeyName = (typeof KeyName)[keyof typeof KeyName];
|
|
25
|
+
export interface Key {
|
|
26
|
+
readonly name: KeyName;
|
|
27
|
+
/** What the key typed. Empty for every name but `Char`. */
|
|
28
|
+
readonly char: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Bytes from a raw-mode terminal, decoded into keys.
|
|
32
|
+
*
|
|
33
|
+
* A class rather than a function because two things have to survive between
|
|
34
|
+
* reads: a half-arrived escape sequence, and a UTF-8 code point split across the
|
|
35
|
+
* chunk boundary. `TextDecoder` in streaming mode holds the second; `#pending`
|
|
36
|
+
* holds the first, and an incomplete sequence is kept rather than guessed at.
|
|
37
|
+
*
|
|
38
|
+
* The one guess it does make: a chunk holding nothing but `0x1b` reads as the
|
|
39
|
+
* Escape key. A terminal that split that byte from the `[A` behind it across two
|
|
40
|
+
* reads would have it read as Escape followed by nothing bindable. Bun's PTY and every terminal
|
|
41
|
+
* measured deliver a sequence in one read - `1b 5b 41` arrived as one chunk on
|
|
42
|
+
* Bun 1.4.0, docs/bun-apis.md - and the alternative is a timer that delays every
|
|
43
|
+
* real Escape.
|
|
44
|
+
*/
|
|
45
|
+
export declare class KeyDecoder {
|
|
46
|
+
#private;
|
|
47
|
+
push(bytes: Uint8Array): readonly Key[];
|
|
48
|
+
}
|
package/dist/prompt.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Key } from './keys.js';
|
|
2
|
+
import type { Tty } from './tty.js';
|
|
3
|
+
export declare class CancelledError extends Error {
|
|
4
|
+
readonly name = "CancelledError";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* One question, as a state machine over keypresses.
|
|
8
|
+
*
|
|
9
|
+
* Rendering is a pure function of the state and returns lines rather than writing
|
|
10
|
+
* them, and `press` is the only way the state moves. Nothing here touches a
|
|
11
|
+
* terminal, so every prompt is exercised in-process by feeding it keys and reading
|
|
12
|
+
* the frame back; `PromptRunner` is the half that owns the real one.
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class Prompt<T> {
|
|
15
|
+
#private;
|
|
16
|
+
/** The interactive frame, one entry per line, within `width` and `height`. */
|
|
17
|
+
abstract frame(width: number, height: number): readonly string[];
|
|
18
|
+
/** The single line left in the scrollback once the question is answered. */
|
|
19
|
+
abstract summary(width: number): string;
|
|
20
|
+
protected abstract handle(key: Key): void;
|
|
21
|
+
press(key: Key): void;
|
|
22
|
+
protected finish(answer: T): void;
|
|
23
|
+
get done(): boolean;
|
|
24
|
+
get cancelled(): boolean;
|
|
25
|
+
/** The answer. Reading it before `done`, or after a cancel, is a bug here. */
|
|
26
|
+
get answer(): T;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Drives one prompt at a time against a real terminal.
|
|
30
|
+
*
|
|
31
|
+
* Repainting is "up N lines, erase to the bottom, write the frame" rather than an
|
|
32
|
+
* alternate screen: the answered prompts stay in the scrollback above, which is
|
|
33
|
+
* what makes the summary line a record of what was chosen rather than something
|
|
34
|
+
* that vanishes on exit.
|
|
35
|
+
*
|
|
36
|
+
* Every line is clipped to the terminal's width and the frame to its height, so a
|
|
37
|
+
* wrapped line can never make the cursor arithmetic wrong.
|
|
38
|
+
*/
|
|
39
|
+
export declare class PromptRunner {
|
|
40
|
+
#private;
|
|
41
|
+
constructor(tty: Tty);
|
|
42
|
+
ask<T>(prompt: Prompt<T>): Promise<T>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Key } from './keys.js';
|
|
2
|
+
import { Prompt } from './prompt.js';
|
|
3
|
+
import type { Style } from './style.js';
|
|
4
|
+
/** One line of free text, with the cursor drawn as reverse video over it. */
|
|
5
|
+
export declare class TextPrompt extends Prompt<string> {
|
|
6
|
+
#private;
|
|
7
|
+
protected readonly style: Style;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
constructor(style: Style, title: string, initial: string);
|
|
10
|
+
/** An error to show instead of accepting, or `undefined` to accept. */
|
|
11
|
+
protected validate(_value: string): string | undefined;
|
|
12
|
+
/** The line under the field when there is nothing wrong with the value. */
|
|
13
|
+
protected hint(): string;
|
|
14
|
+
frame(width: number): readonly string[];
|
|
15
|
+
summary(width: number): string;
|
|
16
|
+
protected handle(key: Key): void;
|
|
17
|
+
}
|
|
18
|
+
/** Yes or no, defaulting to whichever the caller says is safe. */
|
|
19
|
+
export declare class ConfirmPrompt extends Prompt<boolean> {
|
|
20
|
+
#private;
|
|
21
|
+
private readonly style;
|
|
22
|
+
private readonly title;
|
|
23
|
+
constructor(style: Style, title: string, initial: boolean);
|
|
24
|
+
frame(width: number): readonly string[];
|
|
25
|
+
summary(width: number): string;
|
|
26
|
+
protected handle(key: Key): void;
|
|
27
|
+
}
|
|
28
|
+
export interface SelectItem {
|
|
29
|
+
readonly value: string;
|
|
30
|
+
readonly label: string;
|
|
31
|
+
readonly hint: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A multi-select list: space toggles, the arrows move, Enter takes the set.
|
|
35
|
+
*
|
|
36
|
+
* The list scrolls rather than being clipped, because eighteen features do not fit
|
|
37
|
+
* a 24-row terminal alongside anything else. The window offset is the one piece of
|
|
38
|
+
* state `frame` writes, since only `frame` is told how tall the terminal is.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SelectPrompt extends Prompt<readonly string[]> {
|
|
41
|
+
#private;
|
|
42
|
+
protected readonly style: Style;
|
|
43
|
+
readonly title: string;
|
|
44
|
+
protected readonly items: readonly SelectItem[];
|
|
45
|
+
constructor(style: Style, title: string, items: readonly SelectItem[], initial?: readonly string[]);
|
|
46
|
+
/** Values the chosen set pulls in without the user having chosen them. */
|
|
47
|
+
protected implied(_chosen: ReadonlySet<string>): ReadonlySet<string>;
|
|
48
|
+
/** Lines between the list and the footer: what came along, what it needs. */
|
|
49
|
+
protected notes(_chosen: ReadonlySet<string>): readonly string[];
|
|
50
|
+
frame(width: number, height: number): readonly string[];
|
|
51
|
+
summary(width: number): string;
|
|
52
|
+
protected handle(key: Key): void;
|
|
53
|
+
}
|
package/dist/scaffold.d.ts
CHANGED
|
@@ -8,6 +8,15 @@ export type TemplateName = (typeof TEMPLATES)[number];
|
|
|
8
8
|
* written into the template, which would go stale on the next release.
|
|
9
9
|
*/
|
|
10
10
|
export declare const VERSION_PLACEHOLDER = "__DUNX_VERSION__";
|
|
11
|
+
/**
|
|
12
|
+
* What is in `directory` that stops it being a scaffolding target. Empty means it
|
|
13
|
+
* is one, whether or not it exists.
|
|
14
|
+
*
|
|
15
|
+
* Exported because the wizard asks about a non-empty directory before writing
|
|
16
|
+
* anything, and asking a different question from the one `scaffold` then enforces
|
|
17
|
+
* is how a prompt and its guard drift apart.
|
|
18
|
+
*/
|
|
19
|
+
export declare const blockingEntries: (directory: string) => readonly string[];
|
|
11
20
|
export interface ScaffoldOptions {
|
|
12
21
|
/** Directory to create. Relative paths resolve against `cwd`. */
|
|
13
22
|
readonly target: string;
|
|
@@ -40,4 +49,12 @@ export interface ScaffoldResult {
|
|
|
40
49
|
export declare class ScaffoldError extends Error {
|
|
41
50
|
readonly name = "ScaffoldError";
|
|
42
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* npm forbids uppercase and a leading dot or underscore, and a scope is legal.
|
|
54
|
+
* Checked here because the failure would otherwise surface as a confusing
|
|
55
|
+
* `bun install` error inside a directory the user just created.
|
|
56
|
+
*/
|
|
57
|
+
export declare const isValidPackageName: (name: string) => boolean;
|
|
58
|
+
/** This package's own version, which is also the one it writes into the app. */
|
|
59
|
+
export declare const packageVersion: () => Promise<string>;
|
|
43
60
|
export declare const scaffold: (options: ScaffoldOptions) => Promise<ScaffoldResult>;
|
package/dist/style.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI styling, and the switch that turns it off.
|
|
3
|
+
*
|
|
4
|
+
* `Bun.enableANSIColors` is the capability check rather than a `TERM` sniff: it is
|
|
5
|
+
* false under `NO_COLOR` and for a non-TTY, and it cannot be faked in-process.
|
|
6
|
+
* Tests construct one with the switch off and assert on plain text.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Style {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(enabled?: boolean);
|
|
11
|
+
accent(text: string): string;
|
|
12
|
+
muted(text: string): string;
|
|
13
|
+
danger(text: string): string;
|
|
14
|
+
warn(text: string): string;
|
|
15
|
+
bold(text: string): string;
|
|
16
|
+
/** Reverse video, which is how the text cursor is drawn over a character. */
|
|
17
|
+
invert(text: string): string;
|
|
18
|
+
/** An arbitrary colour, for the one place a gradient needs more than four. */
|
|
19
|
+
hex(colour: string, text: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Clipped to `width` columns, measured the way a terminal measures them.
|
|
22
|
+
* `Bun.stringWidth` counts columns rather than code units, and `Bun.sliceAnsi`
|
|
23
|
+
* cuts by the same measure without severing an escape sequence.
|
|
24
|
+
*/
|
|
25
|
+
clip(text: string, width: number): string;
|
|
26
|
+
}
|
package/dist/tty.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type Key } from './keys.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a prompt needs from a terminal, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* An abstract class rather than an interface so the fake the tests drive is the
|
|
6
|
+
* same shape the real one is, checked by the compiler. `ProcessTty` is the real
|
|
7
|
+
* one; `tty.fixture.ts` holds the one that records frames instead of writing them.
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class Tty {
|
|
10
|
+
abstract get columns(): number;
|
|
11
|
+
abstract get rows(): number;
|
|
12
|
+
abstract write(text: string): void;
|
|
13
|
+
/** Raw mode on, decoded keys to `onKey`. */
|
|
14
|
+
abstract open(onKey: (key: Key) => void): void;
|
|
15
|
+
/** Raw mode off, and the read released so the process can exit. */
|
|
16
|
+
abstract close(): void;
|
|
17
|
+
}
|
|
18
|
+
/** The half of `process.stdin` that reading keys in raw mode uses. */
|
|
19
|
+
export interface KeySource {
|
|
20
|
+
readonly isTTY?: boolean | undefined;
|
|
21
|
+
setRawMode?(enabled: boolean): unknown;
|
|
22
|
+
resume(): unknown;
|
|
23
|
+
pause(): unknown;
|
|
24
|
+
on(event: 'data', listener: (chunk: Uint8Array) => void): unknown;
|
|
25
|
+
off(event: 'data', listener: (chunk: Uint8Array) => void): unknown;
|
|
26
|
+
}
|
|
27
|
+
/** The half of `process.stdout` that a frame is written to. */
|
|
28
|
+
export interface FrameSink {
|
|
29
|
+
readonly columns?: number | undefined;
|
|
30
|
+
readonly rows?: number | undefined;
|
|
31
|
+
write(text: string): unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `process.stdin` in raw mode, `process.stdout` for the frames.
|
|
35
|
+
*
|
|
36
|
+
* Raw mode turns an arrow key into three bytes this process reads rather than a
|
|
37
|
+
* line the terminal buffers, and stops the terminal echoing keystrokes over the
|
|
38
|
+
* frame. It also makes `close()` load bearing twice over: Ctrl+C arrives as a byte
|
|
39
|
+
* with no `SIGINT` behind it, and the read holds the event loop open until the
|
|
40
|
+
* listener is removed. Both measured in docs/bun-apis.md, "Raw-mode stdin".
|
|
41
|
+
*
|
|
42
|
+
* The streams are arguments so the suite can drive this without a terminal;
|
|
43
|
+
* `interactive.test.ts` spawns a real one for what a fake cannot answer.
|
|
44
|
+
*/
|
|
45
|
+
export declare class ProcessTty extends Tty {
|
|
46
|
+
#private;
|
|
47
|
+
constructor(input?: KeySource, output?: FrameSink);
|
|
48
|
+
/**
|
|
49
|
+
* Whether this process can ask a question at all. Both halves are checked: a
|
|
50
|
+
* piped stdin has no `setRawMode`, and a piped stdout has no width to draw into.
|
|
51
|
+
*/
|
|
52
|
+
static available(): boolean;
|
|
53
|
+
get columns(): number;
|
|
54
|
+
get rows(): number;
|
|
55
|
+
write(text: string): void;
|
|
56
|
+
open(onKey: (key: Key) => void): void;
|
|
57
|
+
close(): void;
|
|
58
|
+
}
|
package/dist/wizard.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type PromptRunner } from './prompt.js';
|
|
2
|
+
import type { Style } from './style.js';
|
|
3
|
+
export interface WizardAnswers {
|
|
4
|
+
readonly target: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly features: readonly string[];
|
|
7
|
+
readonly force: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** What the flags already settled, so the wizard skips asking again. */
|
|
10
|
+
export interface WizardDefaults {
|
|
11
|
+
readonly target: string | undefined;
|
|
12
|
+
readonly name: string | undefined;
|
|
13
|
+
readonly features: readonly string[];
|
|
14
|
+
readonly force: boolean;
|
|
15
|
+
readonly cwd: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The questions, in the order the answers are needed.
|
|
19
|
+
*
|
|
20
|
+
* Each one is skipped when there is nothing to ask: a target given on the command
|
|
21
|
+
* line, a package name that is already legal, a directory that is already empty.
|
|
22
|
+
* Running `bunx @dunx/create-app my-api` in a clean directory therefore asks one
|
|
23
|
+
* question, the one nothing else can answer.
|
|
24
|
+
*/
|
|
25
|
+
export declare class Wizard {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(runner: PromptRunner, style: Style);
|
|
28
|
+
run(defaults: WizardDefaults): Promise<WizardAnswers>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A package name npm will take, from a directory name it will not. Uppercase and
|
|
32
|
+
* the characters npm forbids both become a hyphen, and a leading dot, underscore
|
|
33
|
+
* or hyphen is dropped.
|
|
34
|
+
*/
|
|
35
|
+
export declare const slug: (value: string) => string;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ const HASHED = /\.[0-9a-f]{8}\.(js|css)$/;
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* `public/` served at `/assets`. `StaticModule` binds `StaticFiles`; the app
|
|
10
|
-
* registers it in `
|
|
10
|
+
* registers it in `main.ts`, because position in the chain is the app's
|
|
11
11
|
* call. The mount skips the global prefix: middleware is not a discovered route.
|
|
12
12
|
*/
|
|
13
13
|
@Module({
|
|
@@ -54,7 +54,7 @@ import { ProfileController } from './profile.controller.js';
|
|
|
54
54
|
controllers: [ProfileController],
|
|
55
55
|
providers: [AuthTables, Audit, AuthDemo],
|
|
56
56
|
// `Auth` is exported because `OpenApiModule` wraps the root and can only
|
|
57
|
-
// inject what the root exports. See
|
|
57
|
+
// inject what the root exports. See main.ts.
|
|
58
58
|
exports: [Audit, AuthDemo, Auth],
|
|
59
59
|
})
|
|
60
60
|
export class AccountsModule {}
|
|
@@ -10,7 +10,7 @@ import { RequestTrail, RequestTrailMiddleware } from './request-trail.js';
|
|
|
10
10
|
// declaring them here is for the reader, not for the resolver.
|
|
11
11
|
@Module({
|
|
12
12
|
imports: [
|
|
13
|
-
// Binds `Compression`; the **app** registers it, in `
|
|
13
|
+
// Binds `Compression`; the **app** registers it, in `main.ts`, for the
|
|
14
14
|
// same reason `StaticFiles` is registered there. Nothing is installed by
|
|
15
15
|
// importing this, so an app that never calls `app.use(Compression)` has no
|
|
16
16
|
// branch in the request path to skip.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"dev": "bun --watch src/main.ts",
|
|
7
8
|
"start": "bun src/main.ts",
|
|
8
9
|
"test": "bun test",
|
|
9
10
|
"typecheck": "tsc --noEmit"
|
|
@@ -15,10 +16,10 @@
|
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"@dunx/testing": "__DUNX_VERSION__",
|
|
18
|
-
"@types/bun": ">=1.
|
|
19
|
+
"@types/bun": ">=1.4.0",
|
|
19
20
|
"typescript": "^5.7.0"
|
|
20
21
|
},
|
|
21
22
|
"engines": {
|
|
22
|
-
"bun": ">=1.
|
|
23
|
+
"bun": ">=1.4.0"
|
|
23
24
|
}
|
|
24
25
|
}
|
package/dist/stdin.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One line of stdin, with the iteration ended before the value comes back.
|
|
3
|
-
*
|
|
4
|
-
* `console[Symbol.asyncIterator]().next()` on its own leaves stdin referenced for
|
|
5
|
-
* the life of the process: the scaffold wrote its files, printed the next steps and
|
|
6
|
-
* then sat there until the user pressed Ctrl+C. Ending the iteration runs the
|
|
7
|
-
* iterator's `return()`, which releases the handle, so the process exits on its own.
|
|
8
|
-
* Measured on Bun 1.4.0 - docs/bun-apis.md, "One line of stdin keeps the process
|
|
9
|
-
* alive".
|
|
10
|
-
*
|
|
11
|
-
* A function rather than a class because it is the whole module: no state, no
|
|
12
|
-
* configuration, and nothing to hold between calls.
|
|
13
|
-
*/
|
|
14
|
-
export declare const readLine: () => Promise<string>;
|