@shapeshift-labs/frontier-lang-compiler 0.2.151 → 0.2.153
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
CHANGED
|
@@ -600,6 +600,7 @@ Recent residual closures represented in the matrix shards:
|
|
|
600
600
|
- Module/export/import graph now records no-substitution template dynamic imports and parser-backed CommonJS helper `require` templates as static module edges while keeping expression templates proof-required.
|
|
601
601
|
- Module/export/import graph now records no-substitution/static template host dependencies for `new URL`, workers, resolver calls, and `importScripts` while leaving expression templates unsupported.
|
|
602
602
|
- Module/export/import graph now emits dynamic host dependency targets as `<host-dependency>` edges with expression hashes and proof-required unresolved evidence instead of omitting them.
|
|
603
|
+
- CSS Modules graph records now infer local class export evidence from `.module.css` source via `@shapeshift-labs/frontier-lang-css`, while generated class-name maps, bundler transform identity, source-map proof, dynamic member access, writes, and helper-call equivalence remain fail-closed.
|
|
603
604
|
- Type/public API graph now includes bounded TypeChecker assignability oracle proof for simple public type aliases while keeping semantic/runtime equivalence claims false.
|
|
604
605
|
- JSX/TSX graph now records same-file and project-local named/default/barrel-import static component prop passthrough as `jsx-render-component-prop-flow-static-passthrough-evidence` and blocks dynamic callsite values with `jsx-render-component-prop-flow-dynamic-value-unsupported`.
|
|
605
606
|
- JSX/TSX graph now records static `memo` / `forwardRef` / `observer` / `React.lazy` component wrapper chains as component-wrapper render-risk evidence while keeping render, lazy-load, and runtime equivalence explicitly unproved.
|
|
@@ -17,6 +17,9 @@ export interface NativeProjectSymbolGraphCssModuleImportBindingRecord {
|
|
|
17
17
|
readonly cssModuleSourceHash?: string;
|
|
18
18
|
readonly cssModuleHash?: string;
|
|
19
19
|
readonly cssModuleEvidenceStatus?: 'supplied' | 'unproved' | string;
|
|
20
|
+
readonly cssModuleEvidenceSource?: 'supplied' | 'inferred-source' | string;
|
|
21
|
+
readonly cssModuleExportNames?: readonly string[];
|
|
22
|
+
readonly cssModuleExportNamesHash?: string;
|
|
20
23
|
readonly generatedClassNameMapHash?: string;
|
|
21
24
|
readonly jsTsUseSiteGraphHash?: string;
|
|
22
25
|
readonly cssModuleCompositionGraphHash?: string;
|
|
@@ -81,6 +84,7 @@ export interface NativeProjectSymbolGraphCssModuleUseSiteGraphRecord {
|
|
|
81
84
|
readonly useSiteCount: number;
|
|
82
85
|
readonly blockerCount: number;
|
|
83
86
|
readonly generatedClassNameMapHash?: string;
|
|
87
|
+
readonly cssModuleExportNamesHash?: string;
|
|
84
88
|
readonly bundlerTransformHash?: string;
|
|
85
89
|
readonly sourceMapProofHash?: string;
|
|
86
90
|
readonly status: 'ready' | 'blocked' | string;
|
|
@@ -48,6 +48,7 @@ function cssModuleImportBindingRecord(edge, index, documentsById, cssSourcesByPa
|
|
|
48
48
|
cssModuleSourceHash: document?.sourceHash ?? cssSource?.sourceHash,
|
|
49
49
|
cssModuleHash,
|
|
50
50
|
cssModuleEvidenceStatus: cssModuleEvidence ? 'supplied' : 'unproved',
|
|
51
|
+
cssModuleEvidenceSource: cssSource?.cssModuleEvidenceSource,
|
|
51
52
|
cssModuleExportNames: cssModuleExportNames.length ? cssModuleExportNames : undefined,
|
|
52
53
|
cssModuleExportNamesHash: cssModuleExportNames.length ? hashSemanticValue(cssModuleExportNames) : undefined,
|
|
53
54
|
generatedClassNameMapHash: cssModuleEvidence?.generatedClassNameMapHash ?? cssModuleGeneratedClassNameMapHash(cssModuleEvidence),
|
|
@@ -224,12 +225,19 @@ function cssModuleEvidenceExportNames(evidence) {
|
|
|
224
225
|
...arrayValue(evidence?.exportNames),
|
|
225
226
|
...arrayValue(evidence?.localClassNames),
|
|
226
227
|
...arrayValue(evidence?.classNames),
|
|
228
|
+
...cssModuleExportRecordNames(evidence?.exports),
|
|
227
229
|
...objectKeys(evidence?.exports),
|
|
228
230
|
...objectKeys(evidence?.generatedClassNameMap),
|
|
229
231
|
...objectKeys(evidence?.classMap)
|
|
230
232
|
]);
|
|
231
233
|
}
|
|
232
234
|
|
|
235
|
+
function cssModuleExportRecordNames(value) {
|
|
236
|
+
return Array.isArray(value)
|
|
237
|
+
? value.map((entry) => entry?.name ?? entry?.localName).filter(Boolean)
|
|
238
|
+
: [];
|
|
239
|
+
}
|
|
240
|
+
|
|
233
241
|
function cssModuleGeneratedClassNameMapHash(evidence) {
|
|
234
242
|
const map = objectValue(evidence?.generatedClassNameMap) ?? objectValue(evidence?.classMap) ?? objectValue(evidence?.exports);
|
|
235
243
|
return map ? hashSemanticValue({ kind: 'frontier.lang.cssModuleGeneratedClassNameMap.v1', map }) : undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { lineColumnForOffset } from './lineColumnForOffset.js';
|
|
2
|
+
import { parseCssSemanticSheet } from '@shapeshift-labs/frontier-lang-css';
|
|
2
3
|
|
|
3
4
|
const CssModulePathPattern = /\.module\.css(?:[?#].*)?$/i;
|
|
4
5
|
|
|
@@ -8,22 +9,48 @@ function cssModuleSourceRecord(imported) {
|
|
|
8
9
|
const metadata = objectValue(imported?.metadata);
|
|
9
10
|
const nativeMetadata = objectValue(imported?.nativeSource?.metadata);
|
|
10
11
|
const astMetadata = objectValue(imported?.nativeAst?.metadata);
|
|
12
|
+
const suppliedEvidence = firstObject(
|
|
13
|
+
metadata.cssModuleEvidence,
|
|
14
|
+
metadata.cssModules,
|
|
15
|
+
nativeMetadata.cssModuleEvidence,
|
|
16
|
+
nativeMetadata.cssModules,
|
|
17
|
+
astMetadata.cssModuleEvidence,
|
|
18
|
+
astMetadata.cssModules
|
|
19
|
+
);
|
|
20
|
+
const sourceText = nativeImportSourceText(imported);
|
|
21
|
+
const inferredEvidence = suppliedEvidence ? undefined : inferCssModuleEvidence(sourceText, sourcePath, metadata, nativeMetadata, astMetadata);
|
|
11
22
|
return compactRecord({
|
|
12
23
|
sourcePath,
|
|
13
24
|
sourceHash: imported?.nativeSource?.sourceHash ?? imported?.metadata?.sourceHash,
|
|
14
|
-
cssModuleEvidence:
|
|
15
|
-
|
|
16
|
-
metadata.cssModules,
|
|
17
|
-
nativeMetadata.cssModuleEvidence,
|
|
18
|
-
nativeMetadata.cssModules,
|
|
19
|
-
astMetadata.cssModuleEvidence,
|
|
20
|
-
astMetadata.cssModules
|
|
21
|
-
),
|
|
25
|
+
cssModuleEvidence: suppliedEvidence ?? inferredEvidence,
|
|
26
|
+
cssModuleEvidenceSource: suppliedEvidence ? 'supplied' : inferredEvidence ? 'inferred-source' : undefined,
|
|
22
27
|
bundlerTransformHash: firstString(metadata.bundlerTransformHash, nativeMetadata.bundlerTransformHash, astMetadata.bundlerTransformHash),
|
|
23
28
|
sourceMapProofHash: firstString(metadata.sourceMapProofHash, nativeMetadata.sourceMapProofHash, astMetadata.sourceMapProofHash)
|
|
24
29
|
});
|
|
25
30
|
}
|
|
26
31
|
|
|
32
|
+
function inferCssModuleEvidence(sourceText, sourcePath, ...metadataValues) {
|
|
33
|
+
if (typeof sourceText !== 'string') return undefined;
|
|
34
|
+
const options = cssModuleEvidenceOptions(sourcePath, metadataValues);
|
|
35
|
+
try {
|
|
36
|
+
return parseCssSemanticSheet(sourceText, options).cssModules;
|
|
37
|
+
} catch {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function cssModuleEvidenceOptions(sourcePath, metadataValues) {
|
|
43
|
+
return {
|
|
44
|
+
sourcePath,
|
|
45
|
+
cssModules: true,
|
|
46
|
+
generatedClassNameMap: firstObject(...metadataValues.map((metadata) => metadata.generatedClassNameMap)),
|
|
47
|
+
generatedClassNameMapHash: firstString(...metadataValues.map((metadata) => metadata.generatedClassNameMapHash)),
|
|
48
|
+
jsTsUseSiteGraphHash: firstString(...metadataValues.map((metadata) => metadata.jsTsUseSiteGraphHash)),
|
|
49
|
+
cssModuleCompositionGraphHash: firstString(...metadataValues.map((metadata) => metadata.cssModuleCompositionGraphHash)),
|
|
50
|
+
icssGraphHash: firstString(...metadataValues.map((metadata) => metadata.icssGraphHash))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
27
54
|
function nativeImportSourceText(imported) {
|
|
28
55
|
return imported?.metadata?.sourcePreservation?.sourceText
|
|
29
56
|
?? imported?.nativeSource?.metadata?.sourcePreservation?.sourceText
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshift-labs/frontier-lang-compiler",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.153",
|
|
4
4
|
"description": "Compiler facade for Frontier Lang source documents and language projection adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@shapeshift-labs/frontier-lang-c": "0.2.9",
|
|
65
65
|
"@shapeshift-labs/frontier-lang-checker": "0.3.8",
|
|
66
|
+
"@shapeshift-labs/frontier-lang-css": "^0.1.4",
|
|
66
67
|
"@shapeshift-labs/frontier-lang-javascript": "0.2.9",
|
|
67
68
|
"@shapeshift-labs/frontier-lang-kernel": "0.3.12",
|
|
68
69
|
"@shapeshift-labs/frontier-lang-parser": "0.3.8",
|