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 #46 from storybookjs/main-patches
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
yannbf committed Jun 20, 2023
2 parents 407af11 + dbbc187 commit 0800012
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 74 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report-🐞.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: "Bug report \U0001F41E"
about: Something is broken and you have a reliable reproduction? Let us know here.
title: "[Bug]: "
labels: bug, needs triage
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**System**
Please paste the results of `npx storybook@latest info` here.

**Additional context**
Add any other context about the problem here.
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
27 changes: 13 additions & 14 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,30 +19,32 @@
"files": [
"dist/**/*"
],
"types": "dist/types/index.d.ts",
"types": "dist/index.d.ts",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@storybook/client-logger": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/instrumenter": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@testing-library/dom": "^8.3.0",
"@testing-library/user-event": "^13.2.1",
"@testing-library/dom": "^9.0.0",
"@testing-library/user-event": "^14.0.0",
"ts-dedent": "^2.2.0"
},
"devDependencies": {
"@storybook/client-logger": "^7.0.0",
"@storybook/instrumenter": "^7.0.0",
"@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": [
"next",
"prerelease"
"prerelease",
"future"
],
"plugins": [
[
Expand Down
12 changes: 10 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { once } from '@storybook/client-logger';
import { instrument } from '@storybook/instrumenter';
import * as domTestingLibrary from '@testing-library/dom';
import _userEvent from '@testing-library/user-event';
import _userEventObj from '@testing-library/user-event';
import dedent from 'ts-dedent';

// @ts-ignore (this is to ensure ESM compatibility)
const _userEvent: typeof _userEventObj = _userEventObj.default || _userEventObj;

const testingLibrary = instrument(
{ ...domTestingLibrary },
{
Expand Down Expand Up @@ -101,4 +104,9 @@ export const {
prettyFormat,
} = testingLibrary;

export const { userEvent } = instrument({ userEvent: _userEvent }, { intercept: true });
const userEvent: typeof _userEventObj = instrument(
{ userEvent: _userEvent },
{ intercept: true }
).userEvent;

export { userEvent };
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 0800012

Please sign in to comment.