@open-audio-stack/core 0.1.9 → 0.1.10

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,7 +5,7 @@ import { ConfigInterface } from '../types/Config.js';
5
5
  export declare class ManagerLocal extends Manager {
6
6
  protected typeDir: string;
7
7
  constructor(type: RegistryType, config: ConfigInterface);
8
- scan(ext?: string): void;
8
+ scan(ext?: string, installable?: boolean): void;
9
9
  export(dir: string, ext?: string): boolean;
10
10
  install(slug: string, version?: string): Promise<void | PackageVersion>;
11
11
  uninstall(slug: string, version?: string): Promise<void | PackageVersion>;
@@ -21,12 +21,13 @@ export class ManagerLocal extends Manager {
21
21
  this.config = new ConfigLocal(configPath, config);
22
22
  this.typeDir = this.config.get(`${type}Dir`);
23
23
  }
24
- scan(ext = 'json') {
24
+ scan(ext = 'json', installable = true) {
25
25
  const filePaths = dirRead(`${this.typeDir}/**/index.${ext}`);
26
26
  filePaths.forEach((filePath) => {
27
27
  const subPath = filePath.replace(`${this.typeDir}/`, '');
28
28
  const pkgJson = ext === 'yaml' ? fileReadYaml(filePath) : fileReadJson(filePath);
29
- pkgJson.installed = true;
29
+ if (installable)
30
+ pkgJson.installed = true;
30
31
  const pkg = new Package(pathGetSlug(subPath));
31
32
  const version = pathGetVersion(subPath);
32
33
  pkg.addVersion(version, pkgJson);
@@ -4,5 +4,5 @@ export declare class RegistryLocal extends Registry {
4
4
  protected managers: Record<string, ManagerLocal>;
5
5
  constructor(name: string, url: string, version: string);
6
6
  export(dir: string, ext?: string): boolean;
7
- scan(ext?: string): void;
7
+ scan(ext?: string, installable?: boolean): void;
8
8
  }
@@ -16,9 +16,9 @@ export class RegistryLocal extends Registry {
16
16
  saveFile(path.join(dir, `index.${ext}`), this.toJSON());
17
17
  return true;
18
18
  }
19
- scan(ext = 'json') {
19
+ scan(ext = 'json', installable = true) {
20
20
  for (const [, manager] of Object.entries(this.managers)) {
21
- manager.scan(ext);
21
+ manager.scan(ext, installable);
22
22
  }
23
23
  }
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-audio-stack/core",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Open-source audio plugin management software",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -14,6 +14,7 @@
14
14
  ],
15
15
  "scripts": {
16
16
  "build": "tsc -p tsconfig.json",
17
+ "check": "npm run format && npm run lint && npm run build",
17
18
  "dev": "tsx ./src/index.ts",
18
19
  "format": "prettier . --write",
19
20
  "lint": "eslint .",