@open-audio-stack/core 0.1.0 → 0.1.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/README.md +35 -2
- package/build/classes/Manager.d.ts +1 -1
- package/build/classes/Manager.js +2 -4
- package/build/classes/ManagerLocal.d.ts +1 -1
- package/build/classes/ManagerLocal.js +2 -2
- package/build/classes/Registry.d.ts +1 -1
- package/build/classes/RegistryLocal.d.ts +7 -0
- package/build/classes/RegistryLocal.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>
|
|
3
|
+
<img src="https://raw.githubusercontent.com/open-audio-stack/open-audio-stack-registry/refs/heads/main/src/assets/open-audio-stack-logo.svg" alt="Open Audio Stack Logo"><br />
|
|
4
|
+
Open Audio Stack
|
|
5
|
+
</h1>
|
|
6
|
+
<p>Audio registry specification and API with searchable list of packages</p>
|
|
7
|
+
<p>
|
|
8
|
+
<a href="https://github.com/open-audio-stack/open-audio-stack-core/wiki/Open-Audio-Stack-%E2%80%90-Registry-%E2%80%90-Specification-1.0.0">Registry Specification</a>
|
|
9
|
+
⦁︎
|
|
10
|
+
<a href="https://open-audio-stack.github.io/open-audio-stack-registry">Registry API</a>
|
|
11
|
+
⦁︎
|
|
12
|
+
<a href="https://github.com/orgs/open-audio-stack/projects">Roadmap</a>
|
|
13
|
+
</p>
|
|
14
|
+
<p>
|
|
2
15
|
|
|
3
16
|

|
|
4
17
|

|
|
18
|
+
<a href="https://discord.com/invite/9D94f98PxP" target="_blank"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Join the chat at Discord"></a>
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
# open-audio-stack-core
|
|
5
25
|
|
|
6
26
|
Common package shared across Open Audio Stack compatible registries, command-line tools, apps and websites for handling installing DAW VST plugin dependencies.
|
|
7
27
|
|
|
@@ -12,9 +32,10 @@ High-level classes enable use without writing business-logic:
|
|
|
12
32
|
- Config - Set and get common configuration types, formats, values, paths and urls.
|
|
13
33
|
- ConfigLocal - All the Config functionality including ability to load and save configuration to a json file.
|
|
14
34
|
- Manager - Search, filter and get packages from a registry.
|
|
15
|
-
- ManagerLocal -
|
|
35
|
+
- ManagerLocal - Scan directories for existing packages locally and install/uninstall packages.
|
|
16
36
|
- Package - Create a new package to add to a registry.
|
|
17
37
|
- Registry - Create an audio package registry with packages and files.
|
|
38
|
+
- RegistryLocal - Scan directories for existing packages locally.
|
|
18
39
|
|
|
19
40
|
Low-level methods/utilities for more custom/advanced implementations:
|
|
20
41
|
|
|
@@ -37,6 +58,18 @@ Import the package using:
|
|
|
37
58
|
|
|
38
59
|
Then use the available methods as normal.
|
|
39
60
|
|
|
61
|
+
## Badges
|
|
62
|
+
|
|
63
|
+
If your project utilizes the Open Stack Audio specification or API, we encourage linking back to this project using a badge:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
<a href="https://github.com/open-audio-stack" target="_blank"><img src="https://raw.githubusercontent.com/open-audio-stack/open-audio-stack-registry/refs/heads/main/src/assets/powered-by-open-audio-stack.svg" alt="Powered by Open Audio Stack"></a>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Example:
|
|
70
|
+
|
|
71
|
+
<a href="https://github.com/open-audio-stack" target="_blank"><img src="https://raw.githubusercontent.com/open-audio-stack/open-audio-stack-registry/refs/heads/main/src/assets/powered-by-open-audio-stack.svg" alt="Powered by Open Audio Stack"></a>
|
|
72
|
+
|
|
40
73
|
## Developer information
|
|
41
74
|
|
|
42
75
|
Open Audio Stack Core was built using:
|
|
@@ -9,7 +9,7 @@ export declare class Manager {
|
|
|
9
9
|
type: RegistryType;
|
|
10
10
|
constructor(type: RegistryType, config?: ConfigInterface);
|
|
11
11
|
addPackage(pkg: Package): void;
|
|
12
|
-
filter(
|
|
12
|
+
filter(method: (pkgVersion: PackageVersion, pkg: Package) => boolean): Package[];
|
|
13
13
|
getPackage(slug: string): Package | undefined;
|
|
14
14
|
listPackages(): Package[];
|
|
15
15
|
removePackage(slug: string): void;
|
package/build/classes/Manager.js
CHANGED
|
@@ -21,13 +21,11 @@ export class Manager {
|
|
|
21
21
|
this.packages.set(pkg.slug, pkg);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
filter(
|
|
24
|
+
filter(method) {
|
|
25
25
|
const results = [];
|
|
26
26
|
for (const [, pkg] of this.packages) {
|
|
27
27
|
const pkgVersion = pkg.getVersionLatest();
|
|
28
|
-
if (
|
|
29
|
-
continue;
|
|
30
|
-
if (pkgVersion[field] === query) {
|
|
28
|
+
if (pkgVersion && method(pkgVersion, pkg)) {
|
|
31
29
|
results.push(pkg);
|
|
32
30
|
}
|
|
33
31
|
}
|
|
@@ -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(): void;
|
|
8
|
+
scan(ext?: string): void;
|
|
9
9
|
install(slug: string, version?: string): Promise<void | PackageVersion>;
|
|
10
10
|
uninstall(slug: string, version?: string): Promise<void | PackageVersion>;
|
|
11
11
|
}
|
|
@@ -19,8 +19,8 @@ export class ManagerLocal extends Manager {
|
|
|
19
19
|
this.config = new ConfigLocal(configPath, config);
|
|
20
20
|
this.typeDir = this.config.get(`${type}Dir`);
|
|
21
21
|
}
|
|
22
|
-
scan() {
|
|
23
|
-
const filePaths = dirRead(`${this.typeDir}/**/index
|
|
22
|
+
scan(ext = 'json') {
|
|
23
|
+
const filePaths = dirRead(`${this.typeDir}/**/index.${ext}`);
|
|
24
24
|
filePaths.forEach((filePath) => {
|
|
25
25
|
const subPath = filePath.replace(`${this.typeDir}/`, '');
|
|
26
26
|
const pkgJson = fileReadJson(filePath);
|
|
@@ -4,7 +4,7 @@ export declare class Registry {
|
|
|
4
4
|
name: string;
|
|
5
5
|
url: string;
|
|
6
6
|
version: string;
|
|
7
|
-
|
|
7
|
+
protected managers: Record<string, Manager>;
|
|
8
8
|
constructor(name: string, url: string, version: string);
|
|
9
9
|
addManager(manager: Manager): void;
|
|
10
10
|
getManager(type: RegistryType): Manager;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ManagerLocal } from './ManagerLocal.js';
|
|
2
|
+
import { Registry } from './Registry.js';
|
|
3
|
+
export declare class RegistryLocal extends Registry {
|
|
4
|
+
protected managers: Record<string, ManagerLocal>;
|
|
5
|
+
constructor(name: string, url: string, version: string);
|
|
6
|
+
scan(ext?: string): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Registry } from './Registry.js';
|
|
2
|
+
export class RegistryLocal extends Registry {
|
|
3
|
+
managers;
|
|
4
|
+
constructor(name, url, version) {
|
|
5
|
+
super(name, url, version);
|
|
6
|
+
this.managers = {};
|
|
7
|
+
}
|
|
8
|
+
scan(ext = 'json') {
|
|
9
|
+
for (const [, manager] of Object.entries(this.managers)) {
|
|
10
|
+
manager.scan(ext);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|