view-ignored 0.4.8 → 0.5.0

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.
Files changed (135) hide show
  1. package/README.md +64 -96
  2. package/out/index.d.ts +1 -4
  3. package/out/index.js +1 -4
  4. package/out/patterns/gitignore.d.ts +3 -0
  5. package/out/patterns/gitignore.js +35 -0
  6. package/out/patterns/index.d.ts +4 -0
  7. package/out/patterns/index.js +4 -0
  8. package/out/patterns/jsrjson.d.ts +4 -0
  9. package/out/patterns/jsrjson.js +39 -0
  10. package/out/patterns/matcher.d.ts +39 -0
  11. package/out/patterns/matcher.js +118 -0
  12. package/out/patterns/packagejson.d.ts +3 -0
  13. package/out/patterns/packagejson.js +25 -0
  14. package/out/scan.d.ts +46 -0
  15. package/out/scan.js +113 -0
  16. package/out/targets/git.d.ts +2 -0
  17. package/out/targets/git.js +22 -0
  18. package/out/targets/index.d.ts +6 -0
  19. package/out/targets/index.js +6 -0
  20. package/out/targets/jsr.d.ts +2 -0
  21. package/out/targets/jsr.js +25 -0
  22. package/out/targets/npm.d.ts +2 -0
  23. package/out/targets/npm.js +46 -0
  24. package/out/targets/target.d.ts +7 -0
  25. package/out/targets/target.js +1 -0
  26. package/out/targets/vsce.d.ts +2 -0
  27. package/out/targets/vsce.js +24 -0
  28. package/out/targets/yarn.d.ts +2 -0
  29. package/out/targets/yarn.js +49 -0
  30. package/out/walk.d.ts +2 -0
  31. package/out/walk.js +19 -0
  32. package/package.json +20 -54
  33. package/bin/viewig +0 -4
  34. package/out/browser/binds/index.d.ts +0 -56
  35. package/out/browser/binds/index.d.ts.map +0 -1
  36. package/out/browser/binds/index.js +0 -95
  37. package/out/browser/binds/index.js.map +0 -1
  38. package/out/browser/binds/plugins/git.d.ts +0 -23
  39. package/out/browser/binds/plugins/git.d.ts.map +0 -1
  40. package/out/browser/binds/plugins/git.js +0 -67
  41. package/out/browser/binds/plugins/git.js.map +0 -1
  42. package/out/browser/binds/plugins/jsr.d.ts +0 -39
  43. package/out/browser/binds/plugins/jsr.d.ts.map +0 -1
  44. package/out/browser/binds/plugins/jsr.js +0 -117
  45. package/out/browser/binds/plugins/jsr.js.map +0 -1
  46. package/out/browser/binds/plugins/npm.d.ts +0 -39
  47. package/out/browser/binds/plugins/npm.d.ts.map +0 -1
  48. package/out/browser/binds/plugins/npm.js +0 -146
  49. package/out/browser/binds/plugins/npm.js.map +0 -1
  50. package/out/browser/binds/plugins/vsce.d.ts +0 -26
  51. package/out/browser/binds/plugins/vsce.d.ts.map +0 -1
  52. package/out/browser/binds/plugins/vsce.js +0 -71
  53. package/out/browser/binds/plugins/vsce.js.map +0 -1
  54. package/out/browser/binds/plugins/yarn.d.ts +0 -12
  55. package/out/browser/binds/plugins/yarn.d.ts.map +0 -1
  56. package/out/browser/binds/plugins/yarn.js +0 -36
  57. package/out/browser/binds/plugins/yarn.js.map +0 -1
  58. package/out/browser/binds/scanner.d.ts +0 -47
  59. package/out/browser/binds/scanner.d.ts.map +0 -1
  60. package/out/browser/binds/scanner.js +0 -166
  61. package/out/browser/binds/scanner.js.map +0 -1
  62. package/out/browser/binds/targets.d.ts +0 -78
  63. package/out/browser/binds/targets.d.ts.map +0 -1
  64. package/out/browser/binds/targets.js +0 -46
  65. package/out/browser/binds/targets.js.map +0 -1
  66. package/out/browser/conc.d.ts +0 -2
  67. package/out/browser/conc.d.ts.map +0 -1
  68. package/out/browser/conc.js +0 -19
  69. package/out/browser/conc.js.map +0 -1
  70. package/out/browser/errors.d.ts +0 -47
  71. package/out/browser/errors.d.ts.map +0 -1
  72. package/out/browser/errors.js +0 -35
  73. package/out/browser/errors.js.map +0 -1
  74. package/out/browser/filtering.d.ts +0 -13
  75. package/out/browser/filtering.d.ts.map +0 -1
  76. package/out/browser/filtering.js +0 -12
  77. package/out/browser/filtering.js.map +0 -1
  78. package/out/browser/fs/directory.d.ts +0 -145
  79. package/out/browser/fs/directory.d.ts.map +0 -1
  80. package/out/browser/fs/directory.js +0 -244
  81. package/out/browser/fs/directory.js.map +0 -1
  82. package/out/browser/fs/file-info.d.ts +0 -89
  83. package/out/browser/fs/file-info.d.ts.map +0 -1
  84. package/out/browser/fs/file-info.js +0 -101
  85. package/out/browser/fs/file-info.js.map +0 -1
  86. package/out/browser/fs/file.d.ts +0 -39
  87. package/out/browser/fs/file.d.ts.map +0 -1
  88. package/out/browser/fs/file.js +0 -42
  89. package/out/browser/fs/file.js.map +0 -1
  90. package/out/browser/fs/index.d.ts +0 -5
  91. package/out/browser/fs/index.d.ts.map +0 -1
  92. package/out/browser/fs/index.js +0 -5
  93. package/out/browser/fs/index.js.map +0 -1
  94. package/out/browser/fs/source-info.d.ts +0 -29
  95. package/out/browser/fs/source-info.d.ts.map +0 -1
  96. package/out/browser/fs/source-info.js +0 -31
  97. package/out/browser/fs/source-info.js.map +0 -1
  98. package/out/browser/index.d.ts +0 -4
  99. package/out/browser/index.d.ts.map +0 -1
  100. package/out/browser/index.js +0 -4
  101. package/out/browser/index.js.map +0 -1
  102. package/out/browser/lib.d.ts +0 -138
  103. package/out/browser/lib.d.ts.map +0 -1
  104. package/out/browser/lib.js +0 -93
  105. package/out/browser/lib.js.map +0 -1
  106. package/out/browser/sorting.d.ts +0 -52
  107. package/out/browser/sorting.d.ts.map +0 -1
  108. package/out/browser/sorting.js +0 -137
  109. package/out/browser/sorting.js.map +0 -1
  110. package/out/browser/styling.d.ts +0 -92
  111. package/out/browser/styling.d.ts.map +0 -1
  112. package/out/browser/styling.js +0 -66
  113. package/out/browser/styling.js.map +0 -1
  114. package/out/cli.d.ts +0 -90
  115. package/out/cli.d.ts.map +0 -1
  116. package/out/cli.js +0 -360
  117. package/out/cli.js.map +0 -1
  118. package/out/config.d.ts +0 -186
  119. package/out/config.d.ts.map +0 -1
  120. package/out/config.js +0 -370
  121. package/out/config.js.map +0 -1
  122. package/out/errors.d.ts +0 -7
  123. package/out/errors.d.ts.map +0 -1
  124. package/out/errors.js +0 -3
  125. package/out/errors.js.map +0 -1
  126. package/out/index.d.ts.map +0 -1
  127. package/out/index.js.map +0 -1
  128. package/out/lib.d.ts +0 -5
  129. package/out/lib.d.ts.map +0 -1
  130. package/out/lib.js +0 -5
  131. package/out/lib.js.map +0 -1
  132. package/out/styling.d.ts +0 -5
  133. package/out/styling.d.ts.map +0 -1
  134. package/out/styling.js +0 -49
  135. package/out/styling.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ export * from './git.js';
2
+ export * from './jsr.js';
3
+ export * from './npm.js';
4
+ export * from './target.js';
5
+ export * from './vsce.js';
6
+ export * from './yarn.js';
@@ -0,0 +1,6 @@
1
+ export * from './git.js';
2
+ export * from './jsr.js';
3
+ export * from './npm.js';
4
+ export * from './target.js';
5
+ export * from './vsce.js';
6
+ export * from './yarn.js';
@@ -0,0 +1,2 @@
1
+ import type { Target } from './target.js';
2
+ export declare const JSR: Target;
@@ -0,0 +1,25 @@
1
+ import { signedPatternIgnores, findAndExtract } from '../patterns/matcher.js';
2
+ import { extractJsrJson, extractJsrJsonc } from '../patterns/jsrjson.js';
3
+ const jsrSources = ['deno.json', 'deno.jsonc', 'jsr.json', 'jsr.jsonc'];
4
+ const jsrSourceMap = new Map([
5
+ ['deno.json', extractJsrJson],
6
+ ['deno.jsonc', extractJsrJsonc],
7
+ ['jsr.json', extractJsrJson],
8
+ ['jsr.jsonc', extractJsrJsonc],
9
+ ]);
10
+ const vscePattern = {
11
+ exclude: [
12
+ '.git',
13
+ '.DS_Store',
14
+ ],
15
+ include: [],
16
+ };
17
+ export const JSR = {
18
+ async matcher(entry, isDir, ctx) {
19
+ if (isDir) {
20
+ await findAndExtract(entry, jsrSources, jsrSourceMap, ctx);
21
+ return true;
22
+ }
23
+ return await signedPatternIgnores(vscePattern, entry, jsrSources, jsrSourceMap, ctx);
24
+ },
25
+ };
@@ -0,0 +1,2 @@
1
+ import type { Target } from './target.js';
2
+ export declare const NPM: Target;
@@ -0,0 +1,46 @@
1
+ import { signedPatternIgnores, findAndExtract } from '../patterns/matcher.js';
2
+ import { extractGitignore } from '../patterns/gitignore.js';
3
+ import { extractPackageJson } from '../patterns/packagejson.js';
4
+ const npmSources = ['package.json', '.npmignore', '.gitignore'];
5
+ const npmSourceMap = new Map([
6
+ ['package.json', extractPackageJson],
7
+ ['.npmignore', extractGitignore],
8
+ ['.gitignore', extractGitignore],
9
+ ]);
10
+ const npmPattern = {
11
+ exclude: [
12
+ '.git',
13
+ '.DS_Store',
14
+ 'node_modules',
15
+ '.*.swp',
16
+ '._*',
17
+ '.DS_Store',
18
+ '.git',
19
+ '.gitignore',
20
+ '.hg',
21
+ '.npmignore',
22
+ '.npmrc',
23
+ '.lock-wscript',
24
+ '.svn',
25
+ '.wafpickle-*',
26
+ 'config.gypi',
27
+ 'CVS',
28
+ 'npm-debug.log',
29
+ ],
30
+ include: [
31
+ 'bin',
32
+ 'package.json',
33
+ 'README*',
34
+ 'LICENSE*',
35
+ 'LICENCE*',
36
+ ],
37
+ };
38
+ export const NPM = {
39
+ async matcher(entry, isDir, ctx) {
40
+ if (isDir) {
41
+ await findAndExtract(entry, npmSources, npmSourceMap, ctx);
42
+ return true;
43
+ }
44
+ return await signedPatternIgnores(npmPattern, entry, npmSources, npmSourceMap, ctx);
45
+ },
46
+ };
@@ -0,0 +1,7 @@
1
+ import type { PathChecker } from '../patterns/matcher.js';
2
+ export interface Target {
3
+ /**
4
+ * Glob-pattern parser.
5
+ */
6
+ matcher: PathChecker;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { Target } from './target.js';
2
+ export declare const VSCE: Target;
@@ -0,0 +1,24 @@
1
+ import { signedPatternIgnores, findAndExtract } from '../patterns/matcher.js';
2
+ import { extractGitignore } from '../patterns/gitignore.js';
3
+ import { extractPackageJson } from '../patterns/packagejson.js';
4
+ const vsceSources = ['package.json', '.vscodeignore'];
5
+ const vsceSourceMap = new Map([
6
+ ['package.json', extractPackageJson],
7
+ ['.vscodeignore', extractGitignore],
8
+ ]);
9
+ const vscePattern = {
10
+ exclude: [
11
+ '.git',
12
+ '.DS_Store',
13
+ ],
14
+ include: [],
15
+ };
16
+ export const VSCE = {
17
+ async matcher(entry, isDir, ctx) {
18
+ if (isDir) {
19
+ await findAndExtract(entry, vsceSources, vsceSourceMap, ctx);
20
+ return true;
21
+ }
22
+ return await signedPatternIgnores(vscePattern, entry, vsceSources, vsceSourceMap, ctx);
23
+ },
24
+ };
@@ -0,0 +1,2 @@
1
+ import type { Target } from './target.js';
2
+ export declare const Yarn: Target;
@@ -0,0 +1,49 @@
1
+ import { signedPatternIgnores, findAndExtract } from '../patterns/matcher.js';
2
+ import { extractGitignore } from '../patterns/gitignore.js';
3
+ import { extractPackageJson } from '../patterns/packagejson.js';
4
+ const yarnSources = ['package.json', '.yarnignore', '.npmignore', '.gitignore'];
5
+ const yarnSourceMap = new Map([
6
+ ['package.json', extractPackageJson],
7
+ ['.yarnignore', extractGitignore],
8
+ ['.npmignore', extractGitignore],
9
+ ['.gitignore', extractGitignore],
10
+ ]);
11
+ const yarnPattern = {
12
+ exclude: [
13
+ '.git',
14
+ '.DS_Store',
15
+ 'node_modules',
16
+ '.*.swp',
17
+ '._*',
18
+ '.DS_Store',
19
+ '.git',
20
+ '.gitignore',
21
+ '.hg',
22
+ '.npmignore',
23
+ '.npmrc',
24
+ '.lock-wscript',
25
+ '.svn',
26
+ '.wafpickle-*',
27
+ 'config.gypi',
28
+ 'CVS',
29
+ 'npm-debug.log',
30
+ '.yarnignore',
31
+ '.yarnrc',
32
+ ],
33
+ include: [
34
+ 'bin',
35
+ 'package.json',
36
+ 'README*',
37
+ 'LICENSE*',
38
+ 'LICENCE*',
39
+ ],
40
+ };
41
+ export const Yarn = {
42
+ async matcher(entry, isDir, ctx) {
43
+ if (isDir) {
44
+ await findAndExtract(entry, yarnSources, yarnSourceMap, ctx);
45
+ return true;
46
+ }
47
+ return await signedPatternIgnores(yarnPattern, entry, yarnSources, yarnSourceMap, ctx);
48
+ },
49
+ };
package/out/walk.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { Dirent, PathLike } from 'node:fs';
2
+ export declare function opendir(path: PathLike, cb: (entry: Dirent) => Promise<0 | 1 | 2>): Promise<void | 2>;
package/out/walk.js ADDED
@@ -0,0 +1,19 @@
1
+ import * as fsp from 'node:fs/promises';
2
+ export async function opendir(path, cb) {
3
+ const dir = await fsp.opendir(path);
4
+ for await (const entry of dir) {
5
+ const r = await cb(entry);
6
+ if (r === 2) {
7
+ return 2;
8
+ }
9
+ if (r === 1) {
10
+ continue;
11
+ }
12
+ if (entry.isDirectory()) {
13
+ const r = await opendir(path + '/' + entry.name, cb);
14
+ if (r === 2) {
15
+ return 2;
16
+ }
17
+ }
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,27 +1,21 @@
1
1
  {
2
2
  "name": "view-ignored",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "Retrieve list of files ignored/included by Git, NPM, Yarn, JSR, VSCE or other tools.",
5
5
  "type": "module",
6
- "bin": {
7
- "viewig": "./bin/viewig",
8
- "view-ignored": "./bin/viewig"
9
- },
10
6
  "scripts": {
11
7
  "prerelease": "bun run test && bun run build:prod && bun run lint",
12
8
  "test": "bun run build && node --test out/**/*.test.js",
13
- "build": "rm -rf out && tsc -p .",
14
- "build:prod": "bun run build && rm out/**/*.test.*",
9
+ "build": "rm -rf out && tsgo -p .",
10
+ "build:prod": "rm -rf out && tsgo -p tsconfig.prod.json",
15
11
  "lint": "bun run eslint .",
16
12
  "release:major": "bun run release-it --increment=major",
17
13
  "release:minor": "bun run release-it --increment=minor",
18
14
  "release:patch": "bun run release-it --increment=patch"
19
15
  },
20
16
  "author": "Mopsgamer",
21
- "license": "ISC",
22
- "main": "./out/index.js",
17
+ "license": "MIT",
23
18
  "files": [
24
- "/bin",
25
19
  "/out"
26
20
  ],
27
21
  "repository": {
@@ -31,7 +25,6 @@
31
25
  "bugs": {
32
26
  "url": "https://github.com/Mopsgamer/view-ignored/issues"
33
27
  },
34
- "homepage": "https://github.com/Mopsgamer/view-ignored",
35
28
  "engines": {
36
29
  "node": ">=18"
37
30
  },
@@ -40,27 +33,13 @@
40
33
  "default": "./out/index.js",
41
34
  "types": "./out/index.d.ts"
42
35
  },
43
- "./browser": {
44
- "default": "./out/browser/index.js",
45
- "types": "./out/browser/index.d.ts"
46
- }
47
- },
48
- "release-it": {
49
- "hooks": {
50
- "before:init": "bun prerelease"
51
- },
52
- "plugins": {
53
- "@release-it/keep-a-changelog": {
54
- "filename": "CHANGELOG.md"
55
- }
56
- },
57
- "github": {
58
- "release": true,
59
- "draft": false,
60
- "releaseName": "${version}"
36
+ "./patterns": {
37
+ "default": "./out/patterns/index.js",
38
+ "types": "./out/patterns/index.d.ts"
61
39
  },
62
- "npm": {
63
- "publish": true
40
+ "./targets": {
41
+ "default": "./out/targets/index.js",
42
+ "types": "./out/targets/index.d.ts"
64
43
  }
65
44
  },
66
45
  "publishConfig": {
@@ -70,45 +49,32 @@
70
49
  "lib": "out"
71
50
  },
72
51
  "dependencies": {
73
- "@humanwhocodes/gitignore-to-minimatch": "^1.0.2",
74
- "@m234/nerd-fonts": "^0.4.0",
75
- "ansi-regex": "^6.2.2",
76
- "chalk": "^5.6.2",
77
- "commander": "^14.0.2",
78
- "jsonify-paths": "^1.1.0",
79
- "load-plugin": "^6.0.3",
52
+ "arktype": "^2.1.29",
80
53
  "minimatch": "^10.1.1",
81
- "ora": "^9.0.0",
82
- "strip-json-comments": "^5.0.3",
83
- "treeify": "^1.1.0",
84
- "yaml": "^2.8.2",
85
- "zod": "^4.1.13"
54
+ "strip-json-comments": "^5.0.3"
86
55
  },
87
56
  "devDependencies": {
88
- "@eslint/js": "^9.39.1",
57
+ "@eslint/js": "^9.39.2",
89
58
  "@release-it/keep-a-changelog": "^7.0.0",
90
59
  "@stylistic/eslint-plugin": "^5.6.1",
91
- "@types/node": "24.10.1",
92
- "@types/treeify": "^1.0.3",
93
- "eslint": "^9.39.1",
60
+ "@types/node": "22",
61
+ "@typescript/native-preview": "^7.0.0-dev.20251214.1",
62
+ "eslint": "^9.39.2",
94
63
  "fs-fixture": "^2.11.0",
95
- "globals": "^16.5.0",
96
- "release-it": "^19.0.6",
97
- "typescript": "^5.9.3",
64
+ "release-it": "^19.1.0",
98
65
  "typescript-eslint": "^8.49.0"
99
66
  },
100
67
  "keywords": [
101
68
  "tree",
102
69
  "ls-tree",
103
70
  "ignore",
71
+ "match",
104
72
  "gitignore",
105
73
  "npmignore",
74
+ "yarnignore",
106
75
  "vscodeignore",
107
- "cli",
108
76
  "fs",
109
- "file-system",
110
- "output",
111
- "project",
77
+ "files",
112
78
  "migration"
113
79
  ]
114
80
  }
package/bin/viewig DELETED
@@ -1,4 +0,0 @@
1
- #! /usr/bin/env node
2
- import {programInit} from '../out/cli.js';
3
-
4
- programInit();
@@ -1,56 +0,0 @@
1
- import { type TargetBind } from './targets.js';
2
- export * from './scanner.js';
3
- export * from './targets.js';
4
- /**
5
- * Built-in name list.
6
- */
7
- export declare const builtInNameList: readonly ["git", "npm", "vsce", "yarn", "jsr"];
8
- /**
9
- * Built-in name type.
10
- */
11
- export type BuiltInName = typeof builtInNameList[number];
12
- /**
13
- * The result of loading.
14
- */
15
- export type PluginLoaded = {
16
- resource: string;
17
- isLoaded: boolean;
18
- exports: unknown;
19
- };
20
- /**
21
- * If a plugin wants to change something, it must export default.
22
- * @internal
23
- */
24
- export type PluginExport = {
25
- viewignored: {
26
- addTargets: TargetBind[];
27
- };
28
- };
29
- /**
30
- * Checks if the value is the {@link PluginExport}.
31
- */
32
- export declare function isPluginExport(value: unknown): value is PluginExport;
33
- /**
34
- * Imports the plugin's exported data.
35
- */
36
- export declare function importPlugin(exportData: PluginExport): void;
37
- /**
38
- * @param modulePath The plugin name.
39
- * @returns The import result for the module.
40
- */
41
- export declare function loadPlugin(modulePath: string, useImport?: boolean): Promise<PluginLoaded>;
42
- /**
43
- * @param modulePathList The plugin name list.
44
- * @returns The import result for the list of modules.
45
- */
46
- export declare function loadPlugins(modulePathList: string[]): Promise<PluginLoaded[]>;
47
- /**
48
- * Load any built-in plugin.
49
- */
50
- export declare function loadBuiltIn(builtIn: BuiltInName): Promise<PluginLoaded>;
51
- /**
52
- * @param modulePathList The plugin name list.
53
- * @returns The import result for the list of modules.
54
- */
55
- export declare function loadBuiltIns(builtInList?: BuiltInName[]): Promise<PluginLoaded[]>;
56
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/binds/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,UAAU,EAAa,MAAM,cAAc,CAAA;AAGvE,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAa5B;;GAEG;AACH,eAAO,MAAM,eAAe,gDAAiD,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE;QACX,UAAU,EAAE,UAAU,EAAE,CAAA;KACzB,CAAA;CACF,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CASpE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,YAAY,QAKpD;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,UAAQ,GAChB,OAAO,CAAC,YAAY,CAAC,CA+BvB;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,cAAc,EAAE,MAAM,EAAE,GACvB,OAAO,CAAC,YAAY,EAAE,CAAC,CAIzB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAEvE;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,WAAW,GAAE,WAAW,EAAyB,GAChD,OAAO,CAAC,YAAY,EAAE,CAAC,CAIzB"}
@@ -1,95 +0,0 @@
1
- import { loadPlugin as load } from 'load-plugin';
2
- import { isTargetBind, targetSet } from './targets.js';
3
- import { conc } from '../conc.js';
4
- export * from './scanner.js';
5
- export * from './targets.js';
6
- /**
7
- * @internal
8
- */
9
- const builtInImportMap = {
10
- git: './plugins/git.js',
11
- npm: './plugins/npm.js',
12
- vsce: './plugins/vsce.js',
13
- yarn: './plugins/yarn.js',
14
- jsr: './plugins/jsr.js',
15
- };
16
- /**
17
- * Built-in name list.
18
- */
19
- export const builtInNameList = ['git', 'npm', 'vsce', 'yarn', 'jsr'];
20
- /**
21
- * Checks if the value is the {@link PluginExport}.
22
- */
23
- export function isPluginExport(value) {
24
- if (value?.constructor !== Object) {
25
- return false;
26
- }
27
- const vign = value.viewignored;
28
- return (vign?.constructor === Object)
29
- && 'addTargets' in vign && Array.isArray(vign.addTargets)
30
- && vign.addTargets.every(v => isTargetBind(v));
31
- }
32
- /**
33
- * Imports the plugin's exported data.
34
- */
35
- export function importPlugin(exportData) {
36
- const { addTargets } = exportData.viewignored;
37
- for (const targetBind of addTargets) {
38
- targetSet(targetBind);
39
- }
40
- }
41
- /**
42
- * @param modulePath The plugin name.
43
- * @returns The import result for the module.
44
- */
45
- export async function loadPlugin(modulePath, useImport = false) {
46
- try {
47
- const exports = useImport
48
- ? Object.getOwnPropertyDescriptor(await import(modulePath), 'default')
49
- ?.value
50
- : await load(modulePath);
51
- const result = {
52
- resource: modulePath,
53
- isLoaded: true,
54
- exports,
55
- };
56
- if (isPluginExport(exports)) {
57
- importPlugin(exports);
58
- }
59
- return result;
60
- }
61
- catch (error) {
62
- const r = error;
63
- let reason = r;
64
- if (r?.code === 'ERR_MODULE_NOT_FOUND') {
65
- reason = r.message;
66
- }
67
- const fail = {
68
- resource: modulePath,
69
- isLoaded: false,
70
- exports: reason,
71
- };
72
- return fail;
73
- }
74
- }
75
- /**
76
- * @param modulePathList The plugin name list.
77
- * @returns The import result for the list of modules.
78
- */
79
- export async function loadPlugins(modulePathList) {
80
- return await conc(modulePathList.map(modulePath => async () => await loadPlugin(modulePath)), 4);
81
- }
82
- /**
83
- * Load any built-in plugin.
84
- */
85
- export function loadBuiltIn(builtIn) {
86
- return loadPlugin(builtInImportMap[builtIn], true);
87
- }
88
- /**
89
- * @param modulePathList The plugin name list.
90
- * @returns The import result for the list of modules.
91
- */
92
- export async function loadBuiltIns(builtInList = [...builtInNameList]) {
93
- return await conc(builtInList.map(modulePath => async () => await loadBuiltIn(modulePath)), 4);
94
- }
95
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/browser/binds/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,YAAY,EAAmB,SAAS,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAE5B;;GAEG;AACH,MAAM,gBAAgB,GAAgC;IACpD,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,kBAAkB;IACvB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,mBAAmB;IACzB,GAAG,EAAE,kBAAkB;CACxB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAU,CAAA;AA0B7E;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,KAAK,EAAE,WAAW,KAAK,MAAM,E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B,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,CAAC,OAAO,CAAA;QACpB,CAAC;QAED,MAAM,IAAI,GAAiB;YACzB,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,MAAM;SAChB,CAAA;QACD,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,cAAwB;IAExB,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAChD,KAAK,IAAI,EAAE,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,CACzC,EAAE,CAAC,CAAC,CAAA;AACP,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,OAAoB;IAC9C,OAAO,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAA;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,cAA6B,CAAC,GAAG,eAAe,CAAC;IAEjD,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAC7C,KAAK,IAAI,EAAE,CAAC,MAAM,WAAW,CAAC,UAAU,CAAC,CAC1C,EAAE,CAAC,CAAC,CAAA;AACP,CAAC"}
@@ -1,23 +0,0 @@
1
- import { File, type Methodology, type Plugins, type Scanner, SourceInfo } from '../../index.js';
2
- /**
3
- * @internal
4
- */
5
- export declare const matcherExclude: string[];
6
- /**
7
- * For the source file parent directory we are getting all the cache recursively for all files.
8
- * @param map The output.
9
- * @param scanner The scanner.
10
- * @param sourceFile This file will be converted to a {@link SourceInfo}.
11
- * @internal
12
- */
13
- export declare function useSourceFile(map: Map<File, SourceInfo>, sourceFile: File, scanner: Scanner & {
14
- pattern: string | string[];
15
- }): Map<File, SourceInfo>;
16
- /**
17
- * @param base The name for gitignore-like file.
18
- * @internal
19
- */
20
- export declare const methodologyGitignoreLike: (base: string) => Methodology;
21
- declare const git: Plugins.PluginExport;
22
- export default git;
23
- //# sourceMappingURL=git.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../src/browser/binds/plugins/git.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,IAAI,EAEJ,KAAK,WAAW,EAEhB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,UAAU,EACX,MAAM,gBAAgB,CAAA;AASvB;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,EAGlC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,EAC1B,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,GAChD,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAWvB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,KAAG,WAsBrD,CAAA;AAWH,QAAA,MAAM,GAAG,EAAE,OAAO,CAAC,YAAsD,CAAA;AACzE,eAAe,GAAG,CAAA"}
@@ -1,67 +0,0 @@
1
- import { icons } from '@m234/nerd-fonts';
2
- import { Directory, File, InvalidPatternError, NoSourceError, SourceInfo, } from '../../index.js';
3
- import { ScannerGitignore } from '../scanner.js';
4
- import {} from '../targets.js';
5
- const id = 'git';
6
- const name = 'Git';
7
- const icon = { ...icons['nf-seti-git'], color: '#F44E28' };
8
- const testCommand = 'git ls-tree -r <git-branch-name> --name-only';
9
- /**
10
- * @internal
11
- */
12
- export const matcherExclude = [
13
- '**/.git/**',
14
- '**/.DS_Store/**',
15
- ];
16
- /**
17
- * For the source file parent directory we are getting all the cache recursively for all files.
18
- * @param map The output.
19
- * @param scanner The scanner.
20
- * @param sourceFile This file will be converted to a {@link SourceInfo}.
21
- * @internal
22
- */
23
- export function useSourceFile(map, sourceFile, scanner) {
24
- const sourceInfo = SourceInfo.from(sourceFile, scanner);
25
- for (const file of sourceFile.parent.deepIterator()) {
26
- if (file instanceof Directory) {
27
- continue;
28
- }
29
- map.set(file, sourceInfo);
30
- }
31
- return map;
32
- }
33
- /**
34
- * @param base The name for gitignore-like file.
35
- * @internal
36
- */
37
- export const methodologyGitignoreLike = (base) => function (tree, o) {
38
- const sourceList = tree.deep(File).filter(dirent => dirent.base === base);
39
- const map = new Map();
40
- if (sourceList.length === 0) {
41
- throw new NoSourceError(base);
42
- }
43
- for (const sourceFile of sourceList) {
44
- const scanner = new ScannerGitignore({ exclude: matcherExclude });
45
- const content = o.modules.fs.readFileSync(sourceFile.absolutePath)
46
- .toString();
47
- const pattern = content;
48
- if (!scanner.isValid(pattern)) {
49
- throw new InvalidPatternError(sourceFile, pattern);
50
- }
51
- scanner.pattern = pattern;
52
- useSourceFile(map, sourceFile, scanner);
53
- }
54
- return map;
55
- };
56
- const bind = {
57
- id,
58
- icon,
59
- name,
60
- testCommand,
61
- scanOptions: {
62
- target: methodologyGitignoreLike('.gitignore'),
63
- },
64
- };
65
- const git = { viewignored: { addTargets: [bind] } };
66
- export default git;
67
- //# sourceMappingURL=git.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../../../src/browser/binds/plugins/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EACL,SAAS,EACT,IAAI,EACJ,mBAAmB,EAEnB,aAAa,EAGb,UAAU,GACX,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAoC,MAAM,eAAe,CAAA;AAEhE,MAAM,EAAE,GAAG,KAAK,CAAA;AAChB,MAAM,IAAI,GAAe,KAAK,CAAA;AAC9B,MAAM,IAAI,GAAe,EAAE,GAAG,KAA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,CAAC;aAC/D,QAAQ,EAAE,CAAA;QACb,MAAM,OAAO,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACpD,CAAC;QAED,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;QACzB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACzC,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAEH,MAAM,IAAI,GAAuB;IAC/B,EAAE;IACF,IAAI;IACJ,IAAI;IACJ,WAAW;IACX,WAAW,EAAE;QACX,MAAM,EAAE,wBAAwB,CAAC,YAAY,CAAC;KAC/C;CACF,CAAA;AACD,MAAM,GAAG,GAAyB,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;AACzE,eAAe,GAAG,CAAA"}
@@ -1,39 +0,0 @@
1
- import { Directory, type File, type Methodology, type Plugins, type SourceInfo } from '../../index.js';
2
- import { type PatternScanner } from '../scanner.js';
3
- /**
4
- * @internal
5
- */
6
- export declare const matcherExclude: never[];
7
- /**
8
- * @internal
9
- */
10
- export declare const matcherInclude: never[];
11
- /**
12
- * @internal
13
- */
14
- export type ValidManifestJsr = {
15
- name: string;
16
- version: string;
17
- exports?: string | Record<string, string>;
18
- exclude?: string[];
19
- include?: string[];
20
- publish?: {
21
- exclude?: string[];
22
- include?: string[];
23
- };
24
- };
25
- /**
26
- * @internal
27
- */
28
- export declare function isValidManifestJsr(value: unknown): value is ValidManifestJsr;
29
- /**
30
- * @internal
31
- */
32
- export declare function useChildren(tree: Directory, map: Map<File, SourceInfo>, getMap: (child: Directory) => Map<File, SourceInfo>): Map<File, SourceInfo>;
33
- /**
34
- * @internal
35
- */
36
- export declare const sourceSearch: (priority: string[], scanner: PatternScanner) => Methodology;
37
- declare const npm: Plugins.PluginExport;
38
- export default npm;
39
- //# sourceMappingURL=jsr.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsr.d.ts","sourceRoot":"","sources":["../../../../src/browser/binds/plugins/jsr.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,SAAS,EACT,KAAK,IAAI,EAET,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,eAAe,CAAA;AAYrE;;GAEG;AACH,eAAO,MAAM,cAAc,SAAK,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,cAAc,SAAK,CAAA;AAEhC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KACnB,CAAA;CACF,CAAA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAe5E;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,EAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,yBAcpD;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAAE,EAClB,SAAS,cAAc,KACtB,WA8DA,CAAA;AAg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