From c0cf9d8baea205f6b0153bff4eb21e81c00ecfa2 Mon Sep 17 00:00:00 2001 From: nisshii0313 Date: Thu, 4 Mar 2021 11:18:20 +0900 Subject: [PATCH 1/6] add @storybook/vue3 support --- bin/lib/getStorybookInfo.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/lib/getStorybookInfo.js b/bin/lib/getStorybookInfo.js index ebc5e613e..dcf5b5be1 100644 --- a/bin/lib/getStorybookInfo.js +++ b/bin/lib/getStorybookInfo.js @@ -5,6 +5,7 @@ import fs from 'fs-extra'; const viewLayers = [ 'react', 'vue', + 'vue3', 'angular', 'html', 'web-components', From 92466f556974677c0165c27253ca022e77eb06e6 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Wed, 3 Mar 2021 23:58:45 -0500 Subject: [PATCH 2/6] Document outputs in action.yml --- action.yml | 60 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/action.yml b/action.yml index 206cb0e28..4454dc913 100755 --- a/action.yml +++ b/action.yml @@ -1,55 +1,65 @@ name: Publish to Chromatic author: Chroma Software, Inc. -description: "Publish your Storybook to Chromatic and run visual regression tests" +description: 'Publish your Storybook to Chromatic and run visual regression tests' branding: - icon: "aperture" - color: "orange" + icon: 'aperture' + color: 'orange' inputs: token: - description: "Your github token" + description: 'Your github token' projectToken: - description: "Your chromatic project token" + description: 'Your chromatic project token' workingDir: - description: "Working directory for the package.json file" + description: 'Working directory for the package.json file' appCode: - description: "Deprecated, please use projectToken instead" + description: 'Deprecated, please use projectToken instead' buildScriptName: - description: "The npm script that builds your Storybook [build-storybook]" + description: 'The npm script that builds your Storybook [build-storybook]' scriptName: - description: "The npm script that starts your Storybook [storybook]" + description: 'The npm script that starts your Storybook [storybook]' exec: - description: "Alternatively, a full command to run to start your storybook" + description: 'Alternatively, a full command to run to start your storybook' skip: - description: "Skip Chromatic tests, but mark the commit as passing" + description: 'Skip Chromatic tests, but mark the commit as passing' doNotStart: - description: "Do not attempt to start or build; use if your Storybook is already running" + description: 'Do not attempt to start or build; use if your Storybook is already running' storybookBuildDir: - description: "Provide a directory with your built storybook; use if you have already built your storybook" + description: 'Provide a directory with your built storybook; use if you have already built your storybook' storybookCa: - description: "Use if Storybook is running on https (auto detected from -s, if set)" + description: 'Use if Storybook is running on https (auto detected from -s, if set)' storybookCert: - description: "Use if Storybook is running on https (auto detected from -s, if set)" + description: 'Use if Storybook is running on https (auto detected from -s, if set)' storybookHttps: - description: "Use if Storybook is running on https (auto detected from -s, if set)" + description: 'Use if Storybook is running on https (auto detected from -s, if set)' storybookKey: - description: "Use if Storybook is running on https (auto detected from -s, if set)" + description: 'Use if Storybook is running on https (auto detected from -s, if set)' storybookPort: - description: "What port is your Storybook running on (auto detected from -s, if set)" + description: 'What port is your Storybook running on (auto detected from -s, if set)' storybookUrl: - description: "Storybook is already running at (external) url (implies -S)" + description: 'Storybook is already running at (external) url (implies -S)' preserveMissing: - description: "Pass the baselines forward and treat all missing stories as “preserved” without re-capturing them" + description: 'Pass the baselines forward and treat all missing stories as “preserved” without re-capturing them' autoAcceptChanges: - description: "Automatically accept all changes in chromatic: boolean or branchname" + description: 'Automatically accept all changes in chromatic: boolean or branchname' allowConsoleErrors: - description: "Do not exit when runtime errors occur in storybook" + description: 'Do not exit when runtime errors occur in storybook' exitZeroOnChanges: - description: "Positive exit of action even when there are changes: boolean or branchname" + description: 'Positive exit of action even when there are changes: boolean or branchname' exitOnceUploaded: - description: "Exit with 0 once the built version has been sent to chromatic: boolean or branchname" + description: 'Exit with 0 once the built version has been sent to chromatic: boolean or branchname' 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)" + 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)' + +outputs: + 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/) + code: + description: The exit code for the current run of the Chromatic CLI runs: main: action/register.js From b4192dcaedf1798de1802c937c5dd26258235230 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Thu, 4 Mar 2021 00:03:16 -0500 Subject: [PATCH 3/6] Add missing `required` field from GitHub Action schema --- action.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/action.yml b/action.yml index 4454dc913..f555d738d 100755 --- a/action.yml +++ b/action.yml @@ -8,48 +8,70 @@ branding: inputs: token: description: 'Your github token' + required: true projectToken: description: 'Your chromatic project token' + required: true workingDir: description: 'Working directory for the package.json file' + required: false appCode: description: 'Deprecated, please use projectToken instead' + required: false buildScriptName: description: 'The npm script that builds your Storybook [build-storybook]' + required: false scriptName: description: 'The npm script that starts your Storybook [storybook]' + required: false exec: description: 'Alternatively, a full command to run to start your storybook' + required: false skip: description: 'Skip Chromatic tests, but mark the commit as passing' + required: false doNotStart: description: 'Do not attempt to start or build; use if your Storybook is already running' + required: false storybookBuildDir: description: 'Provide a directory with your built storybook; use if you have already built your storybook' + required: false storybookCa: description: 'Use if Storybook is running on https (auto detected from -s, if set)' + required: false storybookCert: description: 'Use if Storybook is running on https (auto detected from -s, if set)' + required: false storybookHttps: description: 'Use if Storybook is running on https (auto detected from -s, if set)' + required: false storybookKey: description: 'Use if Storybook is running on https (auto detected from -s, if set)' + required: false storybookPort: description: 'What port is your Storybook running on (auto detected from -s, if set)' + required: false storybookUrl: description: 'Storybook is already running at (external) url (implies -S)' + required: false preserveMissing: description: 'Pass the baselines forward and treat all missing stories as “preserved” without re-capturing them' + required: false autoAcceptChanges: description: 'Automatically accept all changes in chromatic: boolean or branchname' + required: false allowConsoleErrors: description: 'Do not exit when runtime errors occur in storybook' + required: false exitZeroOnChanges: description: 'Positive exit of action even when there are changes: boolean or branchname' + required: false exitOnceUploaded: description: 'Exit with 0 once the built version has been sent to chromatic: boolean or branchname' + 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 outputs: url: From eccc9460c05c5424a8c9ff613bf36a6a613664d3 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Thu, 4 Mar 2021 00:10:11 -0500 Subject: [PATCH 4/6] Document action outputs in Readme --- action/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/action/README.md b/action/README.md index d1f70470f..fe8bcc32b 100755 --- a/action/README.md +++ b/action/README.md @@ -68,6 +68,15 @@ We suggest you use a secret to hide the project token: You can to configure secrets in the repository settings (`///settings/secrets`). However if you need to be able to run this action on pull requests from forks, because those can't access your secret. +### Outputs + +| Name | Type | Description | +| --- | --- | --- | +| `url` | string | An alias for the build URL (e.g. `https://www.chromatic.com/build?appId=&number=)` | +| `buildUrl` | string | The build URL (e.g. `https://www.chromatic.com/build?appId=&number=`) | +| `storybookUrl` | string | The Storybook preview URL for your current branch / Pull Request (e.g. `https://-.chromatic.com/`) | +| `code` | string | The exit code for the current run of the Chromatic CLI | + ## Checkout depth Version 2 of the `actions/checkout` action will only checkout a single commit without history by default. Chromatic needs the full git history in order to track changes over time. Set `fetch-depth: 0` to enable this. See [actions/checkout](https://github.com/actions/checkout#readme) for details. From 3bfa34dd2217b1c25f6a56ae53748f91c07ccabf Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Thu, 4 Mar 2021 00:14:21 -0500 Subject: [PATCH 5/6] Beautify this table real quick --- action/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/action/README.md b/action/README.md index fe8bcc32b..04a03fc73 100755 --- a/action/README.md +++ b/action/README.md @@ -70,12 +70,12 @@ You can to configure secrets in the repository settings (`/// ### Outputs -| Name | Type | Description | -| --- | --- | --- | -| `url` | string | An alias for the build URL (e.g. `https://www.chromatic.com/build?appId=&number=)` | -| `buildUrl` | string | The build URL (e.g. `https://www.chromatic.com/build?appId=&number=`) | +| Name | Type | Description | +| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- | +| `url` | string | An alias for the build URL (e.g. `https://www.chromatic.com/build?appId=&number=)` | +| `buildUrl` | string | The build URL (e.g. `https://www.chromatic.com/build?appId=&number=`) | | `storybookUrl` | string | The Storybook preview URL for your current branch / Pull Request (e.g. `https://-.chromatic.com/`) | -| `code` | string | The exit code for the current run of the Chromatic CLI | +| `code` | string | The exit code for the current run of the Chromatic CLI | ## Checkout depth From 392d33322b54ea9a541f2f8d6bce68250de4c8e9 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Thu, 4 Mar 2021 08:56:10 -0500 Subject: [PATCH 6/6] Fix quotes on output descriptions in action.yml --- action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index f555d738d..810d307c3 100755 --- a/action.yml +++ b/action.yml @@ -75,13 +75,13 @@ inputs: outputs: url: - description: An alias for the build URL (e.g. https://www.chromatic.com/build?appId=&number=) + 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=) + 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/) + description: 'The Storybook preview URL for your current branch / Pull Request (e.g. https://-.chromatic.com/)' code: - description: The exit code for the current run of the Chromatic CLI + description: 'The exit code for the current run of the Chromatic CLI' runs: main: action/register.js