@neurodevs/meta-node 0.19.7 → 0.19.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,27 +14,31 @@ export default class NpmWorkspaceTypeChecker {
14
14
  return new (this.Class ?? this)(workspacePath);
15
15
  }
16
16
  async run() {
17
- console.info('Starting type checking... \n');
18
17
  const repoNames = await this.readDir(this.workspacePath, {
19
18
  withFileTypes: true,
20
19
  });
21
- for (const repoName of repoNames) {
20
+ const repoPaths = (await Promise.all(repoNames.map(async (repoName) => {
22
21
  if (!repoName.isDirectory()) {
23
- continue;
22
+ return;
24
23
  }
25
- const fullRepoPath = join(this.workspacePath, repoName.name);
26
- const repoContents = await this.readDir(fullRepoPath);
24
+ const repoPath = join(this.workspacePath, repoName.name);
25
+ const repoContents = await this.readDir(repoPath);
27
26
  if (!repoContents.includes('tsconfig.json')) {
28
- continue;
27
+ return;
29
28
  }
30
- console.info(`Checking types for ${fullRepoPath}...`);
29
+ return repoPath;
30
+ }))).filter((p) => Boolean(p));
31
+ console.info(`\nChecking types for the following repos:\n\n${repoPaths
32
+ .map((r) => ` ${r}`)
33
+ .join('\n')}\n`);
34
+ await Promise.all(repoPaths.map(async (repoPath) => {
31
35
  try {
32
- await this.exec('npx tsc --noEmit', { cwd: fullRepoPath });
36
+ await this.exec('npx tsc --noEmit', { cwd: repoPath });
33
37
  }
34
38
  catch {
35
- console.error(`Type errors found in ${fullRepoPath}!`);
39
+ console.error(`Type errors found in ${repoPath}!`);
36
40
  }
37
- }
41
+ }));
38
42
  console.info('\nType checking completed!\n');
39
43
  }
40
44
  get readDir() {
@@ -1 +1 @@
1
- {"version":3,"file":"NpmWorkspaceTypeChecker.js","sourceRoot":"","sources":["../../src/impl/NpmWorkspaceTypeChecker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kB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AO,uBAAuB,CAAC,IAAI,CAAA;IACvC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import NpmWorkspaceTypeChecker from '../impl/NpmWorkspaceTypeChecker.js';
2
+ const checker = NpmWorkspaceTypeChecker.Create('../');
3
+ await checker.run();
4
+ //# sourceMappingURL=runNpmWorkspaceTypeChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runNpmWorkspaceTypeChecker.js","sourceRoot":"","sources":["../../src/scripts/runNpmWorkspaceTypeChecker.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,oCAAoC,CAAA;AAExE,MAAM,OAAO,GAAG,uBAAuB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACrD,MAAM,OAAO,CAAC,GAAG,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neurodevs/meta-node",
3
- "version": "0.19.7",
3
+ "version": "0.19.9",
4
4
  "description": "Meta-layer utilities for maintaining Node.js package ecosystems.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -19,32 +19,43 @@ export default class NpmWorkspaceTypeChecker implements WorkspaceTypeChecker {
19
19
  }
20
20
 
21
21
  public async run() {
22
- console.info('Starting type checking... \n')
23
22
  const repoNames = await this.readDir(this.workspacePath, {
24
23
  withFileTypes: true,
25
24
  })
26
25
 
27
- for (const repoName of repoNames) {
28
- if (!repoName.isDirectory()) {
29
- continue
30
- }
26
+ const repoPaths = (
27
+ await Promise.all(
28
+ repoNames.map(async (repoName) => {
29
+ if (!repoName.isDirectory()) {
30
+ return
31
+ }
31
32
 
32
- const fullRepoPath = join(this.workspacePath, repoName.name)
33
+ const repoPath = join(this.workspacePath, repoName.name)
34
+ const repoContents = await this.readDir(repoPath)
33
35
 
34
- const repoContents = await this.readDir(fullRepoPath)
36
+ if (!repoContents.includes('tsconfig.json')) {
37
+ return
38
+ }
39
+ return repoPath
40
+ })
41
+ )
42
+ ).filter((p): p is string => Boolean(p))
35
43
 
36
- if (!repoContents.includes('tsconfig.json')) {
37
- continue
38
- }
44
+ console.info(
45
+ `\nChecking types for the following repos:\n\n${repoPaths
46
+ .map((r) => ` ${r}`)
47
+ .join('\n')}\n`
48
+ )
39
49
 
40
- console.info(`Checking types for ${fullRepoPath}...`)
41
-
42
- try {
43
- await this.exec('npx tsc --noEmit', { cwd: fullRepoPath })
44
- } catch {
45
- console.error(`Type errors found in ${fullRepoPath}!`)
46
- }
47
- }
50
+ await Promise.all(
51
+ repoPaths.map(async (repoPath) => {
52
+ try {
53
+ await this.exec('npx tsc --noEmit', { cwd: repoPath })
54
+ } catch {
55
+ console.error(`Type errors found in ${repoPath}!`)
56
+ }
57
+ })
58
+ )
48
59
 
49
60
  console.info('\nType checking completed!\n')
50
61
  }
@@ -0,0 +1,4 @@
1
+ import NpmWorkspaceTypeChecker from '../impl/NpmWorkspaceTypeChecker.js'
2
+
3
+ const checker = NpmWorkspaceTypeChecker.Create('../')
4
+ await checker.run()