@stillwind/analysis 0.6.0 → 0.8.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/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/reports-BmpsYdDN.d.ts +24 -0
- package/dist/reports-DN38lybK.js +38 -0
- package/dist/reports-DN38lybK.js.map +1 -0
- package/package.json +5 -4
- package/dist/reports-BI3wqUUD.d.ts +0 -12
- package/dist/reports-nlgN4YL4.js +0 -21
- package/dist/reports-nlgN4YL4.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as DiscoverWorkspace, c as WorkspaceEditorResult, i as AnalysisWorkspaceService, l as WorkspaceResult, n as AnalysisResult, o as OpenAnalysisWorkspaces, r as AnalysisWorkspaceContext, s as OpenWorkspaces, t as AnalysisDependency } from "./workspace-DIADkpZF.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as documentationUrl, r as lintReports, t as documentationSection } from "./reports-BmpsYdDN.js";
|
|
3
3
|
import { DesignCandidate, DesignSystemRequest, DesignToken, DesignTokenSource, EditorRequest, EditorResult } from "@stillwind/host";
|
|
4
|
-
export { type AnalysisDependency, type AnalysisResult, type AnalysisWorkspaceContext, type AnalysisWorkspaceService, type DesignCandidate, type DesignSystemRequest, type DesignToken, type DesignTokenSource, type DiscoverWorkspace, type EditorRequest, type EditorResult, type OpenAnalysisWorkspaces, type OpenWorkspaces, type WorkspaceEditorResult, type WorkspaceResult, lintReports };
|
|
4
|
+
export { type AnalysisDependency, type AnalysisResult, type AnalysisWorkspaceContext, type AnalysisWorkspaceService, type DesignCandidate, type DesignSystemRequest, type DesignToken, type DesignTokenSource, type DiscoverWorkspace, type EditorRequest, type EditorResult, type OpenAnalysisWorkspaces, type OpenWorkspaces, type WorkspaceEditorResult, type WorkspaceResult, documentationSection, documentationUrl, lintReports };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as lintReports } from "./reports-
|
|
1
|
+
export { t as documentationSection, n as documentationUrl, r as lintReports } from "./reports-DN38lybK.js";
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as OpenAnalysisWorkspaces, r as AnalysisWorkspaceContext } from "./workspace-DIADkpZF.js";
|
|
2
|
-
import {
|
|
2
|
+
import { r as lintReports } from "./reports-BmpsYdDN.js";
|
|
3
3
|
import { AnalysisWorkspace, DesignCandidate, DesignSystemRequest, DesignToken, EditorEdit, WorkspaceResult } from "@stillwind/host";
|
|
4
4
|
/** Original buffer and ranges excluded by a formatter adapter. Paths are absolute. */
|
|
5
5
|
interface RewriteInput {
|
package/dist/node.js
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { l as WorkspaceResult } from "./workspace-DIADkpZF.js";
|
|
2
|
+
/**
|
|
3
|
+
* Collects distinct reports per project while preserving their analysis order.
|
|
4
|
+
* @param results - Analysis results with their project membership.
|
|
5
|
+
* @returns Reports in first-occurrence order. Equal reports from different projects remain separate.
|
|
6
|
+
*/
|
|
7
|
+
declare function lintReports(results: readonly WorkspaceResult[]): {
|
|
8
|
+
project: number;
|
|
9
|
+
report: import("@stillwind/native").BindingReport;
|
|
10
|
+
}[];
|
|
11
|
+
/**
|
|
12
|
+
* Returns the website page that explains a report code.
|
|
13
|
+
* @param code - Compiler code, such as `SW01001`, or lint rule name, such as `unknown-utility`.
|
|
14
|
+
* @returns The page URL, or undefined for codes without a page, such as `SW_UNVERIFIED`.
|
|
15
|
+
*/
|
|
16
|
+
declare function documentationUrl(code: string): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the documentation section of a report code.
|
|
19
|
+
* @param code - Report code of a diagnostic.
|
|
20
|
+
* @returns `errors` for compiler codes, `lints` for lint rule names, and otherwise undefined.
|
|
21
|
+
*/
|
|
22
|
+
declare function documentationSection(code: string): "errors" | "lints" | undefined;
|
|
23
|
+
export { documentationUrl as n, lintReports as r, documentationSection as t };
|
|
24
|
+
//# sourceMappingURL=reports-BmpsYdDN.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// src/reports.ts
|
|
2
|
+
/**
|
|
3
|
+
* Collects distinct reports per project while preserving their analysis order.
|
|
4
|
+
* @param results - Analysis results with their project membership.
|
|
5
|
+
* @returns Reports in first-occurrence order. Equal reports from different projects remain separate.
|
|
6
|
+
*/
|
|
7
|
+
function lintReports(results) {
|
|
8
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9
|
+
return results.flatMap((entry) => entry.result.reports.flatMap((report) => {
|
|
10
|
+
const key = JSON.stringify([entry.project, report]);
|
|
11
|
+
if (seen.has(key)) return [];
|
|
12
|
+
seen.add(key);
|
|
13
|
+
return [{
|
|
14
|
+
project: entry.project,
|
|
15
|
+
report
|
|
16
|
+
}];
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the website page that explains a report code.
|
|
21
|
+
* @param code - Compiler code, such as `SW01001`, or lint rule name, such as `unknown-utility`.
|
|
22
|
+
* @returns The page URL, or undefined for codes without a page, such as `SW_UNVERIFIED`.
|
|
23
|
+
*/
|
|
24
|
+
function documentationUrl(code) {
|
|
25
|
+
const section = documentationSection(code);
|
|
26
|
+
return section && `https://stillwind.dev/docs/${section}/${code}`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the documentation section of a report code.
|
|
30
|
+
* @param code - Report code of a diagnostic.
|
|
31
|
+
* @returns `errors` for compiler codes, `lints` for lint rule names, and otherwise undefined.
|
|
32
|
+
*/
|
|
33
|
+
function documentationSection(code) {
|
|
34
|
+
return /^SW\d+$/.test(code) ? "errors" : /^[a-z][a-z-]*$/.test(code) ? "lints" : void 0;
|
|
35
|
+
}
|
|
36
|
+
export { documentationUrl as n, lintReports as r, documentationSection as t };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=reports-DN38lybK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports-DN38lybK.js","names":[],"sources":["../src/reports.ts"],"sourcesContent":["import type { WorkspaceResult } from \"./workspace.ts\";\n\n/**\n * Collects distinct reports per project while preserving their analysis order.\n * @param results - Analysis results with their project membership.\n * @returns Reports in first-occurrence order. Equal reports from different projects remain separate.\n */\nexport function lintReports(results: readonly WorkspaceResult[]) {\n const seen = new Set<string>();\n return results.flatMap((entry) =>\n entry.result.reports.flatMap((report) => {\n const key = JSON.stringify([entry.project, report]);\n if (seen.has(key)) {\n return [];\n }\n seen.add(key);\n return [\n {\n project: entry.project,\n report,\n },\n ];\n }),\n );\n}\n\n/**\n * Returns the website page that explains a report code.\n * @param code - Compiler code, such as `SW01001`, or lint rule name, such as `unknown-utility`.\n * @returns The page URL, or undefined for codes without a page, such as `SW_UNVERIFIED`.\n */\nexport function documentationUrl(code: string): string | undefined {\n const section = documentationSection(code);\n return section && `https://stillwind.dev/docs/${section}/${code}`;\n}\n\n/**\n * Returns the documentation section of a report code.\n * @param code - Report code of a diagnostic.\n * @returns `errors` for compiler codes, `lints` for lint rule names, and otherwise undefined.\n */\nexport function documentationSection(code: string): \"errors\" | \"lints\" | undefined {\n return /^SW\\d+$/.test(code) ? \"errors\" : /^[a-z][a-z-]*$/.test(code) ? \"lints\" : undefined;\n}\n"],"mappings":";;;;;;AAOA,SAAgB,YAAY,SAAqC;CAC/D,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,QAAQ,SAAS,UACtB,MAAM,OAAO,QAAQ,SAAS,WAAW;EACvC,MAAM,MAAM,KAAK,UAAU,CAAC,MAAM,SAAS,MAAM,CAAC;EAClD,IAAI,KAAK,IAAI,GAAG,GACd,OAAO,CAAC;EAEV,KAAK,IAAI,GAAG;EACZ,OAAO,CACL;GACE,SAAS,MAAM;GACf;EACF,CACF;CACF,CAAC,CACH;AACF;;;;;;AAOA,SAAgB,iBAAiB,MAAkC;CACjE,MAAM,UAAU,qBAAqB,IAAI;CACzC,OAAO,WAAW,8BAA8B,QAAQ,GAAG;AAC7D;;;;;;AAOA,SAAgB,qBAAqB,MAA8C;CACjF,OAAO,UAAU,KAAK,IAAI,IAAI,WAAW,iBAAiB,KAAK,IAAI,IAAI,UAAU,KAAA;AACnF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stillwind/analysis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Analysis services for the Stillwind CLI, language server, and editors",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stillwind"
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
25
|
"types": "./dist/index.d.ts",
|
|
@@ -42,9 +43,9 @@
|
|
|
42
43
|
"access": "public"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"@stillwind/config": "0.
|
|
46
|
-
"@stillwind/host": "0.
|
|
47
|
-
"@stillwind/native": "0.
|
|
46
|
+
"@stillwind/config": "0.8.0",
|
|
47
|
+
"@stillwind/host": "0.8.0",
|
|
48
|
+
"@stillwind/native": "0.8.0",
|
|
48
49
|
"minimatch": "^11.0.3",
|
|
49
50
|
"pathe": "^2.0.3"
|
|
50
51
|
},
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { l as WorkspaceResult } from "./workspace-DIADkpZF.js";
|
|
2
|
-
/**
|
|
3
|
-
* Collects distinct reports per project while preserving their analysis order.
|
|
4
|
-
* @param results - Analysis results with their project membership.
|
|
5
|
-
* @returns Reports in first-occurrence order. Equal reports from different projects remain separate.
|
|
6
|
-
*/
|
|
7
|
-
declare function lintReports(results: readonly WorkspaceResult[]): {
|
|
8
|
-
project: number;
|
|
9
|
-
report: import("@stillwind/native").BindingReport;
|
|
10
|
-
}[];
|
|
11
|
-
export { lintReports as t };
|
|
12
|
-
//# sourceMappingURL=reports-BI3wqUUD.d.ts.map
|
package/dist/reports-nlgN4YL4.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/reports.ts
|
|
2
|
-
/**
|
|
3
|
-
* Collects distinct reports per project while preserving their analysis order.
|
|
4
|
-
* @param results - Analysis results with their project membership.
|
|
5
|
-
* @returns Reports in first-occurrence order. Equal reports from different projects remain separate.
|
|
6
|
-
*/
|
|
7
|
-
function lintReports(results) {
|
|
8
|
-
const seen = /* @__PURE__ */ new Set();
|
|
9
|
-
return results.flatMap((entry) => entry.result.reports.flatMap((report) => {
|
|
10
|
-
const key = JSON.stringify([entry.project, report]);
|
|
11
|
-
if (seen.has(key)) return [];
|
|
12
|
-
seen.add(key);
|
|
13
|
-
return [{
|
|
14
|
-
project: entry.project,
|
|
15
|
-
report
|
|
16
|
-
}];
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
export { lintReports as t };
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=reports-nlgN4YL4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reports-nlgN4YL4.js","names":[],"sources":["../src/reports.ts"],"sourcesContent":["import type { WorkspaceResult } from \"./workspace.ts\";\n\n/**\n * Collects distinct reports per project while preserving their analysis order.\n * @param results - Analysis results with their project membership.\n * @returns Reports in first-occurrence order. Equal reports from different projects remain separate.\n */\nexport function lintReports(results: readonly WorkspaceResult[]) {\n const seen = new Set<string>();\n return results.flatMap((entry) =>\n entry.result.reports.flatMap((report) => {\n const key = JSON.stringify([entry.project, report]);\n if (seen.has(key)) {\n return [];\n }\n seen.add(key);\n return [\n {\n project: entry.project,\n report,\n },\n ];\n }),\n );\n}\n"],"mappings":";;;;;;AAOA,SAAgB,YAAY,SAAqC;CAC/D,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,QAAQ,SAAS,UACtB,MAAM,OAAO,QAAQ,SAAS,WAAW;EACvC,MAAM,MAAM,KAAK,UAAU,CAAC,MAAM,SAAS,MAAM,CAAC;EAClD,IAAI,KAAK,IAAI,GAAG,GACd,OAAO,CAAC;EAEV,KAAK,IAAI,GAAG;EACZ,OAAO,CACL;GACE,SAAS,MAAM;GACf;EACF,CACF;CACF,CAAC,CACH;AACF"}
|