Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: switch to tsup #2391

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Shinigami92 marked this conversation as resolved.
Show resolved Hide resolved
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"
prisis marked this conversation as resolved.
Show resolved Hide resolved
},
"./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
Loading