From 9380ecfe1ac1cf452a64a3c51019f95cbe3f9462 Mon Sep 17 00:00:00 2001 From: Adrian Macneil Date: Wed, 3 Mar 2021 17:24:54 -0800 Subject: [PATCH 01/15] Support yarn execpath --- bin/tasks/build.js | 2 +- bin/tasks/build.test.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/tasks/build.js b/bin/tasks/build.js index fcda2fd49..52737b9b6 100644 --- a/bin/tasks/build.js +++ b/bin/tasks/build.js @@ -27,7 +27,7 @@ export const setSpawnParams = (ctx) => { // Based on https://github.com/mysticatea/npm-run-all/blob/52eaf86242ba408dedd015f53ca7ca368f25a026/lib/run-task.js#L156-L174 const npmExecPath = process.env.npm_execpath; const isJsPath = typeof npmExecPath === 'string' && /\.m?js/.test(path.extname(npmExecPath)); - const isYarn = npmExecPath && path.basename(npmExecPath) === 'yarn.js'; + const isYarn = npmExecPath && /^yarn(\.js)?$/.test(path.basename(npmExecPath)); ctx.spawnParams = { command: (isJsPath ? process.execPath : npmExecPath) || 'npm', clientArgs: isJsPath ? [npmExecPath, 'run'] : ['run', '--silent'], diff --git a/bin/tasks/build.test.js b/bin/tasks/build.test.js index ad98b77ea..fbc1d7a76 100644 --- a/bin/tasks/build.test.js +++ b/bin/tasks/build.test.js @@ -41,6 +41,17 @@ describe('setSpawnParams', () => { scriptArgs: ['build:storybook', '--', '--output-dir', './source-dir/'], }); }); + + it('supports yarn', async () => { + process.env.npm_execpath = '/path/to/yarn'; + const ctx = { sourceDir: './source-dir/', options: { buildScriptName: 'build:storybook' } }; + await setSpawnParams(ctx); + expect(ctx.spawnParams).toEqual({ + command: '/path/to/yarn', + clientArgs: ['run', '--silent'], + scriptArgs: ['build:storybook', '--output-dir', './source-dir/'], + }); + }); }); describe('buildStorybook', () => { From c0cf9d8baea205f6b0153bff4eb21e81c00ecfa2 Mon Sep 17 00:00:00 2001 From: nisshii0313 Date: Thu, 4 Mar 2021 11:18:20 +0900 Subject: [PATCH 02/15] 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 03/15] 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 04/15] 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 05/15] 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 06/15] 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 07/15] 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 From 44aa1f273d07d7c2f0e24e5246e9cef81169867a Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Tue, 9 Mar 2021 16:09:25 +0100 Subject: [PATCH 08/15] Strip off origin/* prefix --- bin/git/getCommitAndBranch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/git/getCommitAndBranch.js b/bin/git/getCommitAndBranch.js index 8862680e1..0a54ddbe3 100644 --- a/bin/git/getCommitAndBranch.js +++ b/bin/git/getCommitAndBranch.js @@ -85,6 +85,9 @@ export async function getCommitAndBranch({ branchName, patchBaseRef, ci, log } = !!process.env.REPOSITORY_URL || // https://www.netlify.com/docs/continuous-deployment/ !!process.env.GITHUB_REPOSITORY; + // Strip off any `origin/` prefix that's added sometimes. + if (!branchName && !isFromEnvVariable) branch = branch.replace(/^origin\//, ''); + log.debug( `git info: ${JSON.stringify({ commit, From dd7ab5da4649b7fb8dade0e2f464543a454f0ac0 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Tue, 9 Mar 2021 16:22:45 +0100 Subject: [PATCH 09/15] Warn when origin prefix is stripped --- bin/git/getCommitAndBranch.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/git/getCommitAndBranch.js b/bin/git/getCommitAndBranch.js index 0a54ddbe3..55b64afd0 100644 --- a/bin/git/getCommitAndBranch.js +++ b/bin/git/getCommitAndBranch.js @@ -6,6 +6,7 @@ import missingTravisInfo from '../ui/messages/errors/missingTravisInfo'; import travisInternalBuild from '../ui/messages/warnings/travisInternalBuild'; import { getBranch, getCommit, hasPreviousCommit } from './git'; +const ORIGIN_PREFIX_REGEXP = /^origin\//; const notHead = (branch) => (branch && branch !== 'HEAD' ? branch : false); export async function getCommitAndBranch({ branchName, patchBaseRef, ci, log } = {}) { @@ -86,7 +87,10 @@ export async function getCommitAndBranch({ branchName, patchBaseRef, ci, log } = !!process.env.GITHUB_REPOSITORY; // Strip off any `origin/` prefix that's added sometimes. - if (!branchName && !isFromEnvVariable) branch = branch.replace(/^origin\//, ''); + if (!branchName && !isFromEnvVariable && ORIGIN_PREFIX_REGEXP.test(branch)) { + log.warn(`Ignoring 'origin/' prefix in branch name.`); + branch = branch.replace(ORIGIN_PREFIX_REGEXP, ''); + } log.debug( `git info: ${JSON.stringify({ From bc321ec567c1ef58ac54aa585d71c971c028482b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:05:29 +0000 Subject: [PATCH 10/15] Bump elliptic from 6.5.3 to 6.5.4 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4) Signed-off-by: dependabot[bot] --- yarn.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/yarn.lock b/yarn.lock index 974f1d64f..1b348970a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4127,10 +4127,10 @@ bluebird@^3.3.5, bluebird@^3.5.5: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0: - version "4.11.9" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" - integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== bn.js@^5.0.0, bn.js@^5.1.1: version "5.1.3" @@ -4203,7 +4203,7 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -brorand@^1.0.1: +brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= @@ -5618,17 +5618,17 @@ element-resize-detector@^1.2.1: batch-processor "1.0.0" elliptic@^6.5.3: - version "6.5.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" - integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" + bn.js "^4.11.9" + brorand "^1.1.0" hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" emittery@^0.7.1: version "0.7.2" @@ -7128,7 +7128,7 @@ highlight.js@^10.1.1, highlight.js@~10.4.0: resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.4.1.tgz#d48fbcf4a9971c4361b3f95f302747afe19dbad0" integrity sha512-yR5lWvNz7c85OhVAEAeFhVCc/GV4C30Fjzc/rCP0aCWzc1UUOPUk55dK/qdwTZHBvMZo+eZ2jpk62ndX/xMFlg== -hmac-drbg@^1.0.0: +hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= @@ -9119,7 +9119,7 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: +minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= From f71c06b6a72ba0d37349d7fe866f01b4c20d5554 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Thu, 11 Mar 2021 11:56:35 +0100 Subject: [PATCH 11/15] Update compiled action --- action/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action/main.js b/action/main.js index f32a17198..7772a9479 100644 --- a/action/main.js +++ b/action/main.js @@ -128,7 +128,7 @@ function runChromatic(options) { url: (_a = ctx.build) === null || _a === void 0 ? void 0 : _a.webUrl, code: ctx.exitCode, buildUrl: (_b = ctx.build) === null || _b === void 0 ? void 0 : _b.webUrl, - storybookUrl: (_c = ctx.build) === null || _c === void 0 ? void 0 : _c.isolatorUrl + storybookUrl: (_c = ctx.build) === null || _c === void 0 ? void 0 : _c.cachedUrl }]; } }); From 1de55dde19056fb2b113e0ca4d96098b4afabec6 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Thu, 11 Mar 2021 22:22:30 +1100 Subject: [PATCH 12/15] The tunnel is still hosted at chromaticqa.com --- bin/lib/getEnv.js | 2 +- bin/tasks/tunnel.test.js | 8 ++++---- bin/tasks/verify.test.js | 2 +- bin/ui/tasks/tunnel.stories.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/lib/getEnv.js b/bin/lib/getEnv.js index 83891a7eb..3c1fa9a00 100644 --- a/bin/lib/getEnv.js +++ b/bin/lib/getEnv.js @@ -2,7 +2,7 @@ const { CHROMATIC_SERVER_PORT = 3004, CHROMATIC_INDEX_URL = 'https://index.chromatic.com', - CHROMATIC_TUNNEL_URL = 'https://tunnel.chromatic.com', + CHROMATIC_TUNNEL_URL = 'https://tunnel.chromaticqa.com', CHROMATIC_CREATE_TUNNEL = 'true', CHROMATIC_RETRIES = 5, CHROMATIC_POLL_INTERVAL = 1000, diff --git a/bin/tasks/tunnel.test.js b/bin/tasks/tunnel.test.js index c64480980..4caece30e 100644 --- a/bin/tasks/tunnel.test.js +++ b/bin/tasks/tunnel.test.js @@ -10,19 +10,19 @@ const log = { debug: jest.fn() }; describe('createTunnel', () => { it('opens the tunnel and sets the isolatorUrl on context', async () => { - openTunnel.mockReturnValue({ url: 'https://tunnel.chromatic.com' }); + openTunnel.mockReturnValue({ url: 'https://tunnel.chromaticqa.com' }); const ctx = { log, isolatorUrl: 'http://localhost:9001', options: {} }; await createTunnel(ctx); expect(openTunnel).toHaveBeenCalledWith({ log, port: '9001', https: undefined }); - expect(ctx.isolatorUrl).toBe('https://tunnel.chromatic.com/'); + expect(ctx.isolatorUrl).toBe('https://tunnel.chromaticqa.com/'); }); }); describe('testConnection', () => { it('tries to fetch the isolatorUrl', async () => { - testConnection({ isolatorUrl: 'https://tunnel.chromatic.com' }); - expect(fetch).toHaveBeenCalledWith('https://tunnel.chromatic.com'); + testConnection({ isolatorUrl: 'https://tunnel.chromaticqa.com' }); + expect(fetch).toHaveBeenCalledWith('https://tunnel.chromaticqa.com'); }); }); diff --git a/bin/tasks/verify.test.js b/bin/tasks/verify.test.js index 7390b6120..f14ba80b3 100644 --- a/bin/tasks/verify.test.js +++ b/bin/tasks/verify.test.js @@ -28,7 +28,7 @@ describe('createBuild', () => { git: { version: 'whatever', matchesBranch: () => false }, pkg: { version: '1.0.0' }, storybook: { version: '2.0.0', viewLayer: 'react', addons: [] }, - isolatorUrl: 'https://tunnel.chromatic.com/', + isolatorUrl: 'https://tunnel.chromaticqa.com/', }; it('creates a build on the index and puts it on context', async () => { diff --git a/bin/ui/tasks/tunnel.stories.js b/bin/ui/tasks/tunnel.stories.js index fd3794bb2..66b5d6532 100644 --- a/bin/ui/tasks/tunnel.stories.js +++ b/bin/ui/tasks/tunnel.stories.js @@ -6,7 +6,7 @@ export default { decorators: [(storyFn) => task(storyFn())], }; -const CHROMATIC_TUNNEL_URL = 'https://tunnel.chromatic.com'; +const CHROMATIC_TUNNEL_URL = 'https://tunnel.chromaticqa.com'; const cachedUrl = 'https://fdeulpymiq.tunnel.chromatic.com/iframe.html'; export const Initial = () => initial; From 0bce217583e32524776f7672d92f597ed15ac93d Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Thu, 11 Mar 2021 22:25:09 +1100 Subject: [PATCH 13/15] Couple more --- bin/ui/messages/errors/fatalError.stories.js | 2 +- bin/ui/tasks/tunnel.stories.js | 2 +- stories/timing.stories-disabled.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ui/messages/errors/fatalError.stories.js b/bin/ui/messages/errors/fatalError.stories.js index 5569d39f9..9530f48fb 100644 --- a/bin/ui/messages/errors/fatalError.stories.js +++ b/bin/ui/messages/errors/fatalError.stories.js @@ -36,7 +36,7 @@ const context = { number: 1400, webUrl: 'https://www.chromatic.com/build?appId=5d67dc0374b2e300209c41e7&number=1400', }, - isolatorUrl: 'https://pfkaemtlit.tunnel.chromatic.com/iframe.html', + isolatorUrl: 'https://pfkaemtlit.tunnel.chromaticqa.com/iframe.html', cachedUrl: 'https://5d67dc0374b2e300209c41e7-pfkaemtlit.chromatic.com/iframe.html', }; diff --git a/bin/ui/tasks/tunnel.stories.js b/bin/ui/tasks/tunnel.stories.js index 66b5d6532..1b770e907 100644 --- a/bin/ui/tasks/tunnel.stories.js +++ b/bin/ui/tasks/tunnel.stories.js @@ -7,7 +7,7 @@ export default { }; const CHROMATIC_TUNNEL_URL = 'https://tunnel.chromaticqa.com'; -const cachedUrl = 'https://fdeulpymiq.tunnel.chromatic.com/iframe.html'; +const cachedUrl = 'https://fdeulpymiq.tunnel.chromaticqa.com/iframe.html'; export const Initial = () => initial; diff --git a/stories/timing.stories-disabled.js b/stories/timing.stories-disabled.js index 0cac2c528..3fd9f89bf 100644 --- a/stories/timing.stories-disabled.js +++ b/stories/timing.stories-disabled.js @@ -6,7 +6,7 @@ import React, { useState } from 'react'; // Some stories to test out timing code. Disabled by default // These stories are available at (e.g.) -// http://vmdbnybkvx.tunnel.staging-chromatic.com/iframe.html?id=timing--5s +// http://vmdbnybkvx.staging-tunnel.chromaticqa.com/iframe.html?id=timing--5s // A component that guarantees the load event won't load for timeout seconds // Note that the img loading tends to take a litle longer so this is a minimum From 147a2e01ccddfed96a43aeaa9e95c8a4035b3563 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Thu, 11 Mar 2021 13:32:02 +0100 Subject: [PATCH 14/15] Adopt prerelease scheme from 'auto' --- README.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 76820550b..92b936167 100644 --- a/README.md +++ b/README.md @@ -42,32 +42,36 @@ Before publishing, make sure you've done the following: - Committed and pushed everything - Decide on the proper semver bump (major/minor/patch) -#### Doing a `dev` or `rc` release +#### Doing a `canary` or `next` release -We have two types of pre-releases: `dev` and `rc`. `dev` releases are intended for development purposes and should not be used in production, as they may only work against a staging or dev environment. `rc` releases should be valid, working releases that can potentially be used by early adopters of new features, for example to handle a support request. +We have two types of pre-releases: `canary` and `next`. `canary` releases are intended for development purposes and should not be used in production, as they may only work against a staging or dev environment. `next` releases should be valid, working releases that can potentially be used by early adopters of new features, for example to handle a support request. -For the first `dev` (or `rc`) release, bump the version like so (depending on the semver bump): +> Users should *not* use tags in their package.json (e.g. `chromatic@next`), but rather specific version numbers (e.g. `chromatic@5.6.2-next.0`). Otherwise they'll end up with a broken build when we remove or update the tag. + +For the first `canary` (or `next`) release, bump the version like so (depending on the semver bump): ```sh -npm version --preid dev +npm version --preid canary ``` -For consecutive `dev` releases on the same version: +For consecutive `canary` releases on the same version: ```sh -npm version prerelease --preid=dev +npm version prerelease --preid=canary ``` Then push and publish: ```sh git push --follow-tags -npm publish --tag dev +npm publish --tag canary ``` -Make sure to replace `dev` with `rc` if appropriate. +Make sure to replace `canary` with `next` if appropriate. + +#### Doing a `latest` release -#### Doing a final release +A final release is automatically tagged `latest` by npm. ```sh npm version @@ -76,8 +80,10 @@ npm publish yarn publish-action ``` -And finally, remove the `dev` and/or `rc` tag, if any: +And finally, remove the `canary` and/or `next` tag, if any: ``` -npm dist-tag rm chromatic dev +npm dist-tag rm chromatic canary ``` + +This ensures we can safely do a new `canary` or `next` release later, without anyone getting an unexpected update. From abb85910e781405c7229ef63f25e362bfd2f8343 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Thu, 11 Mar 2021 13:34:57 +0100 Subject: [PATCH 15/15] Update tag warning --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92b936167..0f1080869 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Before publishing, make sure you've done the following: We have two types of pre-releases: `canary` and `next`. `canary` releases are intended for development purposes and should not be used in production, as they may only work against a staging or dev environment. `next` releases should be valid, working releases that can potentially be used by early adopters of new features, for example to handle a support request. -> Users should *not* use tags in their package.json (e.g. `chromatic@next`), but rather specific version numbers (e.g. `chromatic@5.6.2-next.0`). Otherwise they'll end up with a broken build when we remove or update the tag. +> As a consumer, **you should not specify a tag** (e.g. `chromatic@next`) in your package dependencies, but rather a specific version number (e.g. `chromatic@5.6.2-next.0`). Otherwise you'll end up with a broken build when we remove or update the tag. For the first `canary` (or `next`) release, bump the version like so (depending on the semver bump):