From 38a755e3659f6f722d7ed66312859ef5b199ab28 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 30 Dec 2024 17:40:13 +0530 Subject: [PATCH] chore: update chokidar to v4 --- package.json | 4 +-- pnpm-lock.yaml | 79 +++++++++++------------------------------ scripts/watchAndCopy.js | 11 ++++-- 3 files changed, 30 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index ee8b8a07c4af..b0f864fd5a2e 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "@types/node": "^22.10.2", "@types/postcss-prefix-selector": "^1.16.3", "@types/prompts": "^2.4.9", - "chokidar": "^3.6.0", + "chokidar": "^4.0.3", "conventional-changelog-cli": "^5.0.0", "cross-spawn": "^7.0.6", "debug": "^4.4.0", @@ -205,7 +205,7 @@ "optional": true } }, - "packageManager": "pnpm@9.15.1", + "packageManager": "pnpm@9.15.2", "pnpm": { "peerDependencyRules": { "ignoreMissing": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8dff53ab1e7d..29b9b0b767e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -156,8 +156,8 @@ importers: specifier: ^2.4.9 version: 2.4.9 chokidar: - specifier: ^3.6.0 - version: 3.6.0 + specifier: ^4.0.3 + version: 4.0.3 conventional-changelog-cli: specifier: ^5.0.0 version: 5.0.0(conventional-commits-filter@5.0.0) @@ -1282,8 +1282,8 @@ packages: resolution: {integrity: sha512-/tfpK2A4FpS0o+S78o3YSdlqXr0MavJIDlFK3XZrlXLy7vaRXJvW5jYg3v5e/wCaF8y0IpMjkYLhoV6QqfpOgw==} engines: {node: '>= 14.0.0'} - alien-signals@0.4.11: - resolution: {integrity: sha512-79GUbcQM5K2zb+HyUMODTgJdVjZWwybDNQRduqP9ks7XZvJylm9uWesOjVcu6/veWsa+XNGVE4xVQ8+RGu8HaA==} + alien-signals@0.4.12: + resolution: {integrity: sha512-Og0PgAihxlp1R22bsoBsyhhMG4+qhU+fkkLPoGBQkYVc3qt9rYnrwYTf+M6kqUqUZpf3rXDnpL90iKa0QcSVVg==} ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} @@ -1309,10 +1309,6 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -1338,10 +1334,6 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - binary-extensions@2.3.0: - resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} - engines: {node: '>=8'} - birpc@0.2.19: resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==} @@ -1391,9 +1383,9 @@ packages: resolution: {integrity: sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==} engines: {node: '>= 6'} - chokidar@3.6.0: - resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} - engines: {node: '>= 8.10.0'} + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} cli-cursor@5.0.0: resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} @@ -1848,10 +1840,6 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - is-core-module@2.16.1: resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} @@ -2190,10 +2178,6 @@ packages: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - npm-run-path@5.3.0: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2389,9 +2373,9 @@ packages: resolution: {integrity: sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==} engines: {node: '>=8'} - readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} + readdirp@4.0.2: + resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} + engines: {node: '>= 14.16.0'} regex-recursion@5.1.1: resolution: {integrity: sha512-ae7SBCbzVNrIjgSbh7wMznPcQel1DNlDtzensnFxpiNpXt1U2ju/bHugH422r+4LAVS1FpW1YCwilmnNsjum9w==} @@ -2651,8 +2635,8 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.1: - resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} tinyglobby@0.2.10: resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} @@ -3025,7 +3009,7 @@ snapshots: '@antfu/install-pkg@0.4.1': dependencies: package-manager-detector: 0.2.8 - tinyexec: 0.3.1 + tinyexec: 0.3.2 '@antfu/utils@0.7.10': {} @@ -3734,7 +3718,7 @@ snapshots: '@vue/compiler-dom': 3.5.13 '@vue/compiler-vue2': 2.7.16 '@vue/shared': 3.5.13 - alien-signals: 0.4.11 + alien-signals: 0.4.12 minimatch: 9.0.5 muggle-string: 0.4.1 path-browserify: 1.0.1 @@ -3813,7 +3797,7 @@ snapshots: '@algolia/requester-fetch': 5.18.0 '@algolia/requester-node-http': 5.18.0 - alien-signals@0.4.11: {} + alien-signals@0.4.12: {} ansi-colors@4.1.3: {} @@ -3831,11 +3815,6 @@ snapshots: ansi-styles@6.2.1: {} - anymatch@3.1.3: - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - arg@5.0.2: {} argparse@1.0.10: @@ -3860,8 +3839,6 @@ snapshots: balanced-match@1.0.2: {} - binary-extensions@2.3.0: {} - birpc@0.2.19: {} boolbase@1.0.0: {} @@ -3916,17 +3893,9 @@ snapshots: parse5-htmlparser2-tree-adapter: 6.0.1 tslib: 2.8.1 - chokidar@3.6.0: + chokidar@4.0.3: dependencies: - anymatch: 3.1.3 - braces: 3.0.3 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 + readdirp: 4.0.2 cli-cursor@5.0.0: dependencies: @@ -4432,10 +4401,6 @@ snapshots: inherits@2.0.4: {} - is-binary-path@2.1.0: - dependencies: - binary-extensions: 2.3.0 - is-core-module@2.16.1: dependencies: hasown: 2.0.2 @@ -4751,8 +4716,6 @@ snapshots: semver: 7.6.3 validate-npm-package-license: 3.0.4 - normalize-path@3.0.0: {} - npm-run-path@5.3.0: dependencies: path-key: 4.0.0 @@ -4941,9 +4904,7 @@ snapshots: dependencies: readable-stream: 3.6.2 - readdirp@3.6.0: - dependencies: - picomatch: 2.3.1 + readdirp@4.0.2: {} regex-recursion@5.1.1: dependencies: @@ -5222,7 +5183,7 @@ snapshots: tinybench@2.9.0: {} - tinyexec@0.3.1: {} + tinyexec@0.3.2: {} tinyglobby@0.2.10: dependencies: @@ -5370,7 +5331,7 @@ snapshots: pathe: 1.1.2 std-env: 3.8.0 tinybench: 2.9.0 - tinyexec: 0.3.1 + tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 1.2.0 vite: 5.4.11(@types/node@22.10.2) diff --git a/scripts/watchAndCopy.js b/scripts/watchAndCopy.js index 58c3b421025d..c66085f84775 100644 --- a/scripts/watchAndCopy.js +++ b/scripts/watchAndCopy.js @@ -1,5 +1,5 @@ -import { copy, remove } from 'fs-extra' import { watch } from 'chokidar' +import { copy, remove } from 'fs-extra' import { normalizePath } from 'vite' function toClientAndNode(method, file) { @@ -18,14 +18,19 @@ function toDist(file) { } // copy shared files to the client and node directory whenever they change. -watch('src/shared/**/*.ts') +watch('src/shared', { + ignored: (path, stats) => stats?.isFile() && !path.endsWith('.ts') +}) .on('change', (file) => toClientAndNode('copy', file)) .on('add', (file) => toClientAndNode('copy', file)) .on('unlink', (file) => toClientAndNode('remove', file)) // copy non ts files, such as an html or css, to the dist directory whenever // they change. -watch('src/client/**/!(*.ts|tsconfig.json)') +watch('src/client', { + ignored: (path, stats) => + stats?.isFile() && (path.endsWith('.ts') || path.endsWith('tsconfig.json')) +}) .on('change', (file) => copy(file, toDist(file))) .on('add', (file) => copy(file, toDist(file))) .on('unlink', (file) => remove(toDist(file)))