{"id":13394085,"url":"https://github.com/ramasilveyra/gitpkg","last_synced_at":"2025-04-04T18:10:34.242Z","repository":{"id":22163641,"uuid":"95237988","full_name":"ramasilveyra/gitpkg","owner":"ramasilveyra","description":"Publish packages as git tags","archived":false,"fork":false,"pushed_at":"2023-01-08T20:20:22.000Z","size":789,"stargazers_count":275,"open_issues_count":14,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T05:03:13.313Z","etag":null,"topics":["git","gitpkg","modules","package","private"],"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/ramasilveyra.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-23T16:37:21.000Z","updated_at":"2024-12-26T07:52:07.000Z","dependencies_parsed_at":"2023-01-11T21:30:34.858Z","dependency_job_id":null,"html_url":"https://github.com/ramasilveyra/gitpkg","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramasilveyra%2Fgitpkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramasilveyra%2Fgitpkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramasilveyra%2Fgitpkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramasilveyra%2Fgitpkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramasilveyra","download_url":"https://codeload.github.com/ramasilveyra/gitpkg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"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":["git","gitpkg","modules","package","private"],"created_at":"2024-07-30T17:01:08.456Z","updated_at":"2025-04-04T18:10:34.218Z","avatar_url":"https://github.com/ramasilveyra.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/ramasilveyra/gitpkg?branch=master\"\u003e\n    \u003cimg src=\"https://travis-ci.org/ramasilveyra/gitpkg.svg?branch=master\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/github/ramasilveyra/gitpkg?branch=master\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/ramasilveyra/gitpkg.svg?branch=master\" alt=\"Codecoverage\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003egitpkg\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003ePublish packages as git tags\u003c/b\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n🔧 Works with projects with build steps.\u003cbr /\u003e\n👯 Works with projects with multiple packages (monorepos).\u003cbr /\u003e\n🏎 Lightweight git tags (only the files needed are included).\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003eTable of Contents\u003c/h2\u003e\n\n- [Background](#background)\n  - [Terminology](#terminology)\n- [Install](#install)\n- [Usage](#usage)\n  - [Publish](#publish)\n- [Contribute](#contribute)\n- [Troubleshooting](#troubleshooting)\n- [License](#license)\n\n\u003ch2 align=\"center\"\u003eBackground\u003c/h2\u003e\n\nBoth npm and yarn support installing packages from git tags.\n\nBut things can get difficult with packages that have a build step (eg [babel](https://github.com/babel/babel)) and monorepos with multiples packages (eg [lerna](https://github.com/lerna/lerna)).\n\n`gitpkg publish` creates a git tag with the same files as if you were running `npm publish` or `yarn publish` and uploads the generated git tag to a git repository.\n\nAlso you can publish any gitpkg package to the same repository, so you can have only one repository used as common registry and you get away from your project git repository the git tags with the build code.\n\n### Terminology:\n\n- **gitpkg package**: git tag generated by gitpkg.\n- **gitpkg registry**: git repository used as common host for your gitpkg packages.\n\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\n\n**Node.js v10.12 or newer** is required.\n\n### npm registry\n\nVia the yarn client:\n\n```bash\n$ yarn global add gitpkg\n```\n\nVia the npm client:\n\n```bash\n$ npm install -g gitpkg\n```\n\n### gitpkg registry\n\nVia the yarn client:\n\n```bash\n$ yarn global add ramasilveyra/public-registry#gitpkg-v1.0.0-beta.2-gitpkg\n```\n\nVia the npm client:\n\n```bash\n$ npm install -g ramasilveyra/public-registry#gitpkg-v1.0.0-beta.2-gitpkg\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n### Publish\n\nPublishes a package to a git repository, by default uploads the package to the git repository in the git remote origin (`git remote -v` to see your git remote origin url). The package published is defined by the package.json in the current directory.\n\n```bash\n$ gitpkg publish\n```\n\n[See in action](https://user-images.githubusercontent.com/7464663/27548379-318b38f8-5a6f-11e7-978c-b5a2f6677e61.gif).\n\n#### --registry, -r\n\n```bash\n$ gitpkg publish --registry git@mygit.server:org/private-registry.git\n```\n\nThis flag tells gitpkg to publish the package to a specific gitpkg registry.\n\nYou can also set the gitpkg registry permanently by adding `\"gitpkg\":{\"registry\":\"git@mygit.server:org/private-registry.git\"}` to the package.json.\n\n\u003ch2 align=\"center\"\u003eConfiguration\u003c/h2\u003e\n\nYou can also configure gitpkg with a config file. Create a file named `gitpkg.config.js` in the root of your project or in the root of a subpackage.\n\n### Available config settings\n\n#### registry\n\nPublish the package to a specific gitpkg registry. Same as the registry flag of the cli.\n\n#### getTagName\n\nFunction used to create the git tags. The function receives one object `pkg`, which is the content of the package.json file.\n\n```js\n// Example content of gitpkg.config.js\nmodule.exports = () =\u003e ({\n  registry: 'git@mygit.server:org/private-registry.git',\n  getTagName: pkg =\u003e `${pkg.name}-v${pkg.version}-gitpkg`\n});\n```\n\n\u003ch2 align=\"center\"\u003eTroubleshooting\u003c/h2\u003e\n\n## Usage with Gerrit\n\ngitpkg works by publishing tags that contain only the files in a package. The commits in these tags don't appear on any branch, so Gerrit will reject them by default:\n\n```\n! [remote rejected] …\n    (prohibited by Gerrit: update for creating new commit object not permitted)\n```\n\nTo gain the permission gitpkg needs, add **Create Reference** and **Push** entries to the `refs/tags/*` reference in the _Access_ settings of your repository.\n\n\u003ch2 align=\"center\"\u003eContribute\u003c/h2\u003e\n\nFeel free to dive in! [Open an issue](https://github.com/ramasilveyra/gitpkg/issues/new) or submit PRs.\n\ngitpkg follows the [Contributor Covenant](http://contributor-covenant.org/version/1/3/0/) Code of Conduct.\n\n\u003ch2 align=\"center\"\u003eLicense\u003c/h2\u003e\n\n[MIT © Ramiro Silveyra d'Avila](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framasilveyra%2Fgitpkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framasilveyra%2Fgitpkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framasilveyra%2Fgitpkg/lists"}