dev-cockpit 0.2.3 → 0.2.4
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/{chunk-C4GFJDMG.js → chunk-A446TCT5.js} +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +94 -81
- package/dist/index.js.map +4 -4
- package/dist/{link-HXNII7EU.js → link-VWT2VQH6.js} +2 -2
- package/examples/cockpit.schema.json +280 -0
- package/examples/cockpit.yaml +36 -10
- package/package.json +1 -1
- /package/dist/{chunk-C4GFJDMG.js.map → chunk-A446TCT5.js.map} +0 -0
- /package/dist/{link-HXNII7EU.js.map → link-VWT2VQH6.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { createLogger, initLogger, getLogger, type Logger } from './core/logger.
|
|
|
5
5
|
export { spawnStream, killAllSpawned, findSpawnedByTag, killSpawnedByTag, type ProcessHandle, type SpawnOptions, } from './core/subprocess.js';
|
|
6
6
|
export { detectTransitions, notify, notifyTransitions, emitEvent, type NotificationsConfig, type NotifyOptions, } from './core/notifier.js';
|
|
7
7
|
export { CONFIG_VERSION, loadConfig, BaseCockpitConfigSchema, ConfigValidationError, ConfigVersionError, type BaseCockpitConfig, type LoadConfigOptions, } from './core/config.js';
|
|
8
|
+
export { discoverConfig, DiscoveryError, type DiscoveryResult, type DiscoverySource, type DiscoverConfigOptions, } from './core/config-discovery.js';
|
|
9
|
+
export { canonical, listMappings, lookupConfig, manifestPath, readManifest, removeMapping, setMapping, type Manifest, } from './core/manifest.js';
|
|
8
10
|
export { Command } from 'commander';
|
|
9
11
|
export type { Command as CommanderCommand } from 'commander';
|
|
10
12
|
export { z } from 'zod';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,UAAU,EACV,SAAS,EACT,OAAO,EACP,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,GACX,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEpF,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,iBAAiB,EACjB,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,KAAK,mBAAmB,EACxB,KAAK,aAAa,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,cAAc,EACd,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,UAAU,EACV,SAAS,EACT,OAAO,E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Ac,EACd,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,KAAK,OAAO,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,SAAS,EACT,cAAc,EACd,KAAK,cAAc,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,9 +17,13 @@ import {
|
|
|
17
17
|
} from "./chunk-VN6UILQW.js";
|
|
18
18
|
import {
|
|
19
19
|
canonical,
|
|
20
|
+
listMappings,
|
|
20
21
|
lookupConfig,
|
|
21
|
-
manifestPath
|
|
22
|
-
|
|
22
|
+
manifestPath,
|
|
23
|
+
readManifest,
|
|
24
|
+
removeMapping,
|
|
25
|
+
setMapping
|
|
26
|
+
} from "./chunk-A446TCT5.js";
|
|
23
27
|
import {
|
|
24
28
|
__commonJS,
|
|
25
29
|
__export,
|
|
@@ -84046,6 +84050,48 @@ function loadConfig(filePath, opts = {}) {
|
|
|
84046
84050
|
return config;
|
|
84047
84051
|
}
|
|
84048
84052
|
|
|
84053
|
+
// src/core/config-discovery.ts
|
|
84054
|
+
import fs4 from "node:fs";
|
|
84055
|
+
import path7 from "node:path";
|
|
84056
|
+
var DiscoveryError = class extends Error {
|
|
84057
|
+
constructor(workspaceRoot) {
|
|
84058
|
+
super(
|
|
84059
|
+
`dev-cockpit: no cockpit.yaml found at ${workspaceRoot}/cockpit.yaml and no entry in ${manifestPath()}. Run \`dev-cockpit link <config-path>\` from this directory to register one, or pass --config <path>.`
|
|
84060
|
+
);
|
|
84061
|
+
this.workspaceRoot = workspaceRoot;
|
|
84062
|
+
this.name = "DiscoveryError";
|
|
84063
|
+
}
|
|
84064
|
+
};
|
|
84065
|
+
function discoverConfig(opts = {}) {
|
|
84066
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
84067
|
+
const envConfig = opts.envConfig ?? process.env["DEV_COCKPIT_CONFIG"];
|
|
84068
|
+
const profileRoot = opts.workspaceDiscoverer?.()?.root;
|
|
84069
|
+
const workspaceRoot = profileRoot ? canonical(profileRoot) : canonical(cwd);
|
|
84070
|
+
if (opts.cliConfig) {
|
|
84071
|
+
return {
|
|
84072
|
+
configPath: path7.resolve(cwd, opts.cliConfig),
|
|
84073
|
+
workspaceRoot,
|
|
84074
|
+
source: "cli"
|
|
84075
|
+
};
|
|
84076
|
+
}
|
|
84077
|
+
if (envConfig) {
|
|
84078
|
+
return {
|
|
84079
|
+
configPath: path7.resolve(cwd, envConfig),
|
|
84080
|
+
workspaceRoot,
|
|
84081
|
+
source: "env"
|
|
84082
|
+
};
|
|
84083
|
+
}
|
|
84084
|
+
const localConfig = path7.join(workspaceRoot, "cockpit.yaml");
|
|
84085
|
+
if (fs4.existsSync(localConfig)) {
|
|
84086
|
+
return { configPath: localConfig, workspaceRoot, source: "workspace" };
|
|
84087
|
+
}
|
|
84088
|
+
const mapped = lookupConfig(workspaceRoot);
|
|
84089
|
+
if (mapped) {
|
|
84090
|
+
return { configPath: mapped, workspaceRoot, source: "manifest" };
|
|
84091
|
+
}
|
|
84092
|
+
throw new DiscoveryError(workspaceRoot);
|
|
84093
|
+
}
|
|
84094
|
+
|
|
84049
84095
|
// node_modules/commander/esm.mjs
|
|
84050
84096
|
var import_index = __toESM(require_commander(), 1);
|
|
84051
84097
|
var {
|
|
@@ -84634,18 +84680,18 @@ function Health() {
|
|
|
84634
84680
|
var import_react4 = __toESM(require_react(), 1);
|
|
84635
84681
|
|
|
84636
84682
|
// src/cockpit/help/loader.ts
|
|
84637
|
-
import
|
|
84638
|
-
import
|
|
84683
|
+
import fs5 from "node:fs";
|
|
84684
|
+
import path8 from "node:path";
|
|
84639
84685
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
84640
84686
|
function resolveDocsRoot(startUrl = import.meta.url) {
|
|
84641
|
-
let dir =
|
|
84642
|
-
while (dir !==
|
|
84643
|
-
const pkgJson =
|
|
84644
|
-
const docsIndex =
|
|
84645
|
-
if (
|
|
84646
|
-
return
|
|
84687
|
+
let dir = path8.dirname(fileURLToPath3(startUrl));
|
|
84688
|
+
while (dir !== path8.dirname(dir)) {
|
|
84689
|
+
const pkgJson = path8.join(dir, "package.json");
|
|
84690
|
+
const docsIndex = path8.join(dir, "docs", "index.md");
|
|
84691
|
+
if (fs5.existsSync(pkgJson) && fs5.existsSync(docsIndex)) {
|
|
84692
|
+
return path8.join(dir, "docs");
|
|
84647
84693
|
}
|
|
84648
|
-
dir =
|
|
84694
|
+
dir = path8.dirname(dir);
|
|
84649
84695
|
}
|
|
84650
84696
|
return null;
|
|
84651
84697
|
}
|
|
@@ -84661,18 +84707,18 @@ function parseIndex(indexBody) {
|
|
|
84661
84707
|
return out;
|
|
84662
84708
|
}
|
|
84663
84709
|
function loadPagesFromDir(docsRoot) {
|
|
84664
|
-
const indexPath =
|
|
84710
|
+
const indexPath = path8.join(docsRoot, "index.md");
|
|
84665
84711
|
let indexBody;
|
|
84666
84712
|
try {
|
|
84667
|
-
indexBody =
|
|
84713
|
+
indexBody = fs5.readFileSync(indexPath, "utf8");
|
|
84668
84714
|
} catch {
|
|
84669
84715
|
return [];
|
|
84670
84716
|
}
|
|
84671
84717
|
const pages = [{ slug: "index", title: "Index", path: indexPath, body: indexBody }];
|
|
84672
84718
|
for (const entry of parseIndex(indexBody)) {
|
|
84673
|
-
const pagePath =
|
|
84719
|
+
const pagePath = path8.join(docsRoot, `${entry.slug}.md`);
|
|
84674
84720
|
try {
|
|
84675
|
-
const body =
|
|
84721
|
+
const body = fs5.readFileSync(pagePath, "utf8");
|
|
84676
84722
|
pages.push({ slug: entry.slug, title: entry.title, path: pagePath, body });
|
|
84677
84723
|
} catch {
|
|
84678
84724
|
}
|
|
@@ -87884,7 +87930,7 @@ function useGlobalKeys(opts) {
|
|
|
87884
87930
|
var import_react7 = __toESM(require_react(), 1);
|
|
87885
87931
|
|
|
87886
87932
|
// src/health/scheduler.ts
|
|
87887
|
-
import
|
|
87933
|
+
import path9 from "node:path";
|
|
87888
87934
|
|
|
87889
87935
|
// src/health/runner.ts
|
|
87890
87936
|
async function runChecks(checks, triggerSet, ctx) {
|
|
@@ -87945,7 +87991,7 @@ var HealthScheduler = class {
|
|
|
87945
87991
|
}
|
|
87946
87992
|
onFsEvent(filePath) {
|
|
87947
87993
|
if (!this.running) return;
|
|
87948
|
-
const fileName =
|
|
87994
|
+
const fileName = path9.basename(filePath);
|
|
87949
87995
|
const isLockfile = this.lockfileNames.has(fileName);
|
|
87950
87996
|
const triggers = ["fsevent"];
|
|
87951
87997
|
if (isLockfile) {
|
|
@@ -88068,7 +88114,7 @@ function resolveNotify(transition, globalConfig, perItem) {
|
|
|
88068
88114
|
|
|
88069
88115
|
// src/health/builtin.ts
|
|
88070
88116
|
import net from "node:net";
|
|
88071
|
-
import
|
|
88117
|
+
import path10 from "node:path";
|
|
88072
88118
|
var containerRunning = (entry) => {
|
|
88073
88119
|
const container = entry.container;
|
|
88074
88120
|
if (!container) {
|
|
@@ -88155,7 +88201,7 @@ var fileExists = (entry) => {
|
|
|
88155
88201
|
throw new Error(`health[${entry.id}]: type 'file-exists' requires 'path'`);
|
|
88156
88202
|
}
|
|
88157
88203
|
return async (ctx) => {
|
|
88158
|
-
const resolved =
|
|
88204
|
+
const resolved = path10.isAbsolute(target) ? target : path10.join(ctx.workspaceRoot, target);
|
|
88159
88205
|
const exists = ctx.fs.existsSync(resolved);
|
|
88160
88206
|
return {
|
|
88161
88207
|
id: entry.id,
|
|
@@ -88266,7 +88312,7 @@ function safeLogger() {
|
|
|
88266
88312
|
}
|
|
88267
88313
|
|
|
88268
88314
|
// src/health/context.ts
|
|
88269
|
-
import
|
|
88315
|
+
import fs6 from "node:fs";
|
|
88270
88316
|
var defaultExec = async (cmd, args, cwd) => {
|
|
88271
88317
|
let stdout = "";
|
|
88272
88318
|
const handle = spawnStream(cmd, args, {
|
|
@@ -88279,13 +88325,13 @@ var defaultExec = async (cmd, args, cwd) => {
|
|
|
88279
88325
|
return { stdout, exitCode };
|
|
88280
88326
|
};
|
|
88281
88327
|
var defaultFs = {
|
|
88282
|
-
existsSync: (p) =>
|
|
88283
|
-
statSync: (p) =>
|
|
88328
|
+
existsSync: (p) => fs6.existsSync(p),
|
|
88329
|
+
statSync: (p) => fs6.statSync(p),
|
|
88284
88330
|
readdirSync: (p, opts) => {
|
|
88285
88331
|
if (opts?.withFileTypes) {
|
|
88286
|
-
return
|
|
88332
|
+
return fs6.readdirSync(p, { withFileTypes: true });
|
|
88287
88333
|
}
|
|
88288
|
-
return
|
|
88334
|
+
return fs6.readdirSync(p);
|
|
88289
88335
|
}
|
|
88290
88336
|
};
|
|
88291
88337
|
function buildHealthContext(workspaceRoot, appendOutput) {
|
|
@@ -88544,8 +88590,8 @@ async function restartDockerService(deps) {
|
|
|
88544
88590
|
}
|
|
88545
88591
|
|
|
88546
88592
|
// src/docker/logs.ts
|
|
88547
|
-
import
|
|
88548
|
-
import
|
|
88593
|
+
import path11 from "node:path";
|
|
88594
|
+
import fs7 from "node:fs";
|
|
88549
88595
|
var DEBOUNCE_MS = 3e4;
|
|
88550
88596
|
var SILENT_THRESHOLD_MS = 9e4;
|
|
88551
88597
|
var DockerLogTailer = class {
|
|
@@ -88572,8 +88618,8 @@ var DockerLogTailer = class {
|
|
|
88572
88618
|
*/
|
|
88573
88619
|
resolveComposeFile() {
|
|
88574
88620
|
if (this.opts.composeFile) {
|
|
88575
|
-
const abs =
|
|
88576
|
-
return
|
|
88621
|
+
const abs = path11.isAbsolute(this.opts.composeFile) ? this.opts.composeFile : path11.join(this.opts.workspaceRoot, this.opts.composeFile);
|
|
88622
|
+
return fs7.existsSync(abs) ? abs : null;
|
|
88577
88623
|
}
|
|
88578
88624
|
return null;
|
|
88579
88625
|
}
|
|
@@ -88686,8 +88732,8 @@ var DockerLogTailer = class {
|
|
|
88686
88732
|
};
|
|
88687
88733
|
|
|
88688
88734
|
// src/watchers/manager.ts
|
|
88689
|
-
import
|
|
88690
|
-
import
|
|
88735
|
+
import fs8 from "node:fs";
|
|
88736
|
+
import path13 from "node:path";
|
|
88691
88737
|
|
|
88692
88738
|
// node_modules/chokidar/index.js
|
|
88693
88739
|
import { EventEmitter as EventEmitter2 } from "node:events";
|
|
@@ -90437,7 +90483,7 @@ function mapPathToRepo(filePath, repos) {
|
|
|
90437
90483
|
}
|
|
90438
90484
|
|
|
90439
90485
|
// src/lint/reactive.ts
|
|
90440
|
-
import
|
|
90486
|
+
import path12 from "node:path";
|
|
90441
90487
|
var EXT_TO_LINT_KEY = {
|
|
90442
90488
|
".js": "js",
|
|
90443
90489
|
".jsx": "js",
|
|
@@ -90452,7 +90498,7 @@ var EXT_TO_LINT_KEY = {
|
|
|
90452
90498
|
".php": "php"
|
|
90453
90499
|
};
|
|
90454
90500
|
function selectLintCommand(filePath, lintConfig) {
|
|
90455
|
-
const ext =
|
|
90501
|
+
const ext = path12.extname(filePath).toLowerCase();
|
|
90456
90502
|
const key = EXT_TO_LINT_KEY[ext];
|
|
90457
90503
|
if (!key) return void 0;
|
|
90458
90504
|
return lintConfig[key];
|
|
@@ -90527,7 +90573,7 @@ async function runLintCmd(filePath, cmd, opts) {
|
|
|
90527
90573
|
ts: Date.now(),
|
|
90528
90574
|
source: repoName,
|
|
90529
90575
|
severity: "info",
|
|
90530
|
-
text: `lint passed for ${
|
|
90576
|
+
text: `lint passed for ${path12.basename(filePath)}`
|
|
90531
90577
|
});
|
|
90532
90578
|
onLintResult("pass");
|
|
90533
90579
|
} else {
|
|
@@ -90535,7 +90581,7 @@ async function runLintCmd(filePath, cmd, opts) {
|
|
|
90535
90581
|
ts: Date.now(),
|
|
90536
90582
|
source: repoName,
|
|
90537
90583
|
severity: "error",
|
|
90538
|
-
text: `lint FAILED for ${
|
|
90584
|
+
text: `lint FAILED for ${path12.basename(filePath)} (exit ${code})`
|
|
90539
90585
|
});
|
|
90540
90586
|
onLintResult("fail");
|
|
90541
90587
|
}
|
|
@@ -90545,7 +90591,7 @@ async function runLintCmd(filePath, cmd, opts) {
|
|
|
90545
90591
|
function detectUsePolling() {
|
|
90546
90592
|
if (process.env["DEV_COCKPIT_CHOKIDAR_POLLING"] === "1") return true;
|
|
90547
90593
|
try {
|
|
90548
|
-
const version =
|
|
90594
|
+
const version = fs8.readFileSync("/proc/version", "utf8");
|
|
90549
90595
|
return /microsoft|wsl/i.test(version);
|
|
90550
90596
|
} catch {
|
|
90551
90597
|
return false;
|
|
@@ -90577,7 +90623,7 @@ var WatcherManager = class {
|
|
|
90577
90623
|
const globs = [];
|
|
90578
90624
|
for (const [, managed] of this.repos) {
|
|
90579
90625
|
for (const pattern of managed.config.discover) {
|
|
90580
|
-
globs.push(
|
|
90626
|
+
globs.push(path13.join(managed.rootDir, pattern));
|
|
90581
90627
|
}
|
|
90582
90628
|
}
|
|
90583
90629
|
if (globs.length === 0) return;
|
|
@@ -90808,48 +90854,6 @@ function buildActionRegistry(configActions, profileActions = []) {
|
|
|
90808
90854
|
return Array.from(byId.values());
|
|
90809
90855
|
}
|
|
90810
90856
|
|
|
90811
|
-
// src/core/config-discovery.ts
|
|
90812
|
-
import fs8 from "node:fs";
|
|
90813
|
-
import path13 from "node:path";
|
|
90814
|
-
var DiscoveryError = class extends Error {
|
|
90815
|
-
constructor(workspaceRoot) {
|
|
90816
|
-
super(
|
|
90817
|
-
`dev-cockpit: no cockpit.yaml found at ${workspaceRoot}/cockpit.yaml and no entry in ${manifestPath()}. Run \`dev-cockpit link <config-path>\` from this directory to register one, or pass --config <path>.`
|
|
90818
|
-
);
|
|
90819
|
-
this.workspaceRoot = workspaceRoot;
|
|
90820
|
-
this.name = "DiscoveryError";
|
|
90821
|
-
}
|
|
90822
|
-
};
|
|
90823
|
-
function discoverConfig(opts = {}) {
|
|
90824
|
-
const cwd = opts.cwd ?? process.cwd();
|
|
90825
|
-
const envConfig = opts.envConfig ?? process.env["DEV_COCKPIT_CONFIG"];
|
|
90826
|
-
const profileRoot = opts.workspaceDiscoverer?.()?.root;
|
|
90827
|
-
const workspaceRoot = profileRoot ? canonical(profileRoot) : canonical(cwd);
|
|
90828
|
-
if (opts.cliConfig) {
|
|
90829
|
-
return {
|
|
90830
|
-
configPath: path13.resolve(cwd, opts.cliConfig),
|
|
90831
|
-
workspaceRoot,
|
|
90832
|
-
source: "cli"
|
|
90833
|
-
};
|
|
90834
|
-
}
|
|
90835
|
-
if (envConfig) {
|
|
90836
|
-
return {
|
|
90837
|
-
configPath: path13.resolve(cwd, envConfig),
|
|
90838
|
-
workspaceRoot,
|
|
90839
|
-
source: "env"
|
|
90840
|
-
};
|
|
90841
|
-
}
|
|
90842
|
-
const localConfig = path13.join(workspaceRoot, "cockpit.yaml");
|
|
90843
|
-
if (fs8.existsSync(localConfig)) {
|
|
90844
|
-
return { configPath: localConfig, workspaceRoot, source: "workspace" };
|
|
90845
|
-
}
|
|
90846
|
-
const mapped = lookupConfig(workspaceRoot);
|
|
90847
|
-
if (mapped) {
|
|
90848
|
-
return { configPath: mapped, workspaceRoot, source: "manifest" };
|
|
90849
|
-
}
|
|
90850
|
-
throw new DiscoveryError(workspaceRoot);
|
|
90851
|
-
}
|
|
90852
|
-
|
|
90853
90857
|
// src/commands/dev.ts
|
|
90854
90858
|
async function devCommand(opts = {}) {
|
|
90855
90859
|
const profile = opts.profile;
|
|
@@ -92779,15 +92783,15 @@ function buildCli(opts = {}) {
|
|
|
92779
92783
|
}
|
|
92780
92784
|
if (!hasCommand(program2, "link")) {
|
|
92781
92785
|
const linkCmd = program2.command("link").description("Register the current directory as using a cockpit.yaml that lives elsewhere").argument("<config-path>", "Path to the cockpit.yaml to associate with this directory").action(async (configPath) => {
|
|
92782
|
-
const { linkAddCommand } = await import("./link-
|
|
92786
|
+
const { linkAddCommand } = await import("./link-VWT2VQH6.js");
|
|
92783
92787
|
linkAddCommand({ configPath });
|
|
92784
92788
|
});
|
|
92785
92789
|
linkCmd.command("list").description("Print all registered project \u2192 config mappings").action(async () => {
|
|
92786
|
-
const { linkListCommand } = await import("./link-
|
|
92790
|
+
const { linkListCommand } = await import("./link-VWT2VQH6.js");
|
|
92787
92791
|
linkListCommand();
|
|
92788
92792
|
});
|
|
92789
92793
|
linkCmd.command("remove").description("Unregister the current directory from the manifest").action(async () => {
|
|
92790
|
-
const { linkRemoveCommand } = await import("./link-
|
|
92794
|
+
const { linkRemoveCommand } = await import("./link-VWT2VQH6.js");
|
|
92791
92795
|
linkRemoveCommand();
|
|
92792
92796
|
});
|
|
92793
92797
|
}
|
|
@@ -92851,6 +92855,7 @@ export {
|
|
|
92851
92855
|
DEFAULT_HIGHLIGHT_PATTERNS,
|
|
92852
92856
|
DEBOUNCE_MS as DOCKER_NOTIFY_DEBOUNCE_MS,
|
|
92853
92857
|
SILENT_THRESHOLD_MS as DOCKER_SILENT_THRESHOLD_MS,
|
|
92858
|
+
DiscoveryError,
|
|
92854
92859
|
DockerLogTailer,
|
|
92855
92860
|
FALLBACK_PAGE,
|
|
92856
92861
|
FilterModal,
|
|
@@ -92874,6 +92879,7 @@ export {
|
|
|
92874
92879
|
buildHealthContext,
|
|
92875
92880
|
buildHealthRegistry,
|
|
92876
92881
|
buildTemplate,
|
|
92882
|
+
canonical,
|
|
92877
92883
|
cockpitStore,
|
|
92878
92884
|
compileHighlights,
|
|
92879
92885
|
createLogger,
|
|
@@ -92881,6 +92887,7 @@ export {
|
|
|
92881
92887
|
detectBrokenSymlinks,
|
|
92882
92888
|
detectTransitions,
|
|
92883
92889
|
devCommand,
|
|
92890
|
+
discoverConfig,
|
|
92884
92891
|
dispatchRemediation,
|
|
92885
92892
|
doctorCommand,
|
|
92886
92893
|
emitEvent,
|
|
@@ -92896,9 +92903,12 @@ export {
|
|
|
92896
92903
|
initLogger,
|
|
92897
92904
|
killAllSpawned,
|
|
92898
92905
|
killSpawnedByTag,
|
|
92906
|
+
listMappings,
|
|
92899
92907
|
loadConfig,
|
|
92900
92908
|
loadHelpPages,
|
|
92901
92909
|
loadPagesFromDir,
|
|
92910
|
+
lookupConfig,
|
|
92911
|
+
manifestPath,
|
|
92902
92912
|
mapPathToRepo,
|
|
92903
92913
|
matchHighlights,
|
|
92904
92914
|
mergeMounts,
|
|
@@ -92910,8 +92920,10 @@ export {
|
|
|
92910
92920
|
notifyTransitions,
|
|
92911
92921
|
parseIndex,
|
|
92912
92922
|
readGitInfo,
|
|
92923
|
+
readManifest,
|
|
92913
92924
|
readMountManifest,
|
|
92914
92925
|
removeManagedSymlinks,
|
|
92926
|
+
removeMapping,
|
|
92915
92927
|
renderDockerOverlay,
|
|
92916
92928
|
renderMarkdown,
|
|
92917
92929
|
renderWizardYaml,
|
|
@@ -92927,6 +92939,7 @@ export {
|
|
|
92927
92939
|
runRemediation,
|
|
92928
92940
|
scheduleLint,
|
|
92929
92941
|
selectLintCommand,
|
|
92942
|
+
setMapping,
|
|
92930
92943
|
spawnStream,
|
|
92931
92944
|
useCockpitStore,
|
|
92932
92945
|
useGlobalKeys,
|