create-bijou-tui-app 1.3.0
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 +55 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +95 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +233 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# `create-bijou-tui-app`
|
|
2
|
+
|
|
3
|
+
Scaffold a new Bijou TUI app with batteries-included defaults.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm create bijou-tui-app@latest my-app
|
|
9
|
+
cd my-app
|
|
10
|
+
npm run dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The generated app can also be run directly with:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npx tsx src/main.ts
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What it generates
|
|
20
|
+
|
|
21
|
+
- TypeScript Node app entrypoint using `createTuiAppSkeleton()`
|
|
22
|
+
- Dependencies:
|
|
23
|
+
- `@flyingrobots/bijou`
|
|
24
|
+
- `@flyingrobots/bijou-node`
|
|
25
|
+
- `@flyingrobots/bijou-tui`
|
|
26
|
+
- `@flyingrobots/bijou-tui-app`
|
|
27
|
+
- Starter scripts: `dev`, `build`, `start`
|
|
28
|
+
- Strict `tsconfig.json`
|
|
29
|
+
|
|
30
|
+
## Flags
|
|
31
|
+
|
|
32
|
+
- `-h`, `--help`: show usage
|
|
33
|
+
- `-y`, `--yes`, `--force`: allow writing into a non-empty target directory
|
|
34
|
+
- `--install`: run dependency installation (default)
|
|
35
|
+
- `--no-install`: skip dependency installation
|
|
36
|
+
|
|
37
|
+
## Test this scaffolder locally (from this monorepo)
|
|
38
|
+
|
|
39
|
+
From the repository root:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
# Run scaffolder unit tests
|
|
43
|
+
npx vitest run --config vitest.config.ts packages/create-bijou-tui-app/src/index.test.ts
|
|
44
|
+
|
|
45
|
+
# Smoke-test generated files without installing dependencies
|
|
46
|
+
TMP="$(mktemp -d /tmp/bijou-scaffold-XXXXXX)"
|
|
47
|
+
TARGET="$TMP/my-app"
|
|
48
|
+
npx tsx packages/create-bijou-tui-app/src/cli.ts "$TARGET" --no-install
|
|
49
|
+
find "$TARGET" -maxdepth 2 -type f | sort
|
|
50
|
+
|
|
51
|
+
# Run the generated app
|
|
52
|
+
cd "$TARGET"
|
|
53
|
+
npm install
|
|
54
|
+
npm run dev
|
|
55
|
+
```
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAWA,+CAA+C;AAC/C,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CA4CtD"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { relative, resolve } from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { parseArgs, scaffoldProject, usage, } from './index.js';
|
|
5
|
+
/** CLI entrypoint for create-bijou-tui-app. */
|
|
6
|
+
export function runCli(argv) {
|
|
7
|
+
const parsedOrCode = parseCliArgs(argv);
|
|
8
|
+
if (typeof parsedOrCode === 'number') {
|
|
9
|
+
return parsedOrCode;
|
|
10
|
+
}
|
|
11
|
+
const parsed = parsedOrCode;
|
|
12
|
+
if (parsed.help) {
|
|
13
|
+
process.stdout.write(`${usage()}\n`);
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
const result = scaffoldProject({
|
|
18
|
+
targetDir: parsed.targetDirArg,
|
|
19
|
+
install: parsed.install,
|
|
20
|
+
force: parsed.force,
|
|
21
|
+
});
|
|
22
|
+
const relDir = relative(process.cwd(), result.targetDir) || '.';
|
|
23
|
+
const suggestedDir = relDir === '.'
|
|
24
|
+
? '.'
|
|
25
|
+
: (relDir.startsWith('..') ? result.targetDir : relDir);
|
|
26
|
+
process.stdout.write(`\nCreated project in ${result.targetDir}\n`);
|
|
27
|
+
process.stdout.write(`\nNext steps:\n`);
|
|
28
|
+
if (suggestedDir !== '.') {
|
|
29
|
+
process.stdout.write(` cd ${quotePath(suggestedDir)}\n`);
|
|
30
|
+
}
|
|
31
|
+
if (!result.installed) {
|
|
32
|
+
process.stdout.write(` ${installCommand(result.packageManager)}\n`);
|
|
33
|
+
}
|
|
34
|
+
process.stdout.write(` ${runDevCommand(result.packageManager)}\n\n`);
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
39
|
+
process.stderr.write(`create-bijou-tui-app: ${message}\n`);
|
|
40
|
+
if (isInstallFailure(message)) {
|
|
41
|
+
process.stderr.write('Tip: rerun with --no-install, then install dependencies manually.\n');
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
process.stderr.write('Tip: run with --help to see CLI options.\n');
|
|
45
|
+
}
|
|
46
|
+
return 1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function parseCliArgs(argv) {
|
|
50
|
+
try {
|
|
51
|
+
return parseArgs(argv);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
55
|
+
process.stderr.write(`create-bijou-tui-app: ${message}\n`);
|
|
56
|
+
process.stderr.write(`\n${usage()}\n`);
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function quotePath(value) {
|
|
61
|
+
if (process.platform === 'win32') {
|
|
62
|
+
const escaped = value
|
|
63
|
+
.replace(/%/g, '%%')
|
|
64
|
+
.replace(/\^/g, '^^')
|
|
65
|
+
.replace(/"/g, '""');
|
|
66
|
+
return `"${escaped}"`;
|
|
67
|
+
}
|
|
68
|
+
return `'${value.replace(/'/g, "'\"'\"'")}'`;
|
|
69
|
+
}
|
|
70
|
+
function isInstallFailure(message) {
|
|
71
|
+
return message.includes(' install failed');
|
|
72
|
+
}
|
|
73
|
+
function installCommand(pm) {
|
|
74
|
+
if (pm === 'yarn')
|
|
75
|
+
return 'yarn';
|
|
76
|
+
if (pm === 'bun')
|
|
77
|
+
return 'bun install';
|
|
78
|
+
return `${pm} install`;
|
|
79
|
+
}
|
|
80
|
+
function runDevCommand(pm) {
|
|
81
|
+
if (pm === 'yarn')
|
|
82
|
+
return 'yarn dev';
|
|
83
|
+
if (pm === 'bun')
|
|
84
|
+
return 'bun run dev';
|
|
85
|
+
return `${pm} run dev`;
|
|
86
|
+
}
|
|
87
|
+
if (isEntrypoint()) {
|
|
88
|
+
process.exitCode = runCli(process.argv.slice(2));
|
|
89
|
+
}
|
|
90
|
+
function isEntrypoint() {
|
|
91
|
+
if (process.argv[1] === undefined)
|
|
92
|
+
return false;
|
|
93
|
+
return import.meta.url === pathToFileURL(resolve(process.argv[1])).href;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,SAAS,EACT,eAAe,EACf,KAAK,GACN,MAAM,YAAY,CAAC;AAEpB,+CAA+C;AAC/C,MAAM,UAAU,MAAM,CAAC,IAAuB;IAC5C,MAAM,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC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,CAAC;aACnB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;aACpB,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvB,OAAO,IAAI,OAAO,GAAG,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC;AAC/C,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAe;IACvC,OAAO,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,cAAc,CAAC,EAAkB;IACxC,IAAI,EAAE,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IACjC,IAAI,EAAE,KAAK,KAAK;QAAE,OAAO,aAAa,CAAC;IACvC,OAAO,GAAG,EAAE,UAAU,CAAC;AACzB,CAAC;AAED,SAAS,aAAa,CAAC,EAAkB;IACvC,IAAI,EAAE,KAAK,MAAM;QAAE,OAAO,UAAU,CAAC;IACrC,IAAI,EAAE,KAAK,KAAK;QAAE,OAAO,aAAa,CAAC;IACvC,OAAO,GAAG,EAAE,UAAU,CAAC;AACzB,CAAC;AAED,IAAI,YAAY,EAAE,EAAE,CAAC;IACnB,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,YAAY;IACnB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAChD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** Supported package managers for post-scaffold install instructions. */
|
|
2
|
+
export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
|
|
3
|
+
/** Parsed CLI arguments for the scaffolder command. */
|
|
4
|
+
export interface ParsedArgs {
|
|
5
|
+
/** Optional target directory argument (relative to cwd). */
|
|
6
|
+
readonly targetDirArg?: string;
|
|
7
|
+
/** Whether to run dependency installation after writing files. */
|
|
8
|
+
readonly install: boolean;
|
|
9
|
+
/** Whether to allow scaffolding into a non-empty target directory. */
|
|
10
|
+
readonly force: boolean;
|
|
11
|
+
/** Whether to print usage/help and exit. */
|
|
12
|
+
readonly help: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Input options for {@link scaffoldProject}. */
|
|
15
|
+
export interface ScaffoldOptions {
|
|
16
|
+
/** Target directory path (relative to `cwd` or absolute). */
|
|
17
|
+
readonly targetDir?: string;
|
|
18
|
+
/** Working directory used to resolve relative target paths. Defaults to process cwd. */
|
|
19
|
+
readonly cwd?: string;
|
|
20
|
+
/** Whether to run package install after file generation. Defaults to true. */
|
|
21
|
+
readonly install?: boolean;
|
|
22
|
+
/** Package manager to use for install/instructions. Defaults to auto-detection. */
|
|
23
|
+
readonly packageManager?: PackageManager;
|
|
24
|
+
/** Allow writing into a non-empty target directory. Defaults to false. */
|
|
25
|
+
readonly force?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Resolved scaffold metadata returned by {@link scaffoldProject}. */
|
|
28
|
+
export interface ScaffoldResult {
|
|
29
|
+
/** Absolute target directory path where files were written. */
|
|
30
|
+
readonly targetDir: string;
|
|
31
|
+
/** Package name used in generated package.json. */
|
|
32
|
+
readonly packageName: string;
|
|
33
|
+
/** Package manager selected for install/instructions. */
|
|
34
|
+
readonly packageManager: PackageManager;
|
|
35
|
+
/** Whether dependencies were installed by the scaffolder. */
|
|
36
|
+
readonly installed: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** Default directory name when caller omits positional target argument. */
|
|
39
|
+
export declare const DEFAULT_TARGET_DIR = "bijou-tui-app";
|
|
40
|
+
/**
|
|
41
|
+
* Parse command-line arguments for the scaffolder.
|
|
42
|
+
*
|
|
43
|
+
* Supported flags:
|
|
44
|
+
* - `-h`, `--help`
|
|
45
|
+
* - `-y`, `--yes`, `--force`
|
|
46
|
+
* - `--install`, `--no-install`
|
|
47
|
+
*/
|
|
48
|
+
export declare function parseArgs(argv: readonly string[]): ParsedArgs;
|
|
49
|
+
/** Detect package manager from npm user agent env. */
|
|
50
|
+
export declare function detectPackageManager(env?: NodeJS.ProcessEnv): PackageManager;
|
|
51
|
+
/**
|
|
52
|
+
* Normalize target directory and derive package name.
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveTarget(targetDir: string | undefined, cwd: string): {
|
|
55
|
+
readonly targetDir: string;
|
|
56
|
+
readonly absTargetDir: string;
|
|
57
|
+
readonly packageName: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Create scaffolded file contents keyed by relative file path.
|
|
61
|
+
*/
|
|
62
|
+
export declare function createTemplateFiles(packageName: string): Readonly<Record<string, string>>;
|
|
63
|
+
/**
|
|
64
|
+
* Scaffold a new Bijou TUI app project.
|
|
65
|
+
*/
|
|
66
|
+
export declare function scaffoldProject(options?: ScaffoldOptions): ScaffoldResult;
|
|
67
|
+
/** Build usage/help text for CLI output. */
|
|
68
|
+
export declare function usage(): string;
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7D,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,OAAO,C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,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkFzF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,eAAoB,GAAG,cAAc,CA0B7E;AAED,4CAA4C;AAC5C,wBAAgB,KAAK,IAAI,MAAM,CAW9B"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, lstatSync, mkdirSync, readdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
4
|
+
/** Default directory name when caller omits positional target argument. */
|
|
5
|
+
export const DEFAULT_TARGET_DIR = 'bijou-tui-app';
|
|
6
|
+
/**
|
|
7
|
+
* Parse command-line arguments for the scaffolder.
|
|
8
|
+
*
|
|
9
|
+
* Supported flags:
|
|
10
|
+
* - `-h`, `--help`
|
|
11
|
+
* - `-y`, `--yes`, `--force`
|
|
12
|
+
* - `--install`, `--no-install`
|
|
13
|
+
*/
|
|
14
|
+
export function parseArgs(argv) {
|
|
15
|
+
let targetDirArg;
|
|
16
|
+
let install = true;
|
|
17
|
+
let force = false;
|
|
18
|
+
let help = false;
|
|
19
|
+
for (const arg of argv) {
|
|
20
|
+
if (arg === '-h' || arg === '--help') {
|
|
21
|
+
help = true;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (arg === '-y' || arg === '--yes' || arg === '--force') {
|
|
25
|
+
force = true;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (arg === '--install') {
|
|
29
|
+
install = true;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (arg === '--no-install') {
|
|
33
|
+
install = false;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (arg.startsWith('-')) {
|
|
37
|
+
throw new Error(`Unknown option: ${arg}`);
|
|
38
|
+
}
|
|
39
|
+
if (targetDirArg !== undefined) {
|
|
40
|
+
throw new Error('Only one target directory argument is supported');
|
|
41
|
+
}
|
|
42
|
+
targetDirArg = arg;
|
|
43
|
+
}
|
|
44
|
+
return { targetDirArg, install, force, help };
|
|
45
|
+
}
|
|
46
|
+
/** Detect package manager from npm user agent env. */
|
|
47
|
+
export function detectPackageManager(env = process.env) {
|
|
48
|
+
const ua = env['npm_config_user_agent'] ?? '';
|
|
49
|
+
if (ua.startsWith('pnpm/'))
|
|
50
|
+
return 'pnpm';
|
|
51
|
+
if (ua.startsWith('yarn/'))
|
|
52
|
+
return 'yarn';
|
|
53
|
+
if (ua.startsWith('bun/'))
|
|
54
|
+
return 'bun';
|
|
55
|
+
return 'npm';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Normalize target directory and derive package name.
|
|
59
|
+
*/
|
|
60
|
+
export function resolveTarget(targetDir, cwd) {
|
|
61
|
+
const normalizedTarget = targetDir?.trim().length
|
|
62
|
+
? targetDir
|
|
63
|
+
: DEFAULT_TARGET_DIR;
|
|
64
|
+
const absTargetDir = resolve(cwd, normalizedTarget);
|
|
65
|
+
const base = basename(absTargetDir) || DEFAULT_TARGET_DIR;
|
|
66
|
+
return {
|
|
67
|
+
targetDir: normalizedTarget,
|
|
68
|
+
absTargetDir,
|
|
69
|
+
packageName: toPackageName(base),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create scaffolded file contents keyed by relative file path.
|
|
74
|
+
*/
|
|
75
|
+
export function createTemplateFiles(packageName) {
|
|
76
|
+
const pkg = {
|
|
77
|
+
name: packageName,
|
|
78
|
+
private: true,
|
|
79
|
+
type: 'module',
|
|
80
|
+
scripts: {
|
|
81
|
+
dev: 'tsx src/main.ts',
|
|
82
|
+
build: 'tsc -p tsconfig.json',
|
|
83
|
+
start: 'node dist/main.js',
|
|
84
|
+
},
|
|
85
|
+
dependencies: {
|
|
86
|
+
'@flyingrobots/bijou': 'latest',
|
|
87
|
+
'@flyingrobots/bijou-node': 'latest',
|
|
88
|
+
'@flyingrobots/bijou-tui': 'latest',
|
|
89
|
+
'@flyingrobots/bijou-tui-app': 'latest',
|
|
90
|
+
},
|
|
91
|
+
devDependencies: {
|
|
92
|
+
'@types/node': '^22.0.0',
|
|
93
|
+
tsx: '^4.21.0',
|
|
94
|
+
typescript: '^5.9.3',
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
const tsconfig = {
|
|
98
|
+
compilerOptions: {
|
|
99
|
+
target: 'ESNext',
|
|
100
|
+
module: 'NodeNext',
|
|
101
|
+
moduleResolution: 'NodeNext',
|
|
102
|
+
strict: true,
|
|
103
|
+
noUnusedLocals: true,
|
|
104
|
+
noUnusedParameters: true,
|
|
105
|
+
noImplicitReturns: true,
|
|
106
|
+
noFallthroughCasesInSwitch: true,
|
|
107
|
+
noUncheckedIndexedAccess: true,
|
|
108
|
+
noImplicitOverride: true,
|
|
109
|
+
noPropertyAccessFromIndexSignature: true,
|
|
110
|
+
skipLibCheck: true,
|
|
111
|
+
outDir: 'dist',
|
|
112
|
+
rootDir: 'src',
|
|
113
|
+
},
|
|
114
|
+
include: ['src/**/*.ts'],
|
|
115
|
+
exclude: ['node_modules', 'dist'],
|
|
116
|
+
};
|
|
117
|
+
const mainTs = `import { initDefaultContext } from '@flyingrobots/bijou-node';
|
|
118
|
+
import { run } from '@flyingrobots/bijou-tui';
|
|
119
|
+
import { createTuiAppSkeleton } from '@flyingrobots/bijou-tui-app';
|
|
120
|
+
|
|
121
|
+
const ctx = initDefaultContext();
|
|
122
|
+
|
|
123
|
+
await run(createTuiAppSkeleton({
|
|
124
|
+
ctx,
|
|
125
|
+
title: 'My Bijou App',
|
|
126
|
+
statusMessage: ({ activeTabTitle }) => \`${'${activeTabTitle}'} ready\`,
|
|
127
|
+
}));
|
|
128
|
+
`;
|
|
129
|
+
const readme = `# ${packageName}
|
|
130
|
+
|
|
131
|
+
Scaffolded with \`create-bijou-tui-app\`.
|
|
132
|
+
|
|
133
|
+
## Run
|
|
134
|
+
|
|
135
|
+
\`\`\`sh
|
|
136
|
+
npm install
|
|
137
|
+
npm run dev
|
|
138
|
+
\`\`\`
|
|
139
|
+
|
|
140
|
+
The default shell includes:
|
|
141
|
+
- full-screen framed app layout
|
|
142
|
+
- two starter tabs (drawer + split)
|
|
143
|
+
- command palette and help integration
|
|
144
|
+
- quit confirmation on \`q\` / \`ctrl+c\`
|
|
145
|
+
`;
|
|
146
|
+
return {
|
|
147
|
+
'.gitignore': 'node_modules\ndist\n',
|
|
148
|
+
'package.json': `${JSON.stringify(pkg, null, 2)}\n`,
|
|
149
|
+
'tsconfig.json': `${JSON.stringify(tsconfig, null, 2)}\n`,
|
|
150
|
+
'README.md': `${readme}\n`,
|
|
151
|
+
'src/main.ts': mainTs,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Scaffold a new Bijou TUI app project.
|
|
156
|
+
*/
|
|
157
|
+
export function scaffoldProject(options = {}) {
|
|
158
|
+
const cwd = options.cwd ?? process.cwd();
|
|
159
|
+
const target = resolveTarget(options.targetDir, cwd);
|
|
160
|
+
const packageManager = options.packageManager ?? detectPackageManager();
|
|
161
|
+
const install = options.install ?? true;
|
|
162
|
+
const force = options.force ?? false;
|
|
163
|
+
ensureTargetWritable(target.absTargetDir, force);
|
|
164
|
+
const files = createTemplateFiles(target.packageName);
|
|
165
|
+
for (const [relPath, content] of Object.entries(files)) {
|
|
166
|
+
const absPath = join(target.absTargetDir, relPath);
|
|
167
|
+
mkdirSync(dirname(absPath), { recursive: true });
|
|
168
|
+
writeFileSync(absPath, content, 'utf8');
|
|
169
|
+
}
|
|
170
|
+
if (install) {
|
|
171
|
+
runInstall(packageManager, target.absTargetDir);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
targetDir: target.absTargetDir,
|
|
175
|
+
packageName: target.packageName,
|
|
176
|
+
packageManager,
|
|
177
|
+
installed: install,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/** Build usage/help text for CLI output. */
|
|
181
|
+
export function usage() {
|
|
182
|
+
return [
|
|
183
|
+
'Usage: npm create bijou-tui-app@latest [directory] [options]',
|
|
184
|
+
'',
|
|
185
|
+
'Options:',
|
|
186
|
+
' -h, --help Show this help message',
|
|
187
|
+
' -y, --yes Allow writing into non-empty target directory',
|
|
188
|
+
' --force Alias for --yes',
|
|
189
|
+
' --install Run dependency installation (default)',
|
|
190
|
+
' --no-install Skip dependency installation',
|
|
191
|
+
].join('\n');
|
|
192
|
+
}
|
|
193
|
+
function ensureTargetWritable(absTargetDir, force) {
|
|
194
|
+
if (!existsSync(absTargetDir)) {
|
|
195
|
+
mkdirSync(absTargetDir, { recursive: true });
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (!lstatSync(absTargetDir).isDirectory()) {
|
|
199
|
+
throw new Error(`Target path is not a directory: ${absTargetDir}\n` +
|
|
200
|
+
'Choose a different directory path.');
|
|
201
|
+
}
|
|
202
|
+
const entries = readdirSync(absTargetDir)
|
|
203
|
+
.filter((name) => name !== '.git' && name !== '.DS_Store');
|
|
204
|
+
if (entries.length > 0 && !force) {
|
|
205
|
+
throw new Error(`Target directory is not empty: ${absTargetDir}\n` +
|
|
206
|
+
'Pass --yes to allow writing into a non-empty directory.');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function runInstall(packageManager, cwd) {
|
|
210
|
+
const args = packageManager === 'yarn' ? [] : ['install'];
|
|
211
|
+
const result = spawnSync(packageManager, args, {
|
|
212
|
+
cwd,
|
|
213
|
+
stdio: 'inherit',
|
|
214
|
+
shell: process.platform === 'win32',
|
|
215
|
+
});
|
|
216
|
+
if (result.status !== 0) {
|
|
217
|
+
throw new Error(`${packageManager} install failed`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Convert a directory basename into a valid npm package name.
|
|
222
|
+
*/
|
|
223
|
+
function toPackageName(input) {
|
|
224
|
+
const normalized = input
|
|
225
|
+
.trim()
|
|
226
|
+
.toLowerCase()
|
|
227
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
228
|
+
.replace(/^[._-]+/, '')
|
|
229
|
+
.replace(/-+/g, '-')
|
|
230
|
+
.replace(/[._-]+$/, '');
|
|
231
|
+
return normalized.length > 0 ? normalized : DEFAULT_TARGET_DIR;
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2C7D,2EAA2E;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC/C,IAAI,YAAgC,CAAC;IACrC,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,IAAI,IAAI,GAAG,KAAK,CAAC;IAEjB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YACrC,IAAI,GAAG,IAAI,CAAC;YACZ,SAAS;QACX,CAAC;QACD,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACzD,KAAK,GAAG,IAAI,CAAC;YACb,SAAS;QACX,CAAC;QACD,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;Y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C;IAC1D,MAAM,MAAM,GAAG,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE;QAC7C,GAAG;QACH,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;KACpC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,GAAG,cAAc,iBAAiB,CAAC,CAAC;IACtD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,UAAU,GAAG,KAAK;SACrB,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;SAC9B,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAE1B,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC;AACjE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-bijou-tui-app",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Scaffold a new Bijou TUI app with batteries-included defaults.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-bijou-tui-app": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -b",
|
|
18
|
+
"prepack": "tsc -b",
|
|
19
|
+
"lint": "tsc --noEmit",
|
|
20
|
+
"test": "vitest run --config ../../vitest.config.ts"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^22.0.0",
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"vitest": "^4.0.18"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"create",
|
|
29
|
+
"scaffold",
|
|
30
|
+
"cli",
|
|
31
|
+
"terminal",
|
|
32
|
+
"tui",
|
|
33
|
+
"bijou"
|
|
34
|
+
],
|
|
35
|
+
"author": "James Ross <james@flyingrobots.dev>",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/flyingrobots/bijou.git",
|
|
40
|
+
"directory": "packages/create-bijou-tui-app"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/flyingrobots/bijou",
|
|
43
|
+
"bugs": "https://github.com/flyingrobots/bijou/issues",
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"provenance": true
|
|
50
|
+
}
|
|
51
|
+
}
|