@pristine-ts/cli 1.0.439 → 2.0.1
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 +7 -0
- package/dist/lib/cjs/bin.js +15 -1
- package/dist/lib/cjs/bin.js.map +1 -1
- package/dist/lib/cjs/bootstrap/app-module-loader.js +321 -0
- package/dist/lib/cjs/bootstrap/app-module-loader.js.map +1 -0
- package/dist/lib/cjs/bootstrap/bootstrap.js +31 -0
- package/dist/lib/cjs/bootstrap/bootstrap.js.map +1 -0
- package/dist/lib/cjs/bootstrap/build-manifest-checker.js +67 -0
- package/dist/lib/cjs/bootstrap/build-manifest-checker.js.map +1 -0
- package/dist/lib/cjs/bootstrap/build-manifest-reader.js +44 -0
- package/dist/lib/cjs/bootstrap/build-manifest-reader.js.map +1 -0
- package/dist/lib/cjs/bootstrap/build-manifest-staleness.enum.js +23 -0
- package/dist/lib/cjs/bootstrap/build-manifest-staleness.enum.js.map +1 -0
- package/dist/lib/cjs/bootstrap/build-manifest-writer.js +55 -0
- package/dist/lib/cjs/bootstrap/build-manifest-writer.js.map +1 -0
- package/dist/lib/cjs/bootstrap/build-manifest.js +31 -0
- package/dist/lib/cjs/bootstrap/build-manifest.js.map +1 -0
- package/dist/lib/cjs/bootstrap/build-runner.js +44 -0
- package/dist/lib/cjs/bootstrap/build-runner.js.map +1 -0
- package/dist/lib/cjs/bootstrap/build-staleness-prompt.js +90 -0
- package/dist/lib/cjs/bootstrap/build-staleness-prompt.js.map +1 -0
- package/dist/lib/cjs/bootstrap/dynamic-importer.js +43 -0
- package/dist/lib/cjs/bootstrap/dynamic-importer.js.map +1 -0
- package/dist/lib/cjs/bootstrap/init-prompt.js +127 -0
- package/dist/lib/cjs/bootstrap/init-prompt.js.map +1 -0
- package/dist/lib/cjs/bootstrap/loaded-app-module.js +29 -0
- package/dist/lib/cjs/bootstrap/loaded-app-module.js.map +1 -0
- package/dist/lib/cjs/bootstrap/loaded-plugin.js +22 -0
- package/dist/lib/cjs/bootstrap/loaded-plugin.js.map +1 -0
- package/dist/lib/cjs/bootstrap/plugin-loader.js +149 -0
- package/dist/lib/cjs/bootstrap/plugin-loader.js.map +1 -0
- package/dist/lib/cjs/bootstrap/source-hasher.js +41 -0
- package/dist/lib/cjs/bootstrap/source-hasher.js.map +1 -0
- package/dist/lib/cjs/cli.js +94 -111
- package/dist/lib/cjs/cli.js.map +1 -1
- package/dist/lib/cjs/cli.module.js +9 -1
- package/dist/lib/cjs/cli.module.js.map +1 -1
- package/dist/lib/cjs/commands/build-alias.command.js +50 -0
- package/dist/lib/cjs/commands/build-alias.command.js.map +1 -0
- package/dist/lib/cjs/commands/build.command.js +173 -0
- package/dist/lib/cjs/commands/build.command.js.map +1 -0
- package/dist/lib/cjs/commands/commands.js +15 -0
- package/dist/lib/cjs/commands/commands.js.map +1 -1
- package/dist/lib/cjs/commands/config-print.command.js +75 -0
- package/dist/lib/cjs/commands/config-print.command.js.map +1 -0
- package/dist/lib/cjs/commands/help-alias.command.js +52 -0
- package/dist/lib/cjs/commands/help-alias.command.js.map +1 -0
- package/dist/lib/cjs/commands/help.command.js +44 -10
- package/dist/lib/cjs/commands/help.command.js.map +1 -1
- package/dist/lib/cjs/commands/info-alias.command.js +50 -0
- package/dist/lib/cjs/commands/info-alias.command.js.map +1 -0
- package/dist/lib/cjs/commands/info.command.js +162 -0
- package/dist/lib/cjs/commands/info.command.js.map +1 -0
- package/dist/lib/cjs/commands/init-alias.command.js +51 -0
- package/dist/lib/cjs/commands/init-alias.command.js.map +1 -0
- package/dist/lib/cjs/commands/init.command-options.js +53 -0
- package/dist/lib/cjs/commands/init.command-options.js.map +1 -0
- package/dist/lib/cjs/commands/init.command.js +249 -0
- package/dist/lib/cjs/commands/init.command.js.map +1 -0
- package/dist/lib/cjs/commands/list-alias.command.js +50 -0
- package/dist/lib/cjs/commands/list-alias.command.js.map +1 -0
- package/dist/lib/cjs/commands/list.command.js +7 -1
- package/dist/lib/cjs/commands/list.command.js.map +1 -1
- package/dist/lib/cjs/commands/start-alias.command.js +51 -0
- package/dist/lib/cjs/commands/start-alias.command.js.map +1 -0
- package/dist/lib/cjs/commands/start.command-options.js +34 -0
- package/dist/lib/cjs/commands/start.command-options.js.map +1 -0
- package/dist/lib/cjs/commands/start.command.js +169 -0
- package/dist/lib/cjs/commands/start.command.js.map +1 -0
- package/dist/lib/cjs/commands/verify-alias.command.js +50 -0
- package/dist/lib/cjs/commands/verify-alias.command.js.map +1 -0
- package/dist/lib/cjs/commands/verify.command.js +71 -0
- package/dist/lib/cjs/commands/verify.command.js.map +1 -0
- package/dist/lib/cjs/config/config-loader.js +136 -0
- package/dist/lib/cjs/config/config-loader.js.map +1 -0
- package/dist/lib/cjs/config/config-provenance.enum.js +15 -0
- package/dist/lib/cjs/config/config-provenance.enum.js.map +1 -0
- package/dist/lib/cjs/config/config.js +22 -0
- package/dist/lib/cjs/config/config.js.map +1 -0
- package/dist/lib/cjs/config/define-config.js +18 -0
- package/dist/lib/cjs/config/define-config.js.map +1 -0
- package/dist/lib/cjs/config/pristine-config.interface.js +3 -0
- package/dist/lib/cjs/config/pristine-config.interface.js.map +1 -0
- package/dist/lib/cjs/config/resolved-pristine-config.js +25 -0
- package/dist/lib/cjs/config/resolved-pristine-config.js.map +1 -0
- package/dist/lib/cjs/event-handlers/cli.event-handler.js +69 -48
- package/dist/lib/cjs/event-handlers/cli.event-handler.js.map +1 -1
- package/dist/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/lib/esm/bin.js +15 -1
- package/dist/lib/esm/bin.js.map +1 -1
- package/dist/lib/esm/bootstrap/app-module-loader.js +315 -0
- package/dist/lib/esm/bootstrap/app-module-loader.js.map +1 -0
- package/dist/lib/esm/bootstrap/bootstrap.js +15 -0
- package/dist/lib/esm/bootstrap/bootstrap.js.map +1 -0
- package/dist/lib/esm/bootstrap/build-manifest-checker.js +61 -0
- package/dist/lib/esm/bootstrap/build-manifest-checker.js.map +1 -0
- package/dist/lib/esm/bootstrap/build-manifest-reader.js +38 -0
- package/dist/lib/esm/bootstrap/build-manifest-reader.js.map +1 -0
- package/dist/lib/esm/bootstrap/build-manifest-staleness.enum.js +20 -0
- package/dist/lib/esm/bootstrap/build-manifest-staleness.enum.js.map +1 -0
- package/dist/lib/esm/bootstrap/build-manifest-writer.js +49 -0
- package/dist/lib/esm/bootstrap/build-manifest-writer.js.map +1 -0
- package/dist/lib/esm/bootstrap/build-manifest.js +27 -0
- package/dist/lib/esm/bootstrap/build-manifest.js.map +1 -0
- package/dist/lib/esm/bootstrap/build-runner.js +41 -0
- package/dist/lib/esm/bootstrap/build-runner.js.map +1 -0
- package/dist/lib/esm/bootstrap/build-staleness-prompt.js +87 -0
- package/dist/lib/esm/bootstrap/build-staleness-prompt.js.map +1 -0
- package/dist/lib/esm/bootstrap/dynamic-importer.js +40 -0
- package/dist/lib/esm/bootstrap/dynamic-importer.js.map +1 -0
- package/dist/lib/esm/bootstrap/init-prompt.js +124 -0
- package/dist/lib/esm/bootstrap/init-prompt.js.map +1 -0
- package/dist/lib/esm/bootstrap/loaded-app-module.js +25 -0
- package/dist/lib/esm/bootstrap/loaded-app-module.js.map +1 -0
- package/dist/lib/esm/bootstrap/loaded-plugin.js +18 -0
- package/dist/lib/esm/bootstrap/loaded-plugin.js.map +1 -0
- package/dist/lib/esm/bootstrap/plugin-loader.js +143 -0
- package/dist/lib/esm/bootstrap/plugin-loader.js.map +1 -0
- package/dist/lib/esm/bootstrap/source-hasher.js +35 -0
- package/dist/lib/esm/bootstrap/source-hasher.js.map +1 -0
- package/dist/lib/esm/cli.js +109 -0
- package/dist/lib/esm/cli.js.map +1 -0
- package/dist/lib/esm/cli.module.js +7 -0
- package/dist/lib/esm/cli.module.js.map +1 -1
- package/dist/lib/esm/commands/build-alias.command.js +47 -0
- package/dist/lib/esm/commands/build-alias.command.js.map +1 -0
- package/dist/lib/esm/commands/build.command.js +167 -0
- package/dist/lib/esm/commands/build.command.js.map +1 -0
- package/dist/lib/esm/commands/commands.js +15 -0
- package/dist/lib/esm/commands/commands.js.map +1 -1
- package/dist/lib/esm/commands/config-print.command.js +69 -0
- package/dist/lib/esm/commands/config-print.command.js.map +1 -0
- package/dist/lib/esm/commands/help-alias.command.js +49 -0
- package/dist/lib/esm/commands/help-alias.command.js.map +1 -0
- package/dist/lib/esm/commands/help.command.js +44 -10
- package/dist/lib/esm/commands/help.command.js.map +1 -1
- package/dist/lib/esm/commands/info-alias.command.js +47 -0
- package/dist/lib/esm/commands/info-alias.command.js.map +1 -0
- package/dist/lib/esm/commands/info.command.js +156 -0
- package/dist/lib/esm/commands/info.command.js.map +1 -0
- package/dist/lib/esm/commands/init-alias.command.js +48 -0
- package/dist/lib/esm/commands/init-alias.command.js.map +1 -0
- package/dist/lib/esm/commands/init.command-options.js +49 -0
- package/dist/lib/esm/commands/init.command-options.js.map +1 -0
- package/dist/lib/esm/commands/init.command.js +243 -0
- package/dist/lib/esm/commands/init.command.js.map +1 -0
- package/dist/lib/esm/commands/list-alias.command.js +47 -0
- package/dist/lib/esm/commands/list-alias.command.js.map +1 -0
- package/dist/lib/esm/commands/list.command.js +8 -2
- package/dist/lib/esm/commands/list.command.js.map +1 -1
- package/dist/lib/esm/commands/start-alias.command.js +48 -0
- package/dist/lib/esm/commands/start-alias.command.js.map +1 -0
- package/dist/lib/esm/commands/start.command-options.js +30 -0
- package/dist/lib/esm/commands/start.command-options.js.map +1 -0
- package/dist/lib/esm/commands/start.command.js +166 -0
- package/dist/lib/esm/commands/start.command.js.map +1 -0
- package/dist/lib/esm/commands/verify-alias.command.js +47 -0
- package/dist/lib/esm/commands/verify-alias.command.js.map +1 -0
- package/dist/lib/esm/commands/verify.command.js +68 -0
- package/dist/lib/esm/commands/verify.command.js.map +1 -0
- package/dist/lib/esm/config/config-loader.js +130 -0
- package/dist/lib/esm/config/config-loader.js.map +1 -0
- package/dist/lib/esm/config/config-provenance.enum.js +12 -0
- package/dist/lib/esm/config/config-provenance.enum.js.map +1 -0
- package/dist/lib/esm/config/config.js +6 -0
- package/dist/lib/esm/config/config.js.map +1 -0
- package/dist/lib/esm/config/define-config.js +14 -0
- package/dist/lib/esm/config/define-config.js.map +1 -0
- package/dist/lib/esm/config/pristine-config.interface.js +2 -0
- package/dist/lib/esm/config/pristine-config.interface.js.map +1 -0
- package/dist/lib/esm/config/resolved-pristine-config.js +21 -0
- package/dist/lib/esm/config/resolved-pristine-config.js.map +1 -0
- package/dist/lib/esm/event-handlers/cli.event-handler.js +69 -48
- package/dist/lib/esm/event-handlers/cli.event-handler.js.map +1 -1
- package/dist/lib/esm/tsconfig.tsbuildinfo +1 -0
- package/dist/types/bootstrap/app-module-loader.d.ts +83 -0
- package/dist/types/bootstrap/bootstrap.d.ts +14 -0
- package/dist/types/bootstrap/build-manifest-checker.d.ts +19 -0
- package/dist/types/bootstrap/build-manifest-reader.d.ts +14 -0
- package/dist/types/bootstrap/build-manifest-staleness.enum.d.ts +18 -0
- package/dist/types/bootstrap/build-manifest-writer.d.ts +19 -0
- package/dist/types/bootstrap/build-manifest.d.ts +29 -0
- package/dist/types/bootstrap/build-runner.d.ts +16 -0
- package/dist/types/bootstrap/build-staleness-prompt.d.ts +27 -0
- package/dist/types/bootstrap/dynamic-importer.d.ts +13 -0
- package/dist/types/bootstrap/init-prompt.d.ts +38 -0
- package/dist/types/bootstrap/loaded-app-module.d.ts +40 -0
- package/dist/types/bootstrap/loaded-plugin.d.ts +20 -0
- package/dist/types/bootstrap/plugin-loader.d.ts +35 -0
- package/dist/types/bootstrap/source-hasher.d.ts +15 -0
- package/dist/types/cli.d.ts +12 -0
- package/dist/types/cli.module.d.ts +3 -0
- package/dist/types/commands/build-alias.command.d.ts +15 -0
- package/dist/types/commands/build.command.d.ts +47 -0
- package/dist/types/commands/commands.d.ts +15 -0
- package/dist/types/commands/config-print.command.d.ts +18 -0
- package/dist/types/commands/help-alias.command.d.ts +17 -0
- package/dist/types/commands/help.command.d.ts +19 -1
- package/dist/types/commands/info-alias.command.d.ts +15 -0
- package/dist/types/commands/info.command.d.ts +41 -0
- package/dist/types/commands/init-alias.command.d.ts +16 -0
- package/dist/types/commands/init.command-options.d.ts +22 -0
- package/dist/types/commands/init.command.d.ts +60 -0
- package/dist/types/commands/list-alias.command.d.ts +15 -0
- package/dist/types/commands/list.command.d.ts +6 -0
- package/dist/types/commands/start-alias.command.d.ts +16 -0
- package/dist/types/commands/start.command-options.d.ts +11 -0
- package/dist/types/commands/start.command.d.ts +47 -0
- package/dist/types/commands/verify-alias.command.d.ts +15 -0
- package/dist/types/commands/verify.command.d.ts +24 -0
- package/dist/types/config/config-loader.d.ts +40 -0
- package/dist/types/config/config-provenance.enum.d.ts +10 -0
- package/dist/types/config/config.d.ts +5 -0
- package/dist/types/config/define-config.d.ts +14 -0
- package/dist/types/config/pristine-config.interface.d.ts +67 -0
- package/dist/types/config/resolved-pristine-config.d.ts +28 -0
- package/dist/types/event-handlers/cli.event-handler.d.ts +30 -3
- package/dist/types/interfaces/command.interface.d.ts +31 -3
- package/package.json +16 -12
- package/readme.md +1023 -17
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
|
|
20
|
+
import { injectable } from "tsyringe";
|
|
21
|
+
import { CliModuleKeyname } from "../cli.module.keyname";
|
|
22
|
+
import { StartCommand } from "./start.command";
|
|
23
|
+
import { StartCommandOptions } from "./start.command-options";
|
|
24
|
+
/**
|
|
25
|
+
* Top-level alias for the framework-reserved `p:start` command. Injects the delegate
|
|
26
|
+
* directly via standard DI.
|
|
27
|
+
*/
|
|
28
|
+
let StartAliasCommand = class StartAliasCommand {
|
|
29
|
+
constructor(delegate) {
|
|
30
|
+
this.delegate = delegate;
|
|
31
|
+
this.optionsType = StartCommandOptions;
|
|
32
|
+
this.name = "start";
|
|
33
|
+
this.description = "Alias for p:start.";
|
|
34
|
+
}
|
|
35
|
+
run(args) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
return this.delegate.run(args);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
StartAliasCommand = __decorate([
|
|
42
|
+
tag(ServiceDefinitionTagEnum.Command),
|
|
43
|
+
moduleScoped(CliModuleKeyname),
|
|
44
|
+
injectable(),
|
|
45
|
+
__metadata("design:paramtypes", [StartCommand])
|
|
46
|
+
], StartAliasCommand);
|
|
47
|
+
export { StartAliasCommand };
|
|
48
|
+
//# sourceMappingURL=start-alias.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start-alias.command.js","sourceRoot":"","sources":["../../../../src/commands/start-alias.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAE5D;;;GAGG;AAII,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAK5B,YAA6B,QAAsB;QAAtB,aAAQ,GAAR,QAAQ,CAAc;QAJnD,gBAAW,GAAG,mBAAmB,CAAC;QAClC,SAAI,GAAG,OAAO,CAAC;QACf,gBAAW,GAAG,oBAAoB,CAAC;IAGnC,CAAC;IAEK,GAAG,CAAC,IAAyB;;YACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;KAAA;CACF,CAAA;AAXY,iBAAiB;IAH7B,GAAG,CAAC,wBAAwB,CAAC,OAAO,CAAC;IACrC,YAAY,CAAC,gBAAgB,CAAC;IAC9B,UAAU,EAAE;qCAM4B,YAAY;GALxC,iBAAiB,CAW7B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import "reflect-metadata";
|
|
11
|
+
import { IsNumber, IsOptional, IsString } from "@pristine-ts/class-validator";
|
|
12
|
+
/**
|
|
13
|
+
* Runtime overrides for `pristine start`. These are applied to every `RuntimeServerInterface`
|
|
14
|
+
* the kernel resolves — implementations are free to ignore them. The flags exist mainly for
|
|
15
|
+
* one-off cases ("I just need to test on a different port right now"); the canonical place
|
|
16
|
+
* to set defaults is the matching module's configurationDefinitions or `pristine.config.ts`.
|
|
17
|
+
*/
|
|
18
|
+
export class StartCommandOptions {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
IsOptional(),
|
|
22
|
+
IsNumber(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], StartCommandOptions.prototype, "port", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
IsOptional(),
|
|
27
|
+
IsString(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], StartCommandOptions.prototype, "address", void 0);
|
|
30
|
+
//# sourceMappingURL=start.command-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.command-options.js","sourceRoot":"","sources":["../../../../src/commands/start.command-options.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;CAQ/B;AALC;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;iDACG;AAId;IAFC,UAAU,EAAE;IACZ,QAAQ,EAAE;;oDACM"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var StartCommand_1;
|
|
23
|
+
import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
|
|
24
|
+
import { injectable, injectAll } from "tsyringe";
|
|
25
|
+
import { Kernel } from "@pristine-ts/core";
|
|
26
|
+
import { ConsoleManager } from "../managers/console.manager";
|
|
27
|
+
import { ExitCodeEnum } from "../enums/exit-code.enum";
|
|
28
|
+
import { CliModuleKeyname } from "../cli.module.keyname";
|
|
29
|
+
import { StartCommandOptions } from "./start.command-options";
|
|
30
|
+
/**
|
|
31
|
+
* Boots the AppModule, starts every registered `RuntimeServerInterface` (HTTP server, gRPC
|
|
32
|
+
* server, etc.), and keeps the process alive until SIGTERM or SIGINT. On signal, runs the
|
|
33
|
+
* registered `onShutdown` hooks via `Kernel.stop()` and exits.
|
|
34
|
+
*
|
|
35
|
+
* This is the production-grade entry point. Use `pristine start` (or its `pristine p:start`
|
|
36
|
+
* canonical name) instead of `node dist/main.js` if you want Pristine to manage the lifecycle,
|
|
37
|
+
* signal handling, and graceful shutdown — including listening on every server module the
|
|
38
|
+
* AppModule imports.
|
|
39
|
+
*
|
|
40
|
+
* Notes:
|
|
41
|
+
* - The kernel is **already started** by `bootstrap()` before this command runs (the CLI
|
|
42
|
+
* boots once for every command). This command does not call `kernel.start()` again — it
|
|
43
|
+
* just starts the registered servers and keeps the process alive.
|
|
44
|
+
* - `RuntimeServer`-tagged services are constructor-injected via `@injectAll`. This works
|
|
45
|
+
* because `RuntimeServer` is a different tag than `Command`, so there's no self-reference
|
|
46
|
+
* cycle (StartCommand is `@tag(Command)`, not `@tag(RuntimeServer)`). When no servers
|
|
47
|
+
* are registered, the array is empty and the start path skips the loop.
|
|
48
|
+
* - The `Kernel` is injected only for `kernel.stop()` — the legitimate use of the Kernel
|
|
49
|
+
* as a service. Other resolution (commands, runtime servers, etc.) goes through
|
|
50
|
+
* standard DI rather than reaching through `kernel.container`.
|
|
51
|
+
* - The shutdown timeout (per `onShutdown` hook) defaults to 10 seconds. The whole-process
|
|
52
|
+
* hard exit timeout defaults to 30 seconds — if the orderly shutdown doesn't finish in
|
|
53
|
+
* that window, the process is force-exited so Kubernetes / ECS don't get stuck waiting.
|
|
54
|
+
* - `--port` / `--address` flags are propagated to every RuntimeServer's `start()`. In
|
|
55
|
+
* multi-server scenarios where servers should listen on different ports, use the per-module
|
|
56
|
+
* configuration values (e.g. `pristine.http.kernel-server.port`) instead of CLI flags.
|
|
57
|
+
* - Watch mode (`--watch`) is not yet implemented. For a dev loop, wrap `pristine start` in
|
|
58
|
+
* `nodemon` or `tsx --watch`.
|
|
59
|
+
*/
|
|
60
|
+
let StartCommand = StartCommand_1 = class StartCommand {
|
|
61
|
+
constructor(consoleManager, kernel, servers) {
|
|
62
|
+
this.consoleManager = consoleManager;
|
|
63
|
+
this.kernel = kernel;
|
|
64
|
+
this.servers = servers;
|
|
65
|
+
this.optionsType = StartCommandOptions;
|
|
66
|
+
this.name = "p:start";
|
|
67
|
+
this.description = "Boot the AppModule and run until SIGTERM/SIGINT. Production-grade entry point.";
|
|
68
|
+
// Sentinel name of the DefaultRuntimeServer registered in @pristine-ts/core. We filter
|
|
69
|
+
// it out of `this.servers` before doing any real work because it's a no-op placeholder
|
|
70
|
+
// whose only job is to make `@injectAll(RuntimeServer)` resolvable in apps that don't
|
|
71
|
+
// import a real server module.
|
|
72
|
+
this.defaultRuntimeServerName = "__default__";
|
|
73
|
+
}
|
|
74
|
+
run(args) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const servers = this.servers.filter(s => s.name !== this.defaultRuntimeServerName);
|
|
77
|
+
const overrides = (args.port !== undefined || args.address !== undefined)
|
|
78
|
+
? { port: args.port, address: args.address }
|
|
79
|
+
: undefined;
|
|
80
|
+
for (const server of servers) {
|
|
81
|
+
try {
|
|
82
|
+
yield server.start(overrides);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
this.consoleManager.writeError(`Failed to start server '${server.name}': ${error.message}`);
|
|
86
|
+
// Best-effort: stop any servers that did start before we abort.
|
|
87
|
+
for (const started of servers) {
|
|
88
|
+
if (started === server)
|
|
89
|
+
break;
|
|
90
|
+
try {
|
|
91
|
+
yield started.stop();
|
|
92
|
+
}
|
|
93
|
+
catch ( /* swallow */_a) { /* swallow */ }
|
|
94
|
+
}
|
|
95
|
+
return ExitCodeEnum.Error;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (servers.length === 0) {
|
|
99
|
+
this.consoleManager.writeSuccess("Pristine app running. Send SIGTERM (or Ctrl+C) to stop.");
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const labels = servers.map(s => s.name).join(", ");
|
|
103
|
+
this.consoleManager.writeSuccess(`Pristine app running with ${servers.length} server(s): ${labels}. Send SIGTERM (or Ctrl+C) to stop.`);
|
|
104
|
+
}
|
|
105
|
+
return new Promise((resolve) => {
|
|
106
|
+
let shuttingDown = false;
|
|
107
|
+
// Keep the event loop alive. Without this, Node would exit as soon as it noticed nothing
|
|
108
|
+
// else (no open sockets, no timers, no listening servers from user modules) was pending —
|
|
109
|
+
// signal handlers alone don't count as work. The interval is a 1-day no-op heartbeat;
|
|
110
|
+
// we clear it on shutdown so the process can actually exit when stop() returns.
|
|
111
|
+
const heartbeat = setInterval(() => { }, 1 << 30);
|
|
112
|
+
const initiateShutdown = (signal) => __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
if (shuttingDown) {
|
|
114
|
+
// Second signal arrived while we're already shutting down — escalate to an immediate
|
|
115
|
+
// hard exit. This mirrors the behavior of most production runtimes (one Ctrl+C =
|
|
116
|
+
// graceful, two = right now).
|
|
117
|
+
this.consoleManager.writeWarning(`Received ${signal} again — forcing exit.`);
|
|
118
|
+
process.exit(130);
|
|
119
|
+
}
|
|
120
|
+
shuttingDown = true;
|
|
121
|
+
this.consoleManager.writeInfo(`Received ${signal}, shutting down gracefully...`);
|
|
122
|
+
const hardExitTimer = setTimeout(() => {
|
|
123
|
+
this.consoleManager.writeError(`Shutdown exceeded ${StartCommand_1.HARD_EXIT_TIMEOUT_MS}ms — forcing exit.`);
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}, StartCommand_1.HARD_EXIT_TIMEOUT_MS);
|
|
126
|
+
// Don't keep the event loop alive just for the timer.
|
|
127
|
+
hardExitTimer.unref();
|
|
128
|
+
try {
|
|
129
|
+
// Kernel.stop() invokes module onShutdown hooks in outer-to-inner order, including
|
|
130
|
+
// HttpModule.onShutdown which calls KernelHttpServer.stop(). No need to stop the
|
|
131
|
+
// servers individually here.
|
|
132
|
+
yield this.kernel.stop();
|
|
133
|
+
this.consoleManager.writeSuccess("Shutdown complete.");
|
|
134
|
+
clearTimeout(hardExitTimer);
|
|
135
|
+
clearInterval(heartbeat);
|
|
136
|
+
resolve(ExitCodeEnum.Success);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
this.consoleManager.writeError(`Shutdown error: ${error.message}`);
|
|
140
|
+
clearTimeout(hardExitTimer);
|
|
141
|
+
clearInterval(heartbeat);
|
|
142
|
+
resolve(ExitCodeEnum.Error);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
// Register on each signal once. A second SIGINT/SIGTERM goes through `initiateShutdown`
|
|
146
|
+
// again, which detects `shuttingDown` and force-exits.
|
|
147
|
+
process.on("SIGTERM", () => { void initiateShutdown("SIGTERM"); });
|
|
148
|
+
process.on("SIGINT", () => { void initiateShutdown("SIGINT"); });
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
// Force-exit safeguard: if onShutdown hooks are still running after this many milliseconds
|
|
154
|
+
// past the first signal, the process is killed. Prevents orchestrators from waiting on a
|
|
155
|
+
// wedged shutdown.
|
|
156
|
+
StartCommand.HARD_EXIT_TIMEOUT_MS = 30000;
|
|
157
|
+
StartCommand = StartCommand_1 = __decorate([
|
|
158
|
+
tag(ServiceDefinitionTagEnum.Command),
|
|
159
|
+
moduleScoped(CliModuleKeyname),
|
|
160
|
+
injectable(),
|
|
161
|
+
__param(2, injectAll(ServiceDefinitionTagEnum.RuntimeServer)),
|
|
162
|
+
__metadata("design:paramtypes", [ConsoleManager,
|
|
163
|
+
Kernel, Array])
|
|
164
|
+
], StartCommand);
|
|
165
|
+
export { StartCommand };
|
|
166
|
+
//# sourceMappingURL=start.command.js.map
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,CAAC,OAAO,EAAE,CAAC,CAAC;wBAC9E,YAAY,CAAC,aAAa,CAAC,CAAC;wBAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;wBACzB,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;oBAC9B,CAAC;gBACH,CAAC,CAAA,CAAC;gBAEF,wFAAwF;gBACxF,uDAAuD;gBACvD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;;AAlGD,2FAA2F;AAC3F,yFAAyF;AACzF,mBAAmB;AACK,iCAAoB,GAAG,KAAM,AAAT,CAAU;AAR3C,YAAY;IAHxB,GAAG,CAAC,wBAAwB,CAAC,OAAO,CAAC;IACrC,YAAY,CAAC,gBAAgB,CAAC;IAC9B,UAAU,EAAE;IAoBR,WAAA,SAAS,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAA;qCAFjB,cAAc;QACtB,MAAM;GAlBtB,YAAY,CAwGxB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
|
|
20
|
+
import { injectable } from "tsyringe";
|
|
21
|
+
import { CliModuleKeyname } from "../cli.module.keyname";
|
|
22
|
+
import { VerifyCommand } from "./verify.command";
|
|
23
|
+
/**
|
|
24
|
+
* Top-level alias for the framework-reserved `p:verify` command. Injects the delegate
|
|
25
|
+
* directly via standard DI.
|
|
26
|
+
*/
|
|
27
|
+
let VerifyAliasCommand = class VerifyAliasCommand {
|
|
28
|
+
constructor(delegate) {
|
|
29
|
+
this.delegate = delegate;
|
|
30
|
+
this.optionsType = null;
|
|
31
|
+
this.name = "verify";
|
|
32
|
+
this.description = "Alias for p:verify.";
|
|
33
|
+
}
|
|
34
|
+
run(args) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return this.delegate.run(args);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
VerifyAliasCommand = __decorate([
|
|
41
|
+
tag(ServiceDefinitionTagEnum.Command),
|
|
42
|
+
moduleScoped(CliModuleKeyname),
|
|
43
|
+
injectable(),
|
|
44
|
+
__metadata("design:paramtypes", [VerifyCommand])
|
|
45
|
+
], VerifyAliasCommand);
|
|
46
|
+
export { VerifyAliasCommand };
|
|
47
|
+
//# sourceMappingURL=verify-alias.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-alias.command.js","sourceRoot":"","sources":["../../../../src/commands/verify-alias.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C;;;GAGG;AAII,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAK7B,YAA6B,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;QAJpD,gBAAW,GAAG,IAAI,CAAC;QACnB,SAAI,GAAG,QAAQ,CAAC;QAChB,gBAAW,GAAG,qBAAqB,CAAC;IAGpC,CAAC;IAEK,GAAG,CAAC,IAAS;;YACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;KAAA;CACF,CAAA;AAXY,kBAAkB;IAH9B,GAAG,CAAC,wBAAwB,CAAC,OAAO,CAAC;IACrC,YAAY,CAAC,gBAAgB,CAAC;IAC9B,UAAU,EAAE;qCAM4B,aAAa;GALzC,kBAAkB,CAW9B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
|
|
23
|
+
import { inject, injectable } from "tsyringe";
|
|
24
|
+
import { Kernel } from "@pristine-ts/core";
|
|
25
|
+
import { ExitCodeEnum } from "../enums/exit-code.enum";
|
|
26
|
+
import { CliModuleKeyname } from "../cli.module.keyname";
|
|
27
|
+
import { AppModuleLoader } from "../bootstrap/app-module-loader";
|
|
28
|
+
/**
|
|
29
|
+
* Verifies that the consumer's AppModule can be instantiated against its configuration.
|
|
30
|
+
* Builds a fresh throw-away kernel, runs every boot phase capturing per-phase outcomes,
|
|
31
|
+
* executes every embedder-registered `InstantiationTestInterface`, and routes the resulting
|
|
32
|
+
* report through the project's `LogHandlerInterface`.
|
|
33
|
+
*
|
|
34
|
+
* Note: this command runs after the CLI's own `kernel.start()` has succeeded, so it cannot
|
|
35
|
+
* be used to debug a configuration that is so broken the CLI can't start. For that case,
|
|
36
|
+
* call `kernel.verifyInstantiation(...)` directly from a small script that imports your
|
|
37
|
+
* AppModule.
|
|
38
|
+
*/
|
|
39
|
+
let VerifyCommand = class VerifyCommand {
|
|
40
|
+
constructor(logHandler, appModuleLoader) {
|
|
41
|
+
this.logHandler = logHandler;
|
|
42
|
+
this.appModuleLoader = appModuleLoader;
|
|
43
|
+
this.optionsType = null;
|
|
44
|
+
this.name = "p:verify";
|
|
45
|
+
this.description = "Verify the AppModule boots cleanly and run all registered InstantiationTests.";
|
|
46
|
+
}
|
|
47
|
+
run(args) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const skipTests = (args === null || args === void 0 ? void 0 : args["skip-tests"]) === true || (args === null || args === void 0 ? void 0 : args.skipTests) === true;
|
|
50
|
+
const { appModule, configuration } = yield this.appModuleLoader.load();
|
|
51
|
+
const kernel = new Kernel();
|
|
52
|
+
const report = yield kernel.verifyInstantiation(appModule, configuration, {
|
|
53
|
+
runInstantiationTests: !skipTests,
|
|
54
|
+
});
|
|
55
|
+
report.log(this.logHandler);
|
|
56
|
+
return report.hasErrors ? ExitCodeEnum.Error : ExitCodeEnum.Success;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
VerifyCommand = __decorate([
|
|
61
|
+
tag(ServiceDefinitionTagEnum.Command),
|
|
62
|
+
moduleScoped(CliModuleKeyname),
|
|
63
|
+
injectable(),
|
|
64
|
+
__param(0, inject("LogHandlerInterface")),
|
|
65
|
+
__metadata("design:paramtypes", [Object, AppModuleLoader])
|
|
66
|
+
], VerifyCommand);
|
|
67
|
+
export { VerifyCommand };
|
|
68
|
+
//# sourceMappingURL=verify.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.command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AAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC;QACtE,CAAC;KAAA;CACF,CAAA;AAzBY,aAAa;IAHzB,GAAG,CAAC,wBAAwB,CAAC,OAAO,CAAC;IACrC,YAAY,CAAC,gBAAgB,CAAC;IAC9B,UAAU,EAAE;IAOR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;6CACI,eAAe;GAPxC,aAAa,CAyBzB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
import { injectable } from "tsyringe";
|
|
20
|
+
import fs from "fs";
|
|
21
|
+
import path from "path";
|
|
22
|
+
import { ConfigProvenanceEnum } from "./config-provenance.enum";
|
|
23
|
+
import { ResolvedPristineConfig } from "./resolved-pristine-config";
|
|
24
|
+
import { DynamicImporter } from "../bootstrap/dynamic-importer";
|
|
25
|
+
/**
|
|
26
|
+
* Loads `pristine.config.ts` (preferred) or `pristine.config.js` (escape hatch for
|
|
27
|
+
* pure-JS projects). Walks up from `process.cwd()` looking for the file, then loads it
|
|
28
|
+
* through `jiti` (for `.ts`) or Node's dynamic `import()` (for `.js`).
|
|
29
|
+
*
|
|
30
|
+
* Returns a `ResolvedPristineConfig` carrying the file path (when found) and per-field
|
|
31
|
+
* provenance, which `pristine p:config:print` uses to render an annotated dump.
|
|
32
|
+
*/
|
|
33
|
+
let ConfigLoader = class ConfigLoader {
|
|
34
|
+
constructor(dynamicImporter) {
|
|
35
|
+
this.dynamicImporter = dynamicImporter;
|
|
36
|
+
/**
|
|
37
|
+
* File names searched for, in order. `.ts` is the canonical form — `defineConfig()`
|
|
38
|
+
* gives full IDE autocomplete and every Pristine project ships a TS toolchain anyway.
|
|
39
|
+
* `.js` is the escape hatch for the rare pure-JS project that cannot have a `.ts`
|
|
40
|
+
* file at the root.
|
|
41
|
+
*/
|
|
42
|
+
this.configFileNames = [
|
|
43
|
+
"pristine.config.ts",
|
|
44
|
+
"pristine.config.js",
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
load(options) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const startDir = (_a = options === null || options === void 0 ? void 0 : options.startDir) !== null && _a !== void 0 ? _a : process.cwd();
|
|
51
|
+
let configFilePath;
|
|
52
|
+
if ((options === null || options === void 0 ? void 0 : options.explicitPath) !== undefined) {
|
|
53
|
+
const abs = path.resolve(startDir, options.explicitPath);
|
|
54
|
+
if (fs.existsSync(abs) === false) {
|
|
55
|
+
throw new Error(`[pristine] Config file not found: '${options.explicitPath}' (resolved to '${abs}')`);
|
|
56
|
+
}
|
|
57
|
+
configFilePath = abs;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
configFilePath = this.findConfigFile(startDir);
|
|
61
|
+
}
|
|
62
|
+
if (configFilePath === undefined) {
|
|
63
|
+
return new ResolvedPristineConfig({}, undefined, {});
|
|
64
|
+
}
|
|
65
|
+
const config = yield this.importConfigFile(configFilePath);
|
|
66
|
+
const provenance = {};
|
|
67
|
+
for (const key of Object.keys(config)) {
|
|
68
|
+
provenance[key] = ConfigProvenanceEnum.ConfigFile;
|
|
69
|
+
}
|
|
70
|
+
return new ResolvedPristineConfig(config, configFilePath, provenance);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Walks up from `startDir` looking for a config file with any of the supported names.
|
|
75
|
+
* Stops at the first match, returning the absolute path. Stops at the filesystem root
|
|
76
|
+
* without finding anything → returns undefined. Walking up matters in monorepos: a CLI
|
|
77
|
+
* invoked in `packages/foo/` should still find a `pristine.config.ts` at the repo root.
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
findConfigFile(startDir) {
|
|
81
|
+
let current = path.resolve(startDir);
|
|
82
|
+
while (true) {
|
|
83
|
+
for (const name of this.configFileNames) {
|
|
84
|
+
const candidate = path.join(current, name);
|
|
85
|
+
if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {
|
|
86
|
+
return candidate;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const parent = path.dirname(current);
|
|
90
|
+
// path.dirname of root === root; we've hit the filesystem boundary.
|
|
91
|
+
if (parent === current)
|
|
92
|
+
return undefined;
|
|
93
|
+
current = parent;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Loads a config file from `absolutePath`. `.ts` goes through `jiti`; `.js` uses Node's
|
|
98
|
+
* native dynamic `import()`. Extracts the default export, falling back to a named
|
|
99
|
+
* `pristineConfig` export for users who prefer not to use `export default`.
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
importConfigFile(absolutePath) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
var _a, _b, _c, _d;
|
|
105
|
+
const ext = path.extname(absolutePath).toLowerCase();
|
|
106
|
+
let loaded;
|
|
107
|
+
if (ext === ".ts") {
|
|
108
|
+
const jitiModule = yield this.dynamicImporter.import("jiti");
|
|
109
|
+
const createJiti = (_b = (_a = jitiModule.default) !== null && _a !== void 0 ? _a : jitiModule.createJiti) !== null && _b !== void 0 ? _b : jitiModule;
|
|
110
|
+
const jiti = createJiti(absolutePath, { interopDefault: true });
|
|
111
|
+
loaded = jiti(absolutePath);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
loaded = yield this.dynamicImporter.import(`file://${absolutePath}`);
|
|
115
|
+
}
|
|
116
|
+
const config = (_d = (_c = loaded === null || loaded === void 0 ? void 0 : loaded.default) !== null && _c !== void 0 ? _c : loaded === null || loaded === void 0 ? void 0 : loaded.pristineConfig) !== null && _d !== void 0 ? _d : loaded;
|
|
117
|
+
if (!config || typeof config !== "object") {
|
|
118
|
+
throw new Error(`[pristine] Config file at '${absolutePath}' did not export a valid configuration. ` +
|
|
119
|
+
`Use \`export default defineConfig({ ... })\` or \`export const pristineConfig = { ... }\`.`);
|
|
120
|
+
}
|
|
121
|
+
return config;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
ConfigLoader = __decorate([
|
|
126
|
+
injectable(),
|
|
127
|
+
__metadata("design:paramtypes", [DynamicImporter])
|
|
128
|
+
], ConfigLoader);
|
|
129
|
+
export { ConfigLoader };
|
|
130
|
+
//# sourceMappingURL=config-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../../../src/config/config-loader.ts"],"names":[],"mapp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AK,EAAE,CAAC;gBAClB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC7D,MAAM,UAAU,GAAG,MAAA,MAAA,UAAU,CAAC,OAAO,mCAAI,UAAU,CAAC,UAAU,mCAAI,UAAU,CAAC;gBAC7E,MAAM,IAAI,GAAG,UAAU,CAAC,YAAY,EAAE,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC,CAAC;gBAC9D,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,YAAY,EAAE,CAAC,CAAC;YACvE,CAAC;YAED,MAAM,MAAM,GAAG,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,mCAAI,MAAM,CAAC;YAEnE,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CACb,8BAA8B,YAAY,0CAA0C;oBACpF,4FAA4F,CAC7F,CAAC;YACJ,CAAC;YAED,OAAO,MAAwB,CAAC;QAClC,CAAC;KAAA;CACF,CAAA;AAhGY,YAAY;IADxB,UAAU,EAAE;qCAamC,eAAe;GAZlD,YAAY,CAgGxB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a resolved configuration value originated. Used by `pristine p:config:print` to
|
|
3
|
+
* annotate output so users can tell whether a value comes from their config file, a
|
|
4
|
+
* deprecated `package.json` field, or the CLI's built-in defaults.
|
|
5
|
+
*/
|
|
6
|
+
export var ConfigProvenanceEnum;
|
|
7
|
+
(function (ConfigProvenanceEnum) {
|
|
8
|
+
ConfigProvenanceEnum["ConfigFile"] = "config-file";
|
|
9
|
+
ConfigProvenanceEnum["PackageJsonDeprecated"] = "package-json-deprecated";
|
|
10
|
+
ConfigProvenanceEnum["Default"] = "default";
|
|
11
|
+
})(ConfigProvenanceEnum || (ConfigProvenanceEnum = {}));
|
|
12
|
+
//# sourceMappingURL=config-provenance.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-provenance.enum.js","sourceRoot":"","sources":["../../../../src/config/config-provenance.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,kDAA0B,CAAA;IAC1B,yEAAiD,CAAA;IACjD,2CAAmB,CAAA;AACrB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/config/config.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity helper that gives an authored `pristine.config.ts` full type checking and
|
|
3
|
+
* autocomplete. Implementation is intentionally trivial — the types do all the work.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import {defineConfig} from "@pristine-ts/cli";
|
|
7
|
+
*
|
|
8
|
+
* export default defineConfig({
|
|
9
|
+
* appModule: { path: "dist/app.module.js" },
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export const defineConfig = (config) => config;
|
|
14
|
+
//# sourceMappingURL=define-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-config.js","sourceRoot":"","sources":["../../../../src/config/define-config.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAsB,EAAkB,EAAE,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pristine-config.interface.js","sourceRoot":"","sources":["../../../../src/config/pristine-config.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A loaded `PristineConfig` augmented with discovery metadata. `ConfigLoader` returns this
|
|
3
|
+
* shape; the raw `PristineConfig` is what users author.
|
|
4
|
+
*/
|
|
5
|
+
export class ResolvedPristineConfig {
|
|
6
|
+
constructor(config,
|
|
7
|
+
/** Absolute path to the config file that was loaded, if any. */
|
|
8
|
+
configFilePath,
|
|
9
|
+
/**
|
|
10
|
+
* Per-top-level-field provenance markers, mainly for `pristine p:config:print`. Keys are
|
|
11
|
+
* top-level fields of `PristineConfig` (`appModule`, `build`, `start`, `plugins`,
|
|
12
|
+
* `kernelConfiguration`); values are the `ConfigProvenanceEnum` describing where each
|
|
13
|
+
* came from.
|
|
14
|
+
*/
|
|
15
|
+
provenance) {
|
|
16
|
+
this.config = config;
|
|
17
|
+
this.configFilePath = configFilePath;
|
|
18
|
+
this.provenance = provenance;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=resolved-pristine-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolved-pristine-config.js","sourceRoot":"","sources":["../../../../src/config/resolved-pristine-config.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACjC,YACkB,MAAsB;IACtC,gEAAgE;IAChD,cAAkC;IAClD;;;;;OAKG;IACa,UAAgD;QAThD,WAAM,GAAN,MAAM,CAAgB;QAEtB,mBAAc,GAAd,cAAc,CAAoB;QAOlC,eAAU,GAAV,UAAU,CAAsC;IAElE,CAAC;CACF"}
|