@goodbones/oxlint 0.1.0-beta.1 → 0.1.0-beta.2
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/build/dts/config-loader.d.ts +0 -1
- package/build/dts/config-loader.d.ts.map +1 -1
- package/build/esm/config-loader.js +10 -5
- package/build/esm/config-loader.js.map +1 -1
- package/build/esm/plugin.js +2 -2
- package/build/esm/plugin.js.map +1 -1
- package/package.json +3 -3
- package/src/config-loader.ts +11 -5
- package/src/plugin.ts +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type LoadedPolicy } from "@goodbones/core";
|
|
2
2
|
export type { LoadedPolicy } from "@goodbones/core";
|
|
3
|
-
export { DEFAULT_CONFIG_FILENAME } from "@goodbones/core";
|
|
4
3
|
export declare const loadPolicyFromFile: (repoRoot: string, configFilename?: string) => Promise<LoadedPolicy>;
|
|
5
4
|
//# sourceMappingURL=config-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/config-loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AAIzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/config-loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AAIzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAOpD,eAAO,MAAM,kBAAkB,aACnB,MAAM,mBACC,MAAM,KACtB,OAAO,CAAC,YAAY,CAkBtB,CAAC"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { findManifestFile, loadPolicy, makeFileSystemLive, readManifestFile, } from "@goodbones/core";
|
|
3
3
|
import { typescriptLanguage } from "@goodbones/typescript";
|
|
4
4
|
import * as Result from "effect/Result";
|
|
5
|
-
export { DEFAULT_CONFIG_FILENAME } from "@goodbones/core";
|
|
6
5
|
// The plugin's composition root: read the manifest file, construct the
|
|
7
6
|
// language packs and the live file system, and hand them to the loader. A load
|
|
8
7
|
// failure throws out of here and out of oxlint's import of the plugin — a
|
|
9
8
|
// plugin that came up with no policy would report nothing and be
|
|
10
9
|
// indistinguishable from a clean codebase.
|
|
11
|
-
export const loadPolicyFromFile = async (repoRoot, configFilename
|
|
12
|
-
|
|
10
|
+
export const loadPolicyFromFile = async (repoRoot, configFilename) => {
|
|
11
|
+
// Named, or discovered: architecture.yaml, .yml, .json, or .config.mjs,
|
|
12
|
+
// exactly one of which may be present.
|
|
13
|
+
const configPath = configFilename === undefined
|
|
14
|
+
? findManifestFile(repoRoot)
|
|
15
|
+
: path.resolve(repoRoot, configFilename);
|
|
16
|
+
const read = await readManifestFile(configPath);
|
|
13
17
|
const loaded = loadPolicy({
|
|
14
18
|
repoRoot,
|
|
15
19
|
configPath,
|
|
16
|
-
manifest:
|
|
20
|
+
manifest: read.manifest,
|
|
21
|
+
locate: read.locate,
|
|
17
22
|
languages: [typescriptLanguage()],
|
|
18
23
|
fileSystem: makeFileSystemLive(repoRoot),
|
|
19
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,gBAAgB,EAEhB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,uEAAuE;AACvE,+EAA+E;AAC/E,0EAA0E;AAC1E,iEAAiE;AACjE,2CAA2C;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,QAAgB,EAChB,cAAuB,EACA,EAAE;IACzB,wEAAwE;IACxE,uCAAuC;IACvC,MAAM,UAAU,GACd,cAAc,KAAK,SAAS;QAC1B,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,UAAU,CAAC;QACxB,QAAQ;QACR,UAAU;QACV,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;QACjC,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC;KACzC,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;QAAE,MAAM,MAAM,CAAC,OAAO,CAAC;IACnD,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC,CAAC"}
|
package/build/esm/plugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadPolicyFromFile } from "./config-loader.js";
|
|
2
2
|
import { makeExportsRule } from "./exports-rule.js";
|
|
3
3
|
import { makeImportsRule } from "./imports-rule.js";
|
|
4
4
|
import { makeMembersRule } from "./members-rule.js";
|
|
@@ -9,7 +9,7 @@ import { makeSurfaceRule } from "./surface-rule.js";
|
|
|
9
9
|
// out of the import and fails the run — which is the point: a plugin that came
|
|
10
10
|
// up with no policy would report nothing and be indistinguishable from a clean
|
|
11
11
|
// codebase.
|
|
12
|
-
const policy = await loadPolicyFromFile(process.env.ARCHITECTURE_ROOT ?? process.cwd(), process.env.ARCHITECTURE_CONFIG
|
|
12
|
+
const policy = await loadPolicyFromFile(process.env.ARCHITECTURE_ROOT ?? process.cwd(), process.env.ARCHITECTURE_CONFIG);
|
|
13
13
|
// A manifest written in a shape on its way out still loads; it says so once,
|
|
14
14
|
// here, rather than on every file.
|
|
15
15
|
for (const notice of policy.notices) {
|
package/build/esm/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,+EAA+E;AAC/E,YAAY;AACZ,MAAM,MAAM,GAAG,MAAM,kBAAkB,CACrC,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,EAAE,EAC9C,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAChC,CAAC;AAEF,6EAA6E;AAC7E,mCAAmC;AACnC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;IACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,MAAM,IAAI,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAMd;IACF,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC;IAChC,SAAS,EAAE,iBAAiB,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,GAA+E;IACzF,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;IAC9B,KAAK;CACN,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodbones/oxlint",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The oxlint plugin for @goodbones/core: the imports, exports, members, structure and surface families as five oxlint rules, evaluated in the editor and in CI from the same manifest the CLI reads.",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"effect": "4.0.0-beta.94",
|
|
47
|
-
"@goodbones/
|
|
48
|
-
"@goodbones/
|
|
47
|
+
"@goodbones/typescript": "0.1.0-beta.2",
|
|
48
|
+
"@goodbones/core": "0.1.0-beta.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"oxlint": ">=1.77.0"
|
package/src/config-loader.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
findManifestFile,
|
|
5
5
|
type LoadedPolicy,
|
|
6
6
|
loadPolicy,
|
|
7
7
|
makeFileSystemLive,
|
|
@@ -11,7 +11,6 @@ import { typescriptLanguage } from "@goodbones/typescript";
|
|
|
11
11
|
import * as Result from "effect/Result";
|
|
12
12
|
|
|
13
13
|
export type { LoadedPolicy } from "@goodbones/core";
|
|
14
|
-
export { DEFAULT_CONFIG_FILENAME } from "@goodbones/core";
|
|
15
14
|
|
|
16
15
|
// The plugin's composition root: read the manifest file, construct the
|
|
17
16
|
// language packs and the live file system, and hand them to the loader. A load
|
|
@@ -20,13 +19,20 @@ export { DEFAULT_CONFIG_FILENAME } from "@goodbones/core";
|
|
|
20
19
|
// indistinguishable from a clean codebase.
|
|
21
20
|
export const loadPolicyFromFile = async (
|
|
22
21
|
repoRoot: string,
|
|
23
|
-
configFilename
|
|
22
|
+
configFilename?: string,
|
|
24
23
|
): Promise<LoadedPolicy> => {
|
|
25
|
-
|
|
24
|
+
// Named, or discovered: architecture.yaml, .yml, .json, or .config.mjs,
|
|
25
|
+
// exactly one of which may be present.
|
|
26
|
+
const configPath =
|
|
27
|
+
configFilename === undefined
|
|
28
|
+
? findManifestFile(repoRoot)
|
|
29
|
+
: path.resolve(repoRoot, configFilename);
|
|
30
|
+
const read = await readManifestFile(configPath);
|
|
26
31
|
const loaded = loadPolicy({
|
|
27
32
|
repoRoot,
|
|
28
33
|
configPath,
|
|
29
|
-
manifest:
|
|
34
|
+
manifest: read.manifest,
|
|
35
|
+
locate: read.locate,
|
|
30
36
|
languages: [typescriptLanguage()],
|
|
31
37
|
fileSystem: makeFileSystemLive(repoRoot),
|
|
32
38
|
});
|
package/src/plugin.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadPolicyFromFile } from "./config-loader.js";
|
|
2
2
|
import { makeExportsRule } from "./exports-rule.js";
|
|
3
3
|
import { makeImportsRule } from "./imports-rule.js";
|
|
4
4
|
import { makeMembersRule } from "./members-rule.js";
|
|
@@ -13,7 +13,7 @@ import { makeSurfaceRule } from "./surface-rule.js";
|
|
|
13
13
|
// codebase.
|
|
14
14
|
const policy = await loadPolicyFromFile(
|
|
15
15
|
process.env.ARCHITECTURE_ROOT ?? process.cwd(),
|
|
16
|
-
process.env.ARCHITECTURE_CONFIG
|
|
16
|
+
process.env.ARCHITECTURE_CONFIG,
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
// A manifest written in a shape on its way out still loads; it says so once,
|