nest-graph-inspector 0.16.0 → 0.17.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.
Files changed (64) hide show
  1. package/README.md +9 -4
  2. package/dist/cli/build-output.d.ts +43 -0
  3. package/dist/cli/build-output.d.ts.map +1 -0
  4. package/dist/cli/build-output.js +231 -0
  5. package/dist/cli/build-output.js.map +1 -0
  6. package/dist/cli/cli-error.d.ts +4 -0
  7. package/dist/cli/cli-error.d.ts.map +1 -1
  8. package/dist/cli/cli-error.js +9 -1
  9. package/dist/cli/cli-error.js.map +1 -1
  10. package/dist/cli/cli.d.ts +1 -1
  11. package/dist/cli/cli.d.ts.map +1 -1
  12. package/dist/cli/cli.js +18 -5
  13. package/dist/cli/cli.js.map +1 -1
  14. package/dist/cli/convention-check.d.ts +24 -0
  15. package/dist/cli/convention-check.d.ts.map +1 -0
  16. package/dist/cli/convention-check.js +281 -0
  17. package/dist/cli/convention-check.js.map +1 -0
  18. package/dist/cli/export-command.d.ts +2 -0
  19. package/dist/cli/export-command.d.ts.map +1 -1
  20. package/dist/cli/export-command.js +50 -30
  21. package/dist/cli/export-command.js.map +1 -1
  22. package/dist/cli/files.d.ts +14 -0
  23. package/dist/cli/files.d.ts.map +1 -0
  24. package/dist/cli/files.js +64 -0
  25. package/dist/cli/files.js.map +1 -0
  26. package/dist/cli/load-guard.d.ts +38 -0
  27. package/dist/cli/load-guard.d.ts.map +1 -0
  28. package/dist/cli/load-guard.js +126 -0
  29. package/dist/cli/load-guard.js.map +1 -0
  30. package/dist/cli/nest-cli-config.d.ts +125 -0
  31. package/dist/cli/nest-cli-config.d.ts.map +1 -0
  32. package/dist/cli/nest-cli-config.js +372 -0
  33. package/dist/cli/nest-cli-config.js.map +1 -0
  34. package/dist/cli/project.d.ts +46 -5
  35. package/dist/cli/project.d.ts.map +1 -1
  36. package/dist/cli/project.js +245 -95
  37. package/dist/cli/project.js.map +1 -1
  38. package/dist/cli/root-module-detection.d.ts +80 -0
  39. package/dist/cli/root-module-detection.d.ts.map +1 -0
  40. package/dist/cli/root-module-detection.js +645 -0
  41. package/dist/cli/root-module-detection.js.map +1 -0
  42. package/dist/cli/source-syntax.d.ts +46 -0
  43. package/dist/cli/source-syntax.d.ts.map +1 -0
  44. package/dist/cli/source-syntax.js +119 -0
  45. package/dist/cli/source-syntax.js.map +1 -0
  46. package/package.json +12 -11
  47. package/src/cli/bin.spec.ts +13 -104
  48. package/src/cli/build-output.ts +286 -0
  49. package/src/cli/cli-error.ts +8 -0
  50. package/src/cli/cli.spec.ts +45 -6
  51. package/src/cli/cli.ts +20 -6
  52. package/src/cli/convention-check.ts +385 -0
  53. package/src/cli/export-command.spec.ts +37 -0
  54. package/src/cli/export-command.ts +56 -50
  55. package/src/cli/files.ts +62 -0
  56. package/src/cli/load-guard.ts +159 -0
  57. package/src/cli/nest-cli-config.ts +556 -0
  58. package/src/cli/project.spec.ts +328 -4
  59. package/src/cli/project.ts +383 -133
  60. package/src/cli/root-module-detection.e2e.spec.ts +1500 -0
  61. package/src/cli/root-module-detection.spec.ts +1785 -0
  62. package/src/cli/root-module-detection.ts +897 -0
  63. package/src/cli/source-syntax.ts +155 -0
  64. package/src/cli/test-support/installed-cli.ts +143 -0
package/README.md CHANGED
@@ -38,10 +38,15 @@ npx nest-graph-inspector export --out - # or to stdout
38
38
 
39
39
  The file is the `GraphOutput` a running inspector serves at `/output.json`,
40
40
  built with the options the application passes to
41
- `NestGraphInspectorModule.forRoot()`. The root module file is found from
42
- `nest-cli.json` and the tsconfig `outDir`; `--entry`, `--module`, `--project`,
43
- `--require` (for example `ts-node/register`, to export TypeScript sources
44
- without building) and `--compact` are listed by
41
+ `NestGraphInspectorModule.forRoot()`. The root module is found by itself: the
42
+ compiled `app.module.js`, from `nest-cli.json` and the tsconfig `outDir`, or
43
+ else the module `main.ts` passes to `NestFactory.create()` — read from
44
+ `main.ts` as text: the export never selects `main.ts` to load. `--app` picks
45
+ an application of a Nest CLI monorepo; the file the export loads is refused
46
+ if it would start the application, as `main.js` would — the modules it
47
+ imports are not checked, so it must not import `main.ts`. `--entry`, `--module`, `--project`, `--require`
48
+ (for example `ts-node/register`, to export TypeScript sources without
49
+ building, or a webpack build) and `--compact` are listed by
45
50
  `npx nest-graph-inspector --help`. If your `main.ts` loads environment
46
51
  variables before it imports `AppModule` (`import 'dotenv/config'`), pass them
47
52
  with `--env-file .env` (Node.js 20.12+) or `--require dotenv/config`. Your
@@ -0,0 +1,43 @@
1
+ import { type ApplicationBuild, type ApplicationLayout, type NestApplication } from "./nest-cli-config";
2
+ export type CompiledFile = {
3
+ kind: "found";
4
+ path: string;
5
+ }
6
+ /** All but one are left from older builds, and which is current cannot be told. */
7
+ | {
8
+ kind: "several";
9
+ paths: readonly string[];
10
+ } | {
11
+ kind: "missing";
12
+ };
13
+ export declare function outDirOf(projectDir: string, tsconfig: ApplicationLayout["tsconfig"]): string;
14
+ /**
15
+ * tsc writes where its tsconfig says, and only there is looked: beside the
16
+ * source without an `outDir`, under an explicit `rootDir` alone — anywhere
17
+ * else could only hold a stale file. Otherwise — tsc inferring its root
18
+ * directory, a builder the export does not know — the root directories
19
+ * `compilerRoots` lists are probed.
20
+ */
21
+ export declare function compiledCandidates(source: string, layout: ApplicationLayout): string[];
22
+ /** One existing candidate is the file; more than one cannot be told apart. */
23
+ export declare function pickCompiled(candidates: readonly string[]): CompiledFile;
24
+ /** Why a file built to more than one of its candidates is loaded from none. */
25
+ export declare function staleBuildsReason(build: ApplicationBuild): string;
26
+ /** Only `nest build <name>` builds an application other than the default project. */
27
+ export declare function buildAdvice(app: string | undefined): string;
28
+ /**
29
+ * A source of another application's that its build also writes to
30
+ * `compiled`: then whose the file is cannot be told. Each other build is read
31
+ * backwards, through its own outDir and root directories, so a source at
32
+ * another path counts too; a bundle writes no such file, and a file both
33
+ * applications reach — a library's — is no other's.
34
+ */
35
+ export declare function sharedWith(compiled: string, source: string, others: readonly ApplicationLayout[]): string | undefined;
36
+ export declare function conventionalEntrySource({ application, projectDir }: ApplicationLayout): string;
37
+ /** Where an application's own build writes `<sourceRoot>/app.module.ts`; a bundle writes none. */
38
+ export declare function conventionalEntryCandidates(layout: ApplicationLayout): string[];
39
+ export declare function entryFileSources({ application, projectDir }: ApplicationLayout): string[];
40
+ export declare function bundleFileName(application: NestApplication): string;
41
+ /** Every path an application's entry file has: its source, and what it compiles or bundles to. */
42
+ export declare function applicationEntryFiles(layout: ApplicationLayout): string[];
43
+ //# sourceMappingURL=build-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-output.d.ts","sourceRoot":"","sources":["../../src/cli/build-output.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAErB,MAAM,mBAAmB,CAAC;AA0B3B,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACjC,mFAAmF;GACjF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAExB,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG,MAAM,CAE5F;AAMD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,MAAM,EAAE,CA+BtF;AA8ED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,CAUxE;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAIjE;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,iBAAiB,EAAE,GACnC,MAAM,GAAG,SAAS,CAmBpB;AA6BD,wBAAgB,uBAAuB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAE9F;AAED,kGAAkG;AAClG,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAI/E;AAED,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAGzF;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAEnE;AAED,kGAAkG;AAClG,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAgBzE"}
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.outDirOf = outDirOf;
4
+ exports.compiledCandidates = compiledCandidates;
5
+ exports.pickCompiled = pickCompiled;
6
+ exports.staleBuildsReason = staleBuildsReason;
7
+ exports.buildAdvice = buildAdvice;
8
+ exports.sharedWith = sharedWith;
9
+ exports.conventionalEntrySource = conventionalEntrySource;
10
+ exports.conventionalEntryCandidates = conventionalEntryCandidates;
11
+ exports.entryFileSources = entryFileSources;
12
+ exports.bundleFileName = bundleFileName;
13
+ exports.applicationEntryFiles = applicationEntryFiles;
14
+ const node_path_1 = require("node:path");
15
+ const files_1 = require("./files");
16
+ const nest_cli_config_1 = require("./nest-cli-config");
17
+ /**
18
+ * Where `nest build` writes an application's files. A compiled build writes
19
+ * one file per source; where the export cannot be sure which root directory
20
+ * the build laid it out from, it probes candidates rather than assume one. A
21
+ * webpack or rspack build writes one bundle, which starts the application.
22
+ */
23
+ const ENTRY_FILE_EXTENSIONS = [".ts", ".mts", ".cts", ".tsx", ".js", ".mjs", ".cjs"];
24
+ const COMPILED_EXTENSIONS = new Map([
25
+ [".ts", ".js"],
26
+ [".tsx", ".js"],
27
+ [".mts", ".mjs"],
28
+ [".cts", ".cjs"],
29
+ [".js", ".js"],
30
+ [".jsx", ".js"],
31
+ [".mjs", ".mjs"],
32
+ [".cjs", ".cjs"],
33
+ ]);
34
+ const SOURCE_EXTENSIONS = [...COMPILED_EXTENSIONS.keys()];
35
+ const CONVENTIONAL_ROOT_MODULE = "app.module.ts";
36
+ function outDirOf(projectDir, tsconfig) {
37
+ return tsconfig?.options.outDir ?? (0, node_path_1.join)(projectDir, nest_cli_config_1.DEFAULT_OUT_DIR);
38
+ }
39
+ function swcOutDir({ projectDir, tsconfig }, options) {
40
+ return options?.outDir === undefined ? outDirOf(projectDir, tsconfig) : (0, node_path_1.resolve)(projectDir, options.outDir);
41
+ }
42
+ /**
43
+ * tsc writes where its tsconfig says, and only there is looked: beside the
44
+ * source without an `outDir`, under an explicit `rootDir` alone — anywhere
45
+ * else could only hold a stale file. Otherwise — tsc inferring its root
46
+ * directory, a builder the export does not know — the root directories
47
+ * `compilerRoots` lists are probed.
48
+ */
49
+ function compiledCandidates(source, layout) {
50
+ const extension = COMPILED_EXTENSIONS.get((0, node_path_1.extname)(source));
51
+ if (extension === undefined) {
52
+ return [];
53
+ }
54
+ const { projectDir, tsconfig } = layout;
55
+ const { build } = layout.application;
56
+ const withExtension = (path, newExtension) => path.slice(0, path.length - (0, node_path_1.extname)(path).length) + newExtension;
57
+ if (build.kind === "swc") {
58
+ // @swc/cli names its output `.${outFileExtension}` when that is set.
59
+ const swcPaths = build.options.flatMap((options) => swcCandidates(source, layout, options).map((path) => withExtension(path, options?.outFileExtension === undefined ? extension : `.${options.outFileExtension}`)));
60
+ return [...new Set(swcPaths)];
61
+ }
62
+ if (build.kind === "tsc" && tsconfig !== undefined && tsconfig.options.outDir === undefined) {
63
+ return [withExtension(source, extension)];
64
+ }
65
+ const outDir = outDirOf(projectDir, tsconfig);
66
+ const candidates = compilerRoots(layout).flatMap((root) => {
67
+ const path = (0, files_1.pathInside)(root, source);
68
+ return path === undefined ? [] : [(0, node_path_1.join)(outDir, withExtension(path, extension))];
69
+ });
70
+ return [...new Set(candidates)];
71
+ }
72
+ /**
73
+ * An explicit `rootDir` alone, for tsc. Otherwise, probed in this order: an
74
+ * explicit `rootDir`, the tsconfig's directory (TypeScript 6's default), the
75
+ * project, the application's `root`, then its `sourceRoot` (where TypeScript
76
+ * 5's default, the sources' common directory, usually is).
77
+ */
78
+ function compilerRoots(layout) {
79
+ const { application, projectDir, tsconfig } = layout;
80
+ const rootDir = tsconfig?.options.rootDir;
81
+ if (application.build.kind === "tsc" && rootDir !== undefined) {
82
+ return [rootDir];
83
+ }
84
+ return [
85
+ rootDir,
86
+ tsconfig ? (0, node_path_1.dirname)(tsconfig.path) : undefined,
87
+ projectDir,
88
+ (0, node_path_1.resolve)(projectDir, application.root),
89
+ (0, node_path_1.resolve)(projectDir, application.sourceRoot),
90
+ ].filter((root) => root !== undefined);
91
+ }
92
+ /**
93
+ * Where `@swc/cli` writes `source` when the Nest CLI runs it, before the
94
+ * extension changes. Its `getDest` takes the source's path from the project,
95
+ * strips its first directory under `stripLeadingPaths`, and joins it to the
96
+ * outDir — the builder's `options.outDir`, else the tsconfig's, else `dist`
97
+ * (`swc-defaults.ts`). The builder's own `stripLeadingPaths` decides when it
98
+ * sets one. Otherwise Nest CLI 12 strips only a source root of one directory,
99
+ * and only when the tsconfig's `rootDir` is unset or is that source root,
100
+ * while Nest CLI 11 always strips: both layouts are candidates, 12's first.
101
+ */
102
+ function swcCandidates(source, layout, options) {
103
+ const { application, projectDir, tsconfig } = layout;
104
+ const fromProject = (0, files_1.pathInside)(projectDir, source);
105
+ if (fromProject === undefined) {
106
+ return [];
107
+ }
108
+ const outDir = swcOutDir(layout, options);
109
+ const whole = (0, node_path_1.join)(outDir, fromProject);
110
+ // @swc/cli's stripComponents: every directory but the first, or the path
111
+ // itself when it has no directory.
112
+ const [, ...rest] = fromProject.split(node_path_1.sep);
113
+ const stripped = rest.length ? (0, node_path_1.join)(outDir, ...rest) : whole;
114
+ if (options?.stripLeadingPaths !== undefined) {
115
+ return [options.stripLeadingPaths ? stripped : whole];
116
+ }
117
+ return nestCli12StripsLeadingPaths(tsconfig?.options.rootDir, application.sourceRoot)
118
+ ? [stripped]
119
+ : [...new Set([whole, stripped])];
120
+ }
121
+ /** Nest CLI 12's `shouldStripLeadingPaths`: a nested source root cannot be flattened by stripping. */
122
+ function nestCli12StripsLeadingPaths(rootDir, sourceRoot) {
123
+ const posix = (path) => path.replace(/^\\\\\?\\/, "").replace(/\\/g, "/").replace(/\/\/+/g, "/");
124
+ const root = posix(sourceRoot).replace(/^\.\//, "").replace(/\/+$/, "");
125
+ if (root.includes("/")) {
126
+ return false;
127
+ }
128
+ if (rootDir === undefined) {
129
+ return true;
130
+ }
131
+ const directory = posix(rootDir).replace(/\/+$/, "");
132
+ return directory === root || directory.endsWith(`/${root}`);
133
+ }
134
+ /** One existing candidate is the file; more than one cannot be told apart. */
135
+ function pickCompiled(candidates) {
136
+ const existing = candidates
137
+ .filter(files_1.isFile)
138
+ .filter((path, index, files) => files.findIndex((other) => (0, files_1.samePath)(other, path)) === index);
139
+ const [first, ...rest] = existing;
140
+ if (first === undefined) {
141
+ return { kind: "missing" };
142
+ }
143
+ return rest.length ? { kind: "several", paths: existing } : { kind: "found", path: first };
144
+ }
145
+ /** Why a file built to more than one of its candidates is loaded from none. */
146
+ function staleBuildsReason(build) {
147
+ return build.kind === "swc"
148
+ ? "Nest CLI 12 and Nest CLI 11 lay out its output differently, so one of them is left from an older build"
149
+ : "each is where a build from a different root directory writes it, so all but one of them are left from older builds";
150
+ }
151
+ /** Only `nest build <name>` builds an application other than the default project. */
152
+ function buildAdvice(app) {
153
+ return app === undefined ? "Build your project first (nest build)" : `Build ${app} first (nest build ${app})`;
154
+ }
155
+ /**
156
+ * A source of another application's that its build also writes to
157
+ * `compiled`: then whose the file is cannot be told. Each other build is read
158
+ * backwards, through its own outDir and root directories, so a source at
159
+ * another path counts too; a bundle writes no such file, and a file both
160
+ * applications reach — a library's — is no other's.
161
+ */
162
+ function sharedWith(compiled, source, others) {
163
+ for (const other of others) {
164
+ if (other.application.build.kind === "bundled") {
165
+ continue;
166
+ }
167
+ const otherSource = sourcesBuiltTo(compiled, other).find((candidate) => !(0, files_1.samePath)(candidate, source) &&
168
+ !(0, files_1.samePath)(candidate, compiled) &&
169
+ (0, files_1.isFile)(candidate) &&
170
+ compiledCandidates(candidate, other).some((path) => (0, files_1.samePath)(path, compiled)));
171
+ if (otherSource !== undefined) {
172
+ return otherSource;
173
+ }
174
+ }
175
+ return undefined;
176
+ }
177
+ /** `compiledCandidates` read backwards, as candidates `sharedWith` confirms forwards. */
178
+ function sourcesBuiltTo(compiled, layout) {
179
+ const { application, projectDir, tsconfig } = layout;
180
+ const { build } = application;
181
+ const stem = compiled.slice(0, compiled.length - (0, node_path_1.extname)(compiled).length);
182
+ const asSources = (base) => SOURCE_EXTENSIONS.map((extension) => base + extension);
183
+ if (build.kind === "tsc" && tsconfig !== undefined && tsconfig.options.outDir === undefined) {
184
+ return asSources(stem);
185
+ }
186
+ const outDirs = build.kind === "swc"
187
+ ? build.options.map((options) => swcOutDir(layout, options))
188
+ : [outDirOf(projectDir, tsconfig)];
189
+ const fromOutDirs = outDirs.flatMap((outDir) => (0, files_1.pathInside)(outDir, stem) ?? []);
190
+ // SWC writes from the project, whole or with its first directory stripped.
191
+ const [firstDirectory] = application.sourceRoot
192
+ .split(/[\\/]/)
193
+ .filter((segment) => segment !== "" && segment !== ".");
194
+ const roots = build.kind === "swc"
195
+ ? [projectDir, ...(firstDirectory === undefined ? [] : [(0, node_path_1.join)(projectDir, firstDirectory)])]
196
+ : compilerRoots(layout);
197
+ return [...new Set(roots.flatMap((root) => fromOutDirs.flatMap((path) => asSources((0, node_path_1.join)(root, path)))))];
198
+ }
199
+ function conventionalEntrySource({ application, projectDir }) {
200
+ return (0, node_path_1.resolve)(projectDir, application.sourceRoot, CONVENTIONAL_ROOT_MODULE);
201
+ }
202
+ /** Where an application's own build writes `<sourceRoot>/app.module.ts`; a bundle writes none. */
203
+ function conventionalEntryCandidates(layout) {
204
+ return layout.application.build.kind === "bundled"
205
+ ? []
206
+ : compiledCandidates(conventionalEntrySource(layout), layout);
207
+ }
208
+ function entryFileSources({ application, projectDir }) {
209
+ const stem = (0, node_path_1.resolve)(projectDir, application.sourceRoot, application.entryFile);
210
+ return ENTRY_FILE_EXTENSIONS.map((extension) => stem + extension);
211
+ }
212
+ function bundleFileName(application) {
213
+ return `${(0, node_path_1.basename)(application.entryFile)}.js`;
214
+ }
215
+ /** Every path an application's entry file has: its source, and what it compiles or bundles to. */
216
+ function applicationEntryFiles(layout) {
217
+ const { application, projectDir, tsconfig } = layout;
218
+ const sources = entryFileSources(layout);
219
+ // Where webpack and rspack write the bundle: dist/<root>/<entryFile>.js, as
220
+ // Nest's webpack defaults name it, and flattened into the outDir. Only a
221
+ // bundled build has one; in a compiled build those paths can be ordinary
222
+ // module files.
223
+ const bundles = application.build.kind === "bundled"
224
+ ? [
225
+ (0, node_path_1.join)(projectDir, nest_cli_config_1.DEFAULT_OUT_DIR, application.root, `${application.entryFile}.js`),
226
+ (0, node_path_1.join)(outDirOf(projectDir, tsconfig), bundleFileName(application)),
227
+ ]
228
+ : [];
229
+ return [...sources, ...sources.flatMap((source) => compiledCandidates(source, layout)), ...bundles];
230
+ }
231
+ //# sourceMappingURL=build-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-output.js","sourceRoot":"","sources":["../../src/cli/build-output.ts"],"names":[],"mappings":";;AAwCA,4BAEC;AAaD,gDA+BC;AA+ED,oCAUC;AAGD,8CAIC;AAGD,kCAEC;AASD,gCAuBC;AA6BD,0DAEC;AAGD,kEAIC;AAED,4CAGC;AAED,wCAEC;AAGD,sDAgBC;AA7RD,yCAA2E;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B,CAAC,MAAM,CAAC,CAAC;IACzC,4EAA4E;IAC5E,yEAAyE;IACzE,yEAAyE;IACzE,gBAAgB;IAChB,MAAM,OAAO,GACX,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;QAClC,CAAC,CAAC;YACE,IAAA,gBAAI,EAAC,UAAU,EAAE,iCAAe,EAAE,WAAW,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,KAAK,CAAC;YAClF,IAAA,gBAAI,EAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;SAClE;QACH,CAAC,CAAC,EAAE,CAAC;IAET,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC;AACtG,CAAC"}
@@ -9,6 +9,10 @@ export declare class CliError extends Error {
9
9
  cause?: unknown;
10
10
  });
11
11
  }
12
+ /** Exit code 2: a command line that parsed but names nothing usable, such as an unknown `--app`. */
13
+ export declare class CliUsageError extends CliError {
14
+ constructor(message: string);
15
+ }
12
16
  export declare function describeError(error: unknown): string;
13
17
  export declare function stackOf(error: unknown): string;
14
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cli-error.d.ts","sourceRoot":"","sources":["../../src/cli/cli-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,GACb,KAAK,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAO9C"}
1
+ {"version":3,"file":"cli-error.d.ts","sourceRoot":"","sources":["../../src/cli/cli-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED,oGAAoG;AACpG,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,GACb,KAAK,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAO9C"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CliError = void 0;
3
+ exports.CliUsageError = exports.CliError = void 0;
4
4
  exports.describeError = describeError;
5
5
  exports.stackOf = stackOf;
6
6
  exports.isErrorLike = isErrorLike;
@@ -17,6 +17,14 @@ class CliError extends Error {
17
17
  }
18
18
  }
19
19
  exports.CliError = CliError;
20
+ /** Exit code 2: a command line that parsed but names nothing usable, such as an unknown `--app`. */
21
+ class CliUsageError extends CliError {
22
+ constructor(message) {
23
+ super(message);
24
+ this.name = "CliUsageError";
25
+ }
26
+ }
27
+ exports.CliUsageError = CliUsageError;
20
28
  function describeError(error) {
21
29
  return isErrorLike(error) ? error.message : String(error);
22
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cli-error.js","sourceRoot":"","sources":["../../src/cli/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MAAa,aAAc,SAAQ,QAAQ;IACzC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AALD,sCAKC;AAED,SAAgB,aAAa,CAAC,KAAc;IAC1C,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CACzB,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAA+B,CAAC,OAAO,KAAK,QAAQ;QAC5D,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,OAAQ,KAA6B,CAAC,KAAK,CAAC,CAC9E,CAAC;AACJ,CAAC"}
package/dist/cli/cli.d.ts CHANGED
@@ -3,7 +3,7 @@ export type CliIo = {
3
3
  stderr: Pick<NodeJS.WritableStream, "write">;
4
4
  cwd: string;
5
5
  };
6
- export declare const HELP = "Usage: nest-graph-inspector export [options]\n\nWrites the dependency graph of a NestJS application without running it. The\napplication is booted in Nest's own preview mode, which builds the module\ncontainer but instantiates no provider or controller and calls no lifecycle\nhook. The file is the GraphOutput JSON a running inspector serves at\n/output.json.\n\nOptions:\n --entry <file> File exporting the root module, compiled JavaScript or \u2014\n with a --require loader \u2014 TypeScript. Default: found from\n nest-cli.json and the tsconfig outDir, such as\n dist/app.module.js or dist/src/app.module.js\n --module <name> Export name of the root module class (default: AppModule,\n or the file's only exported module)\n -o, --out <file> Where to write the graph; \"-\" for stdout\n (default: nest-graph.json)\n -p, --project <dir> Project root; the application is booted from there, as\n it is when started (default: the current directory)\n --env-file <file> Load environment variables from a file before anything\n else, for an application whose main.ts loads them\n before importing AppModule; repeatable. Needs Node.js\n 20.12 or later; --require dotenv/config also works\n -r, --require <id> Module to load first, resolved from the project, such as\n ts-node/register or tsconfig-paths/register; repeatable\n --compact Write the JSON on one line, as /output.json serves it\n -h, --help Show this help\n -v, --version Show the version\n\n--entry, --out, --project and --env-file are relative to the current\ndirectory.\n";
6
+ export declare const HELP = "Usage: nest-graph-inspector export [options]\n\nWrites the dependency graph of a NestJS application without running it. The\napplication is booted in Nest's own preview mode, which builds the module\ncontainer but instantiates no provider or controller and calls no lifecycle\nhook. The file is the GraphOutput JSON a running inspector serves at\n/output.json.\n\nOptions:\n --entry <file> File exporting the root module, compiled JavaScript or \u2014\n with a --require loader \u2014 TypeScript. Default: the\n app.module.js nest build writes, found from nest-cli.json\n and the tsconfig outDir (dist/app.module.js,\n dist/src/app.module.js); failing that, the module main.ts\n passes to NestFactory, found by reading main.ts, never by\n running it. The file to load is refused when it would\n start the application, as main.js would; the modules it\n imports are not checked, so it must not import main.ts\n --module <name> Export name of the root module class (default: the one\n main.ts boots, when the entry was found from main.ts;\n else AppModule, or the file's only exported module)\n --app <name> The application to export from a Nest CLI monorepo, by\n its name under \"projects\" in nest-cli.json (default: the\n default project)\n -o, --out <file> Where to write the graph; \"-\" for stdout\n (default: nest-graph.json)\n -p, --project <dir> Project root; the application is booted from there, as\n it is when started (default: the current directory)\n --env-file <file> Load environment variables from a file before anything\n else, for an application whose main.ts loads them\n before importing AppModule; repeatable. Needs Node.js\n 20.12 or later; --require dotenv/config also works\n -r, --require <id> Module to load first, resolved from the project, such as\n ts-node/register or tsconfig-paths/register; repeatable\n --compact Write the JSON on one line, as /output.json serves it\n -h, --help Show this help\n -v, --version Show the version\n\n--entry, --out, --project and --env-file are relative to the current\ndirectory.\n";
7
7
  /**
8
8
  * The process's own output streams, with their `write` captured now — before
9
9
  * an application's module files get the chance to replace it — so the graph,
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAcF,eAAO,MAAM,IAAI,qwDA+BhB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,KAAK,CAMjC;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,KAAmB,GACtB,OAAO,CAAC,MAAM,CAAC,CA+CjB"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7C,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAeF,eAAO,MAAM,IAAI,u7EAwChB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,KAAK,CAMjC;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,KAAmB,GACtB,OAAO,CAAC,MAAM,CAAC,CAmDjB"}
package/dist/cli/cli.js CHANGED
@@ -42,6 +42,7 @@ const { version } = require("../../package.json");
42
42
  const OPTIONS = {
43
43
  entry: { type: "string" },
44
44
  module: { type: "string" },
45
+ app: { type: "string" },
45
46
  out: { type: "string", short: "o" },
46
47
  project: { type: "string", short: "p" },
47
48
  require: { type: "string", short: "r", multiple: true },
@@ -60,11 +61,20 @@ hook. The file is the GraphOutput JSON a running inspector serves at
60
61
 
61
62
  Options:
62
63
  --entry <file> File exporting the root module, compiled JavaScript or —
63
- with a --require loader — TypeScript. Default: found from
64
- nest-cli.json and the tsconfig outDir, such as
65
- dist/app.module.js or dist/src/app.module.js
66
- --module <name> Export name of the root module class (default: AppModule,
67
- or the file's only exported module)
64
+ with a --require loader — TypeScript. Default: the
65
+ app.module.js nest build writes, found from nest-cli.json
66
+ and the tsconfig outDir (dist/app.module.js,
67
+ dist/src/app.module.js); failing that, the module main.ts
68
+ passes to NestFactory, found by reading main.ts, never by
69
+ running it. The file to load is refused when it would
70
+ start the application, as main.js would; the modules it
71
+ imports are not checked, so it must not import main.ts
72
+ --module <name> Export name of the root module class (default: the one
73
+ main.ts boots, when the entry was found from main.ts;
74
+ else AppModule, or the file's only exported module)
75
+ --app <name> The application to export from a Nest CLI monorepo, by
76
+ its name under "projects" in nest-cli.json (default: the
77
+ default project)
68
78
  -o, --out <file> Where to write the graph; "-" for stdout
69
79
  (default: nest-graph.json)
70
80
  -p, --project <dir> Project root; the application is booted from there, as
@@ -134,6 +144,9 @@ async function runCli(argv, io = processIo()) {
134
144
  return await runExportCommand(argv, values, io);
135
145
  }
136
146
  catch (error) {
147
+ if (error instanceof cli_error_1.CliUsageError) {
148
+ return usageError(io, error.message);
149
+ }
137
150
  io.stderr.write(error instanceof cli_error_1.CliError
138
151
  ? `nest-graph-inspector: ${error.message}\n${error.cause === undefined ? "" : `${(0, cli_error_1.stackOf)(error.cause)}\n`}`
139
152
  : `nest-graph-inspector: export failed: ${(0, cli_error_1.stackOf)(error)}\n`);
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAyB,KAAK,CAAC,OAAO,KACpC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAA,mBAAO,EAAC,KAAK,CAAC,KAAK,CAAC,IAC1D,EAAE;YACJ,CAAC,CAAC,wCAAwC,IAAA,mBAAO,EAAC,KAAK,CAAC,IAAI,CAC/D,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,IAAuB;IAC3C,OAAO,IAAA,qBAAS,EAAC;QACf,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QACf,OAAO,EAAE,OAAO;QAChB,gBAAgB,EAAE,IAAI;QACtB,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,EAAS,EAAE,OAAe;IAC5C,EAAE,CAAC,MAAM,CAAC,KAAK,CACb,yBAAyB,OAAO,kDAAkD,CACnF,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { ApplicationLayout } from "./nest-cli-config";
2
+ import { type BootedRootModule } from "./root-module-detection";
3
+ export type ConventionCheck = {
4
+ mainFile: string;
5
+ root: BootedRootModule;
6
+ /** Where `nest build` writes the root module's file. */
7
+ compiled: readonly string[];
8
+ /** The project's other applications, whose builds could write the same file. */
9
+ others: readonly ApplicationLayout[];
10
+ };
11
+ /** What main.ts boots, when that is one root module traced to its class's file; never throws. */
12
+ export declare function conventionCheck(layout: ApplicationLayout, others: () => readonly ApplicationLayout[]): ConventionCheck | undefined;
13
+ /**
14
+ * Once the root module export is chosen: a warning when main.ts boots a
15
+ * module from another file, or another export of the same file, and when it
16
+ * boots the same one through `.forRoot()`, whose options the export goes
17
+ * without.
18
+ */
19
+ export declare function conventionWarnings(check: ConventionCheck, entry: {
20
+ path: string;
21
+ moduleName: string;
22
+ requestedModule: string | undefined;
23
+ }, cwd: string): string[];
24
+ //# sourceMappingURL=convention-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convention-check.d.ts","sourceRoot":"","sources":["../../src/cli/convention-check.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAajC,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC;IACvB,wDAAwD;IACxD,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,gFAAgF;IAChF,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACtC,CAAC;AAEF,iGAAiG;AACjG,wBAAgB,eAAe,CAC7B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,MAAM,SAAS,iBAAiB,EAAE,GACzC,eAAe,GAAG,SAAS,CA6B7B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,EACtB,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAChF,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAiBV"}