@master/css-mcp 2.0.0-rc.87 → 2.0.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 +47 -22
- package/dist/bin/index.js +4 -5
- package/dist/classes.js +153 -168
- package/dist/compare.js +99 -83
- package/dist/context.d.ts +5 -10
- package/dist/context.js +28 -10
- package/dist/design-system-schema.js +97 -0
- package/dist/directives.js +59 -109
- package/dist/document.js +2 -10
- package/dist/format.js +67 -56
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -3
- package/dist/internal/src/workspace.js +70 -0
- package/dist/language.js +27 -23
- package/dist/lint.js +86 -96
- package/dist/manifest-query.js +40 -100
- package/dist/manifest-summary.js +15 -35
- package/dist/output-schema.js +207 -0
- package/dist/preview-write-lock.js +90 -0
- package/dist/project-comparison-schema.js +59 -0
- package/dist/project.js +77 -18
- package/dist/result.js +67 -8
- package/dist/scan.js +93 -73
- package/dist/semantic-schema.js +286 -0
- package/dist/server.d.ts +10 -9
- package/dist/server.js +123 -111
- package/dist/setup.js +28 -29
- package/dist/source-schema.js +141 -0
- package/dist/suggest.js +22 -0
- package/dist/tooling-session.js +27 -0
- package/package.json +63 -73
- package/LICENSE +0 -21
- package/dist/classes.d.ts +0 -236
- package/dist/compare.d.ts +0 -70
- package/dist/contributor.d.ts +0 -149
- package/dist/contributor.js +0 -499
- package/dist/directives.d.ts +0 -132
- package/dist/document.d.ts +0 -24
- package/dist/format.d.ts +0 -56
- package/dist/language.d.ts +0 -24
- package/dist/lint.d.ts +0 -55
- package/dist/manifest-query.d.ts +0 -148
- package/dist/manifest-summary.d.ts +0 -47
- package/dist/project.d.ts +0 -31
- package/dist/result.d.ts +0 -8
- package/dist/scan.d.ts +0 -156
- package/dist/setup.d.ts +0 -67
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { browserSupport, cssStatus, diagnostic, inspection, matchStatus, range, strings } from "./semantic-schema.js";
|
|
2
|
+
import * as z from "zod/v4";
|
|
3
|
+
// src/source-schema.ts
|
|
4
|
+
const count = z.number().int().nonnegative();
|
|
5
|
+
const counts = (...names) => z.object(Object.fromEntries(names.map((name) => [name, count])));
|
|
6
|
+
const position = z.object({
|
|
7
|
+
line: count,
|
|
8
|
+
character: count
|
|
9
|
+
});
|
|
10
|
+
const location = z.object({
|
|
11
|
+
start: position,
|
|
12
|
+
end: position
|
|
13
|
+
});
|
|
14
|
+
const occurrence = z.object({
|
|
15
|
+
candidate: z.string(),
|
|
16
|
+
source: z.string(),
|
|
17
|
+
range,
|
|
18
|
+
contextRange: range,
|
|
19
|
+
rangeKind: z.enum(["token", "expression"]),
|
|
20
|
+
extractor: z.string(),
|
|
21
|
+
contentKind: z.string(),
|
|
22
|
+
owner: z.string(),
|
|
23
|
+
included: z.boolean(),
|
|
24
|
+
reason: z.string()
|
|
25
|
+
});
|
|
26
|
+
const extractedFile = z.object({
|
|
27
|
+
filePath: z.string(),
|
|
28
|
+
languageId: z.string(),
|
|
29
|
+
occurrences: z.array(occurrence),
|
|
30
|
+
classes: z.array(z.object({
|
|
31
|
+
raw: z.string(),
|
|
32
|
+
token: z.string(),
|
|
33
|
+
range,
|
|
34
|
+
loc: location,
|
|
35
|
+
contextRange: range,
|
|
36
|
+
sourceKind: z.string(),
|
|
37
|
+
provenance: occurrence,
|
|
38
|
+
status: z.string(),
|
|
39
|
+
matchStatus,
|
|
40
|
+
cssSyntaxStatus: cssStatus,
|
|
41
|
+
cssValueStatus: cssStatus,
|
|
42
|
+
browserSupport,
|
|
43
|
+
inspection
|
|
44
|
+
}))
|
|
45
|
+
});
|
|
46
|
+
const sourceFix = z.object({
|
|
47
|
+
kind: z.literal("class-list"),
|
|
48
|
+
safety: z.literal("safe"),
|
|
49
|
+
range,
|
|
50
|
+
text: z.string(),
|
|
51
|
+
description: z.string(),
|
|
52
|
+
requiresFormatting: z.boolean()
|
|
53
|
+
});
|
|
54
|
+
const lintFile = z.object({
|
|
55
|
+
filePath: z.string(),
|
|
56
|
+
languageId: z.string(),
|
|
57
|
+
sourceKind: z.enum([
|
|
58
|
+
"source",
|
|
59
|
+
"stylesheet",
|
|
60
|
+
"manifest"
|
|
61
|
+
]),
|
|
62
|
+
diagnostics: z.array(diagnostic.extend({
|
|
63
|
+
code: z.string(),
|
|
64
|
+
severity: z.enum(["error", "warning"]),
|
|
65
|
+
range,
|
|
66
|
+
loc: z.object({
|
|
67
|
+
start: z.object({
|
|
68
|
+
line: count,
|
|
69
|
+
column: count
|
|
70
|
+
}),
|
|
71
|
+
end: z.object({
|
|
72
|
+
line: count,
|
|
73
|
+
column: count
|
|
74
|
+
})
|
|
75
|
+
}),
|
|
76
|
+
source: z.literal("Master CSS"),
|
|
77
|
+
sourceKind: z.string(),
|
|
78
|
+
fixes: z.array(sourceFix).optional()
|
|
79
|
+
}))
|
|
80
|
+
});
|
|
81
|
+
const lintCoverage = z.object({
|
|
82
|
+
status: z.enum(["complete", "no-inputs"]),
|
|
83
|
+
checkedFiles: strings,
|
|
84
|
+
description: z.string()
|
|
85
|
+
});
|
|
86
|
+
const lintSummary = counts("checkedFiles", "filesWithDiagnostics", "diagnostics", "errors", "warnings", "fixable", "safeFixes");
|
|
87
|
+
const formatFile = z.object({
|
|
88
|
+
filePath: z.string(),
|
|
89
|
+
languageId: z.string(),
|
|
90
|
+
edits: z.array(z.object({
|
|
91
|
+
range: location,
|
|
92
|
+
newText: z.string()
|
|
93
|
+
})),
|
|
94
|
+
changed: z.boolean(),
|
|
95
|
+
beforeBytes: count,
|
|
96
|
+
afterBytes: count
|
|
97
|
+
});
|
|
98
|
+
const discovered = z.object({
|
|
99
|
+
latent: strings,
|
|
100
|
+
valid: strings,
|
|
101
|
+
invalid: strings,
|
|
102
|
+
usedNative: strings
|
|
103
|
+
});
|
|
104
|
+
const scannedFile = z.object({
|
|
105
|
+
filePath: z.string(),
|
|
106
|
+
source: z.string(),
|
|
107
|
+
scanned: z.boolean(),
|
|
108
|
+
changed: z.boolean(),
|
|
109
|
+
discovered
|
|
110
|
+
});
|
|
111
|
+
const scanner = z.object({
|
|
112
|
+
counts: counts("latent", "valid", "invalid", "native", "usedNative", "safelist", "blocklist"),
|
|
113
|
+
classes: discovered.extend({
|
|
114
|
+
native: strings,
|
|
115
|
+
safelist: strings,
|
|
116
|
+
blocklist: strings
|
|
117
|
+
}),
|
|
118
|
+
resetDependencies: strings
|
|
119
|
+
});
|
|
120
|
+
const stylesheets = z.object({
|
|
121
|
+
entries: z.array(z.object({
|
|
122
|
+
filePath: z.string(),
|
|
123
|
+
masterCSS: z.boolean(),
|
|
124
|
+
pruneNativeCSS: z.boolean(),
|
|
125
|
+
dependencies: strings,
|
|
126
|
+
sourceDependencies: strings,
|
|
127
|
+
warnings: strings,
|
|
128
|
+
errors: strings
|
|
129
|
+
})),
|
|
130
|
+
dependencies: strings,
|
|
131
|
+
warnings: strings,
|
|
132
|
+
errors: z.array(z.object({
|
|
133
|
+
filePath: z.string(),
|
|
134
|
+
message: z.string()
|
|
135
|
+
}))
|
|
136
|
+
});
|
|
137
|
+
const scanSummary = counts("files", "stylesheets", "diagnostics", "errors", "warnings", "missingCSS", "invalidClasses");
|
|
138
|
+
const previewSummary = counts("files", "bytesBefore", "bytesAfter");
|
|
139
|
+
const formatSummary = counts("files", "changed", "edits");
|
|
140
|
+
const extractSummary = counts("files", "classes", "matched", "unmatched").extend({ diagnostics: count.optional() });
|
|
141
|
+
export { extractSummary, extractedFile, formatFile, formatSummary, lintCoverage, lintFile, lintSummary, occurrence, previewSummary, scanSummary, scannedFile, scanner, stylesheets };
|
package/dist/suggest.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { loadWorkspaceManifest, manifestMetadata, requireWorkspaceManifest } from "./project.js";
|
|
2
|
+
import { createMCPToolingSession } from "./tooling-session.js";
|
|
3
|
+
// src/suggest.ts
|
|
4
|
+
async function suggestClasses(context, options) {
|
|
5
|
+
const manifest = await loadWorkspaceManifest(context, options.context);
|
|
6
|
+
using session = createMCPToolingSession(requireWorkspaceManifest(manifest));
|
|
7
|
+
const report = session.suggestClasses(options.declarations);
|
|
8
|
+
const inspections = report.classes.map((className) => session.inspectClassName(className));
|
|
9
|
+
return {
|
|
10
|
+
...report,
|
|
11
|
+
manifest: manifestMetadata(manifest),
|
|
12
|
+
diagnostics: inspections.flatMap((inspection) => inspection.diagnostics ?? []),
|
|
13
|
+
validation: inspections.map(({ className, matchStatus, cssSyntaxStatus, cssValueStatus, browserSupport }) => ({
|
|
14
|
+
className,
|
|
15
|
+
matchStatus,
|
|
16
|
+
cssSyntaxStatus,
|
|
17
|
+
cssValueStatus,
|
|
18
|
+
browserSupport
|
|
19
|
+
}))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export { suggestClasses };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createToolingSessionSync } from "@master/css-tooling/node";
|
|
2
|
+
// src/tooling-session.ts
|
|
3
|
+
function createMCPToolingSession(manifest, nativeClassNames = []) {
|
|
4
|
+
return createToolingSessionSync({
|
|
5
|
+
manifest,
|
|
6
|
+
nativeClassNames
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function compactClassInspection(session, className, includeRules = false, resolvedInspection) {
|
|
10
|
+
const inspection = resolvedInspection ?? session.inspectClassName(className);
|
|
11
|
+
return {
|
|
12
|
+
...inspection,
|
|
13
|
+
variables: inspection.variables.map(({ key, variable }) => ({
|
|
14
|
+
key,
|
|
15
|
+
variable: {
|
|
16
|
+
...variable,
|
|
17
|
+
dependencies: [...variable.dependencies ?? []]
|
|
18
|
+
}
|
|
19
|
+
})),
|
|
20
|
+
rules: inspection.rules.map((rule) => {
|
|
21
|
+
if (includeRules) return rule;
|
|
22
|
+
const { text: _text, ...metadata } = rule;
|
|
23
|
+
return metadata;
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export { compactClassInspection, createMCPToolingSession };
|
package/package.json
CHANGED
|
@@ -1,75 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"author": "Aoyue Design LLC.",
|
|
7
|
-
"funding": "https://rc.css.master.co/sponsor",
|
|
8
|
-
"homepage": "https://css.master.co",
|
|
9
|
-
"bugs": {
|
|
10
|
-
"url": "https://github.com/master-co/css/issues"
|
|
11
|
-
},
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/master-co/css.git",
|
|
15
|
-
"directory": "packages/mcp"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"mcp",
|
|
19
|
-
"ai",
|
|
20
|
-
"css",
|
|
21
|
-
"mastercss"
|
|
22
|
-
],
|
|
23
|
-
"sideEffects": false,
|
|
24
|
-
"bin": {
|
|
25
|
-
"master-css-mcp": "./dist/bin/index.js"
|
|
26
|
-
},
|
|
27
|
-
"main": "./dist/index.js",
|
|
28
|
-
"module": "./dist/index.js",
|
|
29
|
-
"jsnext:main": "./dist/index.js",
|
|
30
|
-
"esnext": "./dist/index.js",
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
32
|
-
"exports": {
|
|
33
|
-
".": {
|
|
34
|
-
"types": "./dist/index.d.ts",
|
|
35
|
-
"import": "./dist/index.js",
|
|
36
|
-
"default": "./dist/index.js"
|
|
2
|
+
"name": "@master/css-mcp",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": "^24"
|
|
37
6
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "bun --bun tsdown --config ../../shared/tsdown-package.config.ts",
|
|
9
|
+
"dev": "bun --bun tsdown --config ../../shared/tsdown-package.config.ts --watch",
|
|
10
|
+
"lint": "bun --bun eslint",
|
|
11
|
+
"type-check": "bun --bun tsc -b tsconfig.typecheck.json",
|
|
12
|
+
"test": "bun --bun vitest run"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"description": "Model Context Protocol server for Master CSS tooling.",
|
|
16
|
+
"author": "Aoyue Design LLC.",
|
|
17
|
+
"homepage": "https://css.master.co",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/master-co/css/issues"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/master-co/css.git",
|
|
24
|
+
"directory": "packages/mcp"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"mcp",
|
|
28
|
+
"ai",
|
|
29
|
+
"css",
|
|
30
|
+
"mastercss"
|
|
31
|
+
],
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"bin": {
|
|
34
|
+
"master-css-mcp": "./dist/bin/index.js"
|
|
35
|
+
},
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/index.js",
|
|
41
|
+
"default": "./dist/index.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"provenance": true
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@master/css": "2.0.0",
|
|
53
|
+
"@master/css-compiler": "2.0.0",
|
|
54
|
+
"@master/css-language-service": "2.0.0",
|
|
55
|
+
"@master/css-tooling": "2.0.0",
|
|
56
|
+
"@master/css-preset": "2.0.0",
|
|
57
|
+
"@master/css-schema": "2.0.0",
|
|
58
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
59
|
+
"fast-glob": "^3.3.3",
|
|
60
|
+
"vscode-languageserver-textdocument": "^1.0.16",
|
|
61
|
+
"zod": "^4.6.7"
|
|
62
|
+
},
|
|
63
|
+
"version": "2.0.0",
|
|
64
|
+
"gitHead": "6bf9adc4432b67e62613caea59d3b554711b4d54"
|
|
65
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Aoyue Design LLC.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
package/dist/classes.d.ts
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import MasterCSSMCPContext from "./context.js";
|
|
2
|
-
//#region src/classes.d.ts
|
|
3
|
-
interface ExtractClassesOptions {
|
|
4
|
-
content?: string;
|
|
5
|
-
filePath?: string;
|
|
6
|
-
patterns?: string[];
|
|
7
|
-
includeRules?: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface TraceClassOptions {
|
|
10
|
-
className: string;
|
|
11
|
-
patterns?: string[];
|
|
12
|
-
includeCss?: boolean;
|
|
13
|
-
mode?: string;
|
|
14
|
-
}
|
|
15
|
-
declare function extractClasses(context: MasterCSSMCPContext, options?: ExtractClassesOptions): Promise<{
|
|
16
|
-
version: number;
|
|
17
|
-
root: string;
|
|
18
|
-
manifest: {
|
|
19
|
-
status: "error" | "loaded";
|
|
20
|
-
entries: string[];
|
|
21
|
-
error?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
inputs: {
|
|
24
|
-
mode: string;
|
|
25
|
-
filePath: string;
|
|
26
|
-
patterns?: undefined;
|
|
27
|
-
files?: undefined;
|
|
28
|
-
};
|
|
29
|
-
files: {
|
|
30
|
-
filePath: string;
|
|
31
|
-
languageId: string;
|
|
32
|
-
classes: {
|
|
33
|
-
raw: string;
|
|
34
|
-
token: string;
|
|
35
|
-
range: {
|
|
36
|
-
start: number;
|
|
37
|
-
end: number;
|
|
38
|
-
};
|
|
39
|
-
loc: {
|
|
40
|
-
start: import("vscode-languageserver-textdocument").Position;
|
|
41
|
-
end: import("vscode-languageserver-textdocument").Position;
|
|
42
|
-
};
|
|
43
|
-
contextRange: {
|
|
44
|
-
start: number;
|
|
45
|
-
end: number;
|
|
46
|
-
};
|
|
47
|
-
sourceKind: string;
|
|
48
|
-
status: string;
|
|
49
|
-
valid: boolean;
|
|
50
|
-
inspection: {
|
|
51
|
-
valid: boolean;
|
|
52
|
-
base: string;
|
|
53
|
-
suffix: string;
|
|
54
|
-
key: string | undefined;
|
|
55
|
-
value: string | undefined;
|
|
56
|
-
keyToken: string | undefined;
|
|
57
|
-
valueToken: string | undefined;
|
|
58
|
-
stateToken: string | undefined;
|
|
59
|
-
important: boolean | undefined;
|
|
60
|
-
matcherTypes: ("key" | "pattern" | "static" | "value" | "variable")[];
|
|
61
|
-
variables: {
|
|
62
|
-
key: string;
|
|
63
|
-
variable: import("~/packages/language/src").Variable;
|
|
64
|
-
}[];
|
|
65
|
-
rules: {
|
|
66
|
-
className: string;
|
|
67
|
-
layer: import("@master/css-engine").MasterCSSManifestUtilityLayerName;
|
|
68
|
-
type: import("~/packages/language/src").UtilityType;
|
|
69
|
-
}[];
|
|
70
|
-
};
|
|
71
|
-
}[];
|
|
72
|
-
}[];
|
|
73
|
-
summary: {
|
|
74
|
-
files: number;
|
|
75
|
-
classes: number;
|
|
76
|
-
valid: number;
|
|
77
|
-
invalid: number;
|
|
78
|
-
diagnostics?: undefined;
|
|
79
|
-
};
|
|
80
|
-
scanner?: undefined;
|
|
81
|
-
diagnostics?: undefined;
|
|
82
|
-
} | {
|
|
83
|
-
version: number;
|
|
84
|
-
root: string;
|
|
85
|
-
manifest: {
|
|
86
|
-
status: "error" | "loaded";
|
|
87
|
-
entries: string[];
|
|
88
|
-
error?: string | undefined;
|
|
89
|
-
};
|
|
90
|
-
inputs: {
|
|
91
|
-
filePath?: undefined;
|
|
92
|
-
mode: string;
|
|
93
|
-
patterns: string[];
|
|
94
|
-
files: string[];
|
|
95
|
-
};
|
|
96
|
-
files: {
|
|
97
|
-
filePath: string;
|
|
98
|
-
languageId: string;
|
|
99
|
-
classes: {
|
|
100
|
-
raw: string;
|
|
101
|
-
token: string;
|
|
102
|
-
range: {
|
|
103
|
-
start: number;
|
|
104
|
-
end: number;
|
|
105
|
-
};
|
|
106
|
-
loc: {
|
|
107
|
-
start: import("vscode-languageserver-textdocument").Position;
|
|
108
|
-
end: import("vscode-languageserver-textdocument").Position;
|
|
109
|
-
};
|
|
110
|
-
contextRange: {
|
|
111
|
-
start: number;
|
|
112
|
-
end: number;
|
|
113
|
-
};
|
|
114
|
-
sourceKind: string;
|
|
115
|
-
status: string;
|
|
116
|
-
valid: boolean;
|
|
117
|
-
inspection: {
|
|
118
|
-
valid: boolean;
|
|
119
|
-
base: string;
|
|
120
|
-
suffix: string;
|
|
121
|
-
key: string | undefined;
|
|
122
|
-
value: string | undefined;
|
|
123
|
-
keyToken: string | undefined;
|
|
124
|
-
valueToken: string | undefined;
|
|
125
|
-
stateToken: string | undefined;
|
|
126
|
-
important: boolean | undefined;
|
|
127
|
-
matcherTypes: ("key" | "pattern" | "static" | "value" | "variable")[];
|
|
128
|
-
variables: {
|
|
129
|
-
key: string;
|
|
130
|
-
variable: import("~/packages/language/src").Variable;
|
|
131
|
-
}[];
|
|
132
|
-
rules: {
|
|
133
|
-
className: string;
|
|
134
|
-
layer: import("@master/css-engine").MasterCSSManifestUtilityLayerName;
|
|
135
|
-
type: import("~/packages/language/src").UtilityType;
|
|
136
|
-
}[];
|
|
137
|
-
};
|
|
138
|
-
}[];
|
|
139
|
-
}[];
|
|
140
|
-
scanner: {
|
|
141
|
-
counts: {
|
|
142
|
-
latent: number;
|
|
143
|
-
valid: number;
|
|
144
|
-
invalid: number;
|
|
145
|
-
native: number;
|
|
146
|
-
usedNative: number;
|
|
147
|
-
safelist: number;
|
|
148
|
-
blocklist: number;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
diagnostics: import("~/packages/diagnostics/src").MasterCSSInspectionDiagnostic[];
|
|
152
|
-
summary: {
|
|
153
|
-
files: number;
|
|
154
|
-
classes: number;
|
|
155
|
-
valid: number;
|
|
156
|
-
invalid: number;
|
|
157
|
-
diagnostics: number;
|
|
158
|
-
};
|
|
159
|
-
}>;
|
|
160
|
-
declare function traceClass(context: MasterCSSMCPContext, options: TraceClassOptions): Promise<{
|
|
161
|
-
version: number;
|
|
162
|
-
root: string;
|
|
163
|
-
manifest: {
|
|
164
|
-
status: "error" | "loaded";
|
|
165
|
-
entries: string[];
|
|
166
|
-
error?: string | undefined;
|
|
167
|
-
};
|
|
168
|
-
inputs: {
|
|
169
|
-
className: string;
|
|
170
|
-
patterns: string[];
|
|
171
|
-
mode: string | undefined;
|
|
172
|
-
};
|
|
173
|
-
className: string;
|
|
174
|
-
status: "missing" | "present";
|
|
175
|
-
reason: "blocklisted" | "generated" | "invalid" | "native-css" | "not-detected" | "safelist";
|
|
176
|
-
detected: boolean;
|
|
177
|
-
occurrences: {
|
|
178
|
-
filePath: string;
|
|
179
|
-
source: string;
|
|
180
|
-
statuses: string[];
|
|
181
|
-
}[];
|
|
182
|
-
inspection: {
|
|
183
|
-
valid: boolean;
|
|
184
|
-
base: string;
|
|
185
|
-
suffix: string;
|
|
186
|
-
key: string | undefined;
|
|
187
|
-
value: string | undefined;
|
|
188
|
-
keyToken: string | undefined;
|
|
189
|
-
valueToken: string | undefined;
|
|
190
|
-
stateToken: string | undefined;
|
|
191
|
-
important: boolean | undefined;
|
|
192
|
-
matcherTypes: ("key" | "pattern" | "static" | "value" | "variable")[];
|
|
193
|
-
variables: {
|
|
194
|
-
key: string;
|
|
195
|
-
variable: import("~/packages/language/src").Variable;
|
|
196
|
-
}[];
|
|
197
|
-
rules: {
|
|
198
|
-
className: string;
|
|
199
|
-
layer: import("@master/css-engine").MasterCSSManifestUtilityLayerName;
|
|
200
|
-
type: import("~/packages/language/src").UtilityType;
|
|
201
|
-
}[];
|
|
202
|
-
};
|
|
203
|
-
scanner: {
|
|
204
|
-
counts: {
|
|
205
|
-
latent: number;
|
|
206
|
-
valid: number;
|
|
207
|
-
invalid: number;
|
|
208
|
-
native: number;
|
|
209
|
-
usedNative: number;
|
|
210
|
-
safelist: number;
|
|
211
|
-
blocklist: number;
|
|
212
|
-
};
|
|
213
|
-
safelist: boolean;
|
|
214
|
-
blocklist: boolean;
|
|
215
|
-
};
|
|
216
|
-
css: {
|
|
217
|
-
included: boolean;
|
|
218
|
-
bytes: number;
|
|
219
|
-
emittedGlobals: {
|
|
220
|
-
variables: number;
|
|
221
|
-
animations: number;
|
|
222
|
-
};
|
|
223
|
-
text?: string | undefined;
|
|
224
|
-
};
|
|
225
|
-
diagnostics: import("~/packages/diagnostics/src").MasterCSSInspectionDiagnostic[];
|
|
226
|
-
summary: {
|
|
227
|
-
status: "missing" | "present";
|
|
228
|
-
reason: "blocklisted" | "generated" | "invalid" | "native-css" | "not-detected" | "safelist";
|
|
229
|
-
detected: boolean;
|
|
230
|
-
valid: boolean;
|
|
231
|
-
rules: number;
|
|
232
|
-
diagnostics: number;
|
|
233
|
-
};
|
|
234
|
-
}>;
|
|
235
|
-
//#endregion
|
|
236
|
-
export { ExtractClassesOptions, TraceClassOptions, extractClasses, traceClass };
|
package/dist/compare.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import MasterCSSMCPContext from "./context.js";
|
|
2
|
-
//#region src/compare.d.ts
|
|
3
|
-
interface CompareCSSOptions {
|
|
4
|
-
beforeClassList?: string;
|
|
5
|
-
afterClassList?: string;
|
|
6
|
-
beforeHtml?: string;
|
|
7
|
-
afterHtml?: string;
|
|
8
|
-
beforeContent?: string;
|
|
9
|
-
afterContent?: string;
|
|
10
|
-
filePath?: string;
|
|
11
|
-
}
|
|
12
|
-
declare function compareCSS(context: MasterCSSMCPContext, options: CompareCSSOptions): Promise<{
|
|
13
|
-
version: number;
|
|
14
|
-
root: string;
|
|
15
|
-
manifest: {
|
|
16
|
-
status: "error" | "loaded";
|
|
17
|
-
entries: string[];
|
|
18
|
-
error?: string | undefined;
|
|
19
|
-
};
|
|
20
|
-
inputs: {
|
|
21
|
-
filePath: string;
|
|
22
|
-
before: {
|
|
23
|
-
classes: number;
|
|
24
|
-
invalid: number;
|
|
25
|
-
};
|
|
26
|
-
after: {
|
|
27
|
-
classes: number;
|
|
28
|
-
invalid: number;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
classes: {
|
|
32
|
-
added: string[];
|
|
33
|
-
removed: string[];
|
|
34
|
-
unchanged: string[];
|
|
35
|
-
};
|
|
36
|
-
invalid: {
|
|
37
|
-
before: string[];
|
|
38
|
-
after: string[];
|
|
39
|
-
added: string[];
|
|
40
|
-
removed: string[];
|
|
41
|
-
};
|
|
42
|
-
css: {
|
|
43
|
-
changed: boolean;
|
|
44
|
-
before: {
|
|
45
|
-
bytes: number;
|
|
46
|
-
text: string;
|
|
47
|
-
};
|
|
48
|
-
after: {
|
|
49
|
-
bytes: number;
|
|
50
|
-
text: string;
|
|
51
|
-
};
|
|
52
|
-
bytesDelta: number;
|
|
53
|
-
diff: string;
|
|
54
|
-
};
|
|
55
|
-
rules: {
|
|
56
|
-
added: string[];
|
|
57
|
-
removed: string[];
|
|
58
|
-
unchanged: number;
|
|
59
|
-
};
|
|
60
|
-
summary: {
|
|
61
|
-
changed: boolean;
|
|
62
|
-
addedClasses: number;
|
|
63
|
-
removedClasses: number;
|
|
64
|
-
addedRules: number;
|
|
65
|
-
removedRules: number;
|
|
66
|
-
bytesDelta: number;
|
|
67
|
-
};
|
|
68
|
-
}>;
|
|
69
|
-
//#endregion
|
|
70
|
-
export { CompareCSSOptions, compareCSS };
|