Skip to content

Commit

Permalink
Merge branch 'main' into deprecate-node-16
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Nov 7, 2023
2 parents b59a91c + aed31de commit f6023ed
Show file tree
Hide file tree
Showing 45 changed files with 1,176 additions and 567 deletions.
16 changes: 0 additions & 16 deletions auto.config.ts

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check PR Labels
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]

jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: chromaui/pr-label-checker-action@main
with:
one-of: |
major, minor, patch
release, next-release, skip-release
none-of: DO NOT MERGE
16 changes: 14 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ansiHTML.setColors({
chalk.enabled = true;
chalk.level = 3;

const style = {
const codeStyle = {
display: 'inline-block',
margin: 0,
padding: '1rem',
Expand All @@ -28,6 +28,14 @@ const style = {
color: '#c0c4cd',
};

const htmlStyle = {
fontFamily: "'Nunito Sans', sans-serif",
fontSize: 14,
lineHeight: '1',
color: '#5C6870',
padding: 20,
};

export const parameters = {
layout: 'fullscreen',
};
Expand All @@ -36,7 +44,11 @@ export const decorators = [
(storyFn, { kind }) => {
if (kind.startsWith('CLI/')) {
document.body.style.backgroundColor = '#16242c';
return <code style={style} dangerouslySetInnerHTML={{ __html: ansiHTML(storyFn()) }} />;
return <code style={codeStyle} dangerouslySetInnerHTML={{ __html: ansiHTML(storyFn()) }} />;
}
if (kind.startsWith('HTML/')) {
document.body.style.backgroundColor = '#F6F9FC';
return <div style={htmlStyle} dangerouslySetInnerHTML={{ __html: storyFn() }} />;
}
document.body.style.backgroundColor = 'paleturquoise';
return storyFn();
Expand Down
84 changes: 84 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
# v7.6.0 (Tue Oct 31 2023)

#### 🚀 Enhancement

- Merge Group (Queues) GitHub Action Event Support [#825](https://github.com/chromaui/chromatic-cli/pull/825) ([@mhemmings](https://github.com/mhemmings) [@thafryer](https://github.com/thafryer))

#### 🐛 Bug Fix

- Configure auto with `prerelease` setting and update readme [#847](https://github.com/chromaui/chromatic-cli/pull/847) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 3

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
- Jarel Fryer ([@thafryer](https://github.com/thafryer))
- Mark Hemmings ([@mhemmings](https://github.com/mhemmings))

---

# v7.5.4 (Thu Oct 26 2023)

#### 🐛 Bug Fix

- Configure auto with `prerelease` setting and update readme [#847](https://github.com/chromaui/chromatic-cli/pull/847) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.5.3 (Thu Oct 26 2023)

#### 🐛 Bug Fix

- Fix config for Auto and add `next-release` tag to trigger a `next` release [#846](https://github.com/chromaui/chromatic-cli/pull/846) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.5.2 (Thu Oct 26 2023)

#### 🐛 Bug Fix

- Fix `ENOENT` when uploading stats file with `--upload-metadata` [#843](https://github.com/chromaui/chromatic-cli/pull/843) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.5.1 (Thu Oct 26 2023)

#### 🐛 Bug Fix

- Fix use of `LoggingRenderer` after bad merge [#845](https://github.com/chromaui/chromatic-cli/pull/845) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.5.0 (Tue Oct 24 2023)

#### 🚀 Enhancement

- Write to log file and add `--upload-metadata` to publish metadata files [#836](https://github.com/chromaui/chromatic-cli/pull/836) ([@ghengeveld](https://github.com/ghengeveld))

#### 🐛 Bug Fix

- Add workflow to require certain PR labels before merging [#841](https://github.com/chromaui/chromatic-cli/pull/841) ([@ghengeveld](https://github.com/ghengeveld))
- Fix reading `diagnostics` from undefined [#840](https://github.com/chromaui/chromatic-cli/pull/840) ([@ghengeveld](https://github.com/ghengeveld))
- Only release 'latest' GitHub Action from `main` branch [#837](https://github.com/chromaui/chromatic-cli/pull/837) ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v7.4.0 (Fri Oct 13 2023)

#### 🚀 Enhancement
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ We use `auto` to automate the release process. Versions are bumped, tags are cre

Additionally, a PR **may** have exactly one of these labels:

- `release` creates a `latest` rather than a `next` release (see below)
- `release` creates a `latest` rather than a `next` release on npm
- `next-release` creates a `next` rather than a `latest` release on npm
- `skip-release` does not create a release at all

We have three types of releases:

- `latest` releases are the general audience production releases, used by most people. Automatically created when merging a PR with the `release` label.
- `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. Automatically created when merging a PR without the `release` and `skip-release` labels.
- `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. Automatically created when merging a PR with the `next-release` label.
- `canary` releases are intended for testing purposes and should not be used in production, as they may only work against a staging or dev environment. Automatically created on every PR, but does not auto-publush the GitHub Action.

> For GitHub Actions, we publish `chromaui/action-next` and `chromaui/action-canary`. The latter is only published manually, rather than for every PR.
Expand Down
27 changes: 10 additions & 17 deletions action-src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const getBuildInfo = (event: typeof context) => {
}
case 'workflow_run': {
const { repository } = event.payload;
// eslint-disable-next-line @typescript-eslint/naming-convention
const { head_sha, head_branch } = event.payload.workflow_run;

return {
Expand Down Expand Up @@ -69,29 +68,21 @@ const getBuildInfo = (event: typeof context) => {
slug: event.payload.repository.full_name,
};
}
case 'merge_group': {
const { head_sha, head_ref } = event.payload.merge_group;
return {
sha: head_sha,
branch: head_ref,
slug: event.payload.repository.full_name,
};
}
default: {
setFailed(`${event.eventName} event is not supported in this action`);
return null;
}
}
};

interface Output {
code: number;
url: string;
buildUrl: string;
storybookUrl: string;
specCount: number;
componentCount: number;
testCount: number;
changeCount: number;
errorCount: number;
interactionTestFailuresCount: number;
actualTestCount: number;
actualCaptureCount: number;
inheritedCaptureCount: number;
}

async function run() {
const { sha, branch, slug, mergeCommit } = getBuildInfo(context) || {};
if (!sha || !branch || !slug) return;
Expand Down Expand Up @@ -123,6 +114,7 @@ async function run() {
const storybookConfigDir = getInput('storybookConfigDir');
const traceChanged = getInput('traceChanged');
const untraced = getInput('untraced');
const uploadMetadata = getInput('uploadMetadata');
const workingDir = getInput('workingDir') || getInput('workingDirectory');
const zip = getInput('zip');
const junitReport = getInput('junitReport');
Expand Down Expand Up @@ -165,6 +157,7 @@ async function run() {
storybookConfigDir: maybe(storybookConfigDir),
traceChanged: maybe(traceChanged),
untraced: maybe(untraced),
uploadMetadata: maybe(uploadMetadata, false),
zip: maybe(zip, false),
junitReport: maybe(junitReport, false),
},
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ inputs:
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
Expand Down
1 change: 1 addition & 0 deletions bin-src/trim-stats-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function main([statsFile = './storybook-static/preview-stats.json']
);

console.log(`Wrote ${targetFile}`);
return targetFile;
} catch (err) {
console.error(err);
}
Expand Down

0 comments on commit f6023ed

Please sign in to comment.