From 2d78362cb9d09d6ea694856c842e39e5135fbd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mitja=20Bezen=C5=A1ek?= Date: Wed, 17 Jan 2024 11:59:04 +0100 Subject: [PATCH] Fix the first run of dev script. (#2484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When you first clone the repo and run the `dev` script for the first time you get the following error: ![image](https://github.com/tldraw/tldraw/assets/2523721/89cd0904-3d63-4569-b950-c1e23573f800) This is because the `dev` script in examples runs before `dev` in `tldraw` (which creates the `tldraw.css` file). We now have a `predev` step that does it. ### Change Type - [x] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [ ] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan 1. Clone the repo from start (or delete `packages/tldraw/tldraw.css` file) 2. Run `yarn dev` 3. You should not see the above error. ### Release Notes - Fix first `yarn dev` experience. --- lazy.config.ts | 2 +- packages/tldraw/package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lazy.config.ts b/lazy.config.ts index b39923632..e8670628f 100644 --- a/lazy.config.ts +++ b/lazy.config.ts @@ -32,7 +32,7 @@ const config = { }, dev: { execution: 'independent', - runsAfter: { 'refresh-assets': {} }, + runsAfter: { predev: {}, 'refresh-assets': {} }, cache: 'none', workspaceOverrides: { 'apps/vscode/*': { runsAfter: { build: { in: 'self-only' } } }, diff --git a/packages/tldraw/package.json b/packages/tldraw/package.json index 96e2a8db3..cba34125b 100644 --- a/packages/tldraw/package.json +++ b/packages/tldraw/package.json @@ -31,7 +31,8 @@ "scripts": { "test": "lazy inherit", "test-coverage": "lazy inherit", - "dev": "chokidar '../{editor/editor,tldraw/src/lib/ui}.css' -c 'node ./scripts/copy-css-files.mjs' --initial", + "predev": "node ./scripts/copy-css-files.mjs", + "dev": "chokidar '../{editor/editor,tldraw/src/lib/ui}.css' -c 'node ./scripts/copy-css-files.mjs'", "prebuild": "node ./scripts/copy-css-files.mjs", "build": "yarn run -T tsx ../../scripts/build-package.ts", "build-api": "yarn run -T tsx ../../scripts/build-api.ts",