Skip to content

Commit

Permalink
Merge pull request #8 from open-audio-stack/feature/sha256
Browse files Browse the repository at this point in the history
Rename file hash field to sha256. Split out top-level packages by type
  • Loading branch information
kmturley authored Nov 18, 2024
2 parents ff7d239 + 8402606 commit 21f9b96
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if you miss or enter incorrect information, your package will not be included in
- lv2
- vst3
format: zip
hash: 42ad977d43d6caa75361cd2ad8794e36
sha256: 42ad977d43d6caa75361cd2ad8794e36
systems:
- type: linux
size: 94448096
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"vitest": "^2.1.4"
},
"dependencies": {
"@open-audio-stack/core": "^0.0.14",
"@open-audio-stack/core": "^0.0.15",
"chalk": "^5.3.0"
},
"repository": {
Expand Down
29 changes: 12 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import {
PackageValidationError,
PluginInterface,
Registry,
PluginType,
PresetType,
ProjectType,
RegistryType,
PackageValidationRec,
PresetInterface,
ProjectInterface,
Expand All @@ -23,7 +21,9 @@ import {
const config: Config = new Config();
const registry: Registry = new Registry({
name: 'Open Audio Registry',
packages: {},
plugins: {},
presets: {},
projects: {},
url: 'https://open-audio-stack.github.io/open-audio-stack-registry',
version: '1.0.0',
});
Expand All @@ -37,12 +37,7 @@ export function generateConfig(dirRoot: string, items: any) {
fileJsonCreate(`${dirRoot}/index.json`, items);
}

export function generateYaml(
pathIn: string,
pathOut: string,
pathType: string,
type: typeof PluginType | typeof PresetType | typeof ProjectType,
) {
export function generateYaml(pathIn: string, pathOut: string, pathType: string, type: RegistryType) {
const packagesByOrg: any = {};
const filePaths: string[] = dirRead(`${pathIn}/${pathType}/**/*.yaml`);
filePaths.forEach((filePath: string) => {
Expand All @@ -54,22 +49,22 @@ export function generateYaml(
const errors: PackageValidationError[] = packageValidate(pkgFile);
const recs: PackageValidationRec[] = packageRecommendations(pkgFile);
logReport(`${pkgSlug} | ${pkgVersion} | ${filePath}`, errors, recs);
registry.packageVersionAdd(pkgSlug, pkgVersion, pkgFile);
registry.packageVersionAdd(pkgSlug, type, pkgVersion, pkgFile);

dirCreate(`${pathOut}/${pathType}/${pkgSlug}/${pkgVersion}`);
fileJsonCreate(`${pathOut}/${pathType}/${pkgSlug}/${pkgVersion}/index.json`, pkgFile);
fileJsonCreate(`${pathOut}/${pathType}/${pkgSlug}/index.json`, registry.package(pkgSlug));
fileJsonCreate(`${pathOut}/${pathType}/${pkgSlug}/index.json`, registry.package(pkgSlug, type));

const pkgOrg: string = pkgSlug.split('/')[0];
if (!packagesByOrg[pkgOrg]) packagesByOrg[pkgOrg] = {};
packagesByOrg[pkgOrg][pkgSlug] = registry.package(pkgSlug);
packagesByOrg[pkgOrg][pkgSlug] = registry.package(pkgSlug, type);
});
for (const orgId in packagesByOrg) {
dirCreate(`${pathOut}/${pathType}/${orgId}`);
fileJsonCreate(`${pathOut}/${pathType}/${orgId}/index.json`, packagesByOrg[orgId]);
}
dirCreate(`${pathOut}/${pathType}`);
fileJsonCreate(`${pathOut}/${pathType}/index.json`, registry.packagesFilter(type));
fileJsonCreate(`${pathOut}/${pathType}/index.json`, registry.packages(type));
}

generateConfig('out/config/architectures', config.architectures());
Expand All @@ -84,8 +79,8 @@ generateConfig('out/config/project-formats', config.projectFormats());
generateConfig('out/config/project-types', config.projectTypes());
generateConfig('out/config/systems', config.systems());

generateYaml('src', 'out', 'plugins', PluginType);
generateYaml('src', 'out', 'presets', PresetType);
generateYaml('src', 'out', 'projects', ProjectType);
generateYaml('src', 'out', 'plugins', RegistryType.Plugins);
generateYaml('src', 'out', 'presets', RegistryType.Presets);
generateYaml('src', 'out', 'projects', RegistryType.Projects);

fileJsonCreate('out/index.json', registry.get());
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ files:
contains:
- sfz
format: zip
hash: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552
sha256: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552
systems:
- type: linux
size: 74508517
Expand All @@ -32,7 +32,7 @@ files:
contains:
- sfz
format: zip
hash: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552
sha256: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552
systems:
- type: mac
size: 74508517
Expand All @@ -46,7 +46,7 @@ files:
contains:
- sfz
format: zip
hash: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552
sha256: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552
systems:
- type: win
size: 74508517
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/sfztools/sfizz/1.2.3/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ files:
- lv2
- vst3
format: tar.gz
hash: 5f48937aa823260c1576350ee53c57bde3b4bea0971926f7de84335573d7d342
sha256: 5f48937aa823260c1576350ee53c57bde3b4bea0971926f7de84335573d7d342
systems:
- type: linux
size: 19102967
Expand All @@ -38,7 +38,7 @@ files:
- lv2
- vst3
format: tar.gz
hash: cd17468db1d870199d9687c5d573d1126e4f2e8f3e989f4efc095d6808d67f89
sha256: cd17468db1d870199d9687c5d573d1126e4f2e8f3e989f4efc095d6808d67f89
systems:
- type: mac
size: 1748833
Expand All @@ -50,7 +50,7 @@ files:
- dll
- vst3
format: zip
hash: b361453bc1588623344e8712db4580655ed688fe5c642148e7abf7d08ff70eee
sha256: b361453bc1588623344e8712db4580655ed688fe5c642148e7abf7d08ff70eee
systems:
- type: win
size: 3626650
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/surge-synthesizer/surge/1.3.1/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ files:
- lv2
- vst3
format: zip
hash: d10a757380cea4b404e8b38482c12fa12be55adfe3d03e9886fef51d0a7828a4
sha256: d10a757380cea4b404e8b38482c12fa12be55adfe3d03e9886fef51d0a7828a4
systems:
- type: linux
size: 94448096
Expand All @@ -32,7 +32,7 @@ files:
- component
- vst3
format: zip
hash: e2a7d5d040157539b0a4f12dfe797646ba14ebde6f01ce8d54d3ce2e553db552
sha256: e2a7d5d040157539b0a4f12dfe797646ba14ebde6f01ce8d54d3ce2e553db552
systems:
- type: mac
size: 180726292
Expand All @@ -45,7 +45,7 @@ files:
- clap
- vst3
format: zip
hash: 5f3ba38245c1762108963337aea3003b51dc9e20e094409d98a4f016a6f4e400
sha256: 5f3ba38245c1762108963337aea3003b51dc9e20e094409d98a4f016a6f4e400
systems:
- type: win
size: 48165645
Expand Down
2 changes: 1 addition & 1 deletion src/presets/jh/floating-rhodes/1.0.0/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ files:
contains:
- fxp
format: zip
hash: 111e43b5e603a3849e390961381880f509c835bd
sha256: 111e43b5e603a3849e390961381880f509c835bd
systems:
- type: linux
- type: mac
Expand Down
2 changes: 1 addition & 1 deletion src/projects/kmt/banwer/1.0.1/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ files:
contains:
- als
format: zip
hash: b9f6da7bc31d9b1cabad5a21c3210c31191fa052
sha256: b9f6da7bc31d9b1cabad5a21c3210c31191fa052
systems:
- type: linux
- type: mac
Expand Down

0 comments on commit 21f9b96

Please sign in to comment.