Skip to content

Commit 01c715e

Browse files
authored
chore(deps): upgrade poku (#2855)
1 parent e1cd3e0 commit 01c715e

File tree

6 files changed

+53
-47
lines changed

6 files changed

+53
-47
lines changed

package-lock.json

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"eslint-plugin-async-await": "0.0.0",
8181
"eslint-plugin-markdown": "^5.0.0",
8282
"lint-staged": "^15.0.1",
83-
"poku": "^1.14.0",
83+
"poku": "^2.0.0",
8484
"portfinder": "^1.0.28",
8585
"prettier": "^3.0.0",
8686
"progress": "^2.0.3",
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
import { EOL } from 'node:os';
2-
import { listFiles, assert } from 'poku';
2+
import { listFiles, test, assert } from 'poku';
33

44
const invalidFiles = [];
55
const message = [
66
'Check for invalid file types found in restricted directories',
77
];
88

9-
const checkExtensions = (
9+
const checkExtensions = async (
1010
dirs,
1111
allowedExtensions,
1212
ignoreList = /\.DS_Store/,
1313
) => {
14-
dirs.forEach((dir) => {
15-
const files = listFiles(dir, { filter: /\./ });
14+
for (const dir of dirs) {
15+
const files = await listFiles(dir, { filter: /\./ });
1616

17-
files.forEach((file) => {
17+
for (const file of files) {
1818
if (!ignoreList.test(file) && !allowedExtensions.test(file)) {
1919
invalidFiles.push(file);
2020
message.push(`${EOL}${String(allowedExtensions)}`);
2121
message.push(`- ${file}`);
2222
}
23-
});
24-
});
23+
}
24+
}
2525
};
2626

27-
checkExtensions(['test/unit', 'test/integration'], /\.test\.cjs$/);
28-
checkExtensions(['test/esm'], /\.test\.mjs$/);
29-
checkExtensions(['test/tsc-build'], /(\.test\.ts|tsconfig\.json)$/);
27+
test(async () => {
28+
await checkExtensions(['test/unit', 'test/integration'], /\.test\.cjs$/);
29+
await checkExtensions(['test/esm'], /\.test\.mjs$/);
30+
await checkExtensions(['test/tsc-build'], /(\.test\.ts|tsconfig\.json)$/);
3031

31-
assert.deepStrictEqual(
32-
invalidFiles.length,
33-
0,
34-
Array.from(new Set(message)).join(EOL),
35-
);
32+
assert.deepStrictEqual(
33+
invalidFiles.length,
34+
0,
35+
Array.from(new Set(message)).join(EOL),
36+
);
37+
});

website/package-lock.json

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"eslint-plugin-react-hooks": "^4.6.2",
4747
"eslint-plugin-react-refresh": "^0.4.8",
4848
"packages-update": "^2.0.0",
49-
"poku": "^1.23.0",
49+
"poku": "^2.0.0",
5050
"prettier": "^3.3.2",
5151
"tsx": "^4.16.2",
5252
"typescript": "^5.5.3"
Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
import { EOL } from 'node:os';
2-
import { listFiles, assert } from 'poku';
2+
import { listFiles, test, assert } from 'poku';
33

44
const invalidFiles: string[] = [];
55
const message = [
66
'Check for invalid file types found in restricted directories',
77
];
88

9-
const checkExtensions = (
9+
const checkExtensions = async (
1010
dirs: string[],
1111
allowedExtensions: RegExp,
1212
ignoreList: RegExp = /\.DS_Store/
1313
) => {
14-
dirs.forEach((dir) => {
15-
const files = listFiles(dir, { filter: /\./ });
14+
for (const dir of dirs) {
15+
const files = await listFiles(dir, { filter: /\./ });
1616

17-
files.forEach((file) => {
17+
for (const file of files) {
1818
if (!ignoreList.test(file) && !allowedExtensions.test(file)) {
1919
invalidFiles.push(file);
2020
message.push(`${EOL}${String(allowedExtensions)}`);
2121
message.push(`- ${file}`);
2222
}
23-
});
24-
});
23+
}
24+
}
2525
};
2626

27-
checkExtensions(['docs', 'i18n'], /\.(mdx|json)$/);
28-
checkExtensions(['helpers', 'plugins'], /\.ts$/);
29-
checkExtensions(['test/unit', 'test/utils'], /\.test\.ts$/);
30-
checkExtensions(['src/components', 'src/pages'], /\.tsx$/);
31-
checkExtensions(['src/css'], /\.scss$/);
27+
test(async () => {
28+
await checkExtensions(['docs', 'i18n'], /\.(mdx|json)$/);
29+
await checkExtensions(['helpers', 'plugins'], /\.ts$/);
30+
await checkExtensions(['test/unit', 'test/utils'], /\.test\.ts$/);
31+
await checkExtensions(['src/components', 'src/pages'], /\.tsx$/);
32+
await checkExtensions(['src/css'], /\.scss$/);
3233

33-
assert.deepStrictEqual(
34-
invalidFiles.length,
35-
0,
36-
Array.from(new Set(message)).join(EOL)
37-
);
34+
assert.deepStrictEqual(
35+
invalidFiles.length,
36+
0,
37+
Array.from(new Set(message)).join(EOL)
38+
);
39+
});

0 commit comments

Comments
 (0)