diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 984082c3..bf8c87a4 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -3,7 +3,12 @@ name: "Chromatic" -on: push +on: + pull_request: + branches: + - main + paths: + - 'libs/pxweb2-ui/**' jobs: chromatic: @@ -15,13 +20,9 @@ jobs: fetch-depth: 0 - name: Install dependencies - # ⚠️ Pick one of these, matching the package manager for your project run: npm ci - # run: pnpm install - # run: yarn install --immutable --immutable-cache --check-cache - name: Publish to Chromatic uses: chromaui/action@latest with: - # ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} diff --git a/.gitignore b/.gitignore index 98a6e389..c653ecf1 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ node_modules /libpeerconnection.log npm-debug.log yarn-error.log +build-storybook.log testem.log /typings diff --git a/libs/pxweb2-ui/src/lib/pxweb2-ui.module.scss b/libs/pxweb2-ui/src/lib/pxweb2-ui.module.scss index 45c2aa47..ea1141ff 100644 --- a/libs/pxweb2-ui/src/lib/pxweb2-ui.module.scss +++ b/libs/pxweb2-ui/src/lib/pxweb2-ui.module.scss @@ -5,3 +5,6 @@ * .container { * } */ +.button{ + background-color: aqua; +} diff --git a/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx b/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx index 6d63bf82..4381fa3a 100644 --- a/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx +++ b/libs/pxweb2-ui/src/lib/pxweb2-ui.stories.tsx @@ -29,10 +29,3 @@ export const Secondary: Story = { }, }; -export const Heading: Story = { - args: {}, - play: async ({ canvasElement }) => { - const canvas = within(canvasElement); - expect(canvas.getByText(/Welcome to Pxweb2Ui!/gi)).toBeTruthy(); - }, -}; diff --git a/package-lock.json b/package-lock.json index 69863be1..007a8403 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,7 @@ "@vitejs/plugin-react": "^4.2.0", "@vitest/coverage-v8": "~0.34.6", "@vitest/ui": "~0.34.6", + "chromatic": "^10.3.1", "cypress": "^13.0.0", "eslint": "~8.48.0", "eslint-config-prettier": "^9.0.0", @@ -13351,6 +13352,17 @@ "node": ">= 6" } }, + "node_modules/chromatic": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-10.3.1.tgz", + "integrity": "sha512-IHczKH3K3vVeZGE3XyCy/T8EQH2mGUEyQ9QUuULrWlYCfo760cnzehdTjrpuIUetkHtv7noA5Hmn6joQlz3Ufw==", + "dev": true, + "bin": { + "chroma": "dist/bin.js", + "chromatic": "dist/bin.js", + "chromatic-cli": "dist/bin.js" + } + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", diff --git a/package.json b/package.json index 8565c6d9..dfbc0c0a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "license": "MIT", "scripts": { "start": "npx nx run pxweb2:serve", - "start-storybook": "npx nx run pxweb2-ui:storybook" + "start-storybook": "npx nx run pxweb2-ui:storybook", + "build-storybook": "npx nx run pxweb2-ui:build-storybook" }, "private": true, "dependencies": { @@ -43,6 +44,7 @@ "@vitejs/plugin-react": "^4.2.0", "@vitest/coverage-v8": "~0.34.6", "@vitest/ui": "~0.34.6", + "chromatic": "^10.3.1", "cypress": "^13.0.0", "eslint": "~8.48.0", "eslint-config-prettier": "^9.0.0", @@ -60,5 +62,7 @@ "vite": "^5.0.0", "vite-plugin-dts": "~2.3.0", "vitest": "~0.34.6" - } + }, + "readme": "ERROR: No README data found!", + "_id": "@pxweb2/source@0.0.0" }