@karmaniverous/jeeves 0.4.5 → 0.4.6
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/cli/jeeves/index.js +2 -2
- package/dist/cli/plugin/index.js +2 -2
- package/dist/cli/service/index.js +40 -1
- package/dist/index.js +18 -2
- package/package.json +1 -1
package/dist/cli/jeeves/index.js
CHANGED
|
@@ -261,14 +261,14 @@ const PLATFORM_COMPONENTS = [
|
|
|
261
261
|
* Core library version, inlined at build time.
|
|
262
262
|
*
|
|
263
263
|
* @remarks
|
|
264
|
-
* The `0.4.
|
|
264
|
+
* The `0.4.5` placeholder is replaced by
|
|
265
265
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
266
266
|
* from `package.json`. This ensures the correct version survives
|
|
267
267
|
* when consumers bundle core into their own dist (where runtime
|
|
268
268
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
269
269
|
*/
|
|
270
270
|
/** The core library version from package.json (inlined at build time). */
|
|
271
|
-
const CORE_VERSION = '0.4.
|
|
271
|
+
const CORE_VERSION = '0.4.5';
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
274
|
* Dynamic discovery of installed Jeeves component CLIs.
|
package/dist/cli/plugin/index.js
CHANGED
|
@@ -119,14 +119,14 @@ const COMPONENT_VERSIONS_FILE = 'component-versions.json';
|
|
|
119
119
|
* Core library version, inlined at build time.
|
|
120
120
|
*
|
|
121
121
|
* @remarks
|
|
122
|
-
* The `0.4.
|
|
122
|
+
* The `0.4.5` placeholder is replaced by
|
|
123
123
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
124
124
|
* from `package.json`. This ensures the correct version survives
|
|
125
125
|
* when consumers bundle core into their own dist (where runtime
|
|
126
126
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
127
127
|
*/
|
|
128
128
|
/** The core library version from package.json (inlined at build time). */
|
|
129
|
-
const CORE_VERSION = '0.4.
|
|
129
|
+
const CORE_VERSION = '0.4.5';
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Shared file I/O helpers for managed section operations.
|
|
@@ -232,6 +232,14 @@ function getEffectiveServiceName(descriptor) {
|
|
|
232
232
|
return descriptor.serviceName ?? `jeeves-${descriptor.name}`;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Directory and file path conventions for the Jeeves platform.
|
|
237
|
+
*/
|
|
238
|
+
/** Core config directory name within the config root. */
|
|
239
|
+
const CORE_CONFIG_DIR = 'jeeves-core';
|
|
240
|
+
/** Prefix for component config directories: `jeeves-{name}`. */
|
|
241
|
+
const COMPONENT_CONFIG_PREFIX = 'jeeves-';
|
|
242
|
+
|
|
235
243
|
/**
|
|
236
244
|
* Workspace and config root initialization.
|
|
237
245
|
*
|
|
@@ -242,6 +250,19 @@ function getEffectiveServiceName(descriptor) {
|
|
|
242
250
|
* - `{configRoot}/jeeves-core/` for core config
|
|
243
251
|
* - `{configRoot}/jeeves-{name}/` for each component
|
|
244
252
|
*/
|
|
253
|
+
let state;
|
|
254
|
+
/**
|
|
255
|
+
* Initialize the core library with workspace and config root paths.
|
|
256
|
+
*
|
|
257
|
+
* @param options - Workspace and config root paths.
|
|
258
|
+
*/
|
|
259
|
+
function init(options) {
|
|
260
|
+
state = {
|
|
261
|
+
workspacePath: options.workspacePath,
|
|
262
|
+
configRoot: options.configRoot,
|
|
263
|
+
coreConfigDir: join(options.configRoot, CORE_CONFIG_DIR),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
245
266
|
/**
|
|
246
267
|
* Derive the component config directory from the component name.
|
|
247
268
|
*
|
|
@@ -250,7 +271,9 @@ function getEffectiveServiceName(descriptor) {
|
|
|
250
271
|
* @throws Error if `init()` has not been called.
|
|
251
272
|
*/
|
|
252
273
|
function getComponentConfigDir(componentName) {
|
|
253
|
-
|
|
274
|
+
if (!state)
|
|
275
|
+
throw new Error('jeeves-core: init() must be called first');
|
|
276
|
+
return join(state.configRoot, `${COMPONENT_CONFIG_PREFIX}${componentName}`);
|
|
254
277
|
}
|
|
255
278
|
|
|
256
279
|
/**
|
|
@@ -673,6 +696,19 @@ function createServiceManager(descriptor) {
|
|
|
673
696
|
}
|
|
674
697
|
}
|
|
675
698
|
|
|
699
|
+
/**
|
|
700
|
+
* Shared CLI defaults and option registration for Jeeves CLI commands.
|
|
701
|
+
*
|
|
702
|
+
* @remarks
|
|
703
|
+
* All three CLI commands (install, uninstall, status) share the same
|
|
704
|
+
* `--workspace` and `--config-root` options with the same defaults.
|
|
705
|
+
* This module centralizes them to eliminate duplication.
|
|
706
|
+
*/
|
|
707
|
+
/** Default workspace path (current directory). */
|
|
708
|
+
const DEFAULT_WORKSPACE = '.';
|
|
709
|
+
/** Default config root path. */
|
|
710
|
+
const DEFAULT_CONFIG_ROOT = './config';
|
|
711
|
+
|
|
676
712
|
/**
|
|
677
713
|
* Factory for the standard Jeeves service CLI.
|
|
678
714
|
*
|
|
@@ -715,7 +751,10 @@ function createServiceCli(descriptor) {
|
|
|
715
751
|
.command('start')
|
|
716
752
|
.description('Launch the service process (foreground)')
|
|
717
753
|
.requiredOption('-c, --config <path>', 'Config file path')
|
|
754
|
+
.option('-w, --workspace <path>', 'Workspace root path', DEFAULT_WORKSPACE)
|
|
755
|
+
.option('--config-root <path>', 'Platform config root path', DEFAULT_CONFIG_ROOT)
|
|
718
756
|
.action(async (opts) => {
|
|
757
|
+
init({ workspacePath: opts.workspace, configRoot: opts.configRoot });
|
|
719
758
|
await descriptor.run(opts.config);
|
|
720
759
|
});
|
|
721
760
|
// --- status ---
|
package/dist/index.js
CHANGED
|
@@ -176,14 +176,14 @@ const PLATFORM_COMPONENTS = [
|
|
|
176
176
|
* Core library version, inlined at build time.
|
|
177
177
|
*
|
|
178
178
|
* @remarks
|
|
179
|
-
* The `0.4.
|
|
179
|
+
* The `0.4.5` placeholder is replaced by
|
|
180
180
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
181
181
|
* from `package.json`. This ensures the correct version survives
|
|
182
182
|
* when consumers bundle core into their own dist (where runtime
|
|
183
183
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
184
184
|
*/
|
|
185
185
|
/** The core library version from package.json (inlined at build time). */
|
|
186
|
-
const CORE_VERSION = '0.4.
|
|
186
|
+
const CORE_VERSION = '0.4.5';
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
189
|
* Workspace and config root initialization.
|
|
@@ -2016,6 +2016,19 @@ function createServiceManager(descriptor) {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
}
|
|
2018
2018
|
|
|
2019
|
+
/**
|
|
2020
|
+
* Shared CLI defaults and option registration for Jeeves CLI commands.
|
|
2021
|
+
*
|
|
2022
|
+
* @remarks
|
|
2023
|
+
* All three CLI commands (install, uninstall, status) share the same
|
|
2024
|
+
* `--workspace` and `--config-root` options with the same defaults.
|
|
2025
|
+
* This module centralizes them to eliminate duplication.
|
|
2026
|
+
*/
|
|
2027
|
+
/** Default workspace path (current directory). */
|
|
2028
|
+
const DEFAULT_WORKSPACE = '.';
|
|
2029
|
+
/** Default config root path. */
|
|
2030
|
+
const DEFAULT_CONFIG_ROOT = './config';
|
|
2031
|
+
|
|
2019
2032
|
/**
|
|
2020
2033
|
* Factory for the standard Jeeves service CLI.
|
|
2021
2034
|
*
|
|
@@ -2058,7 +2071,10 @@ function createServiceCli(descriptor) {
|
|
|
2058
2071
|
.command('start')
|
|
2059
2072
|
.description('Launch the service process (foreground)')
|
|
2060
2073
|
.requiredOption('-c, --config <path>', 'Config file path')
|
|
2074
|
+
.option('-w, --workspace <path>', 'Workspace root path', DEFAULT_WORKSPACE)
|
|
2075
|
+
.option('--config-root <path>', 'Platform config root path', DEFAULT_CONFIG_ROOT)
|
|
2061
2076
|
.action(async (opts) => {
|
|
2077
|
+
init({ workspacePath: opts.workspace, configRoot: opts.configRoot });
|
|
2062
2078
|
await descriptor.run(opts.config);
|
|
2063
2079
|
});
|
|
2064
2080
|
// --- status ---
|
package/package.json
CHANGED