@decohere/cli 0.0.1-dev.129 → 0.0.1-dev.131
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/commonjs/src/cli.js +1 -0
- package/commonjs/src/compile-cache.js +13 -0
- package/commonjs/src/flux.js +5 -1
- package/commonjs/src/forge.js +5 -1
- package/commonjs/src/root.command.js +6 -2
- package/commonjs/src/root.module.js +11 -3
- package/es6/src/cli.js +1 -0
- package/es6/src/compile-cache.js +4 -0
- package/es6/src/flux.js +5 -1
- package/es6/src/forge.js +5 -1
- package/es6/src/root.command.js +7 -3
- package/es6/src/root.module.js +7 -4
- package/package.json +11 -11
- package/types/src/cli.d.ts +1 -0
- package/types/src/compile-cache.d.ts +1 -0
- package/types/src/flux.d.ts +1 -0
- package/types/src/forge.d.ts +1 -0
- package/types/src/root.command.d.ts +1 -1
package/commonjs/src/cli.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _nodemodule = /*#__PURE__*/ _interop_require_default(require("node:module"));
|
|
6
|
+
function _interop_require_default(obj) {
|
|
7
|
+
return obj && obj.__esModule ? obj : {
|
|
8
|
+
default: obj
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
// Imported first by the bins: Node keeps the compiled code of every module it loads after
|
|
12
|
+
// this, so the next start skips compiling them again.
|
|
13
|
+
_nodemodule.default.enableCompileCache();
|
package/commonjs/src/flux.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
require("./compile-cache.js");
|
|
6
7
|
require("./logger.setup.js");
|
|
7
8
|
const _flux = require("@decohere/flux");
|
|
8
9
|
const _scribe = require("@decohere/scribe");
|
|
@@ -12,6 +13,8 @@ const configIndex = process.argv.indexOf("--config-file");
|
|
|
12
13
|
const configFile = configIndex !== -1 ? process.argv[configIndex + 1] : undefined;
|
|
13
14
|
const logLevelIndex = process.argv.indexOf("--log-level");
|
|
14
15
|
const logLevel = logLevelIndex !== -1 ? process.argv[logLevelIndex + 1] : undefined;
|
|
16
|
+
const rootDirIndex = process.argv.indexOf("--root-dir");
|
|
17
|
+
const rootDir = rootDirIndex !== -1 ? process.argv[rootDirIndex + 1] : undefined;
|
|
15
18
|
_scribe.scribe.withPinoPretty({
|
|
16
19
|
logLevel: (0, _loglevel.cliLogLevel)(logLevel),
|
|
17
20
|
when: "always"
|
|
@@ -21,7 +24,8 @@ const app = await _rootmodule.RootModule.create([
|
|
|
21
24
|
_flux.FluxModule
|
|
22
25
|
], {
|
|
23
26
|
configFile,
|
|
24
|
-
logLevel
|
|
27
|
+
logLevel,
|
|
28
|
+
rootDir
|
|
25
29
|
});
|
|
26
30
|
try {
|
|
27
31
|
// Route directly to the flux module — users invoke as `flux serve`, not `flux flux serve`
|
package/commonjs/src/forge.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
require("./compile-cache.js");
|
|
6
7
|
require("./logger.setup.js");
|
|
7
8
|
const _forge = require("@decohere/forge");
|
|
8
9
|
const _scribe = require("@decohere/scribe");
|
|
@@ -12,6 +13,8 @@ const configIndex = process.argv.indexOf("--config-file");
|
|
|
12
13
|
const configFile = configIndex !== -1 ? process.argv[configIndex + 1] : undefined;
|
|
13
14
|
const logLevelIndex = process.argv.indexOf("--log-level");
|
|
14
15
|
const logLevel = logLevelIndex !== -1 ? process.argv[logLevelIndex + 1] : undefined;
|
|
16
|
+
const rootDirIndex = process.argv.indexOf("--root-dir");
|
|
17
|
+
const rootDir = rootDirIndex !== -1 ? process.argv[rootDirIndex + 1] : undefined;
|
|
15
18
|
_scribe.scribe.withPinoPretty({
|
|
16
19
|
logLevel: (0, _loglevel.cliLogLevel)(logLevel),
|
|
17
20
|
when: "always"
|
|
@@ -21,7 +24,8 @@ const app = await _rootmodule.RootModule.create([
|
|
|
21
24
|
_forge.ForgeModule
|
|
22
25
|
], {
|
|
23
26
|
configFile,
|
|
24
|
-
logLevel
|
|
27
|
+
logLevel,
|
|
28
|
+
rootDir
|
|
25
29
|
});
|
|
26
30
|
let exitCode = 0;
|
|
27
31
|
try {
|
|
@@ -13,10 +13,13 @@ const _cli = require("@decohere/devkit/cli");
|
|
|
13
13
|
const _commander = require("commander");
|
|
14
14
|
class RootCommand extends _cli.DecohereCommand {
|
|
15
15
|
#configFile;
|
|
16
|
-
|
|
16
|
+
#rootDir;
|
|
17
|
+
constructor(modules, configFile, rootDir){
|
|
17
18
|
super();
|
|
18
19
|
this.#configFile = configFile;
|
|
20
|
+
this.#rootDir = rootDir;
|
|
19
21
|
this.addOption(new _cli.ConfigFileOption());
|
|
22
|
+
this.addOption(new _cli.RootDirOption());
|
|
20
23
|
this.addOption(new _cli.LogLevelOption());
|
|
21
24
|
this.addOption(new _cli.EnvFileOption());
|
|
22
25
|
this.addOption(new _cli.EnvFileIfExistsOption());
|
|
@@ -33,7 +36,8 @@ class RootCommand extends _cli.DecohereCommand {
|
|
|
33
36
|
async parseAsync(argv, options) {
|
|
34
37
|
if (argv?.includes("--version") || argv?.includes("-V")) {
|
|
35
38
|
const workspace = await _workspace.WorkspaceFactory.create({
|
|
36
|
-
configFile: this.#configFile
|
|
39
|
+
configFile: this.#configFile,
|
|
40
|
+
rootDir: this.#rootDir
|
|
37
41
|
});
|
|
38
42
|
const version = await workspace.getVersion() ?? "unknown";
|
|
39
43
|
process.stdout.write(`${version}\n`);
|
|
@@ -8,12 +8,18 @@ Object.defineProperty(exports, "RootModule", {
|
|
|
8
8
|
return RootModule;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
11
12
|
const _workspace = require("@decohere/workspace");
|
|
12
13
|
const _cli = require("@decohere/devkit/cli");
|
|
13
14
|
const _diagnostics = require("@decohere/devkit/diagnostics");
|
|
14
15
|
const _commander = require("commander");
|
|
15
16
|
const _modulefactory = require("./module.factory.js");
|
|
16
17
|
const _rootcommand = require("./root.command.js");
|
|
18
|
+
function _interop_require_default(obj) {
|
|
19
|
+
return obj && obj.__esModule ? obj : {
|
|
20
|
+
default: obj
|
|
21
|
+
};
|
|
22
|
+
}
|
|
17
23
|
function _ts_decorate(decorators, target, key, desc) {
|
|
18
24
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
25
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -25,10 +31,12 @@ function _ts_metadata(k, v) {
|
|
|
25
31
|
}
|
|
26
32
|
class RootModule {
|
|
27
33
|
static async create(moduleTypes, options) {
|
|
28
|
-
|
|
34
|
+
// With --root-dir, the root's .decohere.js, not the current folder's.
|
|
35
|
+
const configFile = options?.configFile ?? (options?.rootDir ? _nodepath.default.join(options.rootDir, _workspace.WORKSPACE_CONFIG) : undefined);
|
|
36
|
+
const userConfig = await _workspace.UserConfigFactory.getUserConfig(configFile);
|
|
29
37
|
return new RootModule(moduleTypes, {
|
|
30
38
|
...userConfig,
|
|
31
|
-
configFile
|
|
39
|
+
configFile,
|
|
32
40
|
rootDir: options?.rootDir
|
|
33
41
|
});
|
|
34
42
|
}
|
|
@@ -42,7 +50,7 @@ class RootModule {
|
|
|
42
50
|
return _modulefactory.ModuleFactory.create(manifest, this.onResponse, config);
|
|
43
51
|
});
|
|
44
52
|
this.#modules = modules;
|
|
45
|
-
this.#command = new _rootcommand.RootCommand(modules, config.configFile);
|
|
53
|
+
this.#command = new _rootcommand.RootCommand(modules, config.configFile, config.rootDir);
|
|
46
54
|
// Before the command runs, not after it returns: a stop signal while `flux serve` boots
|
|
47
55
|
// (`docker stop` during start-up) is held for the shutdown below instead of killing the
|
|
48
56
|
// process before anything is disposed.
|
package/es6/src/cli.js
CHANGED
package/es6/src/flux.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import "./compile-cache.js";
|
|
2
3
|
import "./logger.setup.js";
|
|
3
4
|
import { FluxModule } from "@decohere/flux";
|
|
4
5
|
import { scribe } from "@decohere/scribe";
|
|
@@ -8,6 +9,8 @@ const configIndex = process.argv.indexOf("--config-file");
|
|
|
8
9
|
const configFile = configIndex !== -1 ? process.argv[configIndex + 1] : undefined;
|
|
9
10
|
const logLevelIndex = process.argv.indexOf("--log-level");
|
|
10
11
|
const logLevel = logLevelIndex !== -1 ? process.argv[logLevelIndex + 1] : undefined;
|
|
12
|
+
const rootDirIndex = process.argv.indexOf("--root-dir");
|
|
13
|
+
const rootDir = rootDirIndex !== -1 ? process.argv[rootDirIndex + 1] : undefined;
|
|
11
14
|
scribe.withPinoPretty({
|
|
12
15
|
logLevel: cliLogLevel(logLevel),
|
|
13
16
|
when: "always"
|
|
@@ -17,7 +20,8 @@ const app = await RootModule.create([
|
|
|
17
20
|
FluxModule
|
|
18
21
|
], {
|
|
19
22
|
configFile,
|
|
20
|
-
logLevel
|
|
23
|
+
logLevel,
|
|
24
|
+
rootDir
|
|
21
25
|
});
|
|
22
26
|
try {
|
|
23
27
|
// Route directly to the flux module — users invoke as `flux serve`, not `flux flux serve`
|
package/es6/src/forge.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import "./compile-cache.js";
|
|
2
3
|
import "./logger.setup.js";
|
|
3
4
|
import { ForgeModule } from "@decohere/forge";
|
|
4
5
|
import { scribe } from "@decohere/scribe";
|
|
@@ -8,6 +9,8 @@ const configIndex = process.argv.indexOf("--config-file");
|
|
|
8
9
|
const configFile = configIndex !== -1 ? process.argv[configIndex + 1] : undefined;
|
|
9
10
|
const logLevelIndex = process.argv.indexOf("--log-level");
|
|
10
11
|
const logLevel = logLevelIndex !== -1 ? process.argv[logLevelIndex + 1] : undefined;
|
|
12
|
+
const rootDirIndex = process.argv.indexOf("--root-dir");
|
|
13
|
+
const rootDir = rootDirIndex !== -1 ? process.argv[rootDirIndex + 1] : undefined;
|
|
11
14
|
scribe.withPinoPretty({
|
|
12
15
|
logLevel: cliLogLevel(logLevel),
|
|
13
16
|
when: "always"
|
|
@@ -17,7 +20,8 @@ const app = await RootModule.create([
|
|
|
17
20
|
ForgeModule
|
|
18
21
|
], {
|
|
19
22
|
configFile,
|
|
20
|
-
logLevel
|
|
23
|
+
logLevel,
|
|
24
|
+
rootDir
|
|
21
25
|
});
|
|
22
26
|
let exitCode = 0;
|
|
23
27
|
try {
|
package/es6/src/root.command.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { WorkspaceFactory } from "@decohere/workspace";
|
|
2
|
-
import { ConfigFileOption, DecohereCommand, EnvFileIfExistsOption, EnvFileOption, LogLevelOption } from "@decohere/devkit/cli";
|
|
2
|
+
import { ConfigFileOption, DecohereCommand, EnvFileIfExistsOption, EnvFileOption, LogLevelOption, RootDirOption } from "@decohere/devkit/cli";
|
|
3
3
|
import { CommanderError } from "commander";
|
|
4
4
|
export class RootCommand extends DecohereCommand {
|
|
5
5
|
#configFile;
|
|
6
|
-
|
|
6
|
+
#rootDir;
|
|
7
|
+
constructor(modules, configFile, rootDir){
|
|
7
8
|
super();
|
|
8
9
|
this.#configFile = configFile;
|
|
10
|
+
this.#rootDir = rootDir;
|
|
9
11
|
this.addOption(new ConfigFileOption());
|
|
12
|
+
this.addOption(new RootDirOption());
|
|
10
13
|
this.addOption(new LogLevelOption());
|
|
11
14
|
this.addOption(new EnvFileOption());
|
|
12
15
|
this.addOption(new EnvFileIfExistsOption());
|
|
@@ -23,7 +26,8 @@ export class RootCommand extends DecohereCommand {
|
|
|
23
26
|
async parseAsync(argv, options) {
|
|
24
27
|
if (argv?.includes("--version") || argv?.includes("-V")) {
|
|
25
28
|
const workspace = await WorkspaceFactory.create({
|
|
26
|
-
configFile: this.#configFile
|
|
29
|
+
configFile: this.#configFile,
|
|
30
|
+
rootDir: this.#rootDir
|
|
27
31
|
});
|
|
28
32
|
const version = await workspace.getVersion() ?? "unknown";
|
|
29
33
|
process.stdout.write(`${version}\n`);
|
package/es6/src/root.module.js
CHANGED
|
@@ -7,7 +7,8 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
7
7
|
function _ts_metadata(k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
}
|
|
10
|
-
import
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { UserConfigFactory, WORKSPACE_CONFIG } from "@decohere/workspace";
|
|
11
12
|
import { CommandResponse, DecohereCommand } from "@decohere/devkit/cli";
|
|
12
13
|
import { Trace } from "@decohere/devkit/diagnostics";
|
|
13
14
|
import { CommanderError } from "commander";
|
|
@@ -15,10 +16,12 @@ import { ModuleFactory } from "./module.factory.js";
|
|
|
15
16
|
import { RootCommand } from "./root.command.js";
|
|
16
17
|
export class RootModule {
|
|
17
18
|
static async create(moduleTypes, options) {
|
|
18
|
-
|
|
19
|
+
// With --root-dir, the root's .decohere.js, not the current folder's.
|
|
20
|
+
const configFile = options?.configFile ?? (options?.rootDir ? path.join(options.rootDir, WORKSPACE_CONFIG) : undefined);
|
|
21
|
+
const userConfig = await UserConfigFactory.getUserConfig(configFile);
|
|
19
22
|
return new RootModule(moduleTypes, {
|
|
20
23
|
...userConfig,
|
|
21
|
-
configFile
|
|
24
|
+
configFile,
|
|
22
25
|
rootDir: options?.rootDir
|
|
23
26
|
});
|
|
24
27
|
}
|
|
@@ -32,7 +35,7 @@ export class RootModule {
|
|
|
32
35
|
return ModuleFactory.create(manifest, this.onResponse, config);
|
|
33
36
|
});
|
|
34
37
|
this.#modules = modules;
|
|
35
|
-
this.#command = new RootCommand(modules, config.configFile);
|
|
38
|
+
this.#command = new RootCommand(modules, config.configFile, config.rootDir);
|
|
36
39
|
// Before the command runs, not after it returns: a stop signal while `flux serve` boots
|
|
37
40
|
// (`docker stop` during start-up) is held for the shutdown below instead of killing the
|
|
38
41
|
// process before anything is disposed.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decohere/cli",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.131",
|
|
4
4
|
"description": "CLI for the Decohere toolchain — build, serve, publish, and manage TypeScript monorepos",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@decohere/core": "0.0.1-dev.
|
|
41
|
-
"@decohere/create": "0.0.1-dev.
|
|
42
|
-
"@decohere/crucible": "0.0.1-dev.
|
|
43
|
-
"@decohere/devkit": "0.0.1-dev.
|
|
44
|
-
"@decohere/flux": "0.0.1-dev.
|
|
45
|
-
"@decohere/forge": "0.0.1-dev.
|
|
46
|
-
"@decohere/scaffold": "0.0.1-dev.
|
|
47
|
-
"@decohere/scribe": "0.0.1-dev.
|
|
48
|
-
"@decohere/scribe-pino": "0.0.1-dev.
|
|
49
|
-
"@decohere/workspace": "0.0.1-dev.
|
|
40
|
+
"@decohere/core": "0.0.1-dev.131",
|
|
41
|
+
"@decohere/create": "0.0.1-dev.131",
|
|
42
|
+
"@decohere/crucible": "0.0.1-dev.131",
|
|
43
|
+
"@decohere/devkit": "0.0.1-dev.131",
|
|
44
|
+
"@decohere/flux": "0.0.1-dev.131",
|
|
45
|
+
"@decohere/forge": "0.0.1-dev.131",
|
|
46
|
+
"@decohere/scaffold": "0.0.1-dev.131",
|
|
47
|
+
"@decohere/scribe": "0.0.1-dev.131",
|
|
48
|
+
"@decohere/scribe-pino": "0.0.1-dev.131",
|
|
49
|
+
"@decohere/workspace": "0.0.1-dev.131",
|
|
50
50
|
"commander": "^13.1.0",
|
|
51
51
|
"pino-pretty": "^13.1.3"
|
|
52
52
|
},
|
package/types/src/cli.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/src/flux.d.ts
CHANGED
package/types/src/forge.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { type ApplicationModule, DecohereCommand } from "@decohere/devkit/cli";
|
|
|
2
2
|
import { type ParseOptions } from "commander";
|
|
3
3
|
export declare class RootCommand extends DecohereCommand {
|
|
4
4
|
#private;
|
|
5
|
-
constructor(modules: ApplicationModule[], configFile?: string);
|
|
5
|
+
constructor(modules: ApplicationModule[], configFile?: string, rootDir?: string);
|
|
6
6
|
parseAsync(argv?: readonly string[], options?: ParseOptions): Promise<this>;
|
|
7
7
|
}
|