Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"snapshot": {
"useCalculatedVersion": true
}
}
}
4 changes: 2 additions & 2 deletions .changeset/esm-only-node-22.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@chromatic-com/cypress': minor
'@chromatic-com/playwright': minor
"@chromatic-com/cypress": minor
"@chromatic-com/playwright": minor
---

Feat: Convert all packages to ESM-only, require Node.js 22
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name: Release

on:
workflow_run:
workflows: ['Test and Release Main']
workflows: ["Test and Release Main"]
types: [completed]

permissions:
Expand All @@ -45,8 +45,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
cache: pnpm

- name: Install Dependencies
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
node-version-file: ".nvmrc"
cache: pnpm

- name: Install Dependencies
Expand All @@ -32,27 +32,28 @@ jobs:
working-directory: ./embedded

- name: Build
run: |
pnpm build
run: pnpm build

- name: Publish canary
run: pnpm dlx pkg-pr-new publish --commentWithDev --commentWithSha --packageManager pnpm './packages/cypress' './packages/playwright' './packages/vitest'

- name: Run format
run: pnpm fmt --check

- name: Run lint
run: |
pnpm lint
pnpm publint

- uses: ./.github/actions/setup-playwright

# Needed for additional browsers that Vitest unit tests use.
# System dependencies cannot be cachced.
- name: Playwright deps
run: pnpm exec playwright install-deps

- name: Run lint
run: |
pnpm lint
pnpm publint

- name: Run tests
run: |
pnpm test:unit
run: pnpm test:unit

test-vitest-4:
runs-on: ubuntu-latest
Expand All @@ -67,7 +68,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
node-version-file: ".nvmrc"
cache: pnpm

- name: Override Vitest to v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
node-version-file: ".nvmrc"
cache: pnpm

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
node-version-file: ".nvmrc"
cache: pnpm

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-vitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
node-version-file: ".nvmrc"
cache: pnpm

- name: Install Dependencies
Expand Down
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"editor.defaultFormatter": "oxc.oxc-vscode",
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "explicit"
},
"editor.defaultFormatter": "oxc.oxc-vscode"
}
}
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ If you wish to run the site-under-tests's server separately (e.g. to debug a spe

### Linting & formatting

We use `eslint` and `prettier` to ensure code consistency.
We use `oxlint` and `oxfmt` to ensure code consistency.

To have all formatting and linting auto-fixed (so much as possible) run this at the project root:

```
pnpm lint --fix

pnpm prettier . --write
pnpm fmt
```

### PR Workflow with Changesets
Expand Down
4 changes: 2 additions & 2 deletions embedded/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"license": "MIT",
"author": "Chromatic <tom@chromatic.com>",
"packageManager": "npm@11.15.0",
"dependencies": {
"@storybook/builder-webpack5": "10.2.13",
"@storybook/server": "10.2.13",
"@storybook/server-webpack5": "10.2.13"
}
},
"packageManager": "npm@11.15.0"
}
54 changes: 0 additions & 54 deletions eslint.config.mjs

This file was deleted.

6 changes: 6 additions & 0 deletions oxfmt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from "oxfmt";

export default defineConfig({
sortImports: true,
ignorePatterns: ["**/fixtures/corrupt-stats/*.json"],
});
26 changes: 26 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineConfig } from "oxlint";

export default defineConfig({
options: {
typeAware: true,
},

rules: {
"unicorn/prefer-node-protocol": "error",
},

overrides: [
// Tests
{
files: ["**/**.{test,test-d}.ts", "**/{test,tests,test-server}/**"],
rules: {
"typescript/unbound-method": "off",
"typescript/no-floating-promises": "off",
"typescript/require-array-sort-compare": "off",
"no-empty-pattern": "off",
"no-unused-expressions": "off",
"unicorn/no-empty-file": "off",
},
},
],
});
28 changes: 13 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
"version": "0.0.56",
"private": true,
"description": "Archive end-to-end tests to be replayed in Storybook and Chromatic",
"license": "MIT",
"author": "Chromatic <tom@chromatic.com>",
"repository": {
"type": "git",
"url": "https://github.com/chromaui/chromatic-e2e.git"
},
"license": "MIT",
"author": "Chromatic <tom@chromatic.com>",
"type": "module",
"engines": {
"node": ">=22"
},
"scripts": {
"archive-storybook:cypress": "CHROMATIC_ARCHIVE_LOCATION=tests/cypress/test-downloads pnpm -C packages/cypress exec dist/bin/archive-storybook.mjs",
"archive-storybook:playwright": "CHROMATIC_ARCHIVE_LOCATION=test-results pnpm -C packages/playwright exec dist/bin/archive-storybook.mjs",
Expand All @@ -28,22 +25,18 @@
"build-archive-storybook:vitest": "CHROMATIC_ARCHIVE_LOCATION=test/.vitest/chromatic pnpm -C packages/vitest exec dist/bin/build-archive-storybook.mjs",
"changeset": "changeset",
"dev:server": "node test-server/server",
"lint": "eslint .",
"lint": "oxlint",
"fmt": "oxfmt",
"publint": "pnpm -r --parallel --filter !@chromatic-com/shared-e2e exec publint",
"prepare": "husky install",
"prettier": "prettier",
"release": "pnpm build && pnpm changeset publish",
"test:unit": "vitest run --configLoader=runner",
"test:cypress": "pnpm --filter @chromatic-com/cypress test:cypress",
"test:playwright": "pnpm --filter @chromatic-com/playwright test:playwright",
"test:vitest": "pnpm --filter @chromatic-com/vitest test:vitest"
},
"lint-staged": {
"*.{ts,js,css,md}": "prettier --write"
},
"devDependencies": {
"@changesets/cli": "^2.31.1",
"@eslint/js": "^9.15.0",
"@testing-library/dom": "^8.1.0",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
Expand All @@ -52,19 +45,24 @@
"@types/node": "^22.0.0",
"@types/node-fetch": "^2.6.6",
"@vitest/coverage-v8": "^5.0.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"express": "^4.18.2",
"express-basic-auth": "^1.2.1",
"globals": "^15.12.0",
"husky": ">=6",
"lint-staged": ">=10",
"oxfmt": "^0.65.0",
"oxlint": "^1.80.0",
"oxlint-tsgolint": "^7.0.2001",
"playwright": "^1.46.1",
"prettier": "^3.5.3",
"publint": "^0.3.24",
"typescript": "^5.9.3",
"typescript-eslint": "^8.15.0",
"vitest": "^5.0.0"
},
"lint-staged": {
"*.{ts,js,css,md}": "oxfmt"
},
"engines": {
"node": ">=22"
},
"packageManager": "pnpm@11.5.3"
}
10 changes: 5 additions & 5 deletions packages/cypress/embedded.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { expect, it } from 'vitest';
import {
collectEmbeddedFiles,
generateEmbeddedChecksum,
} from '@chromatic-com/shared-e2e/test-utils';
} from "@chromatic-com/shared-e2e/test-utils";
import { expect, it } from "vitest";

it('/embedded/node_modules has not changed', () => {
it("/embedded/node_modules has not changed", () => {
const { hash, fileCount } = generateEmbeddedChecksum(import.meta.dirname);

expect(fileCount).toMatchInlineSnapshot(`8198`);
expect(hash).toMatchInlineSnapshot(
`"fb7a3c92fbe7930617d966322c4b20b3918a3e197422c2850b6f8838a9d8ad8c"`
`"fb7a3c92fbe7930617d966322c4b20b3918a3e197422c2850b6f8838a9d8ad8c"`,
);
});

it('/embedded/node_modules tree snapshot', () => {
it("/embedded/node_modules tree snapshot", () => {
expect(collectEmbeddedFiles(import.meta.dirname)).toMatchInlineSnapshot(`
[
"@babel/code-frame@7.29.7",
Expand Down
Loading
Loading