{"_id":"@allfeat/music-genres","_rev":"4-63afc3939f13fee1bfec46182ce36426","name":"@allfeat/music-genres","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@allfeat/music-genres","version":"1.0.0","keywords":[],"author":{"name":"Allfeat labs."},"license":"GPL-3.0-or-later","_id":"@allfeat/music-genres@1.0.0","maintainers":[{"name":"sailor_snow","email":"snxwin@pm.me"}],"dist":{"shasum":"cb44807c4f67cbb1b22a52ccd04548e2ff3ed349","tarball":"https://registry.npmjs.org/@allfeat/music-genres/-/music-genres-1.0.0.tgz","fileCount":9,"integrity":"sha512-Kx3WmEQhMt1RA6j12epKENctoCD1x/qVThEvJCC+SC+XZlo0hS7Efs6yKa/xsd7tIULtIqQHFO1hNRM+4ykF2Q==","signatures":[{"sig":"MEUCIQD8ix3Dl0rfIXrGApsX5G76ZTGPRCQvbdCFI5NW+OrLswIgS6+QL1fEYV5iQwWo1oEUMo5wK6Xkb1F30XrLnfajdo8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27596},"main":"src/index.js","_from":"file:allfeat-music-genres-1.0.0.tgz","scripts":{"format":"prettier --write .","release":"changeset publish","version":"changeset version && pnpm install","generate":"tsx scripts/generate.ts","check-format":"prettier --check ."},"_npmUser":{"name":"sailor_snow","email":"snxwin@pm.me"},"_resolved":"/tmp/905b2d0f6853d7e16e1aa97899a3e1ba/allfeat-music-genres-1.0.0.tgz","_integrity":"sha512-Kx3WmEQhMt1RA6j12epKENctoCD1x/qVThEvJCC+SC+XZlo0hS7Efs6yKa/xsd7tIULtIqQHFO1hNRM+4ykF2Q==","_npmVersion":"10.9.2","description":"> Unified music genres and subgenres for Allfeat frontends and the Substrate-based Allfeat blockchain.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.2","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^24.0.1","@allfeat/midds":"^0.2.0","@changesets/cli":"^2.29.4","@allfeat/chaintypes":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/music-genres_1.0.0_1749772278170_0.281386488675303","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@allfeat/music-genres","version":"1.0.1","keywords":[],"author":{"name":"Allfeat labs."},"license":"GPL-3.0-or-later","_id":"@allfeat/music-genres@1.0.1","maintainers":[{"name":"sailor_snow","email":"snxwin@pm.me"}],"dist":{"shasum":"1f39a8d5827b035243f9c8e4324f410ccc680092","tarball":"https://registry.npmjs.org/@allfeat/music-genres/-/music-genres-1.0.1.tgz","fileCount":10,"integrity":"sha512-yhutuaL2Kuw++eqVmo2f+0edl5GeupqS1KbSizORnfx2SrBWaz3Gh+m2EBTHg0+LH53RHWgBF0tqrwaKn20+JQ==","signatures":[{"sig":"MEUCIQCpSGKuXdgEdCzQReNSQ8V+QSrF5JWjbtBEFpRT8VJxngIgGVxLfjxcfhOZNnLvvHoDrc1gDQrFHEjD7TqQiyQV83E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27960},"main":"src/index.js","_from":"file:allfeat-music-genres-1.0.1.tgz","scripts":{"format":"prettier --write .","release":"changeset publish","version":"changeset version && pnpm install","generate":"tsx scripts/generate.ts","check-format":"prettier --check ."},"_npmUser":{"name":"sailor_snow","email":"snxwin@pm.me"},"_resolved":"/tmp/ff4b0c9fb51a718a2ac1ac5289520687/allfeat-music-genres-1.0.1.tgz","_integrity":"sha512-yhutuaL2Kuw++eqVmo2f+0edl5GeupqS1KbSizORnfx2SrBWaz3Gh+m2EBTHg0+LH53RHWgBF0tqrwaKn20+JQ==","_npmVersion":"10.9.2","description":"> Unified music genres and subgenres for Allfeat frontends and the Substrate-based Allfeat blockchain.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.2","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^24.0.1","@allfeat/midds":"^0.2.0","@changesets/cli":"^2.29.4","@allfeat/chaintypes":"0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/music-genres_1.0.1_1749814686897_0.07155418202320574","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@allfeat/music-genres","version":"1.0.2","keywords":[],"author":{"name":"Allfeat labs."},"license":"GPL-3.0-or-later","_id":"@allfeat/music-genres@1.0.2","maintainers":[{"name":"sailor_snow","email":"snxwin@pm.me"}],"dist":{"shasum":"7a1a83e04529f08b1363b53bae2f71332c90d1ef","tarball":"https://registry.npmjs.org/@allfeat/music-genres/-/music-genres-1.0.2.tgz","fileCount":11,"integrity":"sha512-UB07+f655E6s6buBfD24O1+rLV26xVpiMIAuoFs3Dc7nE1gXaldxJY95xYQ47U/U+XgZnm4VOdyVUxl6lrattg==","signatures":[{"sig":"MEQCIFy31N8I/974u3nFPKVHSQjt60JNGjEqSeyPAtG3rQPFAiBRin3RASeizdEG7tpZfHbteEEpZwm9cO/R3PVs3BTQyg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28005},"main":"src/index.js","_from":"file:allfeat-music-genres-1.0.2.tgz","scripts":{"format":"prettier --write .","release":"changeset publish","version":"changeset version && pnpm install","generate":"tsx scripts/generate.ts","check-format":"prettier --check ."},"_npmUser":{"name":"sailor_snow","actor":{"name":"sailor_snow","type":"user","email":"snxwin@pm.me"},"email":"snxwin@pm.me"},"_resolved":"/tmp/b41d1a90d69688556f79776da315e8c4/allfeat-music-genres-1.0.2.tgz","_integrity":"sha512-UB07+f655E6s6buBfD24O1+rLV26xVpiMIAuoFs3Dc7nE1gXaldxJY95xYQ47U/U+XgZnm4VOdyVUxl6lrattg==","_npmVersion":"10.9.2","description":"> Unified music genres and subgenres for Allfeat frontends and the Substrate-based Allfeat blockchain.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.2","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^24.0.1","@allfeat/midds":"^0.5.1","@changesets/cli":"^2.29.4","@allfeat/chaintypes":"0.6.1"},"_npmOperationalInternal":{"tmp":"tmp/music-genres_1.0.2_1750428669171_0.3880276705436516","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@allfeat/music-genres","version":"1.0.3","description":"> Unified music genres and subgenres for Allfeat frontends and the Substrate-based Allfeat blockchain.","main":"dist/index.js","types":"dist/index.d.ts","keywords":[],"author":{"name":"Allfeat labs."},"license":"GPL-3.0-or-later","devDependencies":{"@allfeat/chaintypes":"0.6.1","@allfeat/midds":"^0.5.2","@changesets/cli":"^2.29.5","@types/node":"^24.0.4","prettier":"^3.6.0","tsx":"^4.20.3","typescript":"^5.8.3"},"scripts":{"format":"prettier --write .","build":"tsc","check-format":"prettier --check .","generate":"tsx scripts/generate.ts","version":"changeset version && pnpm install","release":"pnpm run build && changeset publish"},"_id":"@allfeat/music-genres@1.0.3","_integrity":"sha512-cLxHubq7DhheKaP/FmoczV2fzYllyIC3ziOHoHJHZ8iMesZ16WXIsGUwDI+vJVIMLM34IyRf04OkZyfnudlagA==","_resolved":"/tmp/9b42625686c1d16d3eae785418397cc3/allfeat-music-genres-1.0.3.tgz","_from":"file:allfeat-music-genres-1.0.3.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-cLxHubq7DhheKaP/FmoczV2fzYllyIC3ziOHoHJHZ8iMesZ16WXIsGUwDI+vJVIMLM34IyRf04OkZyfnudlagA==","shasum":"f4f80264e8e9e063fad761111ea49c96517f8e22","tarball":"https://registry.npmjs.org/@allfeat/music-genres/-/music-genres-1.0.3.tgz","fileCount":14,"unpackedSize":52653,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCjWbn2/kGI3pJzmuJGbL25KduUb4AABCIRMTCJiX0xgAIhAIAOXWjnQGUmDxlbNgaFRz5gVq0i/FJiEgXKJGP+O6XD"}]},"_npmUser":{"name":"sailor_snow","email":"snxwin@pm.me","actor":{"name":"sailor_snow","email":"snxwin@pm.me","type":"user"}},"directories":{},"maintainers":[{"name":"sailor_snow","email":"snxwin@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/music-genres_1.0.3_1750799386209_0.6254443392478888"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-12T23:51:18.069Z","modified":"2025-06-24T21:09:46.595Z","1.0.0":"2025-06-12T23:51:18.358Z","1.0.1":"2025-06-13T11:38:07.084Z","1.0.2":"2025-06-20T14:11:09.348Z","1.0.3":"2025-06-24T21:09:46.394Z"},"author":{"name":"Allfeat labs."},"license":"GPL-3.0-or-later","keywords":[],"description":"> Unified music genres and subgenres for Allfeat frontends and the Substrate-based Allfeat blockchain.","maintainers":[{"name":"sailor_snow","email":"snxwin@pm.me"}],"readme":"# @allfeat/music-genres\n\n> Unified music genres and subgenres for Allfeat frontends and the Substrate-based Allfeat blockchain.\n\nThis package provides a flat, auto-generated list of music genres and subgenres, each mapped to a valid enum value used on-chain (`AllfeatMusicGenresGeneratedGenreId`). It ensures consistency between frontend applications and blockchain logic, while exposing useful helper functions for selection and validation.\n\n---\n\n## ✨ Features\n\n- Flat list of genres and subgenres\n- `genre` vs `subgenre` distinction via `type`\n- Each entry maps to on-chain enum using `.toNativeType()`\n- Lookup helpers for validation and name resolution\n- Pure TypeScript structure usable in any frontend\n\n---\n\n## 📅 Installation\n\n```bash\npnpm add @allfeat/music-genres\n```\n\n---\n\n## 📖 Usage\n\n```ts\nimport {\n  allGenresUnified,\n  getGenres,\n  getSubgenresOf,\n  isValidGenreId,\n  getGenreName,\n} from \"@allfeat/music-genres\";\n\nconst genres = getGenres();\nconst subgenresOfPop = getSubgenresOf(\"pop\");\n\nif (isValidGenreId(\"trap\")) {\n  const display = getGenreName(\"trap\"); // \"Trap\"\n}\n```\n\n---\n\n## 🔎 UnifiedGenreEntry\n\n```ts\ninterface UnifiedGenreEntry {\n  id: string; // snake_case ID from genres.json\n  name: string; // Human-readable name\n  type: \"genre\" | \"subgenre\"; // Classification\n  parentId?: string; // Present only for subgenres\n  toNativeType(): GenreEnum; // Converts to on-chain enum\n}\n```\n\n---\n\n## ⚙️ Generation\n\nThis package is generated from a shared `../genres.json` file using a `generate.ts` script.\n\n```bash\npnpm run generate\n```\n\nThis ensures that genres remain synchronized between your frontends and the Substrate runtime definitions.\n\n---\n\n## 👷 Scripts\n\n```bash\npnpm run generate     # Regenerate the output from genres.json\npnpm run format       # Format with Prettier\n```\n","readmeFilename":"README.md"}