@intentic/workspace-ignore 1.312.0 → 1.314.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.
- package/README.md +4 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,6 +14,10 @@ flowchart LR
|
|
|
14
14
|
- Ignored means "not part of the tracked project". Ignored directories stay listed and lazy-load, so nothing is hidden and this is not a security boundary.
|
|
15
15
|
- The `./constants` entry point has no Node imports, so the browser bundle shares the same lists as the daemon.
|
|
16
16
|
- `refs/` and `public/` count only at the workspace root. A repository's own `public/` stays ordinary content.
|
|
17
|
+
- A compiled `.gitignore` matcher remembers every path it has answered, so its holder decides how long it lives:
|
|
18
|
+
`createIgnoreScope(matchers)` takes the compiler. By default each layer compiles its own and lives as long as the
|
|
19
|
+
scope; `walkMatchers()` shares them by text for one walk; the daemon's held directory reads share them until its
|
|
20
|
+
watcher or their time bound says the folder changed.
|
|
17
21
|
- `descend()` treats a directory without a `.gitignore` as adding no rules, and rejects when one exists but cannot be read, since reading it as empty would count everything under it as tracked.
|
|
18
22
|
|
|
19
23
|
## Key files
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { type Ignore } from "ignore";
|
|
1
2
|
export { IGNORED_DIRS, isAgentWorktreePath, isBrowserProfilePath, isPublicPath, isReferencePath, PUBLIC_DIR, REFERENCE_DIR, scannerPruneGlobs, } from "./constants.js";
|
|
2
3
|
export type IgnoreScope = {
|
|
3
4
|
isIgnored(name: string, relPath: string, isDir: boolean): boolean;
|
|
4
5
|
descend(absDir: string, relDir: string): Promise<IgnoreScope>;
|
|
5
6
|
layer(relDir: string, gitignore: string | undefined): IgnoreScope;
|
|
6
7
|
};
|
|
7
|
-
export
|
|
8
|
+
export type Matchers = (gitignore: string) => Ignore;
|
|
9
|
+
export declare const compileGitignore: Matchers;
|
|
10
|
+
export declare const walkMatchers: () => Matchers;
|
|
11
|
+
export declare const createIgnoreScope: (matchers?: Matchers) => IgnoreScope;
|
|
8
12
|
export declare const NO_IGNORES: IgnoreScope;
|
|
9
13
|
export declare const toRelPath: (base: string, abs: string) => string;
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAe,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQ7C,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,UAAU,EACV,aAAa,EACb,iBAAiB,GACpB,MAAM,gBAAgB,CAAC;AAQxB,MAAM,MAAM,WAAW,GAAG;IACtB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAClE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE9D,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;CACrE,CAAC;AAKF,MAAM,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;AAGrD,eAAO,MAAM,gBAAgB,EAAE,QAAiD,CAAC;AAIjF,eAAO,MAAM,YAAY,QAAO,QAU/B,CAAC;AAuDF,eAAO,MAAM,iBAAiB,cAAc,QAAQ,KAAsB,WAAsC,CAAC;AAIjH,eAAO,MAAM,UAAU,EAAE,WAIxB,CAAC;AAGF,eAAO,MAAM,SAAS,SAAU,MAAM,OAAO,MAAM,KAAG,MAAkD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,20 +3,19 @@ import { join, relative, sep } from "node:path";
|
|
|
3
3
|
import ignore from "ignore";
|
|
4
4
|
import { IGNORED_DIRS, isAgentWorktreePath, isBrowserProfilePath, isReferencePath } from "./constants.js";
|
|
5
5
|
export { IGNORED_DIRS, isAgentWorktreePath, isBrowserProfilePath, isPublicPath, isReferencePath, PUBLIC_DIR, REFERENCE_DIR, scannerPruneGlobs, } from "./constants.js";
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
matcher
|
|
12
|
-
|
|
13
|
-
compiled.
|
|
6
|
+
export const compileGitignore = (gitignore) => ignore().add(gitignore);
|
|
7
|
+
export const walkMatchers = () => {
|
|
8
|
+
const compiled = new Map();
|
|
9
|
+
return (gitignore) => {
|
|
10
|
+
let matcher = compiled.get(gitignore);
|
|
11
|
+
if (matcher === undefined) {
|
|
12
|
+
matcher = compileGitignore(gitignore);
|
|
13
|
+
compiled.set(gitignore, matcher);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return matcher;
|
|
15
|
+
return matcher;
|
|
16
|
+
};
|
|
18
17
|
};
|
|
19
|
-
const makeScope = (layers) => ({
|
|
18
|
+
const makeScope = (layers, compile) => ({
|
|
20
19
|
isIgnored(name, relPath, isDir) {
|
|
21
20
|
if (isDir && IGNORED_DIRS.has(name)) {
|
|
22
21
|
return true;
|
|
@@ -57,10 +56,10 @@ const makeScope = (layers) => ({
|
|
|
57
56
|
if (gitignore === undefined) {
|
|
58
57
|
return this;
|
|
59
58
|
}
|
|
60
|
-
return makeScope([...layers, { base: relDir.split(sep).join("/"), ig: compile(gitignore) }]);
|
|
59
|
+
return makeScope([...layers, { base: relDir.split(sep).join("/"), ig: compile(gitignore) }], compile);
|
|
61
60
|
},
|
|
62
61
|
});
|
|
63
|
-
export const createIgnoreScope = () => makeScope([]);
|
|
62
|
+
export const createIgnoreScope = (matchers = compileGitignore) => makeScope([], matchers);
|
|
64
63
|
export const NO_IGNORES = {
|
|
65
64
|
isIgnored: () => false,
|
|
66
65
|
descend: async () => NO_IGNORES,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAO1G,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,UAAU,EACV,aAAa,EACb,iBAAiB,GACpB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAO1G,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,UAAU,EACV,aAAa,EACb,iBAAiB,GACpB,MAAM,gBAAgB,CAAC;AAqBxB,MAAM,CAAC,MAAM,gBAAgB,GAAa,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,CAA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AO,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IAC1G,CAAC;CACJ,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,GAAa,gBAAgB,EAAe,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AAIjH,MAAM,CAAC,MAAM,UAAU,GAAgB;IACnC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK;IACtB,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,UAAU;IAC/B,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU;CAC1B,CAAC;AAGF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,GAAW,EAAU,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/workspace-ignore",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.314.0",
|
|
4
4
|
"description": "Layered workspace attention filter, machine subtrees, junk denylist, and accumulated .gitignore",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@intentic/constants": "1.
|
|
44
|
+
"@intentic/constants": "1.314.0",
|
|
45
45
|
"ignore": "7.0.10",
|
|
46
46
|
"tslib": "2.8.1"
|
|
47
47
|
},
|