@intentic/workspace-ignore 1.433.0 → 1.434.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 +6 -4
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,10 +14,12 @@ 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
|
|
18
|
-
`createIgnoreScope(matchers)`
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
- A compiled `.gitignore` matcher remembers every path it has answered, so a scope keeps only the rules' text and asks
|
|
18
|
+
the `matchers` it was created with (`createIgnoreScope(matchers)`) for the compiled one at each test. They decide how
|
|
19
|
+
long a matcher lives. By default, and with `walkMatchers()`, that is as long as the walk's scopes. With
|
|
20
|
+
`passMatchers()` it lasts until `release()`, which is what the daemon's resident tree calls after each pass, since it
|
|
21
|
+
holds its scopes indefinitely. The daemon's held directory reads keep them until its watcher or their time bound says
|
|
22
|
+
the folder changed.
|
|
21
23
|
- `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.
|
|
22
24
|
|
|
23
25
|
## Key files
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,13 @@ export type IgnoreScope = {
|
|
|
6
6
|
layer(relDir: string, gitignore: string | undefined): IgnoreScope;
|
|
7
7
|
};
|
|
8
8
|
export type Matchers = (gitignore: string) => Ignore;
|
|
9
|
-
export declare const compileGitignore:
|
|
9
|
+
export declare const compileGitignore: (gitignore: string) => Ignore;
|
|
10
10
|
export declare const walkMatchers: () => Matchers;
|
|
11
|
+
export interface PassMatchers {
|
|
12
|
+
readonly matchers: Matchers;
|
|
13
|
+
readonly release: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const passMatchers: () => PassMatchers;
|
|
11
16
|
export declare const createIgnoreScope: (matchers?: Matchers) => IgnoreScope;
|
|
12
17
|
export declare const NO_IGNORES: IgnoreScope;
|
|
13
18
|
export declare const toRelPath: (base: string, abs: string) => string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,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;AASxB,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;AAOF,MAAM,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;AAIrD,eAAO,MAAM,gBAAgB,cAAe,MAAM,KAAG,MAAiC,CAAC;AAIvF,eAAO,MAAM,YAAY,QAAO,QAU/B,CAAC;AAEF,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE5B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAChC;AAKD,eAAO,MAAM,YAAY,QAAO,YAQ/B,CAAC;AAiDF,eAAO,MAAM,iBAAiB,cAAc,QAAQ,KAAoB,WAAsC,CAAC;AAI/G,eAAO,MAAM,UAAU,EAAE,WAIxB,CAAC;AAGF,eAAO,MAAM,SAAS,SAAU,MAAM,OAAO,MAAM,KAAG,MAAkD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,15 @@ export const walkMatchers = () => {
|
|
|
16
16
|
return matcher;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
export const passMatchers = () => {
|
|
20
|
+
let current = walkMatchers();
|
|
21
|
+
return {
|
|
22
|
+
matchers: (gitignore) => current(gitignore),
|
|
23
|
+
release: () => {
|
|
24
|
+
current = walkMatchers();
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
19
28
|
const makeScope = (layers, compile) => ({
|
|
20
29
|
isIgnored(name, relPath, isDir) {
|
|
21
30
|
if (isDir && IGNORED_DIRS.has(name)) {
|
|
@@ -33,7 +42,7 @@ const makeScope = (layers, compile) => ({
|
|
|
33
42
|
if (rel === "") {
|
|
34
43
|
continue;
|
|
35
44
|
}
|
|
36
|
-
const result = layer.
|
|
45
|
+
const result = compile(layer.gitignore).test(isDir ? `${rel}/` : rel);
|
|
37
46
|
if (result.ignored) {
|
|
38
47
|
return true;
|
|
39
48
|
}
|
|
@@ -51,10 +60,10 @@ const makeScope = (layers, compile) => ({
|
|
|
51
60
|
if (gitignore === undefined) {
|
|
52
61
|
return this;
|
|
53
62
|
}
|
|
54
|
-
return makeScope([...layers, { base: relDir.split(sep).join("/"),
|
|
63
|
+
return makeScope([...layers, { base: relDir.split(sep).join("/"), gitignore }], compile);
|
|
55
64
|
},
|
|
56
65
|
});
|
|
57
|
-
export const createIgnoreScope = (matchers =
|
|
66
|
+
export const createIgnoreScope = (matchers = walkMatchers()) => makeScope([], matchers);
|
|
58
67
|
export const NO_IGNORES = {
|
|
59
68
|
isIgnored: () => false,
|
|
60
69
|
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,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,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,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,eAAe,EAAE,M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,CAAC,CAAC;QAC7F,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,MAAM,EAAE,SAAS;QACnB,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC,CAAC,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;CACJ,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,GAAa,YAAY,EAAE,EAAe,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AAI/G,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.434.0",
|
|
4
4
|
"description": "Layered workspace attention filter, machine subtrees, junk denylist, and accumulated .gitignore",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@intentic/base": "1.
|
|
45
|
-
"@intentic/constants": "1.
|
|
44
|
+
"@intentic/base": "1.434.0",
|
|
45
|
+
"@intentic/constants": "1.434.0",
|
|
46
46
|
"ignore": "7.0.12"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|