diff --git a/.github/workflows/linear-export.yml b/.github/workflows/linear-export.yml deleted file mode 100644 index 10225f5..0000000 --- a/.github/workflows/linear-export.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Export to linear - -on: - issues: - types: [labeled] - pull_request: - types: [labeled] - -jobs: - trigger: - if: github.event.label.name == 'linear' - name: Export to linear - runs-on: ubuntu-latest - steps: - # - uses: hmarr/debug-action@v2 - - name: Linear action - uses: shilman/linear-action@v1 - with: - ghIssueNumber: ${{ github.event.number || github.event.issue.number }} - ghRepoOwner: ${{ github.event.repository.owner.login }} - ghRepoName: ${{ github.event.repository.name }} - ghToken: ${{ secrets.LINEAR_GH_TOKEN }} - linearIssuePrefix: Testing-Library - linearLabel: Storybook - linearPRLabel: PR - linearTeam: SB - linearApiKey: ${{ secrets.LINEAR_API_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd8a6d3..979ea42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/package.json b/package.json index bf64fad..0ab5fd1 100644 --- a/package.json +++ b/package.json @@ -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" @@ -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": [ diff --git a/tsconfig.base.json b/tsconfig.base.json deleted file mode 100644 index 36b853f..0000000 --- a/tsconfig.base.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "noImplicitAny": true, - "target": "es5", - "allowJs": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "declaration": true, - "declarationDir": "./dist/types" - }, - "include": ["src/*.ts"], - "exclude": ["node_modules"] -} diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json deleted file mode 100644 index 6196628..0000000 --- a/tsconfig.cjs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "outDir": "./dist/cjs", - "module": "CommonJS", - }, -} diff --git a/tsconfig.esm.json b/tsconfig.esm.json deleted file mode 100644 index 3e2451c..0000000 --- a/tsconfig.esm.json +++ /dev/null @@ -1,9 +0,0 @@ - -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "outDir": "./dist/esm", - "module": "ES6", - "target": "ES5", - }, -} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c38207b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2020", + "moduleResolution": "nodenext", + "allowSyntheticDefaultImports": true + }, + "include": ["src/*.ts"] +} diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..86b4621 --- /dev/null +++ b/tsup.config.ts @@ -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, + }, + } +);