@doikayt/tooling-core 1.4.15
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.
- package/README.md +380 -0
- package/dist/cli/generateHelp.d.ts +2 -0
- package/dist/cli/generateHelp.js +53 -0
- package/dist/cli/listFilesToProcess.d.ts +9 -0
- package/dist/cli/listFilesToProcess.js +47 -0
- package/dist/cli/parseStandardCli.d.ts +10 -0
- package/dist/cli/parseStandardCli.js +197 -0
- package/dist/cli/printHelp.d.ts +2 -0
- package/dist/cli/printHelp.js +4 -0
- package/dist/cli/runCli.d.ts +9 -0
- package/dist/cli/runCli.js +93 -0
- package/dist/cli/runLinkValidation.d.ts +2 -0
- package/dist/cli/runLinkValidation.js +32 -0
- package/dist/cli/runPlugin.d.ts +3 -0
- package/dist/cli/runPlugin.js +13 -0
- package/dist/cli/types.d.ts +23 -0
- package/dist/cli/types.js +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +22 -0
- package/dist/markdown/extractLinks.d.ts +9 -0
- package/dist/markdown/extractLinks.js +71 -0
- package/dist/markdown/findMarker.d.ts +31 -0
- package/dist/markdown/findMarker.js +72 -0
- package/dist/markdown/injectBetweenMarkers.d.ts +1 -0
- package/dist/markdown/injectBetweenMarkers.js +10 -0
- package/dist/markdown/parseHeadings.d.ts +2 -0
- package/dist/markdown/parseHeadings.js +31 -0
- package/dist/markdown/slugHeading.d.ts +8 -0
- package/dist/markdown/slugHeading.js +9 -0
- package/dist/markdown/types.d.ts +51 -0
- package/dist/markdown/types.js +1 -0
- package/dist/markdown/validateExternalLink.d.ts +2 -0
- package/dist/markdown/validateExternalLink.js +82 -0
- package/dist/markdown/validateFragmentLink.d.ts +8 -0
- package/dist/markdown/validateFragmentLink.js +19 -0
- package/dist/markdown/validateMarkdownLinks.d.ts +2 -0
- package/dist/markdown/validateMarkdownLinks.js +84 -0
- package/dist/markdown/validateRelativeLink.d.ts +12 -0
- package/dist/markdown/validateRelativeLink.js +62 -0
- package/dist/policy/RunnerPolicy.d.ts +7 -0
- package/dist/policy/RunnerPolicy.js +1 -0
- package/dist/policy/createRunnerPolicy.d.ts +3 -0
- package/dist/policy/createRunnerPolicy.js +36 -0
- package/dist/repository/RepositoryRunner.d.ts +24 -0
- package/dist/repository/RepositoryRunner.js +93 -0
- package/dist/repository/createTransformProcessor.d.ts +5 -0
- package/dist/repository/createTransformProcessor.js +17 -0
- package/dist/repository/types.d.ts +16 -0
- package/dist/repository/types.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/util/concurrency.d.ts +6 -0
- package/dist/util/concurrency.js +18 -0
- package/dist/util/debugLog.d.ts +7 -0
- package/dist/util/debugLog.js +9 -0
- package/dist/util/extractFirstSentence.d.ts +12 -0
- package/dist/util/extractFirstSentence.js +25 -0
- package/dist/util/toErrorMessage.d.ts +1 -0
- package/dist/util/toErrorMessage.js +3 -0
- package/dist/util/walkFiles.d.ts +18 -0
- package/dist/util/walkFiles.js +49 -0
- package/package.json +47 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const DEFAULT_EXCLUDE_DIRS: readonly string[];
|
|
2
|
+
export interface WalkOptions {
|
|
3
|
+
rootDir: string;
|
|
4
|
+
extensions?: string[];
|
|
5
|
+
excludeDirs?: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Deterministic filesystem walker.
|
|
9
|
+
*
|
|
10
|
+
* Guarantees:
|
|
11
|
+
* - Lexicographically sorted directory traversal
|
|
12
|
+
* - Lexicographically sorted final result
|
|
13
|
+
* - Deterministic behavior across repeated runs
|
|
14
|
+
*
|
|
15
|
+
* Default behavior:
|
|
16
|
+
* - Uses DEFAULT_EXCLUDE_DIRS unless over-ride provided
|
|
17
|
+
*/
|
|
18
|
+
export declare function walkFiles(options: WalkOptions): string[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export const DEFAULT_EXCLUDE_DIRS = ["node_modules"];
|
|
4
|
+
/**
|
|
5
|
+
* Deterministic filesystem walker.
|
|
6
|
+
*
|
|
7
|
+
* Guarantees:
|
|
8
|
+
* - Lexicographically sorted directory traversal
|
|
9
|
+
* - Lexicographically sorted final result
|
|
10
|
+
* - Deterministic behavior across repeated runs
|
|
11
|
+
*
|
|
12
|
+
* Default behavior:
|
|
13
|
+
* - Uses DEFAULT_EXCLUDE_DIRS unless over-ride provided
|
|
14
|
+
*/
|
|
15
|
+
export function walkFiles(options) {
|
|
16
|
+
const rootDir = options.rootDir;
|
|
17
|
+
const extensions = options.extensions;
|
|
18
|
+
const excludeDirs = options.excludeDirs ?? DEFAULT_EXCLUDE_DIRS;
|
|
19
|
+
const results = [];
|
|
20
|
+
function walk(currentDir) {
|
|
21
|
+
const entries = fs
|
|
22
|
+
.readdirSync(currentDir, { withFileTypes: true })
|
|
23
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
24
|
+
for (const entry of entries) {
|
|
25
|
+
const fullPath = path.join(currentDir, entry.name);
|
|
26
|
+
if (entry.isDirectory()) {
|
|
27
|
+
if (excludeDirs.includes(entry.name)) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
walk(fullPath);
|
|
31
|
+
}
|
|
32
|
+
else if (entry.isFile()) {
|
|
33
|
+
if (!extensions || extensions.length === 0) {
|
|
34
|
+
results.push(fullPath);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (const ext of extensions) {
|
|
38
|
+
if (entry.name.endsWith(ext)) {
|
|
39
|
+
results.push(fullPath);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
walk(rootDir);
|
|
48
|
+
return results.sort((a, b) => a.localeCompare(b));
|
|
49
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@doikayt/tooling-core",
|
|
3
|
+
"version": "1.4.15",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=22"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/doikayt/build-tools.git",
|
|
25
|
+
"directory": "javascript/tooling-core"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/doikayt/build-tools/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/doikayt/build-tools/tree/main/javascript/tooling-core",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"prepack": "npx nx build @doikayt/tooling-core 1>&2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/mdast": "^4.0.4",
|
|
36
|
+
"@types/node": "^18.16.0",
|
|
37
|
+
"@types/unist": "^3.0.3",
|
|
38
|
+
"typescript": "^5.4.0",
|
|
39
|
+
"vitest": "^4.0.18"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"github-slugger": "^2.0.0",
|
|
43
|
+
"remark-parse": "^11.0.0",
|
|
44
|
+
"unified": "^11.0.5",
|
|
45
|
+
"unist-util-visit": "^5.1.0"
|
|
46
|
+
}
|
|
47
|
+
}
|