@cofferdam/check-sdk 0.2.2 → 0.3.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 +28 -3
- package/dist/check-context.d.ts +5 -0
- package/dist/check-context.d.ts.map +1 -1
- package/dist/define-check.d.ts +52 -2
- package/dist/define-check.d.ts.map +1 -1
- package/dist/define-check.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin-host.d.ts +18 -1
- package/dist/plugin-host.d.ts.map +1 -1
- package/dist/plugin-host.js +107 -0
- package/dist/plugin-host.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -93,17 +93,42 @@ import type {
|
|
|
93
93
|
|
|
94
94
|
Everything in this list is part of the stability contract; new exports are additive. Removing or renaming an export is a breaking change.
|
|
95
95
|
|
|
96
|
+
## MemberExpression property resolution
|
|
97
|
+
|
|
98
|
+
`MemberExpressionNode` exposes two fields: `computed: boolean` and `property: string | undefined`.
|
|
99
|
+
|
|
100
|
+
- **Dot-form** (`obj.foo`, `computed=false`): `property` is always the identifier name — e.g. `"foo"`.
|
|
101
|
+
- **String-literal-indexed** (`obj["foo"]`, `computed=true`): `property` resolves to the literal value — e.g. `"foo"`. The resolver only applies when the index is a bare string literal; template literals and concatenation are treated as dynamic.
|
|
102
|
+
- **Dynamic-indexed** (`obj[runtimeVar]`, `computed=true`): `property` is `undefined`. The index is not statically determinable. Use `file.text.slice(node.span.start_byte, node.span.end_byte)` if you need the surface form.
|
|
103
|
+
|
|
104
|
+
In short: **`property` is always set for dot-form, and set for string-literal bracket-form. It is `undefined` only when the index is truly dynamic.**
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
for (const m of file.ast.findAll("MemberExpression")) {
|
|
108
|
+
if (m.property === "fetch") {
|
|
109
|
+
// Catches both obj.fetch and obj["fetch"]
|
|
110
|
+
ctx.report({ message: "...", span: m.span });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## ts-morph routing status (0.2.x)
|
|
116
|
+
|
|
117
|
+
`DefineCheckInput` exposes a `requiresTypes?: boolean` field for checks that need full type-aware analysis (resolved types, inferred generics, call signatures). **This field is reserved for future use in 0.2.x and is not yet wired.** Setting `requiresTypes: true` today is accepted by the type system and recorded on the `Check` object, but the engine does not route the check through ts-morph and no type information is available inside `run()`. The plugin host emits a one-time warning to stderr at load time when it encounters a plugin with `requiresTypes: true` so authors are not left wondering why type data is absent.
|
|
118
|
+
|
|
119
|
+
Type-aware routing via ts-morph is on the roadmap. Track cd-l58 / [gh #16](https://github.com/TAJD/cofferdam/issues/16) for status.
|
|
120
|
+
|
|
96
121
|
## Versioning
|
|
97
122
|
|
|
98
|
-
The SDK ships in lockstep with the cofferdam binary. `@cofferdam/check-sdk@X.Y.Z` is built and tested against
|
|
123
|
+
The SDK ships in lockstep with the cofferdam binary. `@cofferdam/check-sdk@X.Y.Z` is built and tested against `@cofferdam/cofferdam@X.Y.Z`; the cofferdam plugin host enforces a major-version compatibility check at load time and refuses to run plugins whose vendored SDK is from a different major.
|
|
99
124
|
|
|
100
125
|
For 0.x: minor bumps may be breaking. Pin both packages to the same exact version until 1.0:
|
|
101
126
|
|
|
102
127
|
```jsonc
|
|
103
128
|
{
|
|
104
129
|
"devDependencies": {
|
|
105
|
-
"cofferdam": "0.2.
|
|
106
|
-
"@cofferdam/check-sdk": "0.2.
|
|
130
|
+
"@cofferdam/cofferdam": "0.2.3",
|
|
131
|
+
"@cofferdam/check-sdk": "0.2.3"
|
|
107
132
|
}
|
|
108
133
|
}
|
|
109
134
|
```
|
package/dist/check-context.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export interface SourceFile {
|
|
|
8
8
|
readonly path: string;
|
|
9
9
|
/** Full text of the file, UTF-8. Byte offsets in spans index into this. */
|
|
10
10
|
readonly text: string;
|
|
11
|
+
/**
|
|
12
|
+
* Layer name from `cofferdam.invariants.toml` `[layers]`.
|
|
13
|
+
* `null` when the file is not a member of any declared layer.
|
|
14
|
+
*/
|
|
15
|
+
readonly layer: string | null;
|
|
11
16
|
/**
|
|
12
17
|
* Iterate every line in the file with classification flags drawn
|
|
13
18
|
* from the comment table + an AST walk over string/template/JSX.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-context.d.ts","sourceRoot":"","sources":["../src/check-context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"check-context.d.ts","sourceRoot":"","sources":["../src/check-context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;;OAIG;IACH,KAAK,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAEpC;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,+DAA+D;AAC/D,MAAM,WAAW,UAAU;IACzB,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;uCACmC;IACnC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;KAAE,EAAE,CAAC;IAC7E;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CAChC"}
|
package/dist/define-check.d.ts
CHANGED
|
@@ -11,14 +11,40 @@ import type { Severity } from "./severity.js";
|
|
|
11
11
|
export interface FileScope {
|
|
12
12
|
/** File extensions (without leading dot). Empty/omitted = any. */
|
|
13
13
|
readonly extensions?: readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* Optional layer allowlist. When set, the file's layer (resolved from
|
|
16
|
+
* `cofferdam.invariants.toml` / `cofferdam.toml` `[layers]`) must be in
|
|
17
|
+
* this set. Files outside any declared layer (`file.layer === null`)
|
|
18
|
+
* never match a non-empty `layers` filter — declare a layer for them
|
|
19
|
+
* if you need them in scope.
|
|
20
|
+
*
|
|
21
|
+
* Empty/omitted = no layer filter (any layer or no layer matches).
|
|
22
|
+
* Reuses the same `file.layer` field plugins can read imperatively.
|
|
23
|
+
*/
|
|
24
|
+
readonly layers?: readonly string[];
|
|
14
25
|
/**
|
|
15
26
|
* Optional include glob (gitignore syntax via globset). When set,
|
|
16
27
|
* the file path must match.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Prefer {@link FileScope.pathPatterns} (plural) for new
|
|
30
|
+
* code — it accepts an array, matching the shape of `excludePatterns`
|
|
31
|
+
* and avoiding brace expansion in a single string. `pathPattern`
|
|
32
|
+
* remains functional through the 0.2.x line and is scheduled for
|
|
33
|
+
* removal in 0.3.0. When both forms are present, a file matches the
|
|
34
|
+
* include set if it matches `pathPattern` OR any `pathPatterns`
|
|
35
|
+
* entry.
|
|
17
36
|
*/
|
|
18
37
|
readonly pathPattern?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Optional include globs (gitignore syntax via globset). When set,
|
|
40
|
+
* the file path must match at least one entry. Plural counterpart to
|
|
41
|
+
* the deprecated singular {@link FileScope.pathPattern}; when both are
|
|
42
|
+
* present, a file is in scope if it matches either form.
|
|
43
|
+
*/
|
|
44
|
+
readonly pathPatterns?: readonly string[];
|
|
19
45
|
/**
|
|
20
46
|
* Exclude globs. Paths matching any of these are skipped, even if
|
|
21
|
-
* `pathPattern` matched.
|
|
47
|
+
* `pathPattern` / `pathPatterns` matched.
|
|
22
48
|
*/
|
|
23
49
|
readonly excludePatterns?: readonly string[];
|
|
24
50
|
}
|
|
@@ -39,7 +65,18 @@ export interface Check<S extends OptionsSchema = OptionsSchema> {
|
|
|
39
65
|
readonly explanation: string;
|
|
40
66
|
/** Optional long-form catalog body used by `cofferdam explain --full`. */
|
|
41
67
|
readonly body: string | undefined;
|
|
42
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Whether the check needs full type-aware analysis (routes through ts-morph).
|
|
70
|
+
*
|
|
71
|
+
* **Status (0.2.x): not yet implemented.** Setting this to `true` is
|
|
72
|
+
* accepted by the type system and recorded on the `Check` object, but the
|
|
73
|
+
* engine does **not** route the check through ts-morph and no type
|
|
74
|
+
* information is made available inside `run()`. The field is reserved for
|
|
75
|
+
* future use; type-aware routing via ts-morph is on the roadmap (tracked
|
|
76
|
+
* as cd-l58 / gh #16). Until that work lands, treat `requiresTypes: true`
|
|
77
|
+
* as a declaration of intent only — the check will still run, but without
|
|
78
|
+
* type data.
|
|
79
|
+
*/
|
|
43
80
|
readonly requiresTypes: boolean;
|
|
44
81
|
/** Two-pass consistency mode. */
|
|
45
82
|
readonly consistency: boolean;
|
|
@@ -61,6 +98,19 @@ export interface DefineCheckInput<S extends OptionsSchema> {
|
|
|
61
98
|
readonly defaultSeverity?: Severity;
|
|
62
99
|
readonly explanation: string;
|
|
63
100
|
readonly body?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Whether the check needs full type-aware analysis (routes through ts-morph).
|
|
103
|
+
*
|
|
104
|
+
* **Status (0.2.x): not yet implemented.** Setting this to `true` is
|
|
105
|
+
* accepted by the type system and recorded on the `Check` object, but the
|
|
106
|
+
* engine does **not** route the check through ts-morph and no type
|
|
107
|
+
* information is made available inside `run()`. The field is reserved for
|
|
108
|
+
* future use; type-aware routing via ts-morph is on the roadmap (tracked
|
|
109
|
+
* as cd-l58 / gh #16). Until that work lands, treat `requiresTypes: true`
|
|
110
|
+
* as a declaration of intent only — the check will still run, but without
|
|
111
|
+
* type data. The plugin host will emit a one-time warning to stderr at
|
|
112
|
+
* load time when this is `true`.
|
|
113
|
+
*/
|
|
64
114
|
readonly requiresTypes?: boolean;
|
|
65
115
|
readonly consistency?: boolean;
|
|
66
116
|
/** Schema; defaults to `{}`. Inferred at the call site. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-check.d.ts","sourceRoot":"","sources":["../src/define-check.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO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AAY,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,aAAa,GAAG,EAAE,EAC5D,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACzB,KAAK,CAAC,CAAC,CAAC,CAcV"}
|
package/dist/define-check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-check.js","sourceRoot":"","sources":["../src/define-check.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,iEAAiE;AACjE,wBAAwB;;
|
|
1
|
+
{"version":3,"file":"define-check.js","sourceRoot":"","sources":["../src/define-check.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,iEAAiE;AACjE,wBAAwB;;AA+JxB,kCAgBC;AAhDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,SAAgB,WAAW,CACzB,KAA0B;IAE1B,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,eAAe,EAAE,KAAK,CAAC,eAAe,IAAI,QAAQ;QAClD,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,KAAK;QAC3C,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,KAAK;QACvC,OAAO,EAAE,KAAK,CAAC,OAAO,IAAK,EAAQ;QACnC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { Category } from "./category.js";
|
|
|
2
2
|
export { Severity } from "./severity.js";
|
|
3
3
|
export { Walk } from "./ast.js";
|
|
4
4
|
export { defineCheck } from "./define-check.js";
|
|
5
|
-
export { runPlugin, buildSourceFile } from "./plugin-host.js";
|
|
5
|
+
export { runPlugin, buildSourceFile, fileMatchesScope } from "./plugin-host.js";
|
|
6
6
|
export { loadPlugins, runPlugins } from "./loader.js";
|
|
7
7
|
export type { PluginReport, PluginRunInput, NativeLineView, } from "./plugin-host.js";
|
|
8
8
|
export type { LoadedPlugin, RunPluginsOptions } from "./loader.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,YAAY,EACV,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEnE,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5E,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACpF,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,YAAY,EACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,2BAA2B,EAC3B,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACR,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// stability contract; everything kept internal is not. New exports are
|
|
11
11
|
// additive — removing or renaming an export is a breaking change.
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.runPlugins = exports.loadPlugins = exports.buildSourceFile = exports.runPlugin = exports.defineCheck = exports.Walk = exports.Severity = exports.Category = void 0;
|
|
13
|
+
exports.runPlugins = exports.loadPlugins = exports.fileMatchesScope = exports.buildSourceFile = exports.runPlugin = exports.defineCheck = exports.Walk = exports.Severity = exports.Category = void 0;
|
|
14
14
|
var category_js_1 = require("./category.js");
|
|
15
15
|
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return category_js_1.Category; } });
|
|
16
16
|
var severity_js_1 = require("./severity.js");
|
|
@@ -24,6 +24,7 @@ Object.defineProperty(exports, "defineCheck", { enumerable: true, get: function
|
|
|
24
24
|
var plugin_host_js_1 = require("./plugin-host.js");
|
|
25
25
|
Object.defineProperty(exports, "runPlugin", { enumerable: true, get: function () { return plugin_host_js_1.runPlugin; } });
|
|
26
26
|
Object.defineProperty(exports, "buildSourceFile", { enumerable: true, get: function () { return plugin_host_js_1.buildSourceFile; } });
|
|
27
|
+
Object.defineProperty(exports, "fileMatchesScope", { enumerable: true, get: function () { return plugin_host_js_1.fileMatchesScope; } });
|
|
27
28
|
var loader_js_1 = require("./loader.js");
|
|
28
29
|
Object.defineProperty(exports, "loadPlugins", { enumerable: true, get: function () { return loader_js_1.loadPlugins; } });
|
|
29
30
|
Object.defineProperty(exports, "runPlugins", { enumerable: true, get: function () { return loader_js_1.runPlugins; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,wEAAwE;AACxE,yCAAyC;AACzC,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,kEAAkE;;;AAElE,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,mCAAgC;AAAvB,8FAAA,IAAI,OAAA;AACb,qDAAgD;AAAvC,8GAAA,WAAW,OAAA;AAEpB,qEAAqE;AACrE,8DAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,wEAAwE;AACxE,yCAAyC;AACzC,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,kEAAkE;;;AAElE,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,mCAAgC;AAAvB,8FAAA,IAAI,OAAA;AACb,qDAAgD;AAAvC,8GAAA,WAAW,OAAA;AAEpB,qEAAqE;AACrE,8DAA8D;AAC9D,mDAAgF;AAAvE,2GAAA,SAAS,OAAA;AAAE,iHAAA,eAAe,OAAA;AAAE,kHAAA,gBAAgB,OAAA;AACrD,yCAAsD;AAA7C,wGAAA,WAAW,OAAA;AAAE,uGAAA,UAAU,OAAA"}
|
package/dist/plugin-host.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Check } from "./define-check.js";
|
|
1
|
+
import type { Check, FileScope } from "./define-check.js";
|
|
2
2
|
import type { Fix } from "./check-context.js";
|
|
3
3
|
import type { LineView } from "./line-view.js";
|
|
4
4
|
import type { Span } from "./span.js";
|
|
@@ -38,6 +38,8 @@ export interface PluginRunInput {
|
|
|
38
38
|
readonly path: string;
|
|
39
39
|
readonly text: string;
|
|
40
40
|
readonly lineViews: readonly NativeLineView[];
|
|
41
|
+
/** Layer name from `cofferdam.invariants.toml` `[layers]`. `null` when not in any layer. */
|
|
42
|
+
readonly layer: string | null;
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* Build the `SourceFile` shape a plugin's `run()` callback expects.
|
|
@@ -48,9 +50,20 @@ export interface PluginRunInput {
|
|
|
48
50
|
export declare function buildSourceFile(input: PluginRunInput): {
|
|
49
51
|
path: string;
|
|
50
52
|
text: string;
|
|
53
|
+
layer: string | null;
|
|
51
54
|
lines(): IterableIterator<LineView>;
|
|
52
55
|
ast: null;
|
|
53
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Return true when `path` (normalised to forward slashes) is in scope
|
|
59
|
+
* for the given `FileScope` filter. Mirrors the `fileMatchesScope`
|
|
60
|
+
* logic in `plugin-host.mjs` — both must be kept in sync.
|
|
61
|
+
*
|
|
62
|
+
* `undefined` scope = every file is in scope. `layer` is the file's
|
|
63
|
+
* resolved layer (or `null` when the file is outside every declared
|
|
64
|
+
* layer); used to filter against `scope.layers` when present.
|
|
65
|
+
*/
|
|
66
|
+
export declare function fileMatchesScope(path: string, scope: FileScope | undefined, layer?: string | null): boolean;
|
|
54
67
|
/**
|
|
55
68
|
* Execute a single plugin against a single file. Collects `ctx.report`
|
|
56
69
|
* calls into a `PluginReport[]` the loader can hand to native
|
|
@@ -59,6 +72,10 @@ export declare function buildSourceFile(input: PluginRunInput): {
|
|
|
59
72
|
* This is the function a worker_thread invokes. The host process never
|
|
60
73
|
* touches plugin code directly — crash containment is the worker's
|
|
61
74
|
* boundary.
|
|
75
|
+
*
|
|
76
|
+
* FileScope filtering is applied here: if the check declares a `files`
|
|
77
|
+
* scope and the input path does not match, the function returns an empty
|
|
78
|
+
* array immediately without calling `run()`.
|
|
62
79
|
*/
|
|
63
80
|
export declare function runPlugin(check: Check, input: PluginRunInput): PluginReport[];
|
|
64
81
|
//# sourceMappingURL=plugin-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-host.d.ts","sourceRoot":"","sources":["../src/plugin-host.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-host.d.ts","sourceRoot":"","sources":["../src/plugin-host.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAgB,GAAG,EAAc,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAItC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAA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;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,GAAG,YAAY,EAAE,CA4C7E"}
|
package/dist/plugin-host.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// parsing).
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.buildSourceFile = buildSourceFile;
|
|
17
|
+
exports.fileMatchesScope = fileMatchesScope;
|
|
17
18
|
exports.runPlugin = runPlugin;
|
|
18
19
|
// ---- runtime construction --------------------------------------------
|
|
19
20
|
function buildLineView(native) {
|
|
@@ -46,6 +47,7 @@ function buildSourceFile(input) {
|
|
|
46
47
|
return {
|
|
47
48
|
path: input.path,
|
|
48
49
|
text: input.text,
|
|
50
|
+
layer: input.layer,
|
|
49
51
|
lines() {
|
|
50
52
|
let i = 0;
|
|
51
53
|
const it = {
|
|
@@ -69,6 +71,105 @@ function buildSourceFile(input) {
|
|
|
69
71
|
};
|
|
70
72
|
}
|
|
71
73
|
// ---- runPlugin -------------------------------------------------------
|
|
74
|
+
/**
|
|
75
|
+
* Return true when `path` (normalised to forward slashes) is in scope
|
|
76
|
+
* for the given `FileScope` filter. Mirrors the `fileMatchesScope`
|
|
77
|
+
* logic in `plugin-host.mjs` — both must be kept in sync.
|
|
78
|
+
*
|
|
79
|
+
* `undefined` scope = every file is in scope. `layer` is the file's
|
|
80
|
+
* resolved layer (or `null` when the file is outside every declared
|
|
81
|
+
* layer); used to filter against `scope.layers` when present.
|
|
82
|
+
*/
|
|
83
|
+
function fileMatchesScope(path, scope, layer = null) {
|
|
84
|
+
if (!scope)
|
|
85
|
+
return true;
|
|
86
|
+
const fwd = path.replace(/\\/g, "/");
|
|
87
|
+
const { extensions } = scope;
|
|
88
|
+
if (Array.isArray(extensions) && extensions.length > 0) {
|
|
89
|
+
const lower = fwd.toLowerCase();
|
|
90
|
+
if (!extensions.some((e) => lower.endsWith("." + String(e).toLowerCase()))) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const { layers } = scope;
|
|
95
|
+
if (Array.isArray(layers) && layers.length > 0) {
|
|
96
|
+
if (layer === null || !layers.includes(layer))
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
const includes = [];
|
|
100
|
+
if (typeof scope.pathPattern === "string" && scope.pathPattern) {
|
|
101
|
+
includes.push(scope.pathPattern);
|
|
102
|
+
}
|
|
103
|
+
if (Array.isArray(scope.pathPatterns)) {
|
|
104
|
+
for (const p of scope.pathPatterns) {
|
|
105
|
+
if (typeof p === "string" && p)
|
|
106
|
+
includes.push(p);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (includes.length > 0 && !includes.some((pat) => globMatch(pat, fwd)))
|
|
110
|
+
return false;
|
|
111
|
+
const { excludePatterns } = scope;
|
|
112
|
+
if (Array.isArray(excludePatterns) && excludePatterns.length > 0) {
|
|
113
|
+
if (excludePatterns.some((pat) => typeof pat === "string" && globMatch(pat, fwd))) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
function globMatch(pattern, path) {
|
|
120
|
+
const braceMatch = pattern.match(/^(.*?)\{([^{}]+)\}(.*)$/);
|
|
121
|
+
if (braceMatch) {
|
|
122
|
+
const [, pre, inner, post] = braceMatch;
|
|
123
|
+
return inner.split(",").some((alt) => globMatch(pre + alt + post, path));
|
|
124
|
+
}
|
|
125
|
+
// For relative patterns (no leading `/` or `**/`), also try `**/pattern`.
|
|
126
|
+
if (!pattern.startsWith("/") && !pattern.startsWith("**/")) {
|
|
127
|
+
if (globMatchSingle("**/" + pattern, path))
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
return globMatchSingle(pattern, path);
|
|
131
|
+
}
|
|
132
|
+
function globMatchSingle(pattern, path) {
|
|
133
|
+
let re = "^";
|
|
134
|
+
let i = 0;
|
|
135
|
+
while (i < pattern.length) {
|
|
136
|
+
const c = pattern[i];
|
|
137
|
+
if (c === "*") {
|
|
138
|
+
if (pattern[i + 1] === "*") {
|
|
139
|
+
i += 2;
|
|
140
|
+
if (pattern[i] === "/")
|
|
141
|
+
i++;
|
|
142
|
+
re += "(?:.+/)?";
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
re += "[^/]*";
|
|
146
|
+
}
|
|
147
|
+
else if (c === "?") {
|
|
148
|
+
re += "[^/]";
|
|
149
|
+
}
|
|
150
|
+
else if (c === "[") {
|
|
151
|
+
const end = pattern.indexOf("]", i + 1);
|
|
152
|
+
if (end === -1) {
|
|
153
|
+
re += "\\[";
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
re += pattern.slice(i, end + 1);
|
|
157
|
+
i = end;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
re += c.replace(/[.+^${}()|\\]/g, "\\$&");
|
|
162
|
+
}
|
|
163
|
+
i++;
|
|
164
|
+
}
|
|
165
|
+
re += "$";
|
|
166
|
+
try {
|
|
167
|
+
return new RegExp(re).test(path);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
72
173
|
/**
|
|
73
174
|
* Execute a single plugin against a single file. Collects `ctx.report`
|
|
74
175
|
* calls into a `PluginReport[]` the loader can hand to native
|
|
@@ -77,8 +178,14 @@ function buildSourceFile(input) {
|
|
|
77
178
|
* This is the function a worker_thread invokes. The host process never
|
|
78
179
|
* touches plugin code directly — crash containment is the worker's
|
|
79
180
|
* boundary.
|
|
181
|
+
*
|
|
182
|
+
* FileScope filtering is applied here: if the check declares a `files`
|
|
183
|
+
* scope and the input path does not match, the function returns an empty
|
|
184
|
+
* array immediately without calling `run()`.
|
|
80
185
|
*/
|
|
81
186
|
function runPlugin(check, input) {
|
|
187
|
+
if (!fileMatchesScope(input.path, check.files, input.layer))
|
|
188
|
+
return [];
|
|
82
189
|
const reports = [];
|
|
83
190
|
const ctx = {
|
|
84
191
|
report(args) {
|
package/dist/plugin-host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-host.js","sourceRoot":"","sources":["../src/plugin-host.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,EAAE;AACF,oEAAoE;AACpE,qEAAqE;AACrE,qEAAqE;AACrE,yDAAyD;AACzD,iCAAiC;AACjC,EAAE;AACF,uEAAuE;AACvE,iEAAiE;AACjE,yEAAyE;AACzE,uEAAuE;AACvE,YAAY;;
|
|
1
|
+
{"version":3,"file":"plugin-host.js","sourceRoot":"","sources":["../src/plugin-host.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,EAAE;AACF,oEAAoE;AACpE,qEAAqE;AACrE,qEAAqE;AACrE,yDAAyD;AACzD,iCAAiC;AACjC,EAAE;AACF,uEAAuE;AACvE,iEAAiE;AACjE,yEAAyE;AACzE,uEAAuE;AACvE,YAAY;;AA4EZ,0CA2BC;AAaD,4CA0CC;AAgED,8BA4CC;AA1ND,yEAAyE;AAEzE,SAAS,aAAa,CAAC,MAAsB;IAC3C,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,OAAO,CAAC,SAAiB,EAAE,OAAe;YACxC,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,MAAM;gBACnB,MAAM,EAAE,SAAS,GAAG,CAAC;gBACrB,UAAU,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;gBACxC,QAAQ,EAAE,MAAM,CAAC,SAAS,GAAG,OAAO;aACrC,CAAC;QACJ,CAAC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AuB;YAChC,OAAO,EAAE,WAAW,KAAK,CAAC,EAAE,YAAY,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC1F,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,eAAe,CACtB,MAAS;IAET,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAgB,EAAE,CAAC;QACrD,GAAG,CAAC,GAAa,CAAC,GAAG,MAAM,CAAC,GAAG,CAAE,CAAC,OAAO,CAAC;IAC5C,CAAC;IACD,OAAO,GAAmD,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cofferdam/check-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Author cofferdam plugin checks in TypeScript. defineCheck factory + types.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsc -p .",
|
|
35
35
|
"typecheck": "tsc -p . --noEmit",
|
|
36
|
-
"test:types": "tsc -p tests"
|
|
36
|
+
"test:types": "tsc -p tests",
|
|
37
|
+
"prepublishOnly": "tsc -p ."
|
|
37
38
|
},
|
|
38
39
|
"engines": {
|
|
39
40
|
"node": ">=16"
|