From 12e98b0de7ce72bf0e23c570403f0b0e8d215573 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 13 Oct 2023 11:11:36 -0400 Subject: [PATCH 1/5] Fix file watching bug when renaming files on FreeBSD --- src/cli/build/watching.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/build/watching.js b/src/cli/build/watching.js index e69cd9f8598c..b7788726c1cb 100644 --- a/src/cli/build/watching.js +++ b/src/cli/build/watching.js @@ -164,7 +164,7 @@ export function createWatcher(args, { state, rebuild }) { // This is very likely a chokidar bug but it's one we need to work around // We treat this as a change event and rebuild the CSS watcher.on('raw', (evt, filePath, meta) => { - if (evt !== 'rename') { + if (evt !== 'rename' || filePath === null) { return } From e0facb1cc24c55e89c9305735a39eafa6992df9f Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 13 Oct 2023 11:15:04 -0400 Subject: [PATCH 2/5] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f86d1732771c..dd67c518f05f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improve RegEx parser, reduce possibilities as the key for arbitrary properties ([#12121](https://github.com/tailwindlabs/tailwindcss/pull/12121)) - Fix sorting of utilities that share multiple candidates ([#12173](https://github.com/tailwindlabs/tailwindcss/pull/12173)) - Ensure variants with arbitrary values and a modifier are correctly matched in the RegEx based parser ([#12179](https://github.com/tailwindlabs/tailwindcss/pull/12179)) +- Fix crash when watching renamed files on FreeBSD ([#12193](https://github.com/tailwindlabs/tailwindcss/pull/12193)) ### Added From 5b3dfa22bf411693925a5ed8ba59ca67fb01e92e Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 13 Oct 2023 11:29:15 -0400 Subject: [PATCH 3/5] Add delay to test --- integrations/rollup-sass/tests/integration.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integrations/rollup-sass/tests/integration.test.js b/integrations/rollup-sass/tests/integration.test.js index 90a3831ff268..e600b0d450b3 100644 --- a/integrations/rollup-sass/tests/integration.test.js +++ b/integrations/rollup-sass/tests/integration.test.js @@ -295,6 +295,8 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) + await new Promise((resolve) => setTimeout(resolve, 5000)) + expect(await readOutputFile('index.css')).toIncludeCss( css` .btn { From 8f7ac3a863e05bfa428be97cc9a57bdbb9e1f301 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 13 Oct 2023 15:01:41 -0400 Subject: [PATCH 4/5] Bump delay --- integrations/rollup-sass/tests/integration.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/rollup-sass/tests/integration.test.js b/integrations/rollup-sass/tests/integration.test.js index e600b0d450b3..271264388eba 100644 --- a/integrations/rollup-sass/tests/integration.test.js +++ b/integrations/rollup-sass/tests/integration.test.js @@ -295,7 +295,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - await new Promise((resolve) => setTimeout(resolve, 5000)) + await new Promise((resolve) => setTimeout(resolve, 10000)) expect(await readOutputFile('index.css')).toIncludeCss( css` From 18cd97e160bfec64ae22ae8ba229c7fa15e66b59 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 17 Oct 2023 09:40:31 -0400 Subject: [PATCH 5/5] Update test --- integrations/rollup-sass/tests/integration.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/rollup-sass/tests/integration.test.js b/integrations/rollup-sass/tests/integration.test.js index 271264388eba..a552a3742bbd 100644 --- a/integrations/rollup-sass/tests/integration.test.js +++ b/integrations/rollup-sass/tests/integration.test.js @@ -295,7 +295,7 @@ describe('watcher', () => { ) await runningProcess.onStderr(ready) - await new Promise((resolve) => setTimeout(resolve, 10000)) + await new Promise((resolve) => setTimeout(resolve, 5000)) expect(await readOutputFile('index.css')).toIncludeCss( css` @@ -336,5 +336,5 @@ describe('watcher', () => { ) return runningProcess.stop() - }) + }, 30000) })