Skip to content

Commit

Permalink
Merge branch 'e2e'
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Nov 1, 2023
2 parents d8ae33e + 1c2daf7 commit 1002af1
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
version: pnpm run ci:version
publish: pnpm run ci:publish
version: pnpm run changeset version && pnpm i --no-frozen-lockfile && git add .
publish: pnpm run build && pnpm run changeset publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ jobs:
run: npx playwright install --with-deps chromium

- name: Lint
run: pnpm lint
run: pnpm test:lint

- name: Run Build and Tests
# Will run the step even if lint step failed
if: success() || failure()
run: pnpm run build-test
if: always()
run: pnpm run build-test:packages
env:
CI: true

Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You should reinstall the dependencies and rebuild the packages whenever you pull

The code is formatted with prettier. You can use it if you want, or not, it's up to you because the code get's formatted automatically by a github action. If you want to use it, you can run `pnpm format` to format the code.

If you want to run the E2E tests, you need to install the dependencies by running `npx playwright --with-deps chromium`, then run `pnpm test:e2e`.
If you want to run the E2E tests, you need to install the dependencies by running `pnpm dlx playwright install --with-deps chromium` _(or `npx playwright install --with-deps chromium`)_, then run `pnpm test:e2e`.

## Operating System

Expand Down Expand Up @@ -46,15 +46,15 @@ Important if you want to work on the chrome extension. _(The script may fail som

#### `pnpm build` — Builds all packages

#### `pnpm test` — Runs all the tests
#### `pnpm test:unit` — Runs all unit tests

#### `pnpm test:e2e` - Runs all the E2E tests
#### `pnpm test:types` — Checks types with tsc

#### `pnpm typecheck`Runs the typecheck
#### `pnpm test:lint`Lints code with eslint

#### `pnpm lint` — Lints code with eslint
#### `pnpm test:e2e` - Runs all the E2E tests _(needs playwright deps installed)_

#### `pnpm build-test` — Runs both the build and the tests
#### `pnpm build-test` — Runs both the build and all the tests

Watchout, `build-test` may freeze your computer a bit :)

Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@
"author": "Damian Tarnawski <[email protected]>",
"contributors": [],
"scripts": {
"----------------------DEV----------------------": "",
"dev:ext": "pnpm -dir packages/extension run dev",
"dev:transform": "pnpm -dir packages/transform run dev",
"dev": "pnpm run --parallel --filter ./packages/* --filter !./packages/extension dev",
"sandbox": "pnpm -dir examples/sandbox run dev",
"sandbox:ext": "pnpm -dir examples/sandbox run dev:ext",
"----------------------BUILD----------------------": "",
"build": "turbo run build --filter=./packages/*",
"test": "turbo run test --filter=./packages/*",
"----------------------TEST----------------------": "",
"test:unit": "turbo run test --filter=./packages/*",
"test:types": "turbo run typecheck --filter=./packages/*",
"test:lint": "eslint --ignore-path .gitignore --max-warnings 0 packages/**/*.{js,ts,tsx,jsx} --rule \"@typescript-eslint/no-unnecessary-type-assertion: off\"",
"test:e2e": "cross-env PW_CHROMIUM_ATTACH_TO_OTHER=1 playwright test -c playwright.config.ts",
"typecheck": "turbo run typecheck --filter=./packages/*",
"build-test": "turbo run build test typecheck --filter=./packages/*",
"----------------------UTILS----------------------": "",
"build-test:packages": "turbo run build test:unit test:types --filter=./packages/*",
"build-test": "pnpm run build-test:packages && pnpm run test:lint && pnpm run test:e2e",
"format": "prettier -w ./{packages,examples}/**/*.{js,ts,json,css,tsx,jsx} --ignore-path .gitignore",
"lint": "eslint --ignore-path .gitignore --max-warnings 0 packages/**/*.{js,ts,tsx,jsx} --rule \"@typescript-eslint/no-unnecessary-type-assertion: off\"",
"changeset": "changeset",
"ci:version": "pnpm run changeset version && pnpm i --no-frozen-lockfile && git add .",
"ci:publish": "pnpm run build-test && pnpm run changeset publish"
"changeset": "changeset"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@nothing-but/utils": "~0.3.2",
"@playwright/test": "^1.36.1",
"@playwright/test": "^1.39.0",
"@total-typescript/ts-reset": "^0.4.2",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^6.2.0",
Expand Down
29 changes: 18 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"installCommand": "pnpm i",
"buildCommand": "pnpm run build && pnpm -dir examples/sandbox run build",
"outputDirectory": "examples/sandbox/dist",
"public": true,
"github": {
"silent": true
}
"$schema": "https://openapi.vercel.sh/vercel.json",
"installCommand": "pnpm i",
"buildCommand": "pnpm run build && pnpm -dir examples/sandbox run build",
"outputDirectory": "examples/sandbox/dist",
"public": true
}

0 comments on commit 1002af1

Please sign in to comment.