{"id":16527339,"url":"https://github.com/u3u/fix-tsup-cjs","last_synced_at":"2025-03-21T09:31:20.785Z","repository":{"id":160831606,"uuid":"635301707","full_name":"u3u/fix-tsup-cjs","owner":"u3u","description":"Fix the commonjs default export statement and type definition of tsup output","archived":false,"fork":false,"pushed_at":"2025-03-10T06:09:25.000Z","size":150,"stargazers_count":11,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T03:51:40.491Z","etag":null,"topics":["commonjs","tsup"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/u3u.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-02T12:04:42.000Z","updated_at":"2025-01-21T07:15:08.000Z","dependencies_parsed_at":"2024-01-13T03:18:27.347Z","dependency_job_id":"5fc12943-660e-4705-902f-2df24c073a21","html_url":"https://github.com/u3u/fix-tsup-cjs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Ffix-tsup-cjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Ffix-tsup-cjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Ffix-tsup-cjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/u3u%2Ffix-tsup-cjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/u3u","download_url":"https://codeload.github.com/u3u/fix-tsup-cjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130003,"owners_count":20402752,"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":["commonjs","tsup"],"created_at":"2024-10-11T17:34:45.966Z","updated_at":"2025-03-21T09:31:20.403Z","avatar_url":"https://github.com/u3u.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fix-tsup-cjs\n\n\u003e Fix the `commonjs` default export statement and type definition of [tsup](https://github.com/egoist/tsup) output\n\n[![npm version](https://badgen.net/npm/v/fix-tsup-cjs)](https://npm.im/fix-tsup-cjs) [![npm downloads](https://badgen.net/npm/dm/fix-tsup-cjs)](https://npm.im/fix-tsup-cjs) [![codecov](https://codecov.io/gh/u3u/fix-tsup-cjs/graph/badge.svg)](https://codecov.io/gh/u3u/fix-tsup-cjs)\n\n## Motivation\n\nThe default export statement in the `commonjs` format output by [tsup](https://github.com/egoist/tsup) is `module.exports.default`, which means that you actually need to import it through `require().default`. This cannot be directly used for configuration files such as [Prettier](https://prettier.io/docs/en/configuration.html#basic-configuration) and [ESLint](https://eslint.org/docs/latest/extend/shareable-configs), because they only read `require()`.\n\n## Usage\n\n```sh\ntsup \u0026\u0026 npx fix-tsup-cjs\n```\n\n\u003e _Note: By default, `dist/**/*.js` will be fixed. If the `type` in your `package.json` is set to `module`, then `dist/**/*.cjs` will be fixed._\n\n## CLI Options\n\n```\nUsage:\n  $ fix-tsup-cjs [...files]\n\nCommands:\n  [...files]  Custom matching files glob\n\nFor more info, run any command with the `--help` flag:\n  $ fix-tsup-cjs --help\n\nOptions:\n  --cwd [path]             Set fix directory (default: dist)\n  --dts                    Fix commonjs d.ts and d.cts files (default: true)\n  -i, --ignore [...files]  Ignore files\n  --silent                 Suppress logs\n  -v, --version            Display version number\n  -h, --help               Display this message\n```\n\n## License\n\n[MIT](./LICENSE) License © 2023 [u3u](https://github.com/u3u)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fu3u%2Ffix-tsup-cjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fu3u%2Ffix-tsup-cjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fu3u%2Ffix-tsup-cjs/lists"}