{"id":17242791,"url":"https://github.com/imcuttle/pkgxo","last_synced_at":"2025-03-26T03:44:21.850Z","repository":{"id":57325399,"uuid":"445810496","full_name":"imcuttle/pkgxo","owner":"imcuttle","description":"Lets you can update package.json when publish","archived":false,"fork":false,"pushed_at":"2022-01-08T13:01:01.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T11:57:57.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/imcuttle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-01-08T12:17:02.000Z","updated_at":"2022-01-08T13:01:04.000Z","dependencies_parsed_at":"2022-09-09T08:50:41.351Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/pkgxo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fpkgxo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fpkgxo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fpkgxo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fpkgxo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/pkgxo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245585797,"owners_count":20639671,"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":[],"created_at":"2024-10-15T06:14:05.015Z","updated_at":"2025-03-26T03:44:21.832Z","avatar_url":"https://github.com/imcuttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pkgxo\n\n[![Build status](https://img.shields.io/github/workflow/status/imcuttle/pkgxo/Test/master?style=flat-square)](https://github.com/imcuttle/pkgxo/actions)\n[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/pkgxo/master.svg?style=flat-square)](https://codecov.io/github/imcuttle/pkgxo?branch=master)\n[![NPM version](https://img.shields.io/npm/v/pkgxo.svg?style=flat-square)](https://www.npmjs.com/package/pkgxo)\n[![NPM Downloads](https://img.shields.io/npm/dm/pkgxo.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/pkgxo)\n[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)\n\n\u003e lets you can update package.json when publish\n\n## Installation\n\n```bash\npnpm add pkgxo -D\n```\n\n## Usage\n\n```json\n{\n  \"main\": \"index.ts\",\n  \"publishConfig\": {\n    \"main\": \"index.js\"\n  },\n  \"scripts\": {\n    \"prepublishOnly\": \"pkgxo --submit\",\n    \"postpublish\": \"pkgxo --reset\"\n  }\n}\n```\n\n`pkgxo --submit` would update package.json, use [pnpm-manifest](https://pnpm.io/package_json#publishconfig) by default.\n\n`package.json` is follow\n\n```json\n{\n  \"main\": \"index.js\",\n  \"publishConfig\": {\n    \"main\": \"index.js\"\n  },\n  \"scripts\": {\n    \"prepublishOnly\": \"pkgxo --submit\",\n    \"postpublish\": \"pkgxo --reset\"\n  }\n}\n```\n\n`pkgxo --reset` would reset the latest package.json when submitted.\n\n`package.json` is follow\n\n```json\n{\n  \"main\": \"index.ts\",\n  \"publishConfig\": {\n    \"main\": \"index.js\"\n  },\n  \"scripts\": {\n    \"prepublishOnly\": \"pkgxo --submit\",\n    \"postpublish\": \"pkgxo --reset\"\n  }\n}\n```\n\n## Advanced\n\n### Custom updater\n\nYou could use `pkgxo.js` in CWD for overwriting.\n\n```javascript\n// pkgxo.js\nconst pnpmManifest = require('pkgxo/pnpm-manifest')\nmodule.exports = async function (pkg, filename) {\n  pkg = await pnpmManifest(pkg, filename)\n  pkg.description = `[LOGO]: ${pkg.description || ''}`\n  return pkg\n}\n```\n\n## Contributing\n\n- Fork it!\n- Create your new branch:  \n  `git checkout -b feature-new` or `git checkout -b fix-which-bug`\n- Start your magic work now\n- Make sure npm test passes\n- Commit your changes:  \n  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`\n- Push to the branch: `git push`\n- Submit a pull request :)\n\n## Authors\n\nThis library is written and maintained by imcuttle, \u003ca href=\"mailto:moyuyc95@gmail.com\"\u003emoyuyc95@gmail.com\u003c/a\u003e.\n\n## License\n\nMIT - [imcuttle](https://github.com/imcuttle) 🐟\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fpkgxo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fpkgxo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fpkgxo/lists"}