From 6ff0c912ce7ef638345fd03c5e9be0397a16f148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Weslley=20Ara=C3=BAjo?= <46850407+wellwelwel@users.noreply.github.com> Date: Sat, 13 Jul 2024 10:19:21 -0300 Subject: [PATCH] chore(deps): upgrade `poku` --- package-lock.json | 17 +++++----- package.json | 2 +- test/esm/unit/check-extensions.test.mjs | 32 ++++++++++--------- website/package-lock.json | 11 ++++--- website/package.json | 2 +- website/test/unit/check-extensions.test.ts | 36 ++++++++++++---------- 6 files changed, 53 insertions(+), 47 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6a9551614f..7a04634447 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "eslint-plugin-async-await": "0.0.0", "eslint-plugin-markdown": "^5.0.0", "lint-staged": "^15.0.1", - "poku": "^1.14.0", + "poku": "^2.0.0", "portfinder": "^1.0.28", "prettier": "^3.0.0", "progress": "^2.0.3", @@ -2564,17 +2564,18 @@ "dev": true }, "node_modules/poku": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/poku/-/poku-1.23.0.tgz", - "integrity": "sha512-p845erLh03/9KuM+BVm95jNJ1Vrg99N8alJ63CpYTAVjDfGQ/hTp/B6xG4pKC1EPIg770MyFhkkbBz8WknEuMQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/poku/-/poku-2.0.0.tgz", + "integrity": "sha512-IziJ+lqjnkm1Jl66UvhgEs2iczft3VpZgqEdKu78zt6jGuLxl+3RzG2YxvgbX571zfmX7Q2NwSA0UhuQbUJM9g==", "dev": true, + "license": "MIT", "bin": { "poku": "lib/bin/index.js" }, "engines": { "bun": ">=1.0.0", "deno": ">=1.30.0", - "node": ">=6.0.0", + "node": ">=8.17.0", "typescript": ">=4.7.2" }, "funding": { @@ -5221,9 +5222,9 @@ "dev": true }, "poku": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/poku/-/poku-1.23.0.tgz", - "integrity": "sha512-p845erLh03/9KuM+BVm95jNJ1Vrg99N8alJ63CpYTAVjDfGQ/hTp/B6xG4pKC1EPIg770MyFhkkbBz8WknEuMQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/poku/-/poku-2.0.0.tgz", + "integrity": "sha512-IziJ+lqjnkm1Jl66UvhgEs2iczft3VpZgqEdKu78zt6jGuLxl+3RzG2YxvgbX571zfmX7Q2NwSA0UhuQbUJM9g==", "dev": true }, "portfinder": { diff --git a/package.json b/package.json index b477a1680a..c13b1372fd 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "eslint-plugin-async-await": "0.0.0", "eslint-plugin-markdown": "^5.0.0", "lint-staged": "^15.0.1", - "poku": "^1.14.0", + "poku": "^2.0.0", "portfinder": "^1.0.28", "prettier": "^3.0.0", "progress": "^2.0.3", diff --git a/test/esm/unit/check-extensions.test.mjs b/test/esm/unit/check-extensions.test.mjs index 0708fdeb6e..71642ea0b8 100644 --- a/test/esm/unit/check-extensions.test.mjs +++ b/test/esm/unit/check-extensions.test.mjs @@ -1,35 +1,37 @@ import { EOL } from 'node:os'; -import { listFiles, assert } from 'poku'; +import { listFiles, test, assert } from 'poku'; const invalidFiles = []; const message = [ 'Check for invalid file types found in restricted directories', ]; -const checkExtensions = ( +const checkExtensions = async ( dirs, allowedExtensions, ignoreList = /\.DS_Store/, ) => { - dirs.forEach((dir) => { - const files = listFiles(dir, { filter: /\./ }); + for (const dir of dirs) { + const files = await listFiles(dir, { filter: /\./ }); - files.forEach((file) => { + for (const file of files) { if (!ignoreList.test(file) && !allowedExtensions.test(file)) { invalidFiles.push(file); message.push(`${EOL}${String(allowedExtensions)}`); message.push(`- ${file}`); } - }); - }); + } + } }; -checkExtensions(['test/unit', 'test/integration'], /\.test\.cjs$/); -checkExtensions(['test/esm'], /\.test\.mjs$/); -checkExtensions(['test/tsc-build'], /(\.test\.ts|tsconfig\.json)$/); +test(async () => { + await checkExtensions(['test/unit', 'test/integration'], /\.test\.cjs$/); + await checkExtensions(['test/esm'], /\.test\.mjs$/); + await checkExtensions(['test/tsc-build'], /(\.test\.ts|tsconfig\.json)$/); -assert.deepStrictEqual( - invalidFiles.length, - 0, - Array.from(new Set(message)).join(EOL), -); + assert.deepStrictEqual( + invalidFiles.length, + 0, + Array.from(new Set(message)).join(EOL), + ); +}); diff --git a/website/package-lock.json b/website/package-lock.json index 16149bfee2..8b96e1c2d9 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -35,7 +35,7 @@ "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.8", "packages-update": "^2.0.0", - "poku": "^1.23.0", + "poku": "^2.0.0", "prettier": "^3.3.2", "tsx": "^4.16.2", "typescript": "^5.5.3" @@ -13748,17 +13748,18 @@ } }, "node_modules/poku": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/poku/-/poku-1.23.0.tgz", - "integrity": "sha512-p845erLh03/9KuM+BVm95jNJ1Vrg99N8alJ63CpYTAVjDfGQ/hTp/B6xG4pKC1EPIg770MyFhkkbBz8WknEuMQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/poku/-/poku-2.0.0.tgz", + "integrity": "sha512-IziJ+lqjnkm1Jl66UvhgEs2iczft3VpZgqEdKu78zt6jGuLxl+3RzG2YxvgbX571zfmX7Q2NwSA0UhuQbUJM9g==", "dev": true, + "license": "MIT", "bin": { "poku": "lib/bin/index.js" }, "engines": { "bun": ">=1.0.0", "deno": ">=1.30.0", - "node": ">=6.0.0", + "node": ">=8.17.0", "typescript": ">=4.7.2" }, "funding": { diff --git a/website/package.json b/website/package.json index edc0700a7e..d47240c49b 100644 --- a/website/package.json +++ b/website/package.json @@ -46,7 +46,7 @@ "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.8", "packages-update": "^2.0.0", - "poku": "^1.23.0", + "poku": "^2.0.0", "prettier": "^3.3.2", "tsx": "^4.16.2", "typescript": "^5.5.3" diff --git a/website/test/unit/check-extensions.test.ts b/website/test/unit/check-extensions.test.ts index d2e51ba21a..70cea331f9 100644 --- a/website/test/unit/check-extensions.test.ts +++ b/website/test/unit/check-extensions.test.ts @@ -1,37 +1,39 @@ import { EOL } from 'node:os'; -import { listFiles, assert } from 'poku'; +import { listFiles, test, assert } from 'poku'; const invalidFiles: string[] = []; const message = [ 'Check for invalid file types found in restricted directories', ]; -const checkExtensions = ( +const checkExtensions = async ( dirs: string[], allowedExtensions: RegExp, ignoreList: RegExp = /\.DS_Store/ ) => { - dirs.forEach((dir) => { - const files = listFiles(dir, { filter: /\./ }); + for (const dir of dirs) { + const files = await listFiles(dir, { filter: /\./ }); - files.forEach((file) => { + for (const file of files) { if (!ignoreList.test(file) && !allowedExtensions.test(file)) { invalidFiles.push(file); message.push(`${EOL}${String(allowedExtensions)}`); message.push(`- ${file}`); } - }); - }); + } + } }; -checkExtensions(['docs', 'i18n'], /\.(mdx|json)$/); -checkExtensions(['helpers', 'plugins'], /\.ts$/); -checkExtensions(['test/unit', 'test/utils'], /\.test\.ts$/); -checkExtensions(['src/components', 'src/pages'], /\.tsx$/); -checkExtensions(['src/css'], /\.scss$/); +test(async () => { + await checkExtensions(['docs', 'i18n'], /\.(mdx|json)$/); + await checkExtensions(['helpers', 'plugins'], /\.ts$/); + await checkExtensions(['test/unit', 'test/utils'], /\.test\.ts$/); + await checkExtensions(['src/components', 'src/pages'], /\.tsx$/); + await checkExtensions(['src/css'], /\.scss$/); -assert.deepStrictEqual( - invalidFiles.length, - 0, - Array.from(new Set(message)).join(EOL) -); + assert.deepStrictEqual( + invalidFiles.length, + 0, + Array.from(new Set(message)).join(EOL) + ); +});