From b0fe01cb2f791399b81f33cc3b5261186ecdc735 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 18 Aug 2023 21:02:22 +0800 Subject: [PATCH] Rename package to @storybook/playwright-ct --- README.md | 10 +++++----- package.json | 4 ++-- src/index.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index dcba6f6..1ef1ddb 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ CT Storybook allows you to write a Playwright test against that story using all ```ts // Button.spec.ts -import { test, expect } from 'playwright-ct-storybook'; +import { test, expect } from '@storybook/playwright-ct'; import * as ButtonStories from './Button.stories'; test('interacts', async ({ mount }) => { @@ -144,14 +144,14 @@ npm init playwright@latest Then install this package: ```sh -npm install playwright-ct-storybook +npm install @storybook/playwright-ct ``` -Then update your Playwright config to use `playwright-ct-storybook`'s `defineConfig`: +Then update your Playwright config to use `@storybook/playwright-ct`'s `defineConfig`: ```diff - import { defineConfig, devices } from '@playwright/test'; -+ import { defineConfig, devices } from 'playwright-ct-storybook'; ++ import { defineConfig, devices } from '@storybook/playwright-ct'; ``` This is a thin wrapper around Playwright's `defineConfig` that tells Playwright to run against your Storybook dev server. @@ -167,7 +167,7 @@ This will run the example E2E tests that Playwright installs in your project. Then, you can write your first test based on your existing stories. This test uses `Button.stories` that is included as an example file in the Storybook installation, but it can be any Story file. ```js -import { test, expect } from 'playwright-ct-storybook'; +import { test, expect } from '@storybook/playwright-ct'; import * as ButtonStories from './Button.stories'; test('renders', async ({ mount }) => { diff --git a/package.json b/package.json index bab23da..c25f1f8 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "playwright-ct-storybook", + "name": "@storybook/playwright-ct", "version": "0.0.0", "description": "Playwright CT powered by Storybook (Experimental)", "repository": { "type": "git", - "url": "https://github.com/shilman/playwright-ct-storybook" + "url": "https://github.com/storybookjs/playwright-ct" }, "author": "Michael Shilman ", "license": "MIT", diff --git a/src/index.ts b/src/index.ts index 607de1a..ce373ce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -132,7 +132,7 @@ const defineConfig = (config: PlaywrightTestConfig) => // @ts-expect-error WTH babelPlugins: [...(config.build?.babelPlugins || []), [join(__dirname, 'ct-test-plugin.js')]], // @ts-expect-error WTH - external: [/playwright-ct-storybook\/.*.js$/], + external: [/playwright-ct\/.*.js$/], ...config.build, }, webServer: {