From 8402606cbfe3fb2d78bf39e7ac6ab82b3ad20a86 Mon Sep 17 00:00:00 2001 From: Kim T Date: Sun, 17 Nov 2024 20:49:12 -0800 Subject: [PATCH] Rename file hash field to sha256. Split out top-level packages by type --- README.md | 2 +- package-lock.json | 8 ++--- package.json | 2 +- src/index.ts | 29 ++++++++----------- .../splendidgrandpiano/1.0.0/index.yaml | 6 ++-- src/plugins/sfztools/sfizz/1.2.3/index.yaml | 6 ++-- .../surge-synthesizer/surge/1.3.1/index.yaml | 6 ++-- .../jh/floating-rhodes/1.0.0/index.yaml | 2 +- src/projects/kmt/banwer/1.0.1/index.yaml | 2 +- 9 files changed, 29 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index df9eb9f..0fac9ac 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package-lock.json b/package-lock.json index 6faecc8..a9673a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.2", "license": "cc0-1.0", "dependencies": { - "@open-audio-stack/core": "^0.0.14", + "@open-audio-stack/core": "^0.0.15", "chalk": "^5.3.0" }, "devDependencies": { @@ -817,9 +817,9 @@ } }, "node_modules/@open-audio-stack/core": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/@open-audio-stack/core/-/core-0.0.14.tgz", - "integrity": "sha512-gXrafJZL/yZNqV0VQuxfUZJS9Q3uKJyh7w3vrtA33a/256bVGNSivqDxDCZbianUFy4YTsaWmNBuPQi8qeJtDw==", + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/@open-audio-stack/core/-/core-0.0.15.tgz", + "integrity": "sha512-iNj6fWFymucQlD6o3mRdcLWYsJyPU/Ay/ta1C2+3aOCjqb+9rAsM9qaEzttoKPPbo4OQ9ryzshOWrKxDAROKOA==", "license": "cc0-1.0", "dependencies": { "adm-zip": "^0.5.16", diff --git a/package.json b/package.json index ba0f9d1..c4aa0ca 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/index.ts b/src/index.ts index a32c72e..3de4392 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,9 +12,7 @@ import { PackageValidationError, PluginInterface, Registry, - PluginType, - PresetType, - ProjectType, + RegistryType, PackageValidationRec, PresetInterface, ProjectInterface, @@ -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', }); @@ -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) => { @@ -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()); @@ -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()); diff --git a/src/plugins/sfzinstruments/splendidgrandpiano/1.0.0/index.yaml b/src/plugins/sfzinstruments/splendidgrandpiano/1.0.0/index.yaml index 030cc8f..34addd0 100644 --- a/src/plugins/sfzinstruments/splendidgrandpiano/1.0.0/index.yaml +++ b/src/plugins/sfzinstruments/splendidgrandpiano/1.0.0/index.yaml @@ -18,7 +18,7 @@ files: contains: - sfz format: zip - hash: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552 + sha256: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552 systems: - type: linux size: 74508517 @@ -32,7 +32,7 @@ files: contains: - sfz format: zip - hash: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552 + sha256: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552 systems: - type: mac size: 74508517 @@ -46,7 +46,7 @@ files: contains: - sfz format: zip - hash: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552 + sha256: a1ed29dcf5a66ce931a3945282b797253cc658cb0a7f76b00a60130731ec3552 systems: - type: win size: 74508517 diff --git a/src/plugins/sfztools/sfizz/1.2.3/index.yaml b/src/plugins/sfztools/sfizz/1.2.3/index.yaml index 97be633..4cd8c70 100644 --- a/src/plugins/sfztools/sfizz/1.2.3/index.yaml +++ b/src/plugins/sfztools/sfizz/1.2.3/index.yaml @@ -24,7 +24,7 @@ files: - lv2 - vst3 format: tar.gz - hash: 5f48937aa823260c1576350ee53c57bde3b4bea0971926f7de84335573d7d342 + sha256: 5f48937aa823260c1576350ee53c57bde3b4bea0971926f7de84335573d7d342 systems: - type: linux size: 19102967 @@ -38,7 +38,7 @@ files: - lv2 - vst3 format: tar.gz - hash: cd17468db1d870199d9687c5d573d1126e4f2e8f3e989f4efc095d6808d67f89 + sha256: cd17468db1d870199d9687c5d573d1126e4f2e8f3e989f4efc095d6808d67f89 systems: - type: mac size: 1748833 @@ -50,7 +50,7 @@ files: - dll - vst3 format: zip - hash: b361453bc1588623344e8712db4580655ed688fe5c642148e7abf7d08ff70eee + sha256: b361453bc1588623344e8712db4580655ed688fe5c642148e7abf7d08ff70eee systems: - type: win size: 3626650 diff --git a/src/plugins/surge-synthesizer/surge/1.3.1/index.yaml b/src/plugins/surge-synthesizer/surge/1.3.1/index.yaml index 642220b..de7a443 100644 --- a/src/plugins/surge-synthesizer/surge/1.3.1/index.yaml +++ b/src/plugins/surge-synthesizer/surge/1.3.1/index.yaml @@ -17,7 +17,7 @@ files: - lv2 - vst3 format: zip - hash: d10a757380cea4b404e8b38482c12fa12be55adfe3d03e9886fef51d0a7828a4 + sha256: d10a757380cea4b404e8b38482c12fa12be55adfe3d03e9886fef51d0a7828a4 systems: - type: linux size: 94448096 @@ -32,7 +32,7 @@ files: - component - vst3 format: zip - hash: e2a7d5d040157539b0a4f12dfe797646ba14ebde6f01ce8d54d3ce2e553db552 + sha256: e2a7d5d040157539b0a4f12dfe797646ba14ebde6f01ce8d54d3ce2e553db552 systems: - type: mac size: 180726292 @@ -45,7 +45,7 @@ files: - clap - vst3 format: zip - hash: 5f3ba38245c1762108963337aea3003b51dc9e20e094409d98a4f016a6f4e400 + sha256: 5f3ba38245c1762108963337aea3003b51dc9e20e094409d98a4f016a6f4e400 systems: - type: win size: 48165645 diff --git a/src/presets/jh/floating-rhodes/1.0.0/index.yaml b/src/presets/jh/floating-rhodes/1.0.0/index.yaml index 0ceaceb..a2d70cc 100644 --- a/src/presets/jh/floating-rhodes/1.0.0/index.yaml +++ b/src/presets/jh/floating-rhodes/1.0.0/index.yaml @@ -14,7 +14,7 @@ files: contains: - fxp format: zip - hash: 111e43b5e603a3849e390961381880f509c835bd + sha256: 111e43b5e603a3849e390961381880f509c835bd systems: - type: linux - type: mac diff --git a/src/projects/kmt/banwer/1.0.1/index.yaml b/src/projects/kmt/banwer/1.0.1/index.yaml index 1a1a2f7..c1415e8 100644 --- a/src/projects/kmt/banwer/1.0.1/index.yaml +++ b/src/projects/kmt/banwer/1.0.1/index.yaml @@ -14,7 +14,7 @@ files: contains: - als format: zip - hash: b9f6da7bc31d9b1cabad5a21c3210c31191fa052 + sha256: b9f6da7bc31d9b1cabad5a21c3210c31191fa052 systems: - type: linux - type: mac