Move @storybook/jest and @storybook/testing-library out of monorepo

This commit is contained in:
Gert Hengeveld 2021-09-29 09:32:07 +02:00
parent 1eb3440c0b
commit bab6018d65
14 changed files with 20 additions and 284 deletions

View File

@ -48,8 +48,8 @@
"@storybook/core-events": "6.4.0-alpha.35",
"@storybook/csf": "0.0.2--canary.68887a1.0",
"@storybook/instrumenter": "6.4.0-alpha.35",
"@storybook/jest": "6.4.0-alpha.35",
"@storybook/testing-library": "6.4.0-alpha.35",
"@storybook/jest": "^0.0.0-alpha.1",
"@storybook/testing-library": "^0.0.0-alpha.1",
"@storybook/theming": "6.4.0-alpha.35",
"formik": "^2.2.9",
"global": "^4.4.0",

View File

@ -1,3 +0,0 @@
# Storybook Jest
Storybook integration for Jest, instrumented for use with the Interactions addon.

View File

@ -1,52 +0,0 @@
{
"name": "@storybook/jest",
"version": "6.4.0-alpha.35",
"description": "",
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/main/lib/jest",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "lib/jest"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
"sideEffects": false,
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/ts3.9/index.d.ts",
"typesVersions": {
"<3.8": {
"*": [
"dist/ts3.4/*"
]
}
},
"files": [
"dist/**/*",
"README.md",
"*.js",
"*.d.ts"
],
"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/expect": "^1.0.0-rc.1",
"@storybook/instrumenter": "6.4.0-alpha.35",
"jest-mock": "^27.0.6"
},
"publishConfig": {
"access": "public"
},
"gitHead": "8f65635eb105c8ef3e6ffea3c9cf6668ad34705e",
"sbmodern": "dist/modern/index.js"
}

View File

@ -1,6 +0,0 @@
import * as expectPatched from '@storybook/expect';
import { instrument } from '@storybook/instrumenter';
import * as mock from 'jest-mock';
export const { jest } = instrument({ jest: mock });
export const { expect } = instrument(expectPatched, { intercept: true });

View File

@ -1 +0,0 @@
declare module '@storybook/expect';

View File

@ -1,15 +0,0 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": [
"src/**/*.test.*",
"src/**/tests/**/*",
"src/**/__tests__/**/*",
"src/**/*.stories.*",
"src/**/*.mockdata.*",
"src/**/__testfixtures__/**"
]
}

View File

@ -1,3 +0,0 @@
# Storybook Testing Library
Storybook integration for Testing Library, instrumented for use with the Interactions addon.

View File

@ -1,54 +0,0 @@
{
"name": "@storybook/testing-library",
"version": "6.4.0-alpha.35",
"description": "",
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/main/lib/testing-library",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "lib/testing-library"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
"sideEffects": false,
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/ts3.9/index.d.ts",
"typesVersions": {
"<3.8": {
"*": [
"dist/ts3.4/*"
]
}
},
"files": [
"dist/**/*",
"README.md",
"*.js",
"*.d.ts"
],
"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/client-logger": "6.4.0-alpha.35",
"@storybook/instrumenter": "6.4.0-alpha.35",
"@testing-library/dom": "^8.3.0",
"@testing-library/user-event": "^13.2.1",
"ts-dedent": "^2.2.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "8f65635eb105c8ef3e6ffea3c9cf6668ad34705e",
"sbmodern": "dist/modern/index.js"
}

View File

@ -1,103 +0,0 @@
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 dedent from 'ts-dedent';
const testingLibrary = instrument(
{ ...domTestingLibrary },
{ intercept: (method, path) => path[0] === 'fireEvent' || method.startsWith('findBy') }
);
testingLibrary.screen = Object.entries(testingLibrary.screen).reduce(
(acc, [key, val]) =>
Object.defineProperty(acc, key, {
get() {
once.warn(dedent`
You are using Testing Library's \`screen\` object. Use \`within(canvasElement)\` instead.
More info: https://storybook.js.org/docs/react/essentials/interactions
`);
return val;
},
}),
testingLibrary.screen
);
// console.log(Object.keys(domTestingLibrary).join(',\n'));
export const {
buildQueries,
configure,
createEvent,
findAllByAltText,
findAllByDisplayValue,
findAllByLabelText,
findAllByPlaceholderText,
findAllByRole,
findAllByTestId,
findAllByText,
findAllByTitle,
findByAltText,
findByDisplayValue,
findByLabelText,
findByPlaceholderText,
findByRole,
findByTestId,
findByText,
findByTitle,
fireEvent,
getAllByAltText,
getAllByDisplayValue,
getAllByLabelText,
getAllByPlaceholderText,
getAllByRole,
getAllByTestId,
getAllByText,
getAllByTitle,
getByAltText,
getByDisplayValue,
getByLabelText,
getByPlaceholderText,
getByRole,
getByTestId,
getByText,
getByTitle,
getConfig,
getDefaultNormalizer,
getElementError,
getNodeText,
getQueriesForElement,
getRoles,
getSuggestedQuery,
isInaccessible,
logDOM,
logRoles,
prettyDOM,
queries,
queryAllByAltText,
queryAllByAttribute,
queryAllByDisplayValue,
queryAllByLabelText,
queryAllByPlaceholderText,
queryAllByRole,
queryAllByTestId,
queryAllByText,
queryAllByTitle,
queryByAltText,
queryByAttribute,
queryByDisplayValue,
queryByLabelText,
queryByPlaceholderText,
queryByRole,
queryByTestId,
queryByText,
queryByTitle,
queryHelpers,
screen,
waitFor,
waitForElementToBeRemoved,
within,
prettyFormat,
} = testingLibrary;
export const { userEvent } = instrument({ userEvent: _userEvent }, { intercept: true });

View File

@ -1,15 +0,0 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": [
"src/**/*.test.*",
"src/**/tests/**/*",
"src/**/__tests__/**/*",
"src/**/*.stories.*",
"src/**/*.mockdata.*",
"src/**/__testfixtures__/**"
]
}

View File

@ -217,9 +217,6 @@
"@storybook/instrumenter": {
"implicitDependencies": []
},
"@storybook/jest": {
"implicitDependencies": []
},
"@storybook/node-logger": {
"implicitDependencies": []
},
@ -235,9 +232,6 @@
"@storybook/source-loader": {
"implicitDependencies": []
},
"@storybook/testing-library": {
"implicitDependencies": []
},
"@storybook/theming": {
"implicitDependencies": []
},

View File

@ -161,7 +161,7 @@
"@storybook/eslint-config-storybook": "^2.4.0",
"@storybook/html": "workspace:*",
"@storybook/instrumenter": "workspace:*",
"@storybook/jest": "workspace:*",
"@storybook/jest": "^0.0.0-alpha.1",
"@storybook/linter-config": "^2.5.0",
"@storybook/node-logger": "workspace:*",
"@storybook/postinstall": "workspace:*",
@ -175,7 +175,7 @@
"@storybook/source-loader": "workspace:*",
"@storybook/store": "workspace:*",
"@storybook/svelte": "workspace:*",
"@storybook/testing-library": "workspace:*",
"@storybook/testing-library": "^0.0.0-alpha.1",
"@storybook/theming": "workspace:*",
"@storybook/ui": "workspace:*",
"@storybook/vue": "workspace:*",

View File

@ -265,10 +265,6 @@
"root": "lib/instrumenter",
"type": "library"
},
"@storybook/jest": {
"root": "lib/jest",
"type": "library"
},
"@storybook/node-logger": {
"root": "lib/node-logger",
"type": "library"
@ -289,10 +285,6 @@
"root": "lib/store",
"type": "library"
},
"@storybook/testing-library": {
"root": "lib/testing-library",
"type": "library"
},
"@storybook/theming": {
"root": "lib/theming",
"type": "library"

View File

@ -7176,8 +7176,8 @@ __metadata:
"@storybook/core-events": 6.4.0-alpha.35
"@storybook/csf": 0.0.2--canary.68887a1.0
"@storybook/instrumenter": 6.4.0-alpha.35
"@storybook/jest": 6.4.0-alpha.35
"@storybook/testing-library": 6.4.0-alpha.35
"@storybook/jest": ^0.0.0-alpha.1
"@storybook/testing-library": ^0.0.0-alpha.1
"@storybook/theming": 6.4.0-alpha.35
formik: ^2.2.9
global: ^4.4.0
@ -8366,15 +8366,16 @@ __metadata:
languageName: unknown
linkType: soft
"@storybook/jest@6.4.0-alpha.35, @storybook/jest@workspace:*, @storybook/jest@workspace:lib/jest":
version: 0.0.0-use.local
resolution: "@storybook/jest@workspace:lib/jest"
"@storybook/jest@npm:^0.0.0-alpha.1":
version: 0.0.0-alpha.1
resolution: "@storybook/jest@npm:0.0.0-alpha.1"
dependencies:
"@storybook/expect": ^1.0.0-rc.1
"@storybook/instrumenter": 6.4.0-alpha.35
jest-mock: ^27.0.6
languageName: unknown
linkType: soft
checksum: 497b03b0e49c58876edd5904f569a74f9f0cda03179d201ded3637ac66cd7e35fbdf07e113dd61b15671fae97c2a7b1bf1b63f9fcaced0a236d308709bbb769d
languageName: node
linkType: hard
"@storybook/linter-config@npm:^2.5.0":
version: 2.5.0
@ -8776,7 +8777,7 @@ __metadata:
"@storybook/eslint-config-storybook": ^2.4.0
"@storybook/html": "workspace:*"
"@storybook/instrumenter": "workspace:*"
"@storybook/jest": "workspace:*"
"@storybook/jest": ^0.0.0-alpha.1
"@storybook/linter-config": ^2.5.0
"@storybook/node-logger": "workspace:*"
"@storybook/postinstall": "workspace:*"
@ -8790,7 +8791,7 @@ __metadata:
"@storybook/source-loader": "workspace:*"
"@storybook/store": "workspace:*"
"@storybook/svelte": "workspace:*"
"@storybook/testing-library": "workspace:*"
"@storybook/testing-library": ^0.0.0-alpha.1
"@storybook/theming": "workspace:*"
"@storybook/ui": "workspace:*"
"@storybook/vue": "workspace:*"
@ -9072,17 +9073,18 @@ __metadata:
languageName: unknown
linkType: soft
"@storybook/testing-library@6.4.0-alpha.35, @storybook/testing-library@workspace:*, @storybook/testing-library@workspace:lib/testing-library":
version: 0.0.0-use.local
resolution: "@storybook/testing-library@workspace:lib/testing-library"
"@storybook/testing-library@npm:^0.0.0-alpha.1":
version: 0.0.0-alpha.1
resolution: "@storybook/testing-library@npm:0.0.0-alpha.1"
dependencies:
"@storybook/client-logger": 6.4.0-alpha.35
"@storybook/instrumenter": 6.4.0-alpha.35
"@testing-library/dom": ^8.3.0
"@testing-library/user-event": ^13.2.1
ts-dedent: ^2.2.0
languageName: unknown
linkType: soft
checksum: afbd2a69fb0894a06f3b1bdf8eb30dbec8766e23e59b1a3f250b4b3704c0ef54573054b63495ee372bc59e101cbed3ea7240123ec4cdcaf5fcfb25105ff879fd
languageName: node
linkType: hard
"@storybook/theming@6.4.0-alpha.35, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming":
version: 0.0.0-use.local