Coder Social home page Coder Social logo

fix-tsup-cjs's Introduction

fix-tsup-cjs

Fix the commonjs default export statement and type definition of tsup output

npm version npm downloads codecov

Motivation

The default export statement in the commonjs format output by 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 and ESLint, because they only read require().

Usage

tsup && npx fix-tsup-cjs

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.

CLI Options

Usage:
  $ fix-tsup-cjs [...files]

Commands:
  [...files]  Custom matching files glob

For more info, run any command with the `--help` flag:
  $ fix-tsup-cjs --help

Options:
  --cwd [path]             Set fix directory (default: dist)
  --dts                    Fix commonjs d.ts and d.cts files (default: true)
  -i, --ignore [...files]  Ignore files
  --silent                 Suppress logs
  -v, --version            Display version number
  -h, --help               Display this message

License

MIT License ยฉ 2023 u3u

fix-tsup-cjs's People

Contributors

renovate[bot] avatar u3u avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fix-tsup-cjs's Issues

Unable to install

Thank you for making this project and I'm keen to try it out, but this line is preventing it from being installed:

https://github.com/u3u/fix-tsup-cjs/blob/d92b8903ea08ee7d3b243637c3b05a40059bd9f2/package.json#LL47C24-L47C34

npm ERR! command sh -c npx only-allow pnpm
npm ERR! npm ERR! code E401
npm ERR! npm ERR! Incorrect or missing password.
npm ERR! npm ERR! If you were trying to login, change your password, create an
npm ERR! npm ERR! authentication token or enable two-factor authentication then
npm ERR! npm ERR! that means you likely typed your password in incorrectly.
npm ERR! npm ERR! Please try again, or recover your password at:
npm ERR! npm ERR!     https://www.npmjs.com/forgot
npm ERR! npm ERR! 
npm ERR! npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm ERR!     npm login

I believe the only way to allow npm users to use this would be to remove this lifecycle script. Or write something like pinst that rewrites it on publish.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Invalid schedule: Failed to parse "schedule:daily"

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update devdependency eslint to v9
  • chore(deps): update devdependency execa to v9
  • chore(deps): update pnpm to v9
  • chore(deps): update vitest monorepo to v2 (major) (@vitest/coverage-v8, @vitest/ui, vitest)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yaml
  • actions/checkout v3
  • actions/setup-node v3
  • codecov/codecov-action v3
.github/workflows/release.yaml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • cac ^6.7.14
  • fast-glob ^3.3.1
  • kolorist ^1.8.0
  • read-pkg ^8.0.0
  • @tsconfig/node18 ^18.2.0
  • @types/node ^18.17.4
  • @u3u/eslint-config ^2.9.1
  • @u3u/prettier-config ^3.0.1
  • @vitest/coverage-v8 ^0.34.1
  • @vitest/ui ^0.34.1
  • eslint ^8.46.0
  • execa ^7.2.0
  • lint-staged ^13.2.3
  • prettier ^2.8.8
  • simple-git-hooks ^2.9.0
  • tsup ^7.2.0
  • typescript ^5.1.6
  • vitest ^0.34.1
  • pnpm 8.6.12
nvm
.nvmrc
  • node 18

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.