diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 3eff996dd..1f8c36b80 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -51,7 +51,7 @@ jobs: run: yarn api-check - name: Test - run: yarn test + run: yarn test-ci build: name: 'Build all projects' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1371af88c..81e61010a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ To create a pull request: 2. [Create a separate branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-branches) for your changes 3. Make your changes, and ensure that it is formatted by [Prettier](https://prettier.io) and type-checks without errors in [TypeScript](https://www.typescriptlang.org/) 4. Write tests that validate your change and/or fix. -5. Run `yarn build` and then run tests with `yarn test`. +5. Run `yarn build` and then run tests with `yarn test-ci`. 6. Push your branch and open a PR. 🚀 Before your code is merged, you will need to sign our [contributor license agreement](https://github.com/tldraw/tldraw/blob/main/CLA.md), which is handled automatically via GitHub comments. Your PR will be reviewed and merged in within a day or two if everything looks good. diff --git a/apps/dotcom-asset-upload/package.json b/apps/dotcom-asset-upload/package.json index a93d37566..f02ef3c45 100644 --- a/apps/dotcom-asset-upload/package.json +++ b/apps/dotcom-asset-upload/package.json @@ -10,8 +10,8 @@ "main": "src/index.ts", "scripts": { "dev": "cross-env NODE_ENV=development wrangler dev --log-level info --persist-to tmp-assets", - "test": "lazy inherit --passWithNoTests", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit --passWithNoTests", + "test": "yarn run -T jest", "test-coverage": "lazy inherit --passWithNoTests", "lint": "yarn run -T tsx ../../scripts/lint.ts" }, diff --git a/apps/dotcom-worker/package.json b/apps/dotcom-worker/package.json index c63f82311..029e4b5b3 100644 --- a/apps/dotcom-worker/package.json +++ b/apps/dotcom-worker/package.json @@ -15,8 +15,8 @@ "dev-cron": "yarn run -T tsx ./scripts/cron.ts", "dev-wrangler": "yarn run -T tsx ./scripts/dev-wrap.ts", "report-size": "node scripts/report-size.js", - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "lint": "yarn run -T tsx ../../scripts/lint.ts" }, diff --git a/apps/dotcom/package.json b/apps/dotcom/package.json index 6e77af3e7..7a28b2f25 100644 --- a/apps/dotcom/package.json +++ b/apps/dotcom/package.json @@ -15,8 +15,8 @@ "build": "yarn run -T tsx scripts/build.ts", "start": "VITE_PREVIEW=1 yarn run -T tsx scripts/dev-app.ts", "lint": "yarn run -T tsx ../../scripts/lint.ts", - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch" + "test-ci": "lazy inherit", + "test": "yarn run -T jest" }, "dependencies": { "@radix-ui/react-popover": "^1.0.7", diff --git a/lazy.config.ts b/lazy.config.ts index 67455c6ae..e0a119923 100644 --- a/lazy.config.ts +++ b/lazy.config.ts @@ -53,7 +53,7 @@ const config = { 'apps/vscode/*': { runsAfter: { build: { in: 'self-only' } } }, }, }, - test: { + 'test-ci': { baseCommand: 'yarn run -T jest', runsAfter: { 'refresh-assets': {} }, cache: { diff --git a/package.json b/package.json index 2bfd21648..0c5337bad 100644 --- a/package.json +++ b/package.json @@ -54,8 +54,8 @@ "typecheck": "yarn refresh-assets && tsx scripts/typecheck.ts", "check-scripts": "tsx scripts/check-scripts.ts", "api-check": "lazy api-check", - "test": "lazy test", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy test-ci", + "test": "yarn run -T jest", "test-coverage": "lazy test-coverage && node scripts/offer-coverage.mjs", "e2e": "lazy e2e --filter='apps/examples'" }, diff --git a/packages/editor/package.json b/packages/editor/package.json index 60d46553d..1bfcde2ce 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -33,8 +33,8 @@ "editor.css" ], "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "benchmark": "yarn run -T tsx ./scripts/benchmark.ts", "test-coverage": "lazy inherit", "build": "yarn run -T tsx ../../scripts/build-package.ts", diff --git a/packages/state/package.json b/packages/state/package.json index 2740b873f..fd8d362e9 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -30,8 +30,8 @@ "/* GOTCHA */": "files will include ./dist and index.d.ts by default, add any others you want to include in here", "files": [], "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "build": "yarn run -T tsx ../../scripts/build-package.ts", "build-api": "yarn run -T tsx ../../scripts/build-api.ts", diff --git a/packages/store/package.json b/packages/store/package.json index 0d355956c..e46059310 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -30,8 +30,8 @@ "/* GOTCHA */": "files will include ./dist and index.d.ts by default, add any others you want to include in here", "files": [], "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "build": "yarn run -T tsx ../../scripts/build-package.ts", "build-api": "yarn run -T tsx ../../scripts/build-api.ts", diff --git a/packages/tldraw/package.json b/packages/tldraw/package.json index 3b1cb92be..0ace15428 100644 --- a/packages/tldraw/package.json +++ b/packages/tldraw/package.json @@ -28,8 +28,8 @@ "main": "./src/index.ts", "types": "./.tsbuild/index.d.ts", "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "predev": "node ./scripts/copy-css-files.mjs", "dev": "chokidar '../{editor/editor,tldraw/src/lib/ui}.css' -c 'node ./scripts/copy-css-files.mjs'", diff --git a/packages/tlschema/package.json b/packages/tlschema/package.json index 92a67addb..7bcdaecf3 100644 --- a/packages/tlschema/package.json +++ b/packages/tlschema/package.json @@ -30,8 +30,8 @@ "/* GOTCHA */": "files will include ./dist and index.d.ts by default, add any others you want to include in here", "files": [], "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "index": "node ./scripts/build-index.js && yarn format", "format": "yarn run -T prettier --write --cache \"src/**/*.{ts,tsx,js,jsx,json,md}\"", diff --git a/packages/tlsync/package.json b/packages/tlsync/package.json index 18d80eb9e..6926d6367 100644 --- a/packages/tlsync/package.json +++ b/packages/tlsync/package.json @@ -31,8 +31,8 @@ "/* GOTCHA */": "files will include ./dist and index.d.ts by default, add any others you want to include in here", "files": [], "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "lint": "yarn run -T tsx ../../scripts/lint.ts" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 76db0631f..db02dab91 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,8 +30,8 @@ "/* GOTCHA */": "files will include ./dist and index.d.ts by default, add any others you want to include in here", "files": [], "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "build": "yarn run -T tsx ../../scripts/build-package.ts", "build-api": "yarn run -T tsx ../../scripts/build-api.ts", diff --git a/packages/validate/package.json b/packages/validate/package.json index 423c9e880..4e08d6732 100644 --- a/packages/validate/package.json +++ b/packages/validate/package.json @@ -30,8 +30,8 @@ "/* GOTCHA */": "files will include ./dist and index.d.ts by default, add any others you want to include in here", "files": [], "scripts": { - "test": "lazy inherit", - "test-dev": "yarn run -T jest --watch", + "test-ci": "lazy inherit", + "test": "yarn run -T jest", "test-coverage": "lazy inherit", "build": "yarn run -T tsx ../../scripts/build-package.ts", "build-api": "yarn run -T tsx ../../scripts/build-api.ts", diff --git a/scripts/check-scripts.ts b/scripts/check-scripts.ts index 0f0e52b51..0d118b7ca 100644 --- a/scripts/check-scripts.ts +++ b/scripts/check-scripts.ts @@ -20,7 +20,7 @@ const expectedScripts = { // packages (in packages/) should have these scripts const expectedPackageScripts = { ...expectedScripts, - test: () => 'lazy inherit', + 'test-ci': () => 'lazy inherit', } // published packages should have these scripts @@ -45,7 +45,7 @@ const perPackageExceptions: Record string | undefin lint: () => 'lazy lint', }, '@tldraw/assets': { - test: () => undefined, + 'test-ci': () => undefined, build: () => undefined, 'build-api': () => undefined, prepack: () => undefined,