@pristine-ts/cli 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/pristine.cjs +6 -2
- package/dist/lib/cjs/bin.js +18 -1
- package/dist/lib/cjs/bin.js.map +1 -1
- package/dist/lib/cjs/bootstrap/app-module-loader.js +40 -78
- package/dist/lib/cjs/bootstrap/app-module-loader.js.map +1 -1
- package/dist/lib/cjs/bootstrap/loaded-app-module.js +9 -13
- package/dist/lib/cjs/bootstrap/loaded-app-module.js.map +1 -1
- package/dist/lib/cjs/bootstrap/plugin-loader.js +3 -3
- package/dist/lib/cjs/bootstrap/plugin-loader.js.map +1 -1
- package/dist/lib/cjs/cli.js +173 -80
- package/dist/lib/cjs/cli.js.map +1 -1
- package/dist/lib/cjs/cli.module.js +24 -8
- package/dist/lib/cjs/cli.module.js.map +1 -1
- package/dist/lib/cjs/commands/build-alias.command.js.map +1 -1
- package/dist/lib/cjs/commands/build.command.js +9 -10
- package/dist/lib/cjs/commands/build.command.js.map +1 -1
- package/dist/lib/cjs/commands/config-print.command.js +1 -2
- package/dist/lib/cjs/commands/config-print.command.js.map +1 -1
- package/dist/lib/cjs/commands/help-alias.command.js.map +1 -1
- package/dist/lib/cjs/commands/help.command.js +6 -2
- package/dist/lib/cjs/commands/help.command.js.map +1 -1
- package/dist/lib/cjs/commands/info-alias.command.js.map +1 -1
- package/dist/lib/cjs/commands/info.command.js +7 -8
- package/dist/lib/cjs/commands/info.command.js.map +1 -1
- package/dist/lib/cjs/commands/init-alias.command.js.map +1 -1
- package/dist/lib/cjs/commands/init.command.js +13 -12
- package/dist/lib/cjs/commands/init.command.js.map +1 -1
- package/dist/lib/cjs/commands/list-alias.command.js.map +1 -1
- package/dist/lib/cjs/commands/list.command.js +8 -2
- package/dist/lib/cjs/commands/list.command.js.map +1 -1
- package/dist/lib/cjs/commands/start-alias.command.js.map +1 -1
- package/dist/lib/cjs/commands/start.command.js +3 -4
- package/dist/lib/cjs/commands/start.command.js.map +1 -1
- package/dist/lib/cjs/commands/verify-alias.command.js.map +1 -1
- package/dist/lib/cjs/commands/verify.command.js +3 -4
- package/dist/lib/cjs/commands/verify.command.js.map +1 -1
- package/dist/lib/cjs/config/resolved-pristine-config.js +2 -3
- package/dist/lib/cjs/config/resolved-pristine-config.js.map +1 -1
- package/dist/lib/cjs/errors/cli-error-code.enum.js +17 -0
- package/dist/lib/cjs/errors/cli-error-code.enum.js.map +1 -0
- package/dist/lib/cjs/errors/command-not-found.error.js +11 -12
- package/dist/lib/cjs/errors/command-not-found.error.js.map +1 -1
- package/dist/lib/cjs/errors/errors.js +1 -0
- package/dist/lib/cjs/errors/errors.js.map +1 -1
- package/dist/lib/cjs/event-handlers/cli.event-handler.js +28 -20
- package/dist/lib/cjs/event-handlers/cli.event-handler.js.map +1 -1
- package/dist/lib/cjs/reporters/cli-error.reporter.js +121 -0
- package/dist/lib/cjs/reporters/cli-error.reporter.js.map +1 -0
- package/dist/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/lib/cjs/types/command-event-response.type.js.map +1 -1
- package/dist/lib/esm/bin.js +18 -1
- package/dist/lib/esm/bin.js.map +1 -1
- package/dist/lib/esm/bootstrap/app-module-loader.js +40 -78
- package/dist/lib/esm/bootstrap/app-module-loader.js.map +1 -1
- package/dist/lib/esm/bootstrap/loaded-app-module.js +9 -13
- package/dist/lib/esm/bootstrap/loaded-app-module.js.map +1 -1
- package/dist/lib/esm/bootstrap/plugin-loader.js +3 -3
- package/dist/lib/esm/bootstrap/plugin-loader.js.map +1 -1
- package/dist/lib/esm/cli.js +172 -79
- package/dist/lib/esm/cli.js.map +1 -1
- package/dist/lib/esm/cli.module.js +24 -8
- package/dist/lib/esm/cli.module.js.map +1 -1
- package/dist/lib/esm/commands/build-alias.command.js.map +1 -1
- package/dist/lib/esm/commands/build.command.js +10 -11
- package/dist/lib/esm/commands/build.command.js.map +1 -1
- package/dist/lib/esm/commands/config-print.command.js +2 -3
- package/dist/lib/esm/commands/config-print.command.js.map +1 -1
- package/dist/lib/esm/commands/help-alias.command.js.map +1 -1
- package/dist/lib/esm/commands/help.command.js +7 -3
- package/dist/lib/esm/commands/help.command.js.map +1 -1
- package/dist/lib/esm/commands/info-alias.command.js.map +1 -1
- package/dist/lib/esm/commands/info.command.js +8 -9
- package/dist/lib/esm/commands/info.command.js.map +1 -1
- package/dist/lib/esm/commands/init-alias.command.js.map +1 -1
- package/dist/lib/esm/commands/init.command.js +14 -13
- package/dist/lib/esm/commands/init.command.js.map +1 -1
- package/dist/lib/esm/commands/list-alias.command.js.map +1 -1
- package/dist/lib/esm/commands/list.command.js +9 -3
- package/dist/lib/esm/commands/list.command.js.map +1 -1
- package/dist/lib/esm/commands/start-alias.command.js.map +1 -1
- package/dist/lib/esm/commands/start.command.js +4 -5
- package/dist/lib/esm/commands/start.command.js.map +1 -1
- package/dist/lib/esm/commands/verify-alias.command.js.map +1 -1
- package/dist/lib/esm/commands/verify.command.js +4 -5
- package/dist/lib/esm/commands/verify.command.js.map +1 -1
- package/dist/lib/esm/config/resolved-pristine-config.js +2 -3
- package/dist/lib/esm/config/resolved-pristine-config.js.map +1 -1
- package/dist/lib/esm/errors/cli-error-code.enum.js +14 -0
- package/dist/lib/esm/errors/cli-error-code.enum.js.map +1 -0
- package/dist/lib/esm/errors/command-not-found.error.js +12 -13
- package/dist/lib/esm/errors/command-not-found.error.js.map +1 -1
- package/dist/lib/esm/errors/errors.js +1 -0
- package/dist/lib/esm/errors/errors.js.map +1 -1
- package/dist/lib/esm/event-handlers/cli.event-handler.js +29 -21
- package/dist/lib/esm/event-handlers/cli.event-handler.js.map +1 -1
- package/dist/lib/esm/reporters/cli-error.reporter.js +118 -0
- package/dist/lib/esm/reporters/cli-error.reporter.js.map +1 -0
- package/dist/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/esm/types/command-event-response.type.js.map +1 -1
- package/dist/types/bin.d.ts +1 -0
- package/dist/types/bootstrap/app-module-loader.d.ts +24 -25
- package/dist/types/bootstrap/loaded-app-module.d.ts +12 -26
- package/dist/types/bootstrap/plugin-loader.d.ts +1 -1
- package/dist/types/cli.d.ts +69 -9
- package/dist/types/cli.module.d.ts +2 -2
- package/dist/types/commands/build-alias.command.d.ts +2 -2
- package/dist/types/commands/build.command.d.ts +2 -2
- package/dist/types/commands/config-print.command.d.ts +2 -2
- package/dist/types/commands/help-alias.command.d.ts +2 -2
- package/dist/types/commands/help.command.d.ts +2 -2
- package/dist/types/commands/info-alias.command.d.ts +2 -2
- package/dist/types/commands/info.command.d.ts +2 -2
- package/dist/types/commands/init-alias.command.d.ts +2 -2
- package/dist/types/commands/init.command.d.ts +2 -2
- package/dist/types/commands/list-alias.command.d.ts +2 -2
- package/dist/types/commands/list.command.d.ts +2 -2
- package/dist/types/commands/start-alias.command.d.ts +2 -2
- package/dist/types/commands/start.command.d.ts +2 -2
- package/dist/types/commands/verify-alias.command.d.ts +2 -2
- package/dist/types/commands/verify.command.d.ts +2 -2
- package/dist/types/config/pristine-config.interface.d.ts +38 -12
- package/dist/types/config/resolved-pristine-config.d.ts +4 -6
- package/dist/types/errors/cli-error-code.enum.d.ts +12 -0
- package/dist/types/errors/command-not-found.error.d.ts +8 -7
- package/dist/types/errors/errors.d.ts +1 -0
- package/dist/types/event-handlers/cli.event-handler.d.ts +4 -19
- package/dist/types/interfaces/command.interface.d.ts +2 -2
- package/dist/types/reporters/cli-error.reporter.d.ts +45 -0
- package/dist/types/types/command-event-response.type.d.ts +2 -2
- package/package.json +9 -9
- package/dist/lib/cjs/enums/enums.js +0 -18
- package/dist/lib/cjs/enums/enums.js.map +0 -1
- package/dist/lib/cjs/enums/exit-code.enum.js +0 -9
- package/dist/lib/cjs/enums/exit-code.enum.js.map +0 -1
- package/dist/lib/esm/enums/enums.js +0 -2
- package/dist/lib/esm/enums/enums.js.map +0 -1
- package/dist/lib/esm/enums/exit-code.enum.js +0 -6
- package/dist/lib/esm/enums/exit-code.enum.js.map +0 -1
- package/dist/types/enums/enums.d.ts +0 -1
- package/dist/types/enums/exit-code.enum.d.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-event-response.type.js","sourceRoot":"","sources":["../../../../src/types/command-event-response.type.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAIhD,MAAa,oBAAqB,SAAQ,
|
|
1
|
+
{"version":3,"file":"command-event-response.type.js","sourceRoot":"","sources":["../../../../src/types/command-event-response.type.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAIhD,MAAa,oBAAqB,SAAQ,oBAAqD;CAC9F;AADD,oDACC"}
|
package/dist/lib/esm/bin.js
CHANGED
|
@@ -14,5 +14,22 @@ require('reflect-metadata');
|
|
|
14
14
|
// loaded via `./cli.js` and the consumer's app.module.js loaded via `@pristine-ts/cli`, the
|
|
15
15
|
// two halves would each get their own class identities and tsyringe's decorator metadata
|
|
16
16
|
// (keyed by class identity) would not be shared — manifesting as "TypeInfo not known for X".
|
|
17
|
-
require('@pristine-ts/cli')
|
|
17
|
+
const { Cli } = require('@pristine-ts/cli');
|
|
18
|
+
// `Cli.bootstrap()` is fully self-contained: it handles its own errors, builds the right
|
|
19
|
+
// `EnvironmentManager` from the loaded `pristine.config.ts` (or defaults to production when
|
|
20
|
+
// the config itself couldn't load), and returns the exit code. The bin's only job is to
|
|
21
|
+
// exit with that code. No `process.env` reads, no extra catch handler — everything flows
|
|
22
|
+
// through the kernel's configuration system.
|
|
23
|
+
//
|
|
24
|
+
// `bootstrap()` is designed to be total — every throw funnels through `reportFatalError`.
|
|
25
|
+
// This `.catch` is a last-resort safety net for the pathological case where the fallback
|
|
26
|
+
// reporter itself throws (invalid `pristine.environment` string, reporter constructor
|
|
27
|
+
// failure, etc.). Without it, such a throw becomes an unhandled rejection and Node dumps
|
|
28
|
+
// the raw stack to stderr, bypassing any sanitization.
|
|
29
|
+
new Cli().bootstrap()
|
|
30
|
+
.then((exitCode) => process.exit(exitCode))
|
|
31
|
+
.catch((error) => {
|
|
32
|
+
console.error(error);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
});
|
|
18
35
|
//# sourceMappingURL=bin.js.map
|
package/dist/lib/esm/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../src/bin.ts"],"names":[],"mappings":";;AACA,uDAAuD;AACvD,0FAA0F;AAC1F,4FAA4F;AAC5F,2FAA2F;AAC3F,sFAAsF;AACtF,EAAE;AACF,2FAA2F;AAC3F,4FAA4F;AAC5F,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE5B,4FAA4F;AAC5F,0FAA0F;AAC1F,4FAA4F;AAC5F,yFAAyF;AACzF,6FAA6F;AAC7F,OAAO,CAAC,kBAAkB,CAAC,CAAC,SAAS,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../src/bin.ts"],"names":[],"mappings":";;AACA,uDAAuD;AACvD,0FAA0F;AAC1F,4FAA4F;AAC5F,2FAA2F;AAC3F,sFAAsF;AACtF,EAAE;AACF,2FAA2F;AAC3F,4FAA4F;AAC5F,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE5B,4FAA4F;AAC5F,0FAA0F;AAC1F,4FAA4F;AAC5F,yFAAyF;AACzF,6FAA6F;AAC7F,MAAM,EAAC,GAAG,EAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE1C,yFAAyF;AACzF,4FAA4F;AAC5F,wFAAwF;AACxF,yFAAyF;AACzF,6CAA6C;AAC7C,EAAE;AACF,0FAA0F;AAC1F,yFAAyF;AACzF,sFAAsF;AACtF,yFAAyF;AACzF,uDAAuD;AACvD,IAAI,GAAG,EAAE,CAAC,SAAS,EAAE;KAClB,IAAI,CAAC,CAAC,QAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAClD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -20,7 +20,6 @@ import { injectable } from "tsyringe";
|
|
|
20
20
|
import fs from "fs";
|
|
21
21
|
import path from "path";
|
|
22
22
|
import { pathToFileURL } from "url";
|
|
23
|
-
import { LoggingModuleKeyname, OutputModeEnum, SeverityEnum } from "@pristine-ts/logging";
|
|
24
23
|
import { DirectoryListResultEnum, DirectoryManager, FileManager, MatchTypeEnum, TypesEnum } from "@pristine-ts/file";
|
|
25
24
|
import { CliModule } from "../cli.module";
|
|
26
25
|
import { ConfigLoader } from "../config/config-loader";
|
|
@@ -34,17 +33,21 @@ import { LoadedAppModule } from "./loaded-app-module";
|
|
|
34
33
|
import { PluginLoader } from "./plugin-loader";
|
|
35
34
|
/**
|
|
36
35
|
* Resolves the consumer's AppModule. The contract is intentionally narrow: there is
|
|
37
|
-
* exactly one supported way to specify the module — `appModule.sourcePath` +
|
|
38
|
-
* `appModule.outputPath` in `pristine.config.ts` (or `pristine.config.js`).
|
|
36
|
+
* exactly one supported way to specify the module — `cli.appModule.sourcePath` +
|
|
37
|
+
* `cli.appModule.outputPath` in `pristine.config.ts` (or `pristine.config.js`).
|
|
39
38
|
*
|
|
40
39
|
* Resolution path:
|
|
41
40
|
* 1. Read `pristine.config.{ts,js}` via `ConfigLoader`.
|
|
42
|
-
* 2. If `appModule` is configured: ensure the build is fresh (manifest check, prompt
|
|
43
|
-
* fail on stale), then dynamically import the configured `outputPath`.
|
|
41
|
+
* 2. If `cli.appModule` is configured: ensure the build is fresh (manifest check, prompt
|
|
42
|
+
* or fail on stale), then dynamically import the configured `outputPath`.
|
|
44
43
|
* 3. If anything above is missing or broken: fall back to a `CliModule`-only synthetic
|
|
45
44
|
* AppModule so built-in commands (notably `pristine init`) remain runnable. This is
|
|
46
45
|
* the only escape hatch — there is no convention scan, no package.json discovery,
|
|
47
46
|
* no cached prior selection.
|
|
47
|
+
*
|
|
48
|
+
* **Does not read the `config:` block.** Runtime configuration values are read directly
|
|
49
|
+
* by `ConfigurationManager` during kernel boot. This class is concerned only with
|
|
50
|
+
* module-graph assembly.
|
|
48
51
|
*/
|
|
49
52
|
let AppModuleLoader = class AppModuleLoader {
|
|
50
53
|
constructor(configLoader, pluginLoader, dynamicImporter, buildManifestReader, buildManifestChecker, buildStalenessPrompt, buildRunner) {
|
|
@@ -59,39 +62,33 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
59
62
|
this.fallbackKeyname = "__auto_generated_app.module__";
|
|
60
63
|
}
|
|
61
64
|
/**
|
|
62
|
-
* Resolves the consumer's AppModule
|
|
63
|
-
* with. The flow has five stages, executed in order:
|
|
65
|
+
* Resolves the consumer's AppModule for the CLI. The flow has five stages:
|
|
64
66
|
*
|
|
65
67
|
* 1. **Read the project's pristine.config.{ts,js}** — single source of truth for
|
|
66
68
|
* where the user's AppModule lives and what plugins to wire in.
|
|
67
69
|
* 2. **Check the compiled AppModule is in sync with its source** — when both
|
|
68
|
-
* `appModule.sourcePath` and `appModule.outputPath` are configured,
|
|
69
|
-
* build manifest's recorded source hash against the current source.
|
|
70
|
-
* diverge (the user edited source but didn't rebuild), prompt to rebuild
|
|
71
|
-
* interactive terminal, or fail with an actionable error in CI /
|
|
72
|
-
* contexts.
|
|
70
|
+
* `cli.appModule.sourcePath` and `cli.appModule.outputPath` are configured,
|
|
71
|
+
* compare the build manifest's recorded source hash against the current source.
|
|
72
|
+
* If they diverge (the user edited source but didn't rebuild), prompt to rebuild
|
|
73
|
+
* in an interactive terminal, or fail with an actionable error in CI /
|
|
74
|
+
* non-interactive contexts.
|
|
73
75
|
* 3. **Dynamically import the compiled AppModule** — load the JS file at
|
|
74
76
|
* `outputPath` and pull out the configured named export (default `AppModule`).
|
|
75
77
|
* 4. **Substitute a CliModule-only AppModule when nothing else worked** — when
|
|
76
|
-
* there is no config file, no `appModule` block in the config, or the import
|
|
78
|
+
* there is no config file, no `cli.appModule` block in the config, or the import
|
|
77
79
|
* threw, build a synthetic AppModule that imports just CliModule. This keeps the
|
|
78
80
|
* bin runnable so the user can run `pristine init`, `pristine help`, etc. to
|
|
79
81
|
* recover. There is no convention scan, no package.json discovery — only this
|
|
80
82
|
* one escape hatch.
|
|
81
|
-
* 5. **Wrap with config-declared plugins** — load every plugin listed in
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* Final output: a `LoadedAppModule` carrying the (possibly wrapped) AppModule, the
|
|
86
|
-
* kernel configuration overlay, the logging-module-present flag, and the loaded
|
|
87
|
-
* plugin list.
|
|
83
|
+
* 5. **Wrap with config-declared plugins** — load every plugin listed in
|
|
84
|
+
* `cli.plugins` and merge their modules into the AppModule's import graph via a
|
|
85
|
+
* synthetic outer module.
|
|
88
86
|
*/
|
|
89
87
|
load() {
|
|
90
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
var _a
|
|
89
|
+
var _a;
|
|
92
90
|
const projectRoot = process.cwd();
|
|
93
91
|
let appModule;
|
|
94
|
-
let isLoggingModulePresent = false;
|
|
95
92
|
let resolvedPath;
|
|
96
93
|
let appModuleExportName = this.defaultExportName;
|
|
97
94
|
// ── Stage 1: read the project's pristine.config.{ts,js}. ──
|
|
@@ -99,8 +96,8 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
99
96
|
// when no file is found, which lets the substitute-AppModule branch in Stage 4
|
|
100
97
|
// take over instead of erroring out.
|
|
101
98
|
const resolvedConfig = yield this.configLoader.load({ startDir: projectRoot });
|
|
102
|
-
const appModuleConfig = resolvedConfig.config.appModule;
|
|
103
|
-
// Honor `appModule.export` for projects whose AppModule isn't named `AppModule`.
|
|
99
|
+
const appModuleConfig = (_a = resolvedConfig.config.cli) === null || _a === void 0 ? void 0 : _a.appModule;
|
|
100
|
+
// Honor `cli.appModule.export` for projects whose AppModule isn't named `AppModule`.
|
|
104
101
|
if ((appModuleConfig === null || appModuleConfig === void 0 ? void 0 : appModuleConfig.export) !== undefined) {
|
|
105
102
|
appModuleExportName = appModuleConfig.export;
|
|
106
103
|
}
|
|
@@ -113,19 +110,15 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
113
110
|
if ((appModuleConfig === null || appModuleConfig === void 0 ? void 0 : appModuleConfig.sourcePath) !== undefined && (appModuleConfig === null || appModuleConfig === void 0 ? void 0 : appModuleConfig.outputPath) !== undefined) {
|
|
114
111
|
const ensured = yield this.ensureFreshBuild(projectRoot, appModuleConfig.sourcePath, appModuleConfig.outputPath);
|
|
115
112
|
if (ensured === false) {
|
|
116
|
-
const
|
|
117
|
-
return new LoadedAppModule(
|
|
113
|
+
const fallbackAppModule = yield this.buildFallbackAppModule(projectRoot);
|
|
114
|
+
return new LoadedAppModule(fallbackAppModule, []);
|
|
118
115
|
}
|
|
119
116
|
resolvedPath = path.resolve(projectRoot, appModuleConfig.outputPath);
|
|
120
117
|
}
|
|
121
118
|
// ── Stage 3: dynamically import the AppModule (or fall through to Stage 4). ──
|
|
122
119
|
if (resolvedPath !== undefined) {
|
|
123
|
-
// Stage 3: dynamic import. The compiled output is a regular JS module; we pull
|
|
124
|
-
// out the named export and detect LoggingModule presence so Stage 5 can decide
|
|
125
|
-
// whether to install the CLI's default console-logger configuration overlay.
|
|
126
120
|
try {
|
|
127
121
|
appModule = yield this.importAppModule(resolvedPath, appModuleExportName);
|
|
128
|
-
isLoggingModulePresent = ((_a = appModule.importModules) !== null && _a !== void 0 ? _a : []).find(m => m.keyname === LoggingModuleKeyname) !== undefined;
|
|
129
122
|
}
|
|
130
123
|
catch (error) {
|
|
131
124
|
// Stage 4 (the configured file is broken or missing): we don't crash — that
|
|
@@ -134,24 +127,20 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
134
127
|
// let the user re-run after fixing the issue.
|
|
135
128
|
process.stderr.write(`[pristine] Failed to load AppModule from '${resolvedPath}': ${error.message}\n` +
|
|
136
129
|
`[pristine] Falling back to built-in commands only. Fix your AppModule config and re-run.\n`);
|
|
137
|
-
|
|
138
|
-
appModule = fallback.appModule;
|
|
139
|
-
isLoggingModulePresent = fallback.isLoggingModulePresent;
|
|
130
|
+
appModule = yield this.buildFallbackAppModule(projectRoot);
|
|
140
131
|
}
|
|
141
132
|
}
|
|
142
133
|
else {
|
|
143
|
-
// Stage 4 (no `appModule` block, or no config file at all): substitute the
|
|
134
|
+
// Stage 4 (no `cli.appModule` block, or no config file at all): substitute the
|
|
144
135
|
// CliModule-only AppModule so the bin can still bootstrap the user's project.
|
|
145
136
|
// First-run case (`pristine init` from a fresh project) lands here.
|
|
146
|
-
|
|
147
|
-
appModule = fallback.appModule;
|
|
148
|
-
isLoggingModulePresent = fallback.isLoggingModulePresent;
|
|
137
|
+
appModule = yield this.buildFallbackAppModule(projectRoot);
|
|
149
138
|
}
|
|
150
139
|
// ── Stage 5: wrap with config-declared plugins. ──
|
|
151
|
-
// Plugins declared in `pristine.config.ts` contribute additional modules
|
|
152
|
-
// tooling-only modules the user doesn't want polluting their runtime AppModule).
|
|
153
|
-
// A failing plugin warns but doesn't abort — the bin stays usable so the user can
|
|
154
|
-
//
|
|
140
|
+
// Plugins declared in `pristine.config.ts:cli.plugins` contribute additional modules
|
|
141
|
+
// (e.g. tooling-only modules the user doesn't want polluting their runtime AppModule).
|
|
142
|
+
// A failing plugin warns but doesn't abort — the bin stays usable so the user can fix
|
|
143
|
+
// the offending entry.
|
|
155
144
|
let plugins = [];
|
|
156
145
|
try {
|
|
157
146
|
plugins = yield this.pluginLoader.load(resolvedConfig.config, resolvedConfig.configFilePath, projectRoot);
|
|
@@ -161,20 +150,9 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
161
150
|
process.stderr.write("[pristine] Continuing without plugins. Fix the plugin config and re-run.\n");
|
|
162
151
|
}
|
|
163
152
|
if (plugins.length > 0) {
|
|
164
|
-
// Wrap the AppModule with a synthetic outer module that imports both the user's
|
|
165
|
-
// module and every plugin. Re-detect logging because a plugin could have brought
|
|
166
|
-
// it in.
|
|
167
153
|
appModule = this.pluginLoader.wrap(appModule, plugins);
|
|
168
|
-
if (isLoggingModulePresent === false) {
|
|
169
|
-
isLoggingModulePresent = ((_b = appModule.importModules) !== null && _b !== void 0 ? _b : []).find(m => m.keyname === LoggingModuleKeyname) !== undefined;
|
|
170
|
-
}
|
|
171
154
|
}
|
|
172
|
-
|
|
173
|
-
// The CLI installs sensible defaults for LoggingModule (simple output mode,
|
|
174
|
-
// error-level threshold) when LoggingModule is present, then layers the user's
|
|
175
|
-
// `kernelConfiguration` on top so they can override anything they want.
|
|
176
|
-
const configuration = this.buildKernelConfiguration(isLoggingModulePresent, resolvedConfig.config.kernelConfiguration);
|
|
177
|
-
return new LoadedAppModule(appModule, configuration, isLoggingModulePresent, plugins);
|
|
155
|
+
return new LoadedAppModule(appModule, plugins);
|
|
178
156
|
});
|
|
179
157
|
}
|
|
180
158
|
/**
|
|
@@ -246,17 +224,17 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
246
224
|
});
|
|
247
225
|
}
|
|
248
226
|
/**
|
|
249
|
-
* Builds the safety-net AppModule used when no `appModule` is configured or the
|
|
250
|
-
* file fails to load. Scrapes any `node_modules/@pristine-ts/*` packages
|
|
251
|
-
* so built-in commands they contribute (e.g. `pristine list`) are
|
|
252
|
-
* appends `CliModule` so at minimum the CLI's own commands run.
|
|
253
|
-
* one-way safety net, not a discovery tier — it only fires
|
|
227
|
+
* Builds the safety-net AppModule used when no `cli.appModule` is configured or the
|
|
228
|
+
* configured file fails to load. Scrapes any `node_modules/@pristine-ts/*` packages
|
|
229
|
+
* already installed so built-in commands they contribute (e.g. `pristine list`) are
|
|
230
|
+
* still available, then appends `CliModule` so at minimum the CLI's own commands run.
|
|
231
|
+
* This is intentionally a one-way safety net, not a discovery tier — it only fires
|
|
232
|
+
* when nothing else worked.
|
|
254
233
|
*/
|
|
255
234
|
buildFallbackAppModule(projectRoot) {
|
|
256
235
|
return __awaiter(this, void 0, void 0, function* () {
|
|
257
236
|
const pristineNodeModulesPath = path.resolve(projectRoot, "node_modules", "@pristine-ts");
|
|
258
237
|
const modules = [];
|
|
259
|
-
let isLoggingModulePresent = false;
|
|
260
238
|
if (fs.existsSync(pristineNodeModulesPath)) {
|
|
261
239
|
const directoryManager = new DirectoryManager(new FileManager());
|
|
262
240
|
const moduleFiles = yield directoryManager.list(pristineNodeModulesPath, {
|
|
@@ -269,8 +247,6 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
269
247
|
for (const moduleFile of moduleFiles) {
|
|
270
248
|
const module = yield this.dynamicImporter.import(pathToFileURL(moduleFile).href);
|
|
271
249
|
for (const key in module) {
|
|
272
|
-
if (key === "LoggingModule")
|
|
273
|
-
isLoggingModulePresent = true;
|
|
274
250
|
if (key.endsWith("Module"))
|
|
275
251
|
modules.push(module[key]);
|
|
276
252
|
}
|
|
@@ -280,26 +256,12 @@ let AppModuleLoader = class AppModuleLoader {
|
|
|
280
256
|
modules.push(CliModule);
|
|
281
257
|
}
|
|
282
258
|
return {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
importServices: [],
|
|
287
|
-
},
|
|
288
|
-
isLoggingModulePresent,
|
|
259
|
+
keyname: this.fallbackKeyname,
|
|
260
|
+
importModules: modules,
|
|
261
|
+
importServices: [],
|
|
289
262
|
};
|
|
290
263
|
});
|
|
291
264
|
}
|
|
292
|
-
buildKernelConfiguration(isLoggingModulePresent, userKernelConfiguration) {
|
|
293
|
-
const configuration = {};
|
|
294
|
-
if (isLoggingModulePresent) {
|
|
295
|
-
configuration[LoggingModuleKeyname + ".consoleLoggerOutputMode"] = OutputModeEnum.Simple;
|
|
296
|
-
configuration[LoggingModuleKeyname + ".logSeverityLevelConfiguration"] = SeverityEnum.Error;
|
|
297
|
-
}
|
|
298
|
-
if (userKernelConfiguration !== undefined) {
|
|
299
|
-
Object.assign(configuration, userKernelConfiguration);
|
|
300
|
-
}
|
|
301
|
-
return configuration;
|
|
302
|
-
}
|
|
303
265
|
};
|
|
304
266
|
AppModuleLoader = __decorate([
|
|
305
267
|
injectable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-module-loader.js","sourceRoot":"","sources":["../../../../src/bootstrap/app-module-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"app-module-loader.js","sourceRoot":"","sources":["../../../../src/bootstrap/app-module-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAC;AAElC,OAAO,EAAC,uBAAuB,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACnH,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,0BAA0B,EAAC,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CA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CAAC,CAAC;gBAEH,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;oBACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,aAAa,CAAC,UAAoB,CAAC,CAAC,IAAI,CAAC,CAAC;oBAC3F,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;wBACzB,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;4BAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;oBACxD,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,IAAI,CAAC,eAAe;gBAC7B,aAAa,EAAE,OAAO;gBACtB,cAAc,EAAE,EAAE;aACnB,CAAC;QACJ,CAAC;KAAA;CACF,CAAA;AAxOY,eAAe;IAD3B,UAAU,EAAE;qCAMsB,YAAY;QACZ,YAAY;QACT,eAAe;QACX,mBAAmB;QAClB,oBAAoB;QACpB,oBAAoB;QAC7B,WAAW;GAXhC,eAAe,CAwO3B"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The fully-resolved AppModule
|
|
2
|
+
* The fully-resolved AppModule and the plugin list that the CLI uses to boot the kernel.
|
|
3
3
|
* Returned by `AppModuleLoader.load()`.
|
|
4
|
+
*
|
|
5
|
+
* **No `configuration` field.** Runtime configuration values from `pristine.config.ts:config`
|
|
6
|
+
* are read directly by `ConfigurationManager` during kernel boot, not pre-loaded by the
|
|
7
|
+
* CLI. The CLI is responsible only for module-graph assembly.
|
|
4
8
|
*/
|
|
5
9
|
export class LoadedAppModule {
|
|
6
|
-
constructor(appModule,
|
|
10
|
+
constructor(appModule,
|
|
7
11
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
isLoggingModulePresent,
|
|
13
|
-
/**
|
|
14
|
-
* Plugins loaded from `pristine.config.ts`'s `plugins` array. Empty when no plugins are
|
|
15
|
-
* declared. Carried through so commands like `pristine info` can show what's contributing
|
|
16
|
-
* extra modules to the runtime.
|
|
12
|
+
* Plugins loaded from `pristine.config.ts:cli.plugins`. Empty when no plugins are
|
|
13
|
+
* declared. Carried through so commands like `pristine info` can show what's
|
|
14
|
+
* contributing extra modules to the runtime.
|
|
17
15
|
*/
|
|
18
16
|
plugins) {
|
|
19
17
|
this.appModule = appModule;
|
|
20
|
-
this.configuration = configuration;
|
|
21
|
-
this.isLoggingModulePresent = isLoggingModulePresent;
|
|
22
18
|
this.plugins = plugins;
|
|
23
19
|
}
|
|
24
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loaded-app-module.js","sourceRoot":"","sources":["../../../../src/bootstrap/loaded-app-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loaded-app-module.js","sourceRoot":"","sources":["../../../../src/bootstrap/loaded-app-module.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IAC1B,YACkB,SAA6B;IAC7C;;;;OAIG;IACa,OAAuB;QANvB,cAAS,GAAT,SAAS,CAAoB;QAM7B,YAAO,GAAP,OAAO,CAAgB;IAEzC,CAAC;CACF"}
|
|
@@ -23,7 +23,7 @@ import { pathToFileURL } from "url";
|
|
|
23
23
|
import { DynamicImporter } from "./dynamic-importer";
|
|
24
24
|
import { LoadedPlugin } from "./loaded-plugin";
|
|
25
25
|
/**
|
|
26
|
-
* Resolves and loads every plugin declared in `config.plugins`. Plugin packages are resolved
|
|
26
|
+
* Resolves and loads every plugin declared in `config.cli.plugins`. Plugin packages are resolved
|
|
27
27
|
* from the **consumer's project**, not from the CLI's install location — a plugin lives in
|
|
28
28
|
* the consumer's `node_modules`, not in `@pristine-ts/cli/node_modules`. Without
|
|
29
29
|
* `createRequire` pinned to the project location, `import("@my-org/plugin")` would walk up
|
|
@@ -39,8 +39,8 @@ let PluginLoader = class PluginLoader {
|
|
|
39
39
|
}
|
|
40
40
|
load(config, configFilePath, projectRoot) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a;
|
|
43
|
-
const plugins = (_a = config.plugins) !== null &&
|
|
42
|
+
var _a, _b;
|
|
43
|
+
const plugins = (_b = (_a = config.cli) === null || _a === void 0 ? void 0 : _a.plugins) !== null && _b !== void 0 ? _b : [];
|
|
44
44
|
if (plugins.length === 0) {
|
|
45
45
|
return [];
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-loader.js","sourceRoot":"","sources":["../../../../src/bootstrap/plugin-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAC,aAAa,EAAC,MAAM,QAAQ,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAC;AAGlC,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;;GAUG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAC7D,CAAC;IAEK,IAAI,CAAC,MAAsB,EAAE,cAAkC,EAAE,WAAmB;;;YACxF,MAAM,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-loader.js","sourceRoot":"","sources":["../../../../src/bootstrap/plugin-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,E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