@karmaniverous/jeeves-watcher 0.16.0 → 0.16.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/cli/jeeves-watcher/index.js +17 -2
- package/dist/index.js +15 -2
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { postJson, fetchJson, createServiceCli } from '@karmaniverous/jeeves';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
4
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { packageDirectorySync } from 'package-directory';
|
|
5
7
|
import { z } from 'zod';
|
|
6
8
|
import { jsonMapMapSchema } from '@karmaniverous/jsonmap';
|
|
7
9
|
|
|
@@ -791,8 +793,21 @@ const jeevesWatcherConfigSchema = z.object({
|
|
|
791
793
|
* Jeeves Component Descriptor for the watcher service. Single source of truth
|
|
792
794
|
* consumed by core factories (CLI, plugin tools, HTTP handlers, service manager).
|
|
793
795
|
*/
|
|
796
|
+
/**
|
|
797
|
+
* Resolve the package root directory using `package-directory`.
|
|
798
|
+
*
|
|
799
|
+
* @remarks
|
|
800
|
+
* Works in both dev (`src/descriptor.ts`) and bundled
|
|
801
|
+
* (`dist/cli/jeeves-watcher/index.js`) contexts because
|
|
802
|
+
* `packageDirectorySync` walks upward to find `package.json`.
|
|
803
|
+
*/
|
|
804
|
+
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
805
|
+
const packageRoot = packageDirectorySync({ cwd: thisDir });
|
|
806
|
+
if (!packageRoot) {
|
|
807
|
+
throw new Error('Could not find package root from ' + thisDir);
|
|
808
|
+
}
|
|
794
809
|
const require$1 = createRequire(import.meta.url);
|
|
795
|
-
const { version } = require$1('
|
|
810
|
+
const { version } = require$1(resolve(packageRoot, 'package.json'));
|
|
796
811
|
/**
|
|
797
812
|
* Watcher component descriptor. Single source of truth for service identity,
|
|
798
813
|
* config schema, and extension points consumed by core factories.
|
|
@@ -823,7 +838,7 @@ const watcherDescriptor = {
|
|
|
823
838
|
},
|
|
824
839
|
startCommand: (configPath) => [
|
|
825
840
|
'node',
|
|
826
|
-
|
|
841
|
+
resolve(packageRoot, 'dist/cli/jeeves-watcher/index.js'),
|
|
827
842
|
'start',
|
|
828
843
|
'-c',
|
|
829
844
|
configPath,
|
package/dist/index.js
CHANGED
|
@@ -8151,8 +8151,21 @@ function formatHelperSection(title, data) {
|
|
|
8151
8151
|
* Jeeves Component Descriptor for the watcher service. Single source of truth
|
|
8152
8152
|
* consumed by core factories (CLI, plugin tools, HTTP handlers, service manager).
|
|
8153
8153
|
*/
|
|
8154
|
+
/**
|
|
8155
|
+
* Resolve the package root directory using `package-directory`.
|
|
8156
|
+
*
|
|
8157
|
+
* @remarks
|
|
8158
|
+
* Works in both dev (`src/descriptor.ts`) and bundled
|
|
8159
|
+
* (`dist/cli/jeeves-watcher/index.js`) contexts because
|
|
8160
|
+
* `packageDirectorySync` walks upward to find `package.json`.
|
|
8161
|
+
*/
|
|
8162
|
+
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
8163
|
+
const packageRoot = packageDirectorySync({ cwd: thisDir });
|
|
8164
|
+
if (!packageRoot) {
|
|
8165
|
+
throw new Error('Could not find package root from ' + thisDir);
|
|
8166
|
+
}
|
|
8154
8167
|
const require$1 = createRequire(import.meta.url);
|
|
8155
|
-
const { version } = require$1('
|
|
8168
|
+
const { version } = require$1(resolve(packageRoot, 'package.json'));
|
|
8156
8169
|
/**
|
|
8157
8170
|
* Watcher component descriptor. Single source of truth for service identity,
|
|
8158
8171
|
* config schema, and extension points consumed by core factories.
|
|
@@ -8183,7 +8196,7 @@ const watcherDescriptor = {
|
|
|
8183
8196
|
},
|
|
8184
8197
|
startCommand: (configPath) => [
|
|
8185
8198
|
'node',
|
|
8186
|
-
|
|
8199
|
+
resolve(packageRoot, 'dist/cli/jeeves-watcher/index.js'),
|
|
8187
8200
|
'start',
|
|
8188
8201
|
'-c',
|
|
8189
8202
|
configPath,
|
package/package.json
CHANGED