{"id":21744747,"url":"https://github.com/nestarz/heritage","last_synced_at":"2025-04-13T05:12:14.203Z","repository":{"id":48944905,"uuid":"262901405","full_name":"nestarz/heritage","owner":"nestarz","description":"Tiny Package Manager for the Web","archived":false,"fork":false,"pushed_at":"2021-07-04T11:39:51.000Z","size":117,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T22:04:40.676Z","etag":null,"topics":["browser","cdn","es6","import-maps","package-manager","pika","snowpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nestarz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-11T00:28:13.000Z","updated_at":"2023-03-05T02:07:13.000Z","dependencies_parsed_at":"2022-09-01T08:11:50.317Z","dependency_job_id":null,"html_url":"https://github.com/nestarz/heritage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nestarz%2Fheritage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nestarz%2Fheritage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nestarz%2Fheritage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nestarz%2Fheritage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nestarz","download_url":"https://codeload.github.com/nestarz/heritage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665743,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","cdn","es6","import-maps","package-manager","pika","snowpack"],"created_at":"2024-11-26T07:12:26.150Z","updated_at":"2025-04-13T05:12:14.184Z","avatar_url":"https://github.com/nestarz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# heritage\nTiny Package Manager for the Web based on the [WICG/import-maps](https://github.com/WICG/import-maps) spec. No lock-in.\n\n- Depends only on **two** packages, `acorn` for AST parsing and  `node-fetch` to request packages.\n- Customize to any registry, CDN or filesystems... It's up to you\n- Default to Pika and Unpkg registries\n- Only retrive ES6 browser compatible assets and modules\n- TypeScript definition resolution can be achieve using yarn/npm\n- Easy-to-use\n\n## Use\n\n1. Install Heritage\n```bash\nyarn add -D @eliaspourquoi/heritage\n```\n\n2. Manage Dependencies, feels like Yarn...\n```bash\n# Add Dependencies\nheritage add three three/examples/jsm/loaders/GLTFLoader.js vue@3.0.0-beta.10 react react-dom es-module-shims\n\n# Remove Dependencies\nheritage remove vue\n\n# Install Dependencies\nheritage       \n```\n\n3. Add the generated `import-map.json` to your `index.html`.\n```html\n\u003cscript type=\"importmap\" src=\"web_modules/import-map.json\"\u003e\u003c/script\u003e\n```\n\n4. Optional. For now you may need to polyfill the [WICG/import-maps](https://github.com/WICG/import-maps) spec.\nHere a working example:\n```bash\nheritage add es-module-shims\n```\n```html\n\u003cscript defer src=\"web_modules/es-module-shims/0.4.6/es-module-shims.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"importmap-shim\" src=\"web_modules/import-map.json\"\u003e\u003c/script\u003e\n\u003cscript type=\"module-shim\"\u003e\n  import React from \"react\"; // If you have installed react for example...\n\u003c/script\u003e\n```\n\nThat's all.\n\n## Information\n\nHeritage use `package.json` to register required packages under the `webDependencies` field, exactly like Snowpack.\nThe `lock` file is the generated `import-map.json` used to manage imports by the browser. Default use of the the Pika CDN and fallback to Unpkg if target not found.\n\nTo have the command `heritage` available you need to have `yarn bin`or `npm bin` in your `PATH` like so:\n```\nexport PATH=$(yarn bin):$PATH\n```\nOtherwise you need to use this command `./node_modules/.bin/heritage` from the root of your package.\n\n\n## Custom Registry\nPlace a `heritage.config.js` at the root of your project using this API: \n\n```js\nmodule.exports = [{\n  registryName\u003cString\u003e,\n  entrypoint\u003cFunction\u003e: (name: String, target: String, version: String) =\u003e String,\n  resolveImport\u003cFunction\u003e: (importValue: String) =\u003e \u003cObject {\n    pkgName\u003cString\u003e,\n    pkgTarget\u003cString\u003e,\n    pkgVersion\u003cString\u003e,\n  }\u003e,\n  exists\u003cFunction\u003e: (name: String, target: String, version: String) =\u003e \u003cBoolean\u003e,\n  version\u003cFunction\u003e: (name: String, target: String, version: String) =\u003e \u003cString\u003e,\n  source\u003cFunction\u003e: (entrypoint: String) =\u003e \u003cString\u003e,\n },\n ...\n];\n```\nYou can see the Pika Registry Resolver here https://github.com/nestarz/heritage/blob/master/src/registries/pika.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnestarz%2Fheritage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnestarz%2Fheritage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnestarz%2Fheritage/lists"}