From 8ef798c281277530bb2005bd9e4f59651f1d97a9 Mon Sep 17 00:00:00 2001 From: Chromatic Date: Tue, 8 Oct 2024 18:41:43 +0000 Subject: [PATCH] v11.12.0 --- LICENSE | 21 ++++++ README.md | 7 ++ action.yml | 154 ++++++++++++++++++++++++++++++++++++++ package.json | 208 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 390 insertions(+) create mode 100644 LICENSE create mode 100755 README.md create mode 100755 action.yml create mode 100644 package.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..4b9dcadc --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Chroma Software Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 00000000..044c9f56 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# GitHub Action for Chromatic + +Builds and publishes your Storybook to Chromatic and runs visual regression tests. + +📋 [Source code](https://github.com/chromaui/chromatic-cli) ∙ 📚 [Documentation](https://www.chromatic.com/docs/github-actions) ∙ 💬 [Support](https://www.chromatic.com/docs/support) + +> ⚠️ This repository is just a deployment target for the GitHub Action. Do not fork or create issues/PRs here. diff --git a/action.yml b/action.yml new file mode 100755 index 00000000..f882aa1c --- /dev/null +++ b/action.yml @@ -0,0 +1,154 @@ +name: Publish to Chromatic +author: Chroma Software, Inc. +description: 'Publish your Storybook to Chromatic and run visual regression tests' +branding: + icon: 'aperture' + color: 'orange' + +inputs: + allowConsoleErrors: + description: 'Do not exit when runtime errors occur in storybook' + required: false + appCode: + description: 'Deprecated, please use projectToken instead' + required: false + autoAcceptChanges: + description: 'Automatically accept all changes in chromatic: boolean or branchname' + required: false + branchName: + description: 'Override the branch name' + required: false + buildScriptName: + description: 'The npm script that builds your Storybook [build-storybook]' + required: false + configFile: + description: 'Path from where to load the Chromatic config JSON file.' + cypress: + description: 'Run build against `@chromatic-com/cypress` test archives' + required: false + debug: + description: 'Output verbose debugging information' + required: false + diagnostics: + description: 'Deprecated, use diagnosticsFile instead' + required: false + diagnosticsFile: + description: 'Write process context information to a JSON file' + required: false + dryRun: + description: 'Run without actually publishing to Chromatic' + required: false + exitOnceUploaded: + description: 'Exit with 0 once the built version has been sent to chromatic: boolean or branchname' + required: false + exitZeroOnChanges: + description: 'Positive exit of action even when there are changes: boolean or branchname' + required: false + externals: + description: 'Disable TurboSnap when any of these files have changed since the baseline build' + required: false + fileHashing: + description: 'Whether to apply file hashing to skip uploading unchanged files (default: true)' + required: false + forceRebuild: + description: 'Do not skip build when a rebuild is detected' + required: false + ignoreLastBuildOnBranch: + description: 'Do not use the last build on this branch as a baseline if it is no longer in history (i.e. branch was rebased)' + required: false + logFile: + description: 'Write CLI logs to a file' + required: false + only: + description: 'Deprecated, replaced by onlyStoryNames' + required: false + onlyChanged: + description: 'Enables TurboSnap: Only run stories affected by files changed since the baseline build' + required: false + onlyStoryNames: + description: 'Only run a single story or a subset of stories by their name' + required: false + onlyStoryFiles: + description: 'Only run a single story or a subset of stories by their filename(s)' + required: false + playwright: + description: 'Run build against `@chromatic-com/playwright` test archives' + required: false + preserveMissing: + description: 'Deprecated, use onlyChanged, onlyStoryNames or onlyStoryFiles instead' + required: false + projectToken: + description: 'Your chromatic project token (best provided via env.CHROMATIC_PROJECT_TOKEN)' + required: false + repositorySlug: + description: 'Override the repository slug (e.g. ownerName/repositoryName)' + required: false + skip: + description: 'Skip Chromatic tests, but mark the commit as passing' + required: false + skipUpdateCheck: + description: 'Skips Chromatic CLI update check' + required: false + storybookBaseDir: + description: 'Relative path from repository root to Storybook project root' + required: false + storybookBuildDir: + description: 'Provide a directory with your built storybook; use if you have already built your storybook' + required: false + storybookConfigDir: + description: 'Relative path from where you run Chromatic to your Storybook config directory' + required: false + storybookLogFile: + description: 'Write Storybook build logs to a file' + required: false + token: + description: 'Your github token' + required: false + traceChanged: + description: 'Print dependency trace for changed files to affected story files; set to "expanded" to list individual modules' + required: false + untraced: + description: 'Disregard these files and their dependencies when tracing dependent stories for TurboSnap' + required: false + uploadMetadata: + description: 'Upload Chromatic metadata files as part of the published Storybook' + required: false + workingDir: + description: 'Working directory for the package.json file' + required: false + zip: + description: 'Publish your Storybook to Chromatic as a single zip file instead of individual content files' + required: false + junitReport: + description: 'Write build results to a JUnit XML file' + required: false + +outputs: + code: + description: 'The exit code for the current run of the Chromatic CLI' + url: + description: 'An alias for the build URL (e.g. https://www.chromatic.com/build?appId=&number=)' + buildUrl: + description: 'The build URL (e.g. https://www.chromatic.com/build?appId=&number=)' + storybookUrl: + description: 'The Storybook preview URL for your current branch / Pull Request (e.g. https://-.chromatic.com/)' + specCount: + description: 'The number of stories in the published Storybook' + componentCount: + description: 'The number of components in the published Storybook' + testCount: + description: 'The number of tests on the build' + changeCount: + description: 'The number of tests with visual changes, including any inherited changes (e.g. due to TurboSnap)' + errorCount: + description: 'The number of tests with error(s), including any inherited errors (e.g. due to TurboSnap)' + interactionTestFailuresCount: + description: 'The number of stories with interaction test failures' + actualCaptureCount: + description: 'The number of captured snapshots' + inheritedCaptureCount: + description: 'The number of inherited (not captured) snapshots (e.g. due to TurboSnap)' + +runs: + main: action/register.js + using: node20 # Sync with `target` in tsup.config.ts diff --git a/package.json b/package.json new file mode 100644 index 00000000..1987abaa --- /dev/null +++ b/package.json @@ -0,0 +1,208 @@ +{ + "name": "chromatic", + "version": "11.11.0", + "description": "Automate visual testing across browsers. Gather UI feedback. Versioned documentation.", + "keywords": [ + "storybook-addon", + "storybook", + "addon", + "test", + "popular" + ], + "homepage": "https://www.chromatic.com", + "bugs": { + "url": "https://github.com/chromaui/chromatic-cli", + "email": "support@chromatic.com" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/chromaui/chromatic-cli.git" + }, + "license": "MIT", + "author": { + "name": "Chromatic", + "email": "support@chromatic.com" + }, + "exports": { + ".": { + "types": "./isChromatic.d.ts", + "require": "./isChromatic.js", + "import": "./isChromatic.mjs" + }, + "./node": { + "types": "./dist/node.d.ts", + "require": "./dist/node.js", + "node": "./dist/node.js" + }, + "./isChromatic": { + "types": "./isChromatic.d.ts", + "require": "./isChromatic.js", + "import": "./isChromatic.mjs" + }, + "./package.json": "./package.json" + }, + "main": "isChromatic.js", + "module": "isChromatic.mjs", + "typesVersions": { + "*": { + "*": [ + "./isChromatic.d.ts" + ], + "isChromatic": [ + "./isChromatic.d.ts" + ], + "node": [ + "dist/node.d.ts" + ] + } + }, + "bin": { + "chroma": "dist/bin.js", + "chromatic": "dist/bin.js", + "chromatic-cli": "dist/bin.js" + }, + "files": [ + "dist/*.js", + "dist/node.d.ts", + "isChromatic.js", + "isChromatic.mjs", + "isChromatic.d.ts" + ], + "resolutions": { + "any-observable": "^0.5.1" + }, + "devDependencies": { + "@actions/core": "^1.10.0", + "@actions/github": "^5.0.0", + "@antfu/ni": "^0.21.5", + "@auto-it/exec": "^11.0.4", + "@auto-it/slack": "^11.1.6", + "@discoveryjs/json-ext": "^0.5.7", + "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0", + "@sentry/cli": "^2.37.0", + "@sentry/node": "^8.30.0", + "@storybook/addon-essentials": "^8.1.5", + "@storybook/addon-webpack5-compiler-swc": "^1.0.3", + "@storybook/csf-tools": "^8.1.5", + "@storybook/linter-config": "^4.0.0", + "@storybook/react": "^8.1.5", + "@storybook/react-webpack5": "^8.1.5", + "@tsconfig/node16": "^16.1.1", + "@types/archiver": "^5.3.1", + "@types/async-retry": "^1.4.3", + "@types/cross-spawn": "^6.0.2", + "@types/fs-extra": "^9.0.13", + "@types/jsonfile": "^6.0.1", + "@types/listr": "^0.14.4", + "@types/node": "18.x", + "@types/picomatch": "^2.3.0", + "@types/progress-stream": "^2.0.2", + "@types/prompts": "^2.4.9", + "@types/semver": "^7.3.9", + "@types/webpack-env": "^1.18.5", + "@typescript-eslint/eslint-plugin": "^6.8.0", + "@typescript-eslint/parser": "^6.8.0", + "@vitest/coverage-v8": "^2.0.5", + "ansi-html": "0.0.9", + "any-observable": "^0.5.1", + "archiver": "^5.3.0", + "async-retry": "^1.3.3", + "auto": "^11.0.5", + "boxen": "^7.1.1", + "chalk": "^4.1.2", + "clean-package": "^2.2.0", + "cpy": "^8.1.2", + "cross-env": "^7.0.3", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "dotenv": "^8.2.0", + "env-ci": "^5.0.2", + "eslint": "^9.10.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsdoc": "^48.2.6", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-no-secrets": "^1.0.2", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-security": "^3.0.0", + "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-sort-class-members": "^1.20.0", + "eslint-plugin-unicorn": "^53.0.0", + "esm": "^3.2.25", + "execa": "^7.2.0", + "fake-tag": "^2.0.0", + "filesize": "^10.1.0", + "find-up": "^7.0.0", + "formdata-node": "^6.0.3", + "fs-extra": "^10.0.0", + "globals": "^15.3.0", + "https-proxy-agent": "^7.0.2", + "husky": "^7.0.0", + "jsonfile": "^6.0.1", + "junit-report-builder": "2.1.0", + "listr": "0.14.3", + "listr-update-renderer": "^0.5.0", + "meow": "^9.0.0", + "mock-fs": "^5.1.2", + "no-proxy": "^1.0.3", + "node-ask": "^1.0.1", + "node-fetch": "3.2.10", + "npm-run-all": "^4.0.2", + "observable": "^2.1.4", + "os-browserify": "^0.3.0", + "p-limit": "3.1.0", + "picomatch": "2.2.2", + "pkg-up": "^3.1.0", + "pluralize": "^8.0.0", + "prettier": "^3.2.5", + "progress-stream": "^2.0.0", + "prompts": "^2.4.2", + "prop-types": "^15.7.2", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "read-pkg-up": "^7.0.1", + "semver": "^7.3.5", + "slash": "^3.0.0", + "snyk-nodejs-lockfile-parser": "^1.52.1", + "sort-package-json": "1.50.0", + "storybook": "^8.1.5", + "string-argv": "^0.3.1", + "strip-ansi": "^7.1.0", + "tmp-promise": "3.0.2", + "ts-dedent": "^1.0.0", + "ts-loader": "^9.2.5", + "tsup": "^7.2.0", + "typescript": "^5.2.2", + "typescript-eslint": "^7.11.0", + "util-deprecate": "^1.0.2", + "uuid": "^8.3.2", + "vite": "^4.4.9", + "vitest": "^2.0.5", + "why-is-node-running": "^2.1.2", + "xxhash-wasm": "^1.0.2", + "yarn-or-npm": "^3.0.1", + "zen-observable": "^0.8.15", + "zod": "^3.22.2" + }, + "peerDependencies": { + "@chromatic-com/cypress": "^0.*.* || ^1.0.0", + "@chromatic-com/playwright": "^0.*.* || ^1.0.0" + }, + "peerDependenciesMeta": { + "@chromatic-com/cypress": { + "optional": true + }, + "@chromatic-com/playwright": { + "optional": true + } + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "docs": "https://www.chromatic.com/docs/cli", + "storybook": { + "icon": "https://user-images.githubusercontent.com/263385/101995175-2e087800-3c96-11eb-9a33-9860a1c3ce62.gif", + "displayName": "Chromatic" + } +}