Skip to content

Commit

Permalink
chore!: switch to tsup (#2391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Feb 16, 2024
1 parent 44d698e commit db88a15
Show file tree
Hide file tree
Showing 7 changed files with 369 additions and 374 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is a shorthand for running the following scripts in order:

## Good to know

- The project is being built by [esbuild](https://esbuild.github.io) (see [bundle.ts](scripts/bundle.ts))
- The project is being built by [tsup](https://tsup.egoist.dev) (see [tsup.config.ts](tsup.config.ts))
- The documentation is running via VitePress.
Make sure you **build** the project before running the docs, cause some files depend on `dist`.
Use `pnpm run docs:dev` to edit them in live mode.
Expand Down Expand Up @@ -49,7 +49,7 @@ Please only change files related to one module (e.g. person, location) whenever

## Building Faker

The project is being built by [esbuild](https://esbuild.github.io) (see [bundle.ts](scripts/bundle.ts))
The project is being built by [tsup](https://tsup.egoist.dev) (see [tsup.config.ts](tsup.config.ts))

```shell
pnpm install
Expand Down
3 changes: 3 additions & 0 deletions docs/guide/upgrading_v9/2391.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Using tsup for the build process

We only support exports defined via `package.json` but after the switch to `tsup`, there are now complete restructures in the dist folder resulting it minified and chunked files for cjs.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
],
"bugs": "https://github.com/faker-js/faker/issues",
"license": "MIT",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.mjs",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "index.d.ts",
"typesVersions": {
">=4.0": {
Expand All @@ -41,13 +41,13 @@
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.mjs"
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./locale/*": {
"types": "./dist/types/locale/*.d.ts",
"require": "./dist/cjs/locale/*.js",
"import": "./dist/esm/locale/*.mjs"
"require": "./dist/locale/*.js",
"import": "./dist/locale/*.mjs"
},
"./package.json": "./package.json"
},
Expand All @@ -58,7 +58,7 @@
"scripts": {
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/dist locale pnpm-lock.yaml node_modules",
"build:clean": "rimraf dist",
"build:code": "tsx ./scripts/bundle.ts",
"build:code": "tsup-node",
"build:types": "tsc --project tsconfig.build.json",
"build": "run-s build:clean build:code build:types",
"generate": "run-s generate:locales generate:api-docs",
Expand Down Expand Up @@ -106,7 +106,6 @@
"@vueuse/core": "~10.7.2",
"conventional-changelog-cli": "~4.1.0",
"cypress": "~13.6.4",
"esbuild": "~0.20.0",
"eslint": "~8.56.0",
"eslint-config-prettier": "~9.1.0",
"eslint-define-config": "~2.1.0",
Expand All @@ -124,6 +123,7 @@
"sanitize-html": "~2.11.0",
"semver": "~7.6.0",
"standard-version": "~9.5.0",
"tsup": "~8.0.2",
"tsx": "~4.7.1",
"typedoc": "~0.25.7",
"typescript": "~5.3.3",
Expand Down

0 comments on commit db88a15

Please sign in to comment.