Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #36 from storybookjs/norbert/use-tsup
Browse files Browse the repository at this point in the history
migrate to tsup
  • Loading branch information
ndelangen authored May 1, 2023
2 parents 34e26a2 + a6ec2ac commit 0985aec
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 69 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/linear-export.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- name: Prepare repository
run: git fetch --unshallow --tags

- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install dependencies
run: yarn
Expand Down
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
"type": "git",
"url": "https://github.com/storybookjs/testing-library.git"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"main": "dist/index.js",
"module": "dist/index.mjs",
"license": "MIT",
"scripts": {
"prebuild": "rimraf dist",
"build": "yarn build:esm && yarn build:cjs",
"build:esm": "tsc --project tsconfig.esm.json",
"build:cjs": "tsc --project tsconfig.cjs.json",
"build": "tsup",
"prepack": "yarn build",
"prerelease": "yarn build",
"release": "auto shipit"
Expand All @@ -22,25 +19,26 @@
"files": [
"dist/**/*"
],
"types": "dist/types/index.d.ts",
"types": "dist/index.d.ts",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@storybook/client-logger": "future",
"@storybook/instrumenter": "future",
"@testing-library/dom": "^8.3.0",
"@testing-library/user-event": "^13.2.1",
"ts-dedent": "^2.2.0"
},
"devDependencies": {
"@storybook/client-logger": "future",
"@storybook/instrumenter": "future",
"@auto-it/first-time-contributor": "^10.37.6",
"@auto-it/released": "^10.37.6",
"@storybook/linter-config": "^3.1.2",
"@types/react": "*",
"auto": "^10.37.6",
"rimraf": "^3.0.2",
"typescript": "^4.4.3"
"util": "^0.12.5",
"tsup": "^6.7.0",
"typescript": "^5.0.4"
},
"auto": {
"prereleaseBranches": [
Expand Down
13 changes: 0 additions & 13 deletions tsconfig.base.json

This file was deleted.

7 changes: 0 additions & 7 deletions tsconfig.cjs.json

This file was deleted.

9 changes: 0 additions & 9 deletions tsconfig.esm.json

This file was deleted.

9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"strict": true,
"target": "es2020",
"moduleResolution": "nodenext",
"allowSyntheticDefaultImports": true
},
"include": ["src/*.ts"]
}
24 changes: 24 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineConfig } from 'tsup';

export default defineConfig(
{
clean: true,
entry: ['./src/index.ts'],
format: ['cjs', 'esm'],
esbuildOptions(options, context) {
Object.assign(options, {
platform: 'browser',
logLevel: 'error',
legalComments: 'none',
minifyWhitespace: false,
minifyIdentifiers: false,
minifySyntax: true,
})
},
shims: false,
dts: {
entry: ['./src/index.ts'],
resolve: true,
},
}
);

0 comments on commit 0985aec

Please sign in to comment.