codify-plugin-lib 1.0.182-beta33 → 1.0.182-beta34

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.
@@ -5,9 +5,10 @@ import { getPty } from '../pty/index.js';
5
5
  import { SequentialPty } from '../pty/seqeuntial-pty.js';
6
6
  import { ResourceController } from '../resource/resource-controller.js';
7
7
  import { listAllResources } from '../utils/load-resources.js';
8
- import { readNearestPackageJson } from '../utils/package-json-utils.js';
8
+ import { findNearestPackageJson, readNearestPackageJson } from '../utils/package-json-utils.js';
9
9
  import { ptyLocalStorage } from '../utils/pty-local-storage.js';
10
10
  import { VerbosityLevel } from '../utils/verbosity-level.js';
11
+ import path from 'node:path';
11
12
  export class Plugin {
12
13
  name;
13
14
  version;
@@ -26,6 +27,7 @@ export class Plugin {
26
27
  throw new Error('Failed to read nearest package.json');
27
28
  }
28
29
  const { name, version } = packageJson;
30
+ const root = path.dirname(findNearestPackageJson());
29
31
  const resourceLocations = await listAllResources();
30
32
  const resources = await Promise.all(resourceLocations.map((l) => {
31
33
  return import(l);
@@ -1 +1 @@
1
- export declare const listAllResources: () => Promise<string[]>;
1
+ export declare const listAllResources: (root?: string) => Promise<string[]>;
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
- export const listAllResources = async () => {
3
+ export const listAllResources = async (root = process.cwd()) => {
4
+ console.log('Root', root);
4
5
  const resourceDir = await fs.readdir('./resources');
5
6
  const dedupSet = new Set();
6
7
  const result = new Set();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.182-beta33",
3
+ "version": "1.0.182-beta34",
4
4
  "description": "Library plugin library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -24,9 +24,10 @@ import { getPty } from '../pty/index.js';
24
24
  import { SequentialPty } from '../pty/seqeuntial-pty.js';
25
25
  import { ResourceController } from '../resource/resource-controller.js';
26
26
  import { listAllResources } from '../utils/load-resources.js';
27
- import { readNearestPackageJson } from '../utils/package-json-utils.js';
27
+ import { findNearestPackageJson, readNearestPackageJson } from '../utils/package-json-utils.js';
28
28
  import { ptyLocalStorage } from '../utils/pty-local-storage.js';
29
29
  import { VerbosityLevel } from '../utils/verbosity-level.js';
30
+ import path from 'node:path';
30
31
 
31
32
  export class Plugin {
32
33
  planStorage: Map<string, Plan<any>>;
@@ -48,6 +49,7 @@ export class Plugin {
48
49
 
49
50
  const { name, version } = packageJson;
50
51
 
52
+ const root = path.dirname(findNearestPackageJson()!);
51
53
  const resourceLocations = await listAllResources();
52
54
  const resources = await Promise.all(resourceLocations.map((l) => {
53
55
  return import(l);
@@ -1,7 +1,9 @@
1
1
  import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
 
4
- export const listAllResources = async () => {
4
+ export const listAllResources = async (root = process.cwd()) => {
5
+ console.log('Root', root);
6
+
5
7
  const resourceDir = await fs.readdir('./resources');
6
8
  const dedupSet = new Set();
7
9
  const result = new Set<string>();