@nestjs-dash/cli 0.0.1 → 0.1.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/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,263 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { relative, resolve } from 'node:path';
4
+ import { confirmOverwriteIfNeeded } from './confirm-overwrite.js';
5
+ import { findNestProjectRoot } from './disk-detect.js';
6
+ import { confirmFuzzyDirMatchInteractively, resolveEntityFileInteractively, } from './interactive.js';
7
+ import { runSchematic } from './runner.js';
8
+ const program = new Command();
9
+ program.name('nestjs-dash').description('NestJS Dash scaffolding CLI').version('1.0.0');
10
+ const generate = program.command('generate').alias('g').description('Generate NestJS Dash artifacts');
11
+ function findProjectRootOrExit(cwd) {
12
+ const projectRoot = findNestProjectRoot(cwd);
13
+ if (!projectRoot) {
14
+ console.error('Could not find a NestJS project (no package.json with a "@nestjs/core" dependency) walking up from the current directory. Run this from inside a NestJS project.');
15
+ process.exit(1);
16
+ }
17
+ return projectRoot;
18
+ }
19
+ function toProjectRelative(projectRoot, cwd, path) {
20
+ if (!path)
21
+ return undefined;
22
+ return relative(projectRoot, resolve(cwd, path)) || '.';
23
+ }
24
+ async function generateViaSchematic(projectRoot, schematic, options, flags) {
25
+ if (flags.dryRun) {
26
+ const result = await runSchematic({
27
+ cwd: projectRoot,
28
+ schematic,
29
+ options,
30
+ dryRun: true,
31
+ force: flags.force,
32
+ verbose: flags.verbose,
33
+ });
34
+ console.log(`Would write:\n ${result.changedPaths.join('\n ')}`);
35
+ return;
36
+ }
37
+ const dryPlan = await runSchematic({
38
+ cwd: projectRoot,
39
+ schematic,
40
+ options,
41
+ dryRun: true,
42
+ force: flags.force,
43
+ verbose: false,
44
+ interactive: false,
45
+ });
46
+ const proceed = await confirmOverwriteIfNeeded({
47
+ cwd: projectRoot,
48
+ force: flags.force,
49
+ dryRun: false,
50
+ expectedPaths: dryPlan.changedPaths,
51
+ });
52
+ if (!proceed) {
53
+ process.exitCode = 1;
54
+ return;
55
+ }
56
+ const result = await runSchematic({
57
+ cwd: projectRoot,
58
+ schematic,
59
+ options,
60
+ dryRun: false,
61
+ force: flags.force,
62
+ verbose: flags.verbose,
63
+ });
64
+ console.log(`Wrote:\n ${result.changedPaths.join('\n ')}`);
65
+ }
66
+ generate
67
+ .command('resource')
68
+ .alias('res')
69
+ .argument('<Name>', 'name of the resource, e.g. Bid or bid')
70
+ .description('Scaffold an entity/resource (and optionally a custom page) into a NestJS project, wiring it into the target <folder>.module.ts and (for a new module) the root app module. ' +
71
+ 'Detects a module folder in src matching <Name> and, when it already has one or more *.entity.ts files, reuses one as the model — prompting to pick when there is more than one — deriving the table/form declarations from its columns.')
72
+ .option('--dir <path>', 'target directory relative to the current working directory')
73
+ .option('--page', 'also scaffold a custom <Name>Page', false)
74
+ .option('--no-entity', 'skip entity generation, reuse an existing <name>.entity.ts')
75
+ .option('--force', 'overwrite existing generated files (prompts for confirmation on a TTY)', false)
76
+ .option('--dry-run', 'print the plan without writing anything', false)
77
+ .option('--verbose', 'print detailed diagnostics (fuzzy-match reasoning, codemod results)', false)
78
+ .action(async (name, opts) => {
79
+ const cwd = process.cwd();
80
+ try {
81
+ const projectRoot = findProjectRootOrExit(cwd);
82
+ const entityFilePathAbs = await resolveEntityFileInteractively({
83
+ cwd,
84
+ name,
85
+ dir: opts.dir,
86
+ noEntity: !opts.entity,
87
+ });
88
+ const dirConfirmed = await confirmFuzzyDirMatchInteractively({ cwd, name, dir: opts.dir });
89
+ if (!dirConfirmed) {
90
+ console.error('Aborted — pass --dir explicitly to target a different folder.');
91
+ process.exitCode = 1;
92
+ return;
93
+ }
94
+ const schematicOptions = {
95
+ name,
96
+ dir: toProjectRelative(projectRoot, cwd, opts.dir),
97
+ page: opts.page,
98
+ entity: opts.entity,
99
+ entityFilePath: entityFilePathAbs ? relative(projectRoot, entityFilePathAbs) : undefined,
100
+ force: opts.force,
101
+ verbose: opts.verbose,
102
+ };
103
+ await generateViaSchematic(projectRoot, 'resource', schematicOptions, opts);
104
+ }
105
+ catch (error) {
106
+ console.error(error instanceof Error ? error.message : String(error));
107
+ process.exitCode = 1;
108
+ }
109
+ });
110
+ generate
111
+ .command('panel')
112
+ .argument('<Name>', 'name of the panel')
113
+ .description('Scaffold a standalone Panel + AdminModule.forRoot() file')
114
+ .option('--force', 'overwrite an existing <name>.panel.ts (prompts for confirmation on a TTY)', false)
115
+ .option('--dry-run', 'print the plan without writing anything', false)
116
+ .option('--verbose', 'print detailed diagnostics', false)
117
+ .action(async (name, opts) => {
118
+ try {
119
+ const projectRoot = findProjectRootOrExit(process.cwd());
120
+ await generateViaSchematic(projectRoot, 'panel', { name, force: opts.force }, opts);
121
+ }
122
+ catch (error) {
123
+ console.error(error instanceof Error ? error.message : String(error));
124
+ process.exitCode = 1;
125
+ }
126
+ });
127
+ generate
128
+ .command('relation-manager')
129
+ .alias('rm')
130
+ .argument('<Name>', 'the relationship name, e.g. Books')
131
+ .description("Scaffold a RelationManager subclass under <dir>/relation-managers/, optionally wiring it into an existing Resource file's relationManagers array.")
132
+ .requiredOption('--dir <path>', 'target directory (a relation-managers/ subfolder is added)')
133
+ .option('--related-resource <slug>', 'slug of the related resource (defaults to the dasherized name)')
134
+ .option('--type <type>', 'has-many | belongs-to-many', 'has-many')
135
+ .option('--foreign-key <key>', 'foreign key column on the related entity (has-many only)')
136
+ .option('--title <text>', 'tab/section title (defaults to the humanized name)')
137
+ .option('--resource <path>', 'path to an existing Resource file to wire the generated class into')
138
+ .option('--force', 'overwrite an existing <name>.relation-manager.ts', false)
139
+ .option('--dry-run', 'print the plan without writing anything', false)
140
+ .option('--verbose', 'print detailed diagnostics', false)
141
+ .action(async (name, opts) => {
142
+ const cwd = process.cwd();
143
+ try {
144
+ const projectRoot = findProjectRootOrExit(cwd);
145
+ const schematicOptions = {
146
+ name,
147
+ dir: toProjectRelative(projectRoot, cwd, opts.dir),
148
+ relatedResource: opts.relatedResource,
149
+ type: opts.type,
150
+ foreignKey: opts.foreignKey,
151
+ title: opts.title,
152
+ resource: toProjectRelative(projectRoot, cwd, opts.resource),
153
+ force: opts.force,
154
+ verbose: opts.verbose,
155
+ };
156
+ await generateViaSchematic(projectRoot, 'relation-manager', schematicOptions, opts);
157
+ }
158
+ catch (error) {
159
+ console.error(error instanceof Error ? error.message : String(error));
160
+ process.exitCode = 1;
161
+ }
162
+ });
163
+ generate
164
+ .command('filter')
165
+ .alias('fi')
166
+ .argument('<Name>', 'the column to filter on, e.g. status')
167
+ .description("Wire a SelectFilter/TextFilter/DateFilter into an existing resource's table().")
168
+ .requiredOption('--resource <path>', 'path to the Resource (or RelationManager) file to wire into')
169
+ .option('--kind <kind>', 'text | select | date', 'text')
170
+ .option('--label <text>', 'filter label (defaults to the humanized column name)')
171
+ .option('--options <list>', 'kind=select only: comma-separated value:Label pairs, e.g. "active:Active,banned:Banned"')
172
+ .option('--operators <list>', 'comma-separated FilterOperator list, e.g. "$eq,$ilike"')
173
+ .option('--dry-run', 'print the plan without writing anything', false)
174
+ .option('--verbose', 'print detailed diagnostics', false)
175
+ .action(async (name, opts) => {
176
+ const cwd = process.cwd();
177
+ try {
178
+ const projectRoot = findProjectRootOrExit(cwd);
179
+ const schematicOptions = {
180
+ name,
181
+ resource: toProjectRelative(projectRoot, cwd, opts.resource),
182
+ kind: opts.kind,
183
+ label: opts.label,
184
+ options: opts.options,
185
+ operators: opts.operators,
186
+ verbose: opts.verbose,
187
+ };
188
+ await generateViaSchematic(projectRoot, 'filter', schematicOptions, {
189
+ ...opts,
190
+ force: false,
191
+ });
192
+ }
193
+ catch (error) {
194
+ console.error(error instanceof Error ? error.message : String(error));
195
+ process.exitCode = 1;
196
+ }
197
+ });
198
+ generate
199
+ .command('action')
200
+ .alias('ac')
201
+ .argument('<Name>', "the action's name/verb, e.g. publish")
202
+ .description("Wire a custom Action.make(...).handler(...) into an existing resource's table() (row/bulk/toolbar).")
203
+ .requiredOption('--resource <path>', 'path to the Resource (or RelationManager) file to wire into')
204
+ .option('--variant <variant>', 'record | bulk | toolbar', 'record')
205
+ .option('--icon <name>', 'Lucide icon name, e.g. star')
206
+ .option('--label <text>', 'button label (defaults to the humanized action name)')
207
+ .option('--dry-run', 'print the plan without writing anything', false)
208
+ .option('--verbose', 'print detailed diagnostics', false)
209
+ .action(async (name, opts) => {
210
+ const cwd = process.cwd();
211
+ try {
212
+ const projectRoot = findProjectRootOrExit(cwd);
213
+ const schematicOptions = {
214
+ name,
215
+ resource: toProjectRelative(projectRoot, cwd, opts.resource),
216
+ variant: opts.variant,
217
+ icon: opts.icon,
218
+ label: opts.label,
219
+ verbose: opts.verbose,
220
+ };
221
+ await generateViaSchematic(projectRoot, 'action', schematicOptions, {
222
+ ...opts,
223
+ force: false,
224
+ });
225
+ }
226
+ catch (error) {
227
+ console.error(error instanceof Error ? error.message : String(error));
228
+ process.exitCode = 1;
229
+ }
230
+ });
231
+ generate
232
+ .command('widget')
233
+ .alias('wi')
234
+ .argument('<Name>', 'the widget\'s title/label, e.g. "Total Users"')
235
+ .description("Wire a DashboardWidget (StatCard or a BarChart/LineChart/PieChart) into an existing Panel's widgets().")
236
+ .requiredOption('--panel <path>', 'path to a Panel factory file (as scaffolded by the panel command) to wire into')
237
+ .option('--kind <kind>', 'stat | bar | line | pie', 'stat')
238
+ .option('--side', 'render in the narrow side column instead of the main column', false)
239
+ .option('--dry-run', 'print the plan without writing anything', false)
240
+ .option('--verbose', 'print detailed diagnostics', false)
241
+ .action(async (name, opts) => {
242
+ const cwd = process.cwd();
243
+ try {
244
+ const projectRoot = findProjectRootOrExit(cwd);
245
+ const schematicOptions = {
246
+ name,
247
+ panel: toProjectRelative(projectRoot, cwd, opts.panel),
248
+ kind: opts.kind,
249
+ side: opts.side,
250
+ verbose: opts.verbose,
251
+ };
252
+ await generateViaSchematic(projectRoot, 'widget', schematicOptions, {
253
+ ...opts,
254
+ force: false,
255
+ });
256
+ }
257
+ catch (error) {
258
+ console.error(error instanceof Error ? error.message : String(error));
259
+ process.exitCode = 1;
260
+ }
261
+ });
262
+ program.parse();
263
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACH,iCAAiC,EACjC,8BAA8B,GACjC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAA4B,MAAM,aAAa,CAAC;AAErE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAExF,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,gCAAgC,CAAC,CAAC;AAQtG,SAAS,qBAAqB,CAAC,GAAW;IACxC,MAAM,WAAW,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,CAAC,KAAK,CACX,kKAAkK,CACnK,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAA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gF,CACjF;KACA,MAAM,CAAC,eAAe,EAAE,yBAAyB,EAAE,MAAM,CAAC;KAC1D,MAAM,CAAC,QAAQ,EAAE,6DAA6D,EAAE,KAAK,CAAC;KACtF,MAAM,CAAC,WAAW,EAAE,yCAAyC,EAAE,KAAK,CAAC;KACrE,MAAM,CAAC,WAAW,EAAE,4BAA4B,EAAE,KAAK,CAAC;KACxD,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,IAA0B,EAAE,EAAE;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,gBAAgB,GAAG;YACvB,IAAI;YACJ,KAAK,EAAE,iBAAiB,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;YACtD,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;QACF,MAAM,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE;YAClE,GAAG,IAAI;YACP,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface ConfirmOverwriteOptions {
2
+ cwd: string;
3
+ force: boolean;
4
+ dryRun: boolean;
5
+ expectedPaths: string[];
6
+ }
7
+ export declare function confirmOverwriteIfNeeded(options: ConfirmOverwriteOptions): Promise<boolean>;
8
+ //# sourceMappingURL=confirm-overwrite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-overwrite.d.ts","sourceRoot":"","sources":["../src/confirm-overwrite.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAEhB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAUD,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAajG"}
@@ -0,0 +1,17 @@
1
+ import { confirm } from '@inquirer/prompts';
2
+ import { existsSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ export async function confirmOverwriteIfNeeded(options) {
5
+ if (options.dryRun || !options.force)
6
+ return true;
7
+ const existing = options.expectedPaths.filter((path) => existsSync(join(options.cwd, path.replace(/^\//, ''))));
8
+ if (existing.length === 0)
9
+ return true;
10
+ if (!process.stdout.isTTY)
11
+ return true;
12
+ return confirm({
13
+ message: `--force will overwrite ${existing.length} existing file(s):\n ${existing.join('\n ')}\nContinue?`,
14
+ default: false,
15
+ });
16
+ }
17
+ //# sourceMappingURL=confirm-overwrite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-overwrite.js","sourceRoot":"","sources":["../src/confirm-overwrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAkBjC,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAAgC;IAC7E,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAElD,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACrD,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CACvD,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,OAAO,CAAC;QACb,OAAO,EAAE,0BAA0B,QAAQ,CAAC,MAAM,yBAAyB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;QAC7G,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare function findNestProjectRoot(startDir: string): string | null;
2
+ export declare function resolveSourceRoot(projectRoot: string): string;
3
+ export declare function resolveTargetDir(options: {
4
+ cwd: string;
5
+ sourceRoot: string;
6
+ name: string;
7
+ explicitDir?: string;
8
+ }): {
9
+ dir: string;
10
+ folderName: string;
11
+ matched: boolean;
12
+ matchedModulePath?: string;
13
+ };
14
+ export declare function findEntityFile(dir: string, name: string): string | null;
15
+ export declare function findAllEntityFiles(dir: string): string[];
16
+ //# sourceMappingURL=disk-detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disk-detect.d.ts","sourceRoot":"","sources":["../src/disk-detect.ts"],"names":[],"mappings":"AAYA,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBnE;AAGD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAW7D;AAyCD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,CAkBpF;AAGD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIvE;AAGD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAexD"}
@@ -0,0 +1,113 @@
1
+ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
2
+ import { basename, dirname, join } from 'node:path';
3
+ import { toKebabCase } from './naming.js';
4
+ export function findNestProjectRoot(startDir) {
5
+ let dir = startDir;
6
+ for (;;) {
7
+ const pkgPath = join(dir, 'package.json');
8
+ if (existsSync(pkgPath)) {
9
+ try {
10
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
11
+ if (pkg.dependencies?.['@nestjs/core'] || pkg.devDependencies?.['@nestjs/core']) {
12
+ return dir;
13
+ }
14
+ }
15
+ catch {
16
+ }
17
+ }
18
+ const parent = dirname(dir);
19
+ if (parent === dir)
20
+ return null;
21
+ dir = parent;
22
+ }
23
+ }
24
+ export function resolveSourceRoot(projectRoot) {
25
+ const nestCliPath = join(projectRoot, 'nest-cli.json');
26
+ if (existsSync(nestCliPath)) {
27
+ try {
28
+ const nestCli = JSON.parse(readFileSync(nestCliPath, 'utf8'));
29
+ if (nestCli.sourceRoot)
30
+ return join(projectRoot, nestCli.sourceRoot);
31
+ }
32
+ catch {
33
+ }
34
+ }
35
+ return join(projectRoot, 'src');
36
+ }
37
+ function walkFiles(root, predicate, maxDepth = 6) {
38
+ const results = [];
39
+ const skip = new Set(['node_modules', 'dist', '.git', '.turbo']);
40
+ function walk(dir, depth) {
41
+ if (depth > maxDepth)
42
+ return;
43
+ let entries;
44
+ try {
45
+ entries = readdirSync(dir);
46
+ }
47
+ catch {
48
+ return;
49
+ }
50
+ for (const entry of entries) {
51
+ if (skip.has(entry))
52
+ continue;
53
+ const full = join(dir, entry);
54
+ let stat;
55
+ try {
56
+ stat = statSync(full);
57
+ }
58
+ catch {
59
+ continue;
60
+ }
61
+ if (stat.isDirectory()) {
62
+ walk(full, depth + 1);
63
+ }
64
+ else if (predicate(full)) {
65
+ results.push(full);
66
+ }
67
+ }
68
+ }
69
+ walk(root, 0);
70
+ return results;
71
+ }
72
+ export function resolveTargetDir(options) {
73
+ if (options.explicitDir) {
74
+ const dir = join(options.cwd, options.explicitDir);
75
+ return { dir, folderName: basename(dir), matched: existsSync(dir) };
76
+ }
77
+ const kebab = toKebabCase(options.name);
78
+ const moduleFiles = walkFiles(options.sourceRoot, (p) => p.endsWith('.module.ts'));
79
+ for (const moduleFile of moduleFiles) {
80
+ const moduleBase = basename(moduleFile).replace(/\.module\.ts$/, '');
81
+ if (moduleBase.includes(kebab) || kebab.includes(moduleBase)) {
82
+ const dir = dirname(moduleFile);
83
+ return { dir, folderName: basename(dir), matched: true, matchedModulePath: moduleFile };
84
+ }
85
+ }
86
+ const folderName = `${kebab}s`;
87
+ return { dir: join(options.sourceRoot, folderName), folderName, matched: false };
88
+ }
89
+ export function findEntityFile(dir, name) {
90
+ const kebab = toKebabCase(name);
91
+ const candidates = [join(dir, 'entities', `${kebab}.entity.ts`), join(dir, `${kebab}.entity.ts`)];
92
+ return candidates.find((c) => existsSync(c)) ?? null;
93
+ }
94
+ export function findAllEntityFiles(dir) {
95
+ const found = new Set();
96
+ for (const candidateDir of [dir, join(dir, 'entities')]) {
97
+ if (!existsSync(candidateDir))
98
+ continue;
99
+ let entries;
100
+ try {
101
+ entries = readdirSync(candidateDir);
102
+ }
103
+ catch {
104
+ continue;
105
+ }
106
+ for (const entry of entries) {
107
+ if (entry.endsWith('.entity.ts'))
108
+ found.add(join(candidateDir, entry));
109
+ }
110
+ }
111
+ return [...found].sort();
112
+ }
113
+ //# sourceMapping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AAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACnF,CAAC;AAGD,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,IAAY;IACtD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,YAAY,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC;IAClG,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AACvD,CAAC;AAGD,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,YAAY,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;YAAE,SAAS;QACxC,IAAI,OAAiB,CAAC;QACtB,IAAI,CAAC;YACH,OAAO,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface ResolveEntityOptions {
2
+ cwd: string;
3
+ name: string;
4
+ dir?: string;
5
+ noEntity?: boolean;
6
+ }
7
+ export declare function resolveEntityFileInteractively(options: ResolveEntityOptions): Promise<string | undefined>;
8
+ export interface ResolveDirOptions {
9
+ cwd: string;
10
+ name: string;
11
+ dir?: string;
12
+ }
13
+ export declare function confirmFuzzyDirMatchInteractively(options: ResolveDirOptions): Promise<boolean>;
14
+ //# sourceMappingURL=interactive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAWD,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAwB7B;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AASD,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
@@ -0,0 +1,51 @@
1
+ import { confirm, select } from '@inquirer/prompts';
2
+ import { relative } from 'node:path';
3
+ import { findAllEntityFiles, findEntityFile, findNestProjectRoot, resolveSourceRoot, resolveTargetDir, } from './disk-detect.js';
4
+ export async function resolveEntityFileInteractively(options) {
5
+ const projectRoot = findNestProjectRoot(options.cwd);
6
+ if (!projectRoot)
7
+ return undefined;
8
+ const sourceRoot = resolveSourceRoot(projectRoot);
9
+ const { dir } = resolveTargetDir({
10
+ cwd: options.cwd,
11
+ sourceRoot,
12
+ name: options.name,
13
+ explicitDir: options.dir,
14
+ });
15
+ const conventional = findEntityFile(dir, options.name);
16
+ if (conventional)
17
+ return conventional;
18
+ if (options.noEntity)
19
+ return undefined;
20
+ const candidates = findAllEntityFiles(dir);
21
+ if (candidates.length === 0)
22
+ return undefined;
23
+ if (candidates.length === 1)
24
+ return candidates[0];
25
+ return select({
26
+ message: `Found multiple entity files in ${relative(options.cwd, dir) || '.'} — which one is the model for "${options.name}"?`,
27
+ choices: candidates.map((path) => ({ name: relative(dir, path), value: path })),
28
+ });
29
+ }
30
+ export async function confirmFuzzyDirMatchInteractively(options) {
31
+ if (options.dir)
32
+ return true;
33
+ const projectRoot = findNestProjectRoot(options.cwd);
34
+ if (!projectRoot)
35
+ return true;
36
+ const sourceRoot = resolveSourceRoot(projectRoot);
37
+ const { dir, matched, matchedModulePath } = resolveTargetDir({
38
+ cwd: options.cwd,
39
+ sourceRoot,
40
+ name: options.name,
41
+ });
42
+ if (!matched)
43
+ return true;
44
+ if (!process.stdout.isTTY)
45
+ return true;
46
+ return confirm({
47
+ message: `Use existing folder ${relative(options.cwd, dir)} for "${options.name}"? (matched via ${matchedModulePath ? relative(options.cwd, matchedModulePath) : dir})`,
48
+ default: true,
49
+ });
50
+ }
51
+ //# sourceMappingURL=interactive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive.js","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAkB1B,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,OAA6B;IAE7B,MAAM,WAAW,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IAEnC,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,EAAE,GAAG,EAAE,GAAG,gBAAgB,CAAC;QAC/B,GAA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AAG,EAAE,OAAO,CAAC,GAAG;QAChB,UAAU;QACV,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC,CAAC;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,OAAO,CAAC;QACb,OAAO,EAAE,uBAAuB,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,OAAO,CAAC,IAAI,mBAAmB,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;QACvK,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function toPascalCase(value: string): string;
2
+ export declare function toKebabCase(value: string): string;
3
+ export declare function toCamelCase(value: string): string;
4
+ export declare function humanize(pascal: string): string;
5
+ //# sourceMappingURL=naming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/C"}
package/dist/naming.js ADDED
@@ -0,0 +1,21 @@
1
+ export function toPascalCase(value) {
2
+ return value
3
+ .split(/[-_\s]+/)
4
+ .filter(Boolean)
5
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
6
+ .join('');
7
+ }
8
+ export function toKebabCase(value) {
9
+ return value
10
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
11
+ .replace(/[_\s]+/g, '-')
12
+ .toLowerCase();
13
+ }
14
+ export function toCamelCase(value) {
15
+ const pascal = toPascalCase(value);
16
+ return pascal.charAt(0).toLowerCase() + pascal.slice(1);
17
+ }
18
+ export function humanize(pascal) {
19
+ return pascal.replace(/([a-z0-9])([A-Z])/g, '$1 $2').trim();
20
+ }
21
+ //# sourceMappingURL=naming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.js","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK;SACT,KAAK,CAAC,SAAS,CAAC;SAChB,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK;SACT,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,WAAW,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { schema } from '@angular-devkit/core';
2
+ export declare function createInquirerPromptProvider(): schema.PromptProvider;
3
+ //# sourceMappingURL=prompt-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-provider.d.ts","sourceRoot":"","sources":["../src/prompt-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAS9D,wBAAgB,4BAA4B,IAAI,MAAM,CAAC,cAAc,CA8BpE"}
@@ -0,0 +1,31 @@
1
+ import { confirm, input, select } from '@inquirer/prompts';
2
+ export function createInquirerPromptProvider() {
3
+ return async (definitions) => {
4
+ const answers = {};
5
+ for (const def of definitions) {
6
+ switch (def.type) {
7
+ case 'confirmation':
8
+ answers[def.id] = await confirm({
9
+ message: def.message,
10
+ default: def.default ?? undefined,
11
+ });
12
+ break;
13
+ case 'list':
14
+ answers[def.id] = await select({
15
+ message: def.message,
16
+ choices: (def.items ?? []).map((item) => typeof item === 'string'
17
+ ? { name: item, value: item }
18
+ : { name: item.label, value: item.value }),
19
+ });
20
+ break;
21
+ default:
22
+ answers[def.id] = await input({
23
+ message: def.message,
24
+ default: def.default != null ? String(def.default) : undefined,
25
+ });
26
+ }
27
+ }
28
+ return answers;
29
+ };
30
+ }
31
+ //# sourceMappingURL=prompt-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-provider.js","sourceRoot":"","sources":["../src/prompt-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAQ3D,MAAM,UAAU,4BAA4B;IAC1C,OAAO,KAAK,EAAE,WAAsC,EAAE,EAAE;QACtD,MAAM,OAAO,GAA8B,EAAE,CAAC;QAC9C,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAC9B,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;gBACjB,KAAK,cAAc;oBACjB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC;wBAC9B,OAAO,EAAE,GAAG,CAAC,OAAO;wBACpB,OAAO,EAAG,GAAG,CAAC,OAA+B,IAAI,SAAS;qBAC3D,CAAC,CAAC;oBACH,MAAM;gBACR,KAAK,MAAM;oBACT,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,MAAM,CAAC;wBAC7B,OAAO,EAAE,GAAG,CAAC,OAAO;wBACpB,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACtC,OAAO,IAAI,KAAK,QAAQ;4BACtB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;4BAC7B,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAC5C;qBACF,CAAC,CAAC;oBACH,MAAM;gBACR;oBACE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,KAAK,CAAC;wBAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;wBACpB,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;qBAC/D,CAAC,CAAC;YACP,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface RunSchematicOptions {
2
+ cwd: string;
3
+ schematic: 'entity' | 'module' | 'page' | 'panel' | 'resource' | 'relation-manager' | 'filter' | 'action' | 'widget';
4
+ options: Record<string, unknown>;
5
+ dryRun: boolean;
6
+ force: boolean;
7
+ verbose: boolean;
8
+ interactive?: boolean;
9
+ }
10
+ export interface RunSchematicResult {
11
+ changedPaths: string[];
12
+ }
13
+ export declare function runSchematic(opts: RunSchematicOptions): Promise<RunSchematicResult>;
14
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EACL,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,kBAAkB,GAClB,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IAQjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAQD,wBAAsB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+BzF"}
package/dist/runner.js ADDED
@@ -0,0 +1,30 @@
1
+ import { createConsoleLogger } from '@angular-devkit/core/node';
2
+ import { NodeWorkflow } from '@angular-devkit/schematics/tools/index.js';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { lastValueFrom } from 'rxjs';
5
+ import { createInquirerPromptProvider } from './prompt-provider.js';
6
+ export async function runSchematic(opts) {
7
+ const workflow = new NodeWorkflow(opts.cwd, {
8
+ force: opts.force,
9
+ dryRun: opts.dryRun,
10
+ resolvePaths: [opts.cwd, fileURLToPath(new URL('..', import.meta.url))],
11
+ });
12
+ if (opts.interactive !== false && process.stdin.isTTY && process.stdout.isTTY) {
13
+ workflow.registry.usePromptProvider(createInquirerPromptProvider());
14
+ }
15
+ const changedPaths = [];
16
+ workflow.reporter.subscribe((event) => {
17
+ if (event.kind !== 'error')
18
+ changedPaths.push(event.path);
19
+ if (opts.verbose)
20
+ console.error(`${event.kind} ${event.path}`);
21
+ });
22
+ await lastValueFrom(workflow.execute({
23
+ collection: '@nestjs-dash/schematics',
24
+ schematic: opts.schematic,
25
+ options: opts.options,
26
+ logger: createConsoleLogger(opts.verbose),
27
+ }), { defaultValue: undefined });
28
+ return { changedPaths };
29
+ }
30
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAsCpE,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAyB;IAC1D,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE;QAC1C,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QAInB,YAAY,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;KACxE,CAAC,CAAC;IAEH,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC9E,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,4BAA4B,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,KAAkB,EAAE,EAAE;QACjD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;YAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,MAAM,aAAa,CACjB,QAAQ,CAAC,OAAO,CAAC;QACf,UAAU,EAAE,yBAAyB;QACrC,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC;KAC1C,CAAC,EACF,EAAE,YAAY,EAAE,SAAS,EAAE,CAC5B,CAAC;IAEF,OAAO,EAAE,YAAY,EAAE,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,8 @@
1
1
  {
2
2
  "name": "@nestjs-dash/cli",
3
- "version": "0.0.1",
4
- "description": "CLI generators for nestjs-dash",
3
+ "version": "0.1.0",
4
+ "description": "CLI generators for NestJS Dash",
5
5
  "license": "MIT",
6
- "bugs": {
7
- "url": "https://github.com/nestjs-dash/cli/issues"
8
- },
9
- "homepage": "https://github.com/nestjs-dash/cli/tree/main/packages/cli#readme",
10
6
  "bin": {
11
7
  "nestjs-dash": "./dist/cli.js"
12
8
  },
@@ -15,9 +11,20 @@
15
11
  ],
16
12
  "type": "module",
17
13
  "publishConfig": {
18
- "access": "public",
19
- "registry": "https://registry.npmjs.org/",
20
- "tag": "latest"
14
+ "access": "public"
15
+ },
16
+ "dependencies": {
17
+ "@nestjs-dash/schematics": "0.1.0",
18
+ "@angular-devkit/core": "22.1.8",
19
+ "@angular-devkit/schematics": "22.1.8",
20
+ "@inquirer/prompts": "^8.7.2",
21
+ "commander": "^15.0.0",
22
+ "rxjs": "^7.8.2"
23
+ },
24
+ "devDependencies": {
25
+ "@nestjs-dash/typescript-config": "0.1.0",
26
+ "typescript": "6.0.3",
27
+ "vitest": "^5.0.0"
21
28
  },
22
29
  "scripts": {
23
30
  "build": "tsc -p tsconfig.json",
@@ -26,17 +33,6 @@
26
33
  "lint": "oxlint src",
27
34
  "test": "vitest run",
28
35
  "test:coverage": "vitest run --coverage",
29
- "release": "release-it",
30
36
  "dev": "tsc -p tsconfig.json --watch"
31
- },
32
- "devDependencies": {
33
- "@types/node": "^26.5.1",
34
- "@vitest/coverage-v8": "5.0.0",
35
- "oxfmt": "^0.67.0",
36
- "oxlint": "^1.82.0",
37
- "typescript": "7.0.2",
38
- "vitest": "^5.0.0",
39
- "release-it": "^21.0.2",
40
- "@release-it/conventional-changelog": "^12.0.0"
41
37
  }
42
38
  }
package/README.md DELETED
@@ -1 +0,0 @@
1
- # @nestjs-dash/prisma
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js DELETED
@@ -1,5 +0,0 @@
1
- import { createRequire } from 'node:module';
2
- const require = createRequire(import.meta.url);
3
- const pkg = require('../package.json');
4
- console.log(`Hello from ${pkg.name}`);
5
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAqB,CAAC;AAE3D,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC"}