dev-cockpit 0.4.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/buildCli.d.ts.map +1 -1
- package/dist/commands/init-config.d.ts +6 -0
- package/dist/commands/init-config.d.ts.map +1 -1
- package/dist/commands/mount.d.ts +20 -1
- package/dist/commands/mount.d.ts.map +1 -1
- package/dist/core/types.d.ts +13 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.js +96 -24
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `dev-cockpit` are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## [0.5.0] — 2026-06-11
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **`Profile.cliCommand`** — the command users type to invoke the profile's CLI (e.g. `awc-cockpit`). Used for the commander program name and threaded into every user-facing message that suggests a command (init-config guard, link hint, doctor suggestions), so instructions are copy-pasteable for profile users. Falls back to `appName`, then `dev-cockpit`.
|
|
10
|
+
- **`Profile.profileKey`** — explicit key for the profile's namespace in cockpit.yaml (`profile.<key>:`), used by dev/doctor/mount config loading. Falls back to `appName` (its historical carrier), which now remains responsible only for state-dir identity defaults.
|
|
11
|
+
- **init-config manifest-precedence guard** — when the workspace is registered to an external config via the manifest, `init-config` refuses to write a workspace-local `cockpit.yaml` (which would take precedence in discovery and silently disconnect the registered config). `--force` overrides. Targets outside the discovery location (`-o elsewhere.yaml`) pass freely.
|
|
12
|
+
- **init-config `-o` wiring hint** — files written outside the discovery location end with explicit instructions to register them (`<cli> link <path>`), since discovery only finds `<workspace>/cockpit.yaml` or manifest registrations.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **init-config is interactive by default on a TTY** — the wizard (including profile-contributed steps) runs without flags; `--static` writes the canned starter template without prompts; non-TTY invocations automatically get the static template; `-i` still forces the wizard.
|
|
17
|
+
|
|
5
18
|
## [0.3.1] — 2026-05-12
|
|
6
19
|
|
|
7
20
|
### Added
|
package/dist/buildCli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCli.d.ts","sourceRoot":"","sources":["../src/buildCli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO/C,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAkBD,wBAAgB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"buildCli.d.ts","sourceRoot":"","sources":["../src/buildCli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO/C,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAkBD,wBAAgB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CA2K5D"}
|
|
@@ -22,6 +22,12 @@ export interface InitConfigOptions {
|
|
|
22
22
|
profile?: Profile;
|
|
23
23
|
/** Override default output path (`<cwd>/cockpit.yaml`). */
|
|
24
24
|
output?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Command name used in user-facing messages and suggested commands.
|
|
27
|
+
* Profiles pass their own (e.g. "awc-cockpit") so instructions are
|
|
28
|
+
* copy-pasteable for their users. Default: "dev-cockpit".
|
|
29
|
+
*/
|
|
30
|
+
cliCommand?: string;
|
|
25
31
|
}
|
|
26
32
|
export declare function buildTemplate(opts: {
|
|
27
33
|
withDocker: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-config.d.ts","sourceRoot":"","sources":["../../src/commands/init-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"init-config.d.ts","sourceRoot":"","sources":["../../src/commands/init-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sFAAsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAwFpF;AAED,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,iBAAiB,CACrC,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAmGlC"}
|
package/dist/commands/mount.d.ts
CHANGED
|
@@ -25,6 +25,25 @@ export interface MountCommandOptions {
|
|
|
25
25
|
quiet?: boolean;
|
|
26
26
|
}
|
|
27
27
|
export declare function mergeMounts(configMounts: readonly Mount[], providerMounts: readonly Mount[]): Mount[];
|
|
28
|
+
/**
|
|
29
|
+
* Seed the candidate list from the currently-applied manifest.
|
|
30
|
+
*
|
|
31
|
+
* Two jobs:
|
|
32
|
+
* 1. Manifest entries with no discovered/config counterpart (ad-hoc custom
|
|
33
|
+
* mounts added via the picker's add-custom loop) are appended as
|
|
34
|
+
* candidates — otherwise they'd be invisible on the next `mount` run and
|
|
35
|
+
* silently dropped by any re-apply, with no way to toggle just one off.
|
|
36
|
+
* 2. Returns the applied-key set so the picker can pre-check exactly the
|
|
37
|
+
* mounts that are currently applied (instead of pre-checking everything,
|
|
38
|
+
* where an absent-minded ⏎ would apply mounts the user never had).
|
|
39
|
+
*
|
|
40
|
+
* `appliedKeys` is null when no manifest exists — first-run pickers keep the
|
|
41
|
+
* legacy default (everything matched pre-checked).
|
|
42
|
+
*/
|
|
43
|
+
export declare function seedCandidatesFromManifest(merged: readonly Mount[], manifestMounts: readonly Mount[] | null): {
|
|
44
|
+
candidates: Mount[];
|
|
45
|
+
appliedKeys: ReadonlySet<string> | null;
|
|
46
|
+
};
|
|
28
47
|
/**
|
|
29
48
|
* Interactive picker. Lazy-imports @inquirer/prompts to keep the `dev`
|
|
30
49
|
* command's startup time clean. Three phases:
|
|
@@ -39,7 +58,7 @@ export declare function mergeMounts(configMounts: readonly Mount[], providerMoun
|
|
|
39
58
|
* Returns the final mount set in source-of-truth order. The caller writes
|
|
40
59
|
* the overlay / manifest from this list.
|
|
41
60
|
*/
|
|
42
|
-
export declare function pickMounts(candidates: readonly Mount[]): Promise<Mount[]>;
|
|
61
|
+
export declare function pickMounts(candidates: readonly Mount[], appliedKeys?: ReadonlySet<string> | null): Promise<Mount[]>;
|
|
43
62
|
export declare function mountCommand(opts?: MountCommandOptions): Promise<void>;
|
|
44
63
|
export declare function mountStatusCommand(opts?: MountCommandOptions): Promise<void>;
|
|
45
64
|
export declare function mountClearCommand(opts?: MountCommandOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/commands/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAoBvD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAWD,wBAAgB,WAAW,CACzB,YAAY,EAAE,SAAS,KAAK,EAAE,EAC9B,cAAc,EAAE,SAAS,KAAK,EAAE,GAC/B,KAAK,EAAE,CAKT;AAsHD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/commands/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAoBvD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAWD,wBAAgB,WAAW,CACzB,YAAY,EAAE,SAAS,KAAK,EAAE,EAC9B,cAAc,EAAE,SAAS,KAAK,EAAE,GAC/B,KAAK,EAAE,CAKT;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,cAAc,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI,GACtC;IAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;CAAE,CAUlE;AAsHD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,SAAS,KAAK,EAAE,EAC5B,WAAW,GAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAW,GAC7C,OAAO,CAAC,KAAK,EAAE,CAAC,CA6KlB;AAED,wBAAsB,YAAY,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwGhF;AAED,wBAAsB,kBAAkB,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEtF;AAED,wBAAsB,iBAAiB,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCrF"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -161,6 +161,19 @@ export interface Profile {
|
|
|
161
161
|
* core 8 steps. Each step's YAML output lands under `profile.<appName>:`
|
|
162
162
|
* in the generated cockpit.yaml.
|
|
163
163
|
*/
|
|
164
|
+
/**
|
|
165
|
+
* The command users type to invoke this profile's CLI (e.g.
|
|
166
|
+
* "awc-cockpit"). Used for the commander program name and in every
|
|
167
|
+
* user-facing message that suggests a command. Falls back to `appName`,
|
|
168
|
+
* then "dev-cockpit".
|
|
169
|
+
*/
|
|
170
|
+
cliCommand?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Key of this profile's namespace in cockpit.yaml (`profile.<key>:`),
|
|
173
|
+
* used when loading/validating config in dev/doctor/mount. Falls back
|
|
174
|
+
* to `appName` (its historical carrier).
|
|
175
|
+
*/
|
|
176
|
+
profileKey?: string;
|
|
164
177
|
wizardSteps?: readonly WizardStep[];
|
|
165
178
|
configSchemaExt?: z.ZodObject<z.ZodRawShape>;
|
|
166
179
|
mountCandidatesProvider?: () => Mount[] | Promise<Mount[]>;
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEpE,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;AAK/C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AACrD,2HAA2H;AAC3H,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEzD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GA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,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAChE,oFAAoF;IACpF,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,kFAAkF;IAClF,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,mEAAmE;IACnE,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB"}
|
package/dist/index.js
CHANGED
|
@@ -91567,7 +91567,7 @@ async function devCommand(opts = {}) {
|
|
|
91567
91567
|
}
|
|
91568
91568
|
const config = loadConfig(configPath, {
|
|
91569
91569
|
configSchemaExt: profile?.configSchemaExt,
|
|
91570
|
-
profileKey: profile?.appName
|
|
91570
|
+
profileKey: profile?.profileKey ?? profile?.appName
|
|
91571
91571
|
});
|
|
91572
91572
|
const seededRepos = {};
|
|
91573
91573
|
const seededOrder = [];
|
|
@@ -91856,7 +91856,7 @@ async function doctorCommand(opts = {}) {
|
|
|
91856
91856
|
}
|
|
91857
91857
|
const config = loadConfig(configPath, {
|
|
91858
91858
|
configSchemaExt: profile?.configSchemaExt,
|
|
91859
|
-
profileKey: profile?.appName
|
|
91859
|
+
profileKey: profile?.profileKey ?? profile?.appName
|
|
91860
91860
|
});
|
|
91861
91861
|
const ctx = buildHealthContext(workspaceRoot);
|
|
91862
91862
|
const registry = buildHealthRegistry({
|
|
@@ -92920,10 +92920,10 @@ docker:
|
|
|
92920
92920
|
# - name: app
|
|
92921
92921
|
# tail: true
|
|
92922
92922
|
`;
|
|
92923
|
-
return `# dev-cockpit configuration. All keys except \`version\` and
|
|
92924
|
-
# optional; defaults from src/core/config.ts apply when missing.
|
|
92923
|
+
return `# dev-cockpit configuration (schema v3). All keys except \`version\` and
|
|
92924
|
+
# \`appName\` are optional; defaults from src/core/config.ts apply when missing.
|
|
92925
92925
|
|
|
92926
|
-
version:
|
|
92926
|
+
version: 3
|
|
92927
92927
|
appName: ${opts.appName}
|
|
92928
92928
|
|
|
92929
92929
|
# Long-running processes streamed into the Output pane.
|
|
@@ -92952,6 +92952,26 @@ ${dockerBlock}
|
|
|
92952
92952
|
# label: app responsive
|
|
92953
92953
|
# type: http-ok
|
|
92954
92954
|
# url: http://localhost:3000/health
|
|
92955
|
+
# remediation:
|
|
92956
|
+
# label: restart app
|
|
92957
|
+
# command: docker compose restart app
|
|
92958
|
+
|
|
92959
|
+
# Single-keypress \u2192 health-id dispatch table (v3). Value can be a single id
|
|
92960
|
+
# or a list; multi-id bindings fire each UNIQUE remediation (deduped by
|
|
92961
|
+
# \`command|cwd\`) once. Action keys live separately on \`actions[].key\`.
|
|
92962
|
+
# keybindings:
|
|
92963
|
+
# R: app-up
|
|
92964
|
+
# D:
|
|
92965
|
+
# - app-up
|
|
92966
|
+
|
|
92967
|
+
# Named shell commands surfaced via the \`:\` palette and the Targets pane.
|
|
92968
|
+
# \`scope\` values: \`global\` | \`repos\` | \`repos:<id>\`.
|
|
92969
|
+
# actions:
|
|
92970
|
+
# - id: docs
|
|
92971
|
+
# label: Open docs
|
|
92972
|
+
# command: open ./docs/index.html
|
|
92973
|
+
# scope: global
|
|
92974
|
+
# key: o
|
|
92955
92975
|
|
|
92956
92976
|
# Help-pane sources (markdown trees) and the landing page slug.
|
|
92957
92977
|
# help:
|
|
@@ -92971,12 +92991,29 @@ ${dockerBlock}
|
|
|
92971
92991
|
}
|
|
92972
92992
|
async function initConfigCommand(opts = {}) {
|
|
92973
92993
|
const cwd = opts.cwd ?? process.cwd();
|
|
92994
|
+
const cli = opts.cliCommand ?? "dev-cockpit";
|
|
92974
92995
|
const target = opts.output ? path22.resolve(cwd, opts.output) : path22.join(cwd, "cockpit.yaml");
|
|
92975
92996
|
const exists = fs15.existsSync(target);
|
|
92976
92997
|
if (exists && !opts.force) {
|
|
92977
92998
|
process.stdout.write(
|
|
92978
|
-
|
|
92999
|
+
`${cli} init-config: ${target} already exists.
|
|
92979
93000
|
Pass --force to overwrite.
|
|
93001
|
+
`
|
|
93002
|
+
);
|
|
93003
|
+
return null;
|
|
93004
|
+
}
|
|
93005
|
+
const discoveryTarget = path22.join(cwd, "cockpit.yaml");
|
|
93006
|
+
const registered = lookupConfig(cwd);
|
|
93007
|
+
if (registered && !opts.force && target === discoveryTarget && path22.resolve(registered) !== target) {
|
|
93008
|
+
process.stdout.write(
|
|
93009
|
+
`${cli} init-config: this workspace already uses an external config:
|
|
93010
|
+
|
|
93011
|
+
${registered}
|
|
93012
|
+
(registered in ${manifestPath()})
|
|
93013
|
+
|
|
93014
|
+
A new ${target} would take precedence over it \u2014 commands in this workspace would stop reading the registered config and use the fresh starter file instead. The registered file itself is not modified.
|
|
93015
|
+
|
|
93016
|
+
Edit the registered config instead, or pass --force to write the local file anyway.
|
|
92980
93017
|
`
|
|
92981
93018
|
);
|
|
92982
93019
|
return null;
|
|
@@ -92993,15 +93030,24 @@ async function initConfigCommand(opts = {}) {
|
|
|
92993
93030
|
});
|
|
92994
93031
|
fs15.writeFileSync(target, content, "utf8");
|
|
92995
93032
|
process.stdout.write(`
|
|
92996
|
-
|
|
93033
|
+
${cli} init-config: wrote ${target}
|
|
92997
93034
|
`);
|
|
93035
|
+
if (target !== discoveryTarget) {
|
|
93036
|
+
process.stdout.write(
|
|
93037
|
+
`
|
|
93038
|
+
Note: this file is not wired to any workspace \u2014 discovery only finds <workspace>/cockpit.yaml or manifest registrations.
|
|
93039
|
+
To use it from a workspace, register it:
|
|
93040
|
+
cd <workspace> && ${cli} link ${target}
|
|
93041
|
+
`
|
|
93042
|
+
);
|
|
93043
|
+
}
|
|
92998
93044
|
if (opts.withDocker) {
|
|
92999
93045
|
process.stdout.write(" Docker block uncommented; adjust composeFile/services as needed.\n");
|
|
93000
93046
|
}
|
|
93001
93047
|
if (opts.interactive) {
|
|
93002
93048
|
const { confirm } = await import("@inquirer/prompts");
|
|
93003
93049
|
const runDoctorNow = await confirm({
|
|
93004
|
-
message:
|
|
93050
|
+
message: `Run \`${cli} doctor\` now to validate the file + show initial health?`,
|
|
93005
93051
|
default: true
|
|
93006
93052
|
});
|
|
93007
93053
|
if (runDoctorNow) {
|
|
@@ -93017,13 +93063,16 @@ doctor failed: ${err instanceof Error ? err.message : String(err)}
|
|
|
93017
93063
|
}
|
|
93018
93064
|
}
|
|
93019
93065
|
process.stdout.write("\nNext:\n");
|
|
93020
|
-
process.stdout.write(
|
|
93066
|
+
process.stdout.write(` \u2022 Edit cockpit.yaml any time, then re-run \`${cli} doctor\`.
|
|
93067
|
+
`);
|
|
93021
93068
|
process.stdout.write(
|
|
93022
|
-
|
|
93069
|
+
` \u2022 Run \`${cli} dev\` to launch the cockpit (Tab/arrows cycle panes, q quits).
|
|
93070
|
+
`
|
|
93023
93071
|
);
|
|
93024
93072
|
process.stdout.write(" \u2022 The Help tab inside the cockpit has the full docs.\n");
|
|
93025
93073
|
} else {
|
|
93026
|
-
process.stdout.write(
|
|
93074
|
+
process.stdout.write(` Run \`${cli} doctor\` to verify the config loads cleanly.
|
|
93075
|
+
`);
|
|
93027
93076
|
}
|
|
93028
93077
|
return { path: target, overwrote: exists };
|
|
93029
93078
|
}
|
|
@@ -93108,6 +93157,17 @@ function mergeMounts(configMounts, providerMounts) {
|
|
|
93108
93157
|
for (const m of configMounts) seen.set(mountKey(m), m);
|
|
93109
93158
|
return Array.from(seen.values());
|
|
93110
93159
|
}
|
|
93160
|
+
function seedCandidatesFromManifest(merged, manifestMounts) {
|
|
93161
|
+
if (manifestMounts === null) {
|
|
93162
|
+
return { candidates: [...merged], appliedKeys: null };
|
|
93163
|
+
}
|
|
93164
|
+
const mergedKeys = new Set(merged.map(mountKey));
|
|
93165
|
+
const extras = manifestMounts.filter((m) => !mergedKeys.has(mountKey(m)));
|
|
93166
|
+
return {
|
|
93167
|
+
candidates: [...merged, ...extras],
|
|
93168
|
+
appliedKeys: new Set(manifestMounts.map(mountKey))
|
|
93169
|
+
};
|
|
93170
|
+
}
|
|
93111
93171
|
async function resolveContext(opts) {
|
|
93112
93172
|
const profile = opts.profile;
|
|
93113
93173
|
let configPath;
|
|
@@ -93134,7 +93194,7 @@ async function resolveContext(opts) {
|
|
|
93134
93194
|
}
|
|
93135
93195
|
const config = loadConfig(configPath, {
|
|
93136
93196
|
configSchemaExt: profile?.configSchemaExt,
|
|
93137
|
-
profileKey: profile?.appName
|
|
93197
|
+
profileKey: profile?.profileKey ?? profile?.appName
|
|
93138
93198
|
});
|
|
93139
93199
|
const explicitService = opts.service ?? config.mount.service ?? config.docker?.services?.[0]?.name;
|
|
93140
93200
|
if (!explicitService) {
|
|
@@ -93194,18 +93254,19 @@ async function pickSourceForMount(m, prompts) {
|
|
|
93194
93254
|
validate: (v) => v.trim().length > 0 && path24.isAbsolute(v.trim()) ? true : "must be an absolute path"
|
|
93195
93255
|
})).trim();
|
|
93196
93256
|
}
|
|
93197
|
-
async function pickMounts(candidates) {
|
|
93257
|
+
async function pickMounts(candidates, appliedKeys = null) {
|
|
93198
93258
|
const { checkbox, confirm, input, select } = await import("@inquirer/prompts");
|
|
93199
93259
|
const prompts = { select, input };
|
|
93200
93260
|
let selected = [];
|
|
93201
93261
|
if (candidates.length > 0) {
|
|
93202
93262
|
const choices = candidates.map((m) => {
|
|
93203
93263
|
const unmatched = isUnmatched(m);
|
|
93204
|
-
const
|
|
93264
|
+
const applied = appliedKeys?.has(mountKey(m)) ?? false;
|
|
93265
|
+
const suffix = unmatched ? " (no source found \u2014 pick one)" : ` ${m.hostPath}${applied ? " [applied]" : ""}`;
|
|
93205
93266
|
return {
|
|
93206
93267
|
name: `${mountLabel(m)}${suffix}`,
|
|
93207
93268
|
value: m,
|
|
93208
|
-
checked: !unmatched
|
|
93269
|
+
checked: !unmatched && (appliedKeys ? applied : true)
|
|
93209
93270
|
};
|
|
93210
93271
|
});
|
|
93211
93272
|
selected = await checkbox({ message: "Select mounts to apply:", choices });
|
|
@@ -93328,26 +93389,32 @@ async function mountCommand(opts = {}) {
|
|
|
93328
93389
|
profile
|
|
93329
93390
|
} = ctx;
|
|
93330
93391
|
const merged = mergeMounts(configMounts, providerMounts);
|
|
93392
|
+
let manifestMounts = null;
|
|
93393
|
+
try {
|
|
93394
|
+
manifestMounts = readMountManifest(manifestPath2)?.mounts ?? null;
|
|
93395
|
+
} catch {
|
|
93396
|
+
}
|
|
93397
|
+
const { candidates, appliedKeys } = seedCandidatesFromManifest(merged, manifestMounts);
|
|
93331
93398
|
let selected;
|
|
93332
93399
|
if (opts.quiet || configMounts.length > 0 && providerMounts.length === 0) {
|
|
93333
|
-
if (
|
|
93400
|
+
if (candidates.length === 0) {
|
|
93334
93401
|
process.stdout.write(
|
|
93335
93402
|
"dev-cockpit mount: no mount candidates from config.mounts[] or profile.mountCandidatesProvider.\n"
|
|
93336
93403
|
);
|
|
93337
93404
|
return;
|
|
93338
93405
|
}
|
|
93339
|
-
selected =
|
|
93406
|
+
selected = candidates;
|
|
93340
93407
|
if (opts.quiet) {
|
|
93341
93408
|
process.stdout.write(`dev-cockpit mount: applying all ${selected.length} candidate(s).
|
|
93342
93409
|
`);
|
|
93343
93410
|
}
|
|
93344
93411
|
} else {
|
|
93345
|
-
if (
|
|
93412
|
+
if (candidates.length === 0) {
|
|
93346
93413
|
process.stdout.write(
|
|
93347
93414
|
"dev-cockpit mount: no mount candidates discovered. You can add custom mounts interactively below, or Ctrl-C to bail.\n"
|
|
93348
93415
|
);
|
|
93349
93416
|
}
|
|
93350
|
-
selected = await pickMounts(
|
|
93417
|
+
selected = await pickMounts(candidates, appliedKeys);
|
|
93351
93418
|
if (selected.length === 0) {
|
|
93352
93419
|
process.stdout.write("dev-cockpit mount: nothing selected; nothing to apply.\n");
|
|
93353
93420
|
return;
|
|
@@ -93576,7 +93643,7 @@ function hasCommand(program2, name) {
|
|
|
93576
93643
|
function buildCli(opts = {}) {
|
|
93577
93644
|
const program2 = new Command();
|
|
93578
93645
|
const profile = opts.profile;
|
|
93579
|
-
const appName = profile?.appName ?? "dev-cockpit";
|
|
93646
|
+
const appName = profile?.cliCommand ?? profile?.appName ?? "dev-cockpit";
|
|
93580
93647
|
program2.name(appName).description(profile ? `${appName} \u2014 built on dev-cockpit` : "Generic terminal UI dev cockpit").version(profile?.version ?? readPackageVersion(), "-V, --version", "Output the version number");
|
|
93581
93648
|
if (profile?.setupCli) {
|
|
93582
93649
|
profile.setupCli(program2);
|
|
@@ -93600,17 +93667,22 @@ function buildCli(opts = {}) {
|
|
|
93600
93667
|
if (!hasCommand(program2, "init-config")) {
|
|
93601
93668
|
program2.command("init-config").description("Write a starter cockpit.yaml in the current directory").option("-f, --force", "Overwrite an existing cockpit.yaml without prompting", false).option("--with-docker", "Include an uncommented docker block (static template only)", false).option(
|
|
93602
93669
|
"-i, --interactive",
|
|
93603
|
-
"
|
|
93670
|
+
"Force the interactive wizard (default on a TTY; this flag matters in scripts)",
|
|
93604
93671
|
false
|
|
93605
|
-
).option("
|
|
93672
|
+
).option("--static", "Write the static starter template without prompts", false).option(
|
|
93673
|
+
"-o, --output <path>",
|
|
93674
|
+
"Write the file to this path instead of <cwd>/cockpit.yaml. The file is NOT registered/linked to any workspace \u2014 run `link <path>` from the workspace afterwards"
|
|
93675
|
+
).action(
|
|
93606
93676
|
async (cmdOpts) => {
|
|
93677
|
+
const interactive = cmdOpts.static ? false : (cmdOpts.interactive ?? false) || Boolean(process.stdout.isTTY && process.stdin.isTTY);
|
|
93607
93678
|
await initConfigCommand({
|
|
93608
93679
|
force: cmdOpts.force ?? false,
|
|
93609
93680
|
withDocker: cmdOpts.withDocker ?? false,
|
|
93610
|
-
interactive
|
|
93681
|
+
interactive,
|
|
93611
93682
|
appName,
|
|
93612
93683
|
profile,
|
|
93613
|
-
output: cmdOpts.output
|
|
93684
|
+
output: cmdOpts.output,
|
|
93685
|
+
cliCommand: appName
|
|
93614
93686
|
});
|
|
93615
93687
|
}
|
|
93616
93688
|
);
|