@velarscript/web 0.31.0 → 0.33.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 +1 -1
- package/dist/analysis/calls/intrinsics/config.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/config.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/config.js +19 -0
- package/dist/analysis/calls/intrinsics/config.js.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.js +38 -0
- package/dist/analysis/calls/intrinsics/forms.js.map +1 -0
- package/dist/analysis/calls/intrinsics/http.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/http.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/http.js +37 -0
- package/dist/analysis/calls/intrinsics/http.js.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.js +30 -0
- package/dist/analysis/calls/intrinsics/reactive.js.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts +16 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.js +91 -0
- package/dist/analysis/calls/intrinsics/storage.js.map +1 -0
- package/dist/analysis/calls/intrinsics/web.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/web.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/web.js +100 -0
- package/dist/analysis/calls/intrinsics/web.js.map +1 -0
- package/dist/analysis/calls/intrinsics.d.ts +13 -0
- package/dist/analysis/calls/intrinsics.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics.js +31 -0
- package/dist/analysis/calls/intrinsics.js.map +1 -0
- package/dist/analysis/components/contracts.d.ts +19 -0
- package/dist/analysis/components/contracts.d.ts.map +1 -0
- package/dist/analysis/components/contracts.js +83 -0
- package/dist/analysis/components/contracts.js.map +1 -0
- package/dist/analysis/components/declaration.d.ts +4 -0
- package/dist/analysis/components/declaration.d.ts.map +1 -0
- package/dist/analysis/components/declaration.js +163 -0
- package/dist/analysis/components/declaration.js.map +1 -0
- package/dist/analysis/components/host.d.ts +61 -0
- package/dist/analysis/components/host.d.ts.map +1 -0
- package/dist/analysis/components/host.js +22 -0
- package/dist/analysis/components/host.js.map +1 -0
- package/dist/analysis/components/lifecycle.d.ts +22 -0
- package/dist/analysis/components/lifecycle.d.ts.map +1 -0
- package/dist/analysis/components/lifecycle.js +33 -0
- package/dist/analysis/components/lifecycle.js.map +1 -0
- package/dist/analysis/components/ownership.d.ts +74 -0
- package/dist/analysis/components/ownership.d.ts.map +1 -0
- package/dist/analysis/components/ownership.js +106 -0
- package/dist/analysis/components/ownership.js.map +1 -0
- package/dist/analysis/declarations.d.ts +99 -0
- package/dist/analysis/declarations.d.ts.map +1 -0
- package/dist/analysis/declarations.js +176 -0
- package/dist/analysis/declarations.js.map +1 -0
- package/dist/analysis/inference.d.ts +75 -0
- package/dist/analysis/inference.d.ts.map +1 -0
- package/dist/analysis/inference.js +257 -0
- package/dist/analysis/inference.js.map +1 -0
- package/dist/analysis/jsx/attributes.d.ts +103 -0
- package/dist/analysis/jsx/attributes.d.ts.map +1 -0
- package/dist/analysis/jsx/attributes.js +601 -0
- package/dist/analysis/jsx/attributes.js.map +1 -0
- package/dist/analysis/jsx/elements.d.ts +17 -0
- package/dist/analysis/jsx/elements.d.ts.map +1 -0
- package/dist/analysis/jsx/elements.js +213 -0
- package/dist/analysis/jsx/elements.js.map +1 -0
- package/dist/analysis/jsx/host.d.ts +61 -0
- package/dist/analysis/jsx/host.d.ts.map +1 -0
- package/dist/analysis/jsx/host.js +15 -0
- package/dist/analysis/jsx/host.js.map +1 -0
- package/dist/analysis/jsx/keys.d.ts +15 -0
- package/dist/analysis/jsx/keys.d.ts.map +1 -0
- package/dist/analysis/jsx/keys.js +67 -0
- package/dist/analysis/jsx/keys.js.map +1 -0
- package/dist/analysis/jsx/security.d.ts +29 -0
- package/dist/analysis/jsx/security.d.ts.map +1 -0
- package/dist/analysis/jsx/security.js +61 -0
- package/dist/analysis/jsx/security.js.map +1 -0
- package/dist/analysis/jsx-detection.d.ts +49 -0
- package/dist/analysis/jsx-detection.d.ts.map +1 -0
- package/dist/analysis/jsx-detection.js +196 -0
- package/dist/analysis/jsx-detection.js.map +1 -0
- package/dist/analysis/keyed-rebuild.d.ts +148 -0
- package/dist/analysis/keyed-rebuild.d.ts.map +1 -0
- package/dist/analysis/keyed-rebuild.js +299 -0
- package/dist/analysis/keyed-rebuild.js.map +1 -0
- package/dist/analysis/keyframes-analysis.d.ts +6 -0
- package/dist/analysis/keyframes-analysis.d.ts.map +1 -0
- package/dist/analysis/keyframes-analysis.js +79 -0
- package/dist/analysis/keyframes-analysis.js.map +1 -0
- package/dist/analysis/look/builders.d.ts +29 -0
- package/dist/analysis/look/builders.d.ts.map +1 -0
- package/dist/analysis/look/builders.js +174 -0
- package/dist/analysis/look/builders.js.map +1 -0
- package/dist/analysis/look/conditions.d.ts +13 -0
- package/dist/analysis/look/conditions.d.ts.map +1 -0
- package/dist/analysis/look/conditions.js +84 -0
- package/dist/analysis/look/conditions.js.map +1 -0
- package/dist/analysis/look/edits.d.ts +36 -0
- package/dist/analysis/look/edits.d.ts.map +1 -0
- package/dist/analysis/look/edits.js +80 -0
- package/dist/analysis/look/edits.js.map +1 -0
- package/dist/analysis/look/entries.d.ts +56 -0
- package/dist/analysis/look/entries.d.ts.map +1 -0
- package/dist/analysis/look/entries.js +223 -0
- package/dist/analysis/look/entries.js.map +1 -0
- package/dist/analysis/look/host.d.ts +47 -0
- package/dist/analysis/look/host.d.ts.map +1 -0
- package/dist/analysis/look/host.js +16 -0
- package/dist/analysis/look/host.js.map +1 -0
- package/dist/analysis/look/tokens.d.ts +75 -0
- package/dist/analysis/look/tokens.d.ts.map +1 -0
- package/dist/analysis/look/tokens.js +156 -0
- package/dist/analysis/look/tokens.js.map +1 -0
- package/dist/analysis/look/values.d.ts +45 -0
- package/dist/analysis/look/values.d.ts.map +1 -0
- package/dist/analysis/look/values.js +148 -0
- package/dist/analysis/look/values.js.map +1 -0
- package/dist/analysis/look-conditions.d.ts +47 -0
- package/dist/analysis/look-conditions.d.ts.map +1 -0
- package/dist/analysis/look-conditions.js +157 -0
- package/dist/analysis/look-conditions.js.map +1 -0
- package/dist/analysis/look-sites.d.ts +62 -0
- package/dist/analysis/look-sites.d.ts.map +1 -0
- package/dist/analysis/look-sites.js +121 -0
- package/dist/analysis/look-sites.js.map +1 -0
- package/dist/analysis/look-values.d.ts +19 -0
- package/dist/analysis/look-values.d.ts.map +1 -1
- package/dist/analysis/look-values.js +38 -0
- package/dist/analysis/look-values.js.map +1 -1
- package/dist/analysis/look-vocabulary-guidance.d.ts +76 -0
- package/dist/analysis/look-vocabulary-guidance.d.ts.map +1 -0
- package/dist/analysis/look-vocabulary-guidance.js +338 -0
- package/dist/analysis/look-vocabulary-guidance.js.map +1 -0
- package/dist/analysis/media-conditions.d.ts +33 -0
- package/dist/analysis/media-conditions.d.ts.map +1 -0
- package/dist/analysis/media-conditions.js +92 -0
- package/dist/analysis/media-conditions.js.map +1 -0
- package/dist/analysis/program-passes.d.ts +106 -0
- package/dist/analysis/program-passes.d.ts.map +1 -0
- package/dist/analysis/program-passes.js +149 -0
- package/dist/analysis/program-passes.js.map +1 -0
- package/dist/analysis/reactivity/bindings.d.ts +37 -0
- package/dist/analysis/reactivity/bindings.d.ts.map +1 -0
- package/dist/analysis/reactivity/bindings.js +88 -0
- package/dist/analysis/reactivity/bindings.js.map +1 -0
- package/dist/analysis/reactivity/derived.d.ts +39 -0
- package/dist/analysis/reactivity/derived.d.ts.map +1 -0
- package/dist/analysis/reactivity/derived.js +80 -0
- package/dist/analysis/reactivity/derived.js.map +1 -0
- package/dist/analysis/reactivity/host.d.ts +38 -0
- package/dist/analysis/reactivity/host.d.ts.map +1 -0
- package/dist/analysis/reactivity/host.js +14 -0
- package/dist/analysis/reactivity/host.js.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts +82 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.js +118 -0
- package/dist/analysis/reactivity/retired-accessors.js.map +1 -0
- package/dist/analysis/renderable.d.ts +47 -0
- package/dist/analysis/renderable.d.ts.map +1 -0
- package/dist/analysis/renderable.js +105 -0
- package/dist/analysis/renderable.js.map +1 -0
- package/dist/analysis/routes.d.ts +64 -0
- package/dist/analysis/routes.d.ts.map +1 -0
- package/dist/analysis/routes.js +182 -0
- package/dist/analysis/routes.js.map +1 -0
- package/dist/analysis/url-attributes.d.ts +12 -0
- package/dist/analysis/url-attributes.d.ts.map +1 -0
- package/dist/analysis/url-attributes.js +48 -0
- package/dist/analysis/url-attributes.js.map +1 -0
- package/dist/analysis/watch-cycles.d.ts +102 -0
- package/dist/analysis/watch-cycles.d.ts.map +1 -1
- package/dist/analysis/watch-cycles.js +240 -1
- package/dist/analysis/watch-cycles.js.map +1 -1
- package/dist/analysis/watch-subject.d.ts +45 -0
- package/dist/analysis/watch-subject.d.ts.map +1 -0
- package/dist/analysis/watch-subject.js +272 -0
- package/dist/analysis/watch-subject.js.map +1 -0
- package/dist/analysis/web-types.d.ts +27 -0
- package/dist/analysis/web-types.d.ts.map +1 -0
- package/dist/analysis/web-types.js +170 -0
- package/dist/analysis/web-types.js.map +1 -0
- package/dist/analyzer.d.ts +18 -617
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +211 -4853
- package/dist/analyzer.js.map +1 -1
- package/dist/compiler.d.ts +20 -0
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +31 -864
- package/dist/compiler.js.map +1 -1
- package/dist/documentation.d.ts +28 -0
- package/dist/documentation.d.ts.map +1 -0
- package/dist/documentation.js +67 -0
- package/dist/documentation.js.map +1 -0
- package/dist/editor/completions.d.ts +12 -0
- package/dist/editor/completions.d.ts.map +1 -0
- package/dist/editor/completions.js +6 -0
- package/dist/editor/completions.js.map +1 -0
- package/dist/editor/jsx-completion.d.ts +12 -0
- package/dist/editor/jsx-completion.d.ts.map +1 -0
- package/dist/editor/jsx-completion.js +137 -0
- package/dist/editor/jsx-completion.js.map +1 -0
- package/dist/editor/look-completion.d.ts +29 -0
- package/dist/editor/look-completion.d.ts.map +1 -0
- package/dist/editor/look-completion.js +159 -0
- package/dist/editor/look-completion.js.map +1 -0
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +12 -288
- package/dist/editor.js.map +1 -1
- package/dist/emit/components.d.ts +33 -0
- package/dist/emit/components.d.ts.map +1 -0
- package/dist/emit/components.js +135 -0
- package/dist/emit/components.js.map +1 -0
- package/dist/emit/jsx.d.ts +57 -0
- package/dist/emit/jsx.d.ts.map +1 -0
- package/dist/emit/jsx.js +384 -0
- package/dist/emit/jsx.js.map +1 -0
- package/dist/emit/look-css.d.ts +44 -0
- package/dist/emit/look-css.d.ts.map +1 -0
- package/dist/emit/look-css.js +177 -0
- package/dist/emit/look-css.js.map +1 -0
- package/dist/emit/look.d.ts +39 -0
- package/dist/emit/look.d.ts.map +1 -0
- package/dist/emit/look.js +218 -0
- package/dist/emit/look.js.map +1 -0
- package/dist/emit/runtime-imports.d.ts +40 -0
- package/dist/emit/runtime-imports.d.ts.map +1 -0
- package/dist/emit/runtime-imports.js +188 -0
- package/dist/emit/runtime-imports.js.map +1 -0
- package/dist/emitter.d.ts +15 -68
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +79 -1008
- package/dist/emitter.js.map +1 -1
- package/dist/look/animation.d.ts +7 -0
- package/dist/look/animation.d.ts.map +1 -0
- package/dist/look/animation.js +13 -0
- package/dist/look/animation.js.map +1 -0
- package/dist/look/builders.d.ts +35 -0
- package/dist/look/builders.d.ts.map +1 -0
- package/dist/look/builders.js +74 -0
- package/dist/look/builders.js.map +1 -0
- package/dist/look/css-functions.d.ts +28 -0
- package/dist/look/css-functions.d.ts.map +1 -0
- package/dist/look/css-functions.js +54 -0
- package/dist/look/css-functions.js.map +1 -0
- package/dist/look/keyword-sets.d.ts +41 -0
- package/dist/look/keyword-sets.d.ts.map +1 -0
- package/dist/look/keyword-sets.js +117 -0
- package/dist/look/keyword-sets.js.map +1 -0
- package/dist/look/keywords.d.ts +55 -0
- package/dist/look/keywords.d.ts.map +1 -0
- package/dist/look/keywords.js +387 -0
- package/dist/look/keywords.js.map +1 -0
- package/dist/look/media.d.ts +19 -0
- package/dist/look/media.d.ts.map +1 -0
- package/dist/look/media.js +27 -0
- package/dist/look/media.js.map +1 -0
- package/dist/look/naming.d.ts +9 -0
- package/dist/look/naming.d.ts.map +1 -0
- package/dist/look/naming.js +45 -0
- package/dist/look/naming.js.map +1 -0
- package/dist/look/properties.d.ts +16 -0
- package/dist/look/properties.d.ts.map +1 -0
- package/dist/look/properties.js +52 -0
- package/dist/look/properties.js.map +1 -0
- package/dist/look/shorthands.d.ts +25 -0
- package/dist/look/shorthands.d.ts.map +1 -0
- package/dist/look/shorthands.js +130 -0
- package/dist/look/shorthands.js.map +1 -0
- package/dist/look/tokens.d.ts +38 -0
- package/dist/look/tokens.d.ts.map +1 -0
- package/dist/look/tokens.js +59 -0
- package/dist/look/tokens.js.map +1 -0
- package/dist/look/units.d.ts +24 -0
- package/dist/look/units.d.ts.map +1 -0
- package/dist/look/units.js +33 -0
- package/dist/look/units.js.map +1 -0
- package/dist/look.d.ts +32 -227
- package/dist/look.d.ts.map +1 -1
- package/dist/look.js +28 -933
- package/dist/look.js.map +1 -1
- package/dist/module-roster.d.ts +16 -0
- package/dist/module-roster.d.ts.map +1 -0
- package/dist/module-roster.js +28 -0
- package/dist/module-roster.js.map +1 -0
- package/dist/modules/app.d.ts +9 -0
- package/dist/modules/app.d.ts.map +1 -0
- package/dist/modules/app.js +20 -0
- package/dist/modules/app.js.map +1 -0
- package/dist/modules/browser-test.d.ts +9 -0
- package/dist/modules/browser-test.d.ts.map +1 -0
- package/dist/modules/browser-test.js +67 -0
- package/dist/modules/browser-test.js.map +1 -0
- package/dist/modules/browser.d.ts +10 -0
- package/dist/modules/browser.d.ts.map +1 -0
- package/dist/modules/browser.js +89 -0
- package/dist/modules/browser.js.map +1 -0
- package/dist/modules/config.d.ts +9 -0
- package/dist/modules/config.d.ts.map +1 -0
- package/dist/modules/config.js +14 -0
- package/dist/modules/config.js.map +1 -0
- package/dist/modules/files.d.ts +9 -0
- package/dist/modules/files.d.ts.map +1 -0
- package/dist/modules/files.js +16 -0
- package/dist/modules/files.js.map +1 -0
- package/dist/modules/forms.d.ts +9 -0
- package/dist/modules/forms.d.ts.map +1 -0
- package/dist/modules/forms.js +26 -0
- package/dist/modules/forms.js.map +1 -0
- package/dist/modules/http.d.ts +9 -0
- package/dist/modules/http.d.ts.map +1 -0
- package/dist/modules/http.js +127 -0
- package/dist/modules/http.js.map +1 -0
- package/dist/modules/look.d.ts +9 -0
- package/dist/modules/look.d.ts.map +1 -0
- package/dist/modules/look.js +58 -0
- package/dist/modules/look.js.map +1 -0
- package/dist/modules/realtime.d.ts +9 -0
- package/dist/modules/realtime.d.ts.map +1 -0
- package/dist/modules/realtime.js +163 -0
- package/dist/modules/realtime.js.map +1 -0
- package/dist/modules/storage.d.ts +9 -0
- package/dist/modules/storage.d.ts.map +1 -0
- package/dist/modules/storage.js +59 -0
- package/dist/modules/storage.js.map +1 -0
- package/dist/modules/types.d.ts +78 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/modules/types.js +154 -0
- package/dist/modules/types.js.map +1 -0
- package/dist/modules/web.d.ts +9 -0
- package/dist/modules/web.d.ts.map +1 -0
- package/dist/modules/web.js +63 -0
- package/dist/modules/web.js.map +1 -0
- package/dist/modules/websocket.d.ts +11 -0
- package/dist/modules/websocket.d.ts.map +1 -0
- package/dist/modules/websocket.js +75 -0
- package/dist/modules/websocket.js.map +1 -0
- package/dist/parser/expressions/jsx.d.ts +17 -0
- package/dist/parser/expressions/jsx.d.ts.map +1 -0
- package/dist/parser/expressions/jsx.js +43 -0
- package/dist/parser/expressions/jsx.js.map +1 -0
- package/dist/parser/expressions/keyframes.d.ts +15 -0
- package/dist/parser/expressions/keyframes.d.ts.map +1 -0
- package/dist/parser/expressions/keyframes.js +33 -0
- package/dist/parser/expressions/keyframes.js.map +1 -0
- package/dist/parser/expressions/look.d.ts +16 -0
- package/dist/parser/expressions/look.d.ts.map +1 -0
- package/dist/parser/expressions/look.js +37 -0
- package/dist/parser/expressions/look.js.map +1 -0
- package/dist/parser/expressions/visual-block.d.ts +17 -0
- package/dist/parser/expressions/visual-block.d.ts.map +1 -0
- package/dist/parser/expressions/visual-block.js +21 -0
- package/dist/parser/expressions/visual-block.js.map +1 -0
- package/dist/parser/keyframes-source.d.ts +24 -0
- package/dist/parser/keyframes-source.d.ts.map +1 -0
- package/dist/parser/keyframes-source.js +133 -0
- package/dist/parser/keyframes-source.js.map +1 -0
- package/dist/parser/look-source.d.ts +25 -0
- package/dist/parser/look-source.d.ts.map +1 -0
- package/dist/parser/look-source.js +189 -0
- package/dist/parser/look-source.js.map +1 -0
- package/dist/parser/spans.d.ts +24 -0
- package/dist/parser/spans.d.ts.map +1 -0
- package/dist/parser/spans.js +113 -0
- package/dist/parser/spans.js.map +1 -0
- package/dist/parser/statements/components.d.ts +37 -0
- package/dist/parser/statements/components.d.ts.map +1 -0
- package/dist/parser/statements/components.js +185 -0
- package/dist/parser/statements/components.js.map +1 -0
- package/dist/parser/statements/heads.d.ts +38 -0
- package/dist/parser/statements/heads.d.ts.map +1 -0
- package/dist/parser/statements/heads.js +55 -0
- package/dist/parser/statements/heads.js.map +1 -0
- package/dist/parser/statements/imports.d.ts +9 -0
- package/dist/parser/statements/imports.d.ts.map +1 -0
- package/dist/parser/statements/imports.js +31 -0
- package/dist/parser/statements/imports.js.map +1 -0
- package/dist/parser/statements/reactive.d.ts +31 -0
- package/dist/parser/statements/reactive.d.ts.map +1 -0
- package/dist/parser/statements/reactive.js +68 -0
- package/dist/parser/statements/reactive.js.map +1 -0
- package/dist/parser/statements/unsafe-css.d.ts +21 -0
- package/dist/parser/statements/unsafe-css.d.ts.map +1 -0
- package/dist/parser/statements/unsafe-css.js +42 -0
- package/dist/parser/statements/unsafe-css.js.map +1 -0
- package/dist/parser.d.ts +37 -50
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +98 -882
- package/dist/parser.js.map +1 -1
- package/dist/runtime-sources.generated.d.ts +1 -1
- package/dist/runtime-sources.generated.d.ts.map +1 -1
- package/dist/runtime-sources.generated.js +4 -4
- package/dist/runtime-sources.generated.js.map +1 -1
- package/package.json +2 -2
package/dist/analyzer.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Diagnostic, type Span } from "@velarscript/compiler";
|
|
2
|
-
import { Analyzer, type AnalysisContext, type CompilerAnalysisExtension, type
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { Analyzer, type AnalysisContext, type CompilerAnalysisExtension, type Expression, type Program, type Statement, type TypeReference, type ValueType } from "@velarscript/compiler/extension";
|
|
3
|
+
import { inferWebIntrinsic } from "./analysis/calls/intrinsics.ts";
|
|
4
|
+
import { routeContextIdentity } from "./analysis/web-types.ts";
|
|
5
|
+
export { inferWebIntrinsic, routeContextIdentity };
|
|
5
6
|
export declare class VelarWebAnalyzer extends Analyzer {
|
|
6
7
|
private componentStates;
|
|
7
8
|
private mountedDepth;
|
|
@@ -80,643 +81,43 @@ export declare class VelarWebAnalyzer extends Analyzer {
|
|
|
80
81
|
private publicConfigNames;
|
|
81
82
|
/** velar/look builder calls this compile refused on their own arguments (D114 0.29.0 LK-I2). */
|
|
82
83
|
private readonly refusedBuilderCalls;
|
|
84
|
+
/** The one object every `analysis/` collaborator reads this analyzer through. */
|
|
85
|
+
private readonly host;
|
|
83
86
|
constructor(context?: AnalysisContext, extensions?: readonly CompilerAnalysisExtension[]);
|
|
84
87
|
analyze(program: Program): readonly Diagnostic[];
|
|
85
|
-
/**
|
|
86
|
-
* D57 rule 138: `velar/web-test` only has a runtime under `velar test
|
|
87
|
-
* --browser`, so an import of it anywhere else compiles a call that cannot
|
|
88
|
-
* succeed. D51 rule 109 puts the refusal at the declaration rather than at the
|
|
89
|
-
* eventual use, so the error lands on the `import` line — including the
|
|
90
|
-
* JavaScript-bridge and re-export spellings, which reach the same runtime.
|
|
91
|
-
*/
|
|
92
|
-
private reportBrowserTestImports;
|
|
93
|
-
/**
|
|
94
|
-
* D72 rule 186: a Web module publishes its own type names, and a user
|
|
95
|
-
* declaration of one used to be accepted at the declaration and then lose at
|
|
96
|
-
* every use — `type Event:` compiled, and `describe({kind: "charge"})` was
|
|
97
|
-
* told it could not assign to `Event`, naming a type the author had just
|
|
98
|
-
* written. D51 rule 109 already settled where that refusal belongs: at the
|
|
99
|
-
* declaration, which is the only place a rename is cheap.
|
|
100
|
-
*
|
|
101
|
-
* The names come from the extension's own published table, so adding a type
|
|
102
|
-
* to `WEB_OWNED_TYPE_NAMES` extends this protection with it. The last time
|
|
103
|
-
* this family was repaired by listing names instead of deriving them, the
|
|
104
|
-
* list drifted; D57 rule 135 is the same repair on the Core roster.
|
|
105
|
-
*
|
|
106
|
-
* Core now says the same sentence about its own built-in type names —
|
|
107
|
-
* `builtinTypeNameDeclarationMessage` in packages/compiler/src/analyzer.ts,
|
|
108
|
-
* reported as VEL3007. The rosters differ; the wording is meant to read
|
|
109
|
-
* alike, so a change to either sentence belongs in both.
|
|
110
|
-
*
|
|
111
|
-
* `Duration` is on both rosters — Core owns it as a primitive and
|
|
112
|
-
* `velar/look` republishes it — so a Web module used to report it twice. This
|
|
113
|
-
* refusal is the more specific of the two, because it names the surface the
|
|
114
|
-
* author is writing against, so it marks the name refused and Core's stays
|
|
115
|
-
* unsaid. The mark is Core's own hook, which is what lets this pass take
|
|
116
|
-
* precedence without either side learning the other's roster.
|
|
117
|
-
*/
|
|
118
|
-
private rejectWebOwnedTypeNames;
|
|
119
|
-
/**
|
|
120
|
-
* WEB-C1: charter §14 promises that a key outside a keyed shape is a
|
|
121
|
-
* diagnostic rather than a silent no-op. Interpolated positions report while
|
|
122
|
-
* their interpolation is walked; static positions are collected during JSX
|
|
123
|
-
* inference and reported once every keyed interpolation is known.
|
|
124
|
-
*/
|
|
125
|
-
private reportStaticJsxKeys;
|
|
126
88
|
protected predeclareExtensionStatement(statement: Statement): boolean;
|
|
127
89
|
protected analyzeExtensionStatement(statement: Statement): boolean;
|
|
128
90
|
protected analyzeStatement(statement: Statement): void;
|
|
129
|
-
private directReadonlyPropMutation;
|
|
130
|
-
private rootBindingName;
|
|
131
91
|
protected prescanExtensionScopeDeclaration(statement: Statement): {
|
|
132
92
|
readonly name: string;
|
|
133
93
|
readonly span: Span;
|
|
134
94
|
} | null;
|
|
135
|
-
/**
|
|
136
|
-
* D71 rule 182: a derived value is reactive and read-only, which is exactly
|
|
137
|
-
* the reactive identity a component prop already carries — a bare read lowers
|
|
138
|
-
* through `.get()`, and nothing may write it. Registering that identity
|
|
139
|
-
* rather than `state` is what keeps `bind={doubled}` and every other writable
|
|
140
|
-
* position refusing a derived name for free.
|
|
141
|
-
*/
|
|
142
|
-
private analyzeComputedDeclaration;
|
|
143
|
-
/**
|
|
144
|
-
* True when `name` resolves to a `computed` declaration or to an imported one.
|
|
145
|
-
* The question is asked of the *binding* the name resolves to, never of the
|
|
146
|
-
* spelling: a local `state` may shadow an imported derived name, and that
|
|
147
|
-
* shadow is writable state.
|
|
148
|
-
*/
|
|
149
|
-
private isComputedBinding;
|
|
150
|
-
/**
|
|
151
|
-
* True when `name` resolves to a `resource` declaration. Asked of the binding
|
|
152
|
-
* rather than of the spelling, for the reason `isComputedBinding` is: a local
|
|
153
|
-
* `state` may shadow a resource's name, and the shadow is not a resource.
|
|
154
|
-
*/
|
|
155
|
-
private isResourceBinding;
|
|
156
|
-
private isImportedComputedBinding;
|
|
157
|
-
/**
|
|
158
|
-
* D71 rule 184: a cross-module `computed` travels through `reactiveExports`
|
|
159
|
-
* so its bare read lowers through `.get()` like an exported `state` — but it
|
|
160
|
-
* is not writable, and the imported binding must not inherit the writable
|
|
161
|
-
* identity that carries `bind={...}` and `event => name = ...`. The Web
|
|
162
|
-
* extension publishes which exported names are derived, so the import is
|
|
163
|
-
* demoted to the read-only reactive identity here.
|
|
164
|
-
*/
|
|
165
95
|
protected markDeclaredBindingReactive(name: string, kind?: "state" | "prop"): void;
|
|
166
96
|
protected inferExtensionExpression(expression: Expression, _contextualType: ValueType): ValueType | undefined;
|
|
167
97
|
protected inferExpression(expression: Expression, contextualType?: ValueType): ValueType;
|
|
168
|
-
/** Infers one builder slot and parks the answer in the probe cache, so the call's own analysis reads it back. */
|
|
169
|
-
private probedSlotType;
|
|
170
|
-
private writableStateName;
|
|
171
|
-
/**
|
|
172
|
-
* P2b-5: a `def` that answers markup and answers it with a component element.
|
|
173
|
-
*
|
|
174
|
-
* Everything about the shape is legal one step out. A component element is a
|
|
175
|
-
* legal module-level expression — `const root = <App />` is the instantiation
|
|
176
|
-
* site D90 R4-b rules on, and `mount` takes exactly the instance it evaluates
|
|
177
|
-
* to. A `def` answering markup is a legal markup helper — dispatch over a
|
|
178
|
-
* closed vocabulary is what the P2b wave was writing. The defect is only
|
|
179
|
-
* where the two meet, and it is a representation split the type does not
|
|
180
|
-
* carry: a component element in a *child* position lowers to `__velarChild`,
|
|
181
|
-
* which owns a scope and answers a DOM node, while the same element standing
|
|
182
|
-
* alone lowers to `__velarInstantiate`, which answers an instance. Both are
|
|
183
|
-
* typed `WebNode`; only one is one. Returned from a helper and handed to a
|
|
184
|
-
* render, the instance reaches `__velarAppend` and takes the whole subtree
|
|
185
|
-
* down with "JSX can render only text, finite numbers, bool, enums, WebNode
|
|
186
|
-
* values, and Lists of those values" — the check-green, runtime-dead shape.
|
|
187
|
-
*
|
|
188
|
-
* The walk stops at every JSX element, which is exactly where the emitter
|
|
189
|
-
* stops: inside one, every position is a child position and every component
|
|
190
|
-
* element there is already correct — `return <div><Badge /></div>` and an
|
|
191
|
-
* interpolated `{cond ? <Badge /> : ...}` both work today and must keep
|
|
192
|
-
* working. Only a component element the returned markup *starts* with is the
|
|
193
|
-
* defect, including one reached through a `.map(...)` answering a row per
|
|
194
|
-
* item, which fails the same way for the same reason.
|
|
195
|
-
*/
|
|
196
|
-
private rejectUnownedComponentElement;
|
|
197
|
-
/**
|
|
198
|
-
* The audit's seventh root cause: a `def` that declares reactive state and
|
|
199
|
-
* answers `WebNode` is a component wearing a function's clothes, and calling
|
|
200
|
-
* it bypasses exactly what the charter already refuses `View(...)` for. Two
|
|
201
|
-
* things follow from the call, both reproduced: every call runs the `state`
|
|
202
|
-
* declaration again, so the value resets on every re-render; and the
|
|
203
|
-
* observers the returned markup registers bind to whatever scope the call
|
|
204
|
-
* site was building — at module scope the global one, which is never
|
|
205
|
-
* destroyed, so they are never cleaned up.
|
|
206
|
-
*
|
|
207
|
-
* Only DECLARATION is refused. A `def -> WebNode` that merely reads state or a
|
|
208
|
-
* prop is a legitimate markup helper — examples/app has two — and a `def`
|
|
209
|
-
* nested inside a component binds its observers to that component's scope, so
|
|
210
|
-
* nothing about reading is defective.
|
|
211
|
-
*
|
|
212
|
-
* What answers "this `def` returns markup" is the sink, not one spelling of
|
|
213
|
-
* it: `-> WebNode?` and `-> List<WebNode>` are the shapes markup travels in,
|
|
214
|
-
* and a `def` may carry no return type at all — all three reached the same
|
|
215
|
-
* defect with the same body while only the bare annotation was read.
|
|
216
|
-
*/
|
|
217
|
-
private rejectStatefulWebNodeFunction;
|
|
218
|
-
/**
|
|
219
|
-
* D71 rule 182: a declared derived value is read bare, exactly like state.
|
|
220
|
-
* Calling one is the habit the retired `computed(...)` accessor taught, and it
|
|
221
|
-
* is also what a half-migrated project looks like from the importing side — so
|
|
222
|
-
* the answer names the one spelling and carries the edit that reaches it,
|
|
223
|
-
* which is what lets `velar fix` finish a migration that crosses modules.
|
|
224
|
-
*/
|
|
225
|
-
private calledComputedBinding;
|
|
226
|
-
/**
|
|
227
|
-
* D69 rule 178: a `watch` body that can never run is a block of statements
|
|
228
|
-
* the compile silently drops — the same defect a bare `5` is already rejected
|
|
229
|
-
* for (VEL4030), reached from a position the rule could not see.
|
|
230
|
-
*
|
|
231
|
-
* D90 R15(a) adds the third refusal and fixes the order the three are asked
|
|
232
|
-
* in. A frozen subject is answered before the shape rule so that one shape
|
|
233
|
-
* never draws two messages: a subject built only from frozen parts has no
|
|
234
|
-
* reactive source at all, and telling its author to declare a `computed`
|
|
235
|
-
* would only buy him a dead one. What survives both is either a path — the
|
|
236
|
-
* name of a reactive binding, or a member/index read out of one — or a
|
|
237
|
-
* computation, and a computation has a spelling of its own.
|
|
238
|
-
*
|
|
239
|
-
* The three refusals are separate because their causes are: a reader that was
|
|
240
|
-
* not called names a value that never moves, a frozen value has no reactive
|
|
241
|
-
* source behind it at all, and a computed subject has one but hides which.
|
|
242
|
-
*/
|
|
243
|
-
private rejectFrozenWatchSubject;
|
|
244
|
-
/**
|
|
245
|
-
* D114 W: the three watch shapes a compile can prove re-trigger the watch
|
|
246
|
-
* itself. D90 R21 removed the analysis of *who writes what* across calls, and
|
|
247
|
-
* nothing here brings it back: two watches writing one state are still an
|
|
248
|
-
* ordinary program, a write reached through an ordinary helper is still
|
|
249
|
-
* silent, and a write under `if`, `match`, a loop, `try`, a nested `def` or an
|
|
250
|
-
* arrow is still the author's converging correction to make.
|
|
251
|
-
*
|
|
252
|
-
* What is refused is only what is decided at the top of the body, with no
|
|
253
|
-
* condition to end it:
|
|
254
|
-
*
|
|
255
|
-
* - **B** the body writes the watched place itself (`watch count: count =
|
|
256
|
-
* count + 1`), assignment, compound assignment, or a mutating collection
|
|
257
|
-
* call on the watched collection;
|
|
258
|
-
* - **A2(a)** the subject is a `resource` field and the body reloads that
|
|
259
|
-
* same resource — a reload writes exactly those fields, so every completed
|
|
260
|
-
* load re-triggers the watch;
|
|
261
|
-
* - **A2(b)** the body starts an `action` or an `async def` of this module
|
|
262
|
-
* whose own top level writes the watched place. One hop, one module, no
|
|
263
|
-
* condition on either end; anything further is the runtime budget's.
|
|
264
|
-
*
|
|
265
|
-
* One diagnostic per watch, at the first statement that earns it. A watch with
|
|
266
|
-
* two of these has two mistakes, and the second is read after the first is
|
|
267
|
-
* fixed, exactly as two errors on one line are.
|
|
268
|
-
*/
|
|
269
|
-
private rejectWatchCycle;
|
|
270
|
-
/**
|
|
271
|
-
* D114 0.28.0 H-D1: the type of the place `steps` below the watched subject,
|
|
272
|
-
* or null when the walk cannot reach one.
|
|
273
|
-
*
|
|
274
|
-
* Only the steps the reactive graph publishes as part of the subject are
|
|
275
|
-
* walked — a record field and a collection element — because those are the
|
|
276
|
-
* writes a watch on the containing value is woken by. A step that leaves them
|
|
277
|
-
* (a class instance, a capability handle, a field the record does not declare)
|
|
278
|
-
* is not provably part of the subject, and a refusal that must be right every
|
|
279
|
-
* time answers no there rather than guessing.
|
|
280
|
-
*/
|
|
281
|
-
/**
|
|
282
|
-
* Whether a write `steps` below the watched subject, made the given way, is a
|
|
283
|
-
* write of the subject — the one definition both the body scan (VEL5077) and
|
|
284
|
-
* the one-hop writer scan (VEL5079) read. An assignment to a place the walk
|
|
285
|
-
* can reach is a write; a call is one only when the type at that depth is a
|
|
286
|
-
* collection and the call is on its own mutating roster.
|
|
287
|
-
*/
|
|
288
|
-
private watchSubjectWrite;
|
|
289
|
-
private reactivePlaceType;
|
|
290
|
-
/**
|
|
291
|
-
* D89 A4: records `list = list.map(item => {…})`, React's immutable update,
|
|
292
|
-
* where the callback builds a new record rather than changing a field.
|
|
293
|
-
*
|
|
294
|
-
* D90 R2 stands — `__velarKeyed` compares identity and that does not move,
|
|
295
|
-
* and the framework does not accommodate the idiom. This channel is not the
|
|
296
|
-
* framework taking responsibility; it is the compiler telling the author that
|
|
297
|
-
* the row he is typing into is about to be destroyed. Nothing is reported
|
|
298
|
-
* yet: the advisory is owed only if the rewritten list is what a keyed list
|
|
299
|
-
* renders, and the render usually sits below the update.
|
|
300
|
-
*/
|
|
301
|
-
private recordKeyedListRebuild;
|
|
302
|
-
/**
|
|
303
|
-
* D89 A4, the wider proven shape: the same churn written as a derived value.
|
|
304
|
-
* `computed rows = source.map(item => {…})` and `computed rows = build(...)`
|
|
305
|
-
* over a `for`/`append` builder both hand a keyed position a fresh record for
|
|
306
|
-
* every row on every recompute, which is exactly what the assignment shape
|
|
307
|
-
* does — the reconciliation wave compiled both and found only one of them
|
|
308
|
-
* named. It is one advisory with a wider proof, not a second code: the defect,
|
|
309
|
-
* the consequence, and the suppression are the same.
|
|
310
|
-
*
|
|
311
|
-
* A `const` in a component body is deliberately not here. It is constructed
|
|
312
|
-
* once, so its records never move, and advising it would be a guess rather
|
|
313
|
-
* than a proof.
|
|
314
|
-
*/
|
|
315
|
-
private recordDerivedKeyedListRebuild;
|
|
316
|
-
/**
|
|
317
|
-
* Whether a derived initializer constructs one fresh record per source
|
|
318
|
-
* element. Two spellings are proven and everything else is silent: a `map`
|
|
319
|
-
* whose callback answers a record literal — the same recognizer the
|
|
320
|
-
* assignment shape uses — and a call to a `def` this module declares whose
|
|
321
|
-
* whole answer is a list it filled with record literals.
|
|
322
|
-
*/
|
|
323
|
-
private rebuildsRecordsPerElement;
|
|
324
|
-
/**
|
|
325
|
-
* D89 A4: raises the advisory for the rebuilds whose list a keyed position
|
|
326
|
-
* really renders. The advisory channel cannot reach `this.diagnostics`, so
|
|
327
|
-
* nothing here fails a build, changes an emitted byte, or moves a semantic
|
|
328
|
-
* rule; `// velar-allow A4: <reason>` suppresses it where building the rows is
|
|
329
|
-
* the only spelling, which a `readonly` list or one API response makes it.
|
|
330
|
-
*/
|
|
331
|
-
private adviseKeyedListRebuilds;
|
|
332
|
-
/** A value that is read by calling it and takes no arguments to do so. */
|
|
333
|
-
private zeroArgumentReader;
|
|
334
|
-
/**
|
|
335
|
-
* True only for subjects built entirely from values the compile can see are
|
|
336
|
-
* frozen: literals, and non-reactive bindings whose type is a primitive, so no
|
|
337
|
-
* deep-reactive object can be hiding behind the name. Every member access,
|
|
338
|
-
* index, and call is excluded on purpose — `alias.done` on a const bound to a
|
|
339
|
-
* reactive element does track, and a call can read anything.
|
|
340
|
-
*/
|
|
341
|
-
private frozenWatchSubject;
|
|
342
|
-
/** A primitive holds no reactive identity, so a non-reactive binding of one is a snapshot. */
|
|
343
|
-
private frozenValueType;
|
|
344
|
-
/**
|
|
345
|
-
* D71 rule 182: a derived value has no writable location behind it, so the
|
|
346
|
-
* const message ("cannot assign to const binding") would name the wrong
|
|
347
|
-
* reason. Answering here means the reader is told what a derived value is and
|
|
348
|
-
* which spelling holds a value that is written.
|
|
349
|
-
*/
|
|
350
|
-
private rejectComputedAssignment;
|
|
351
|
-
/**
|
|
352
|
-
* D71 rule 183: `computed(...)` the function — the shape Vue and the signals
|
|
353
|
-
* libraries teach — is not how a derived value is written here; the `computed`
|
|
354
|
-
* declaration is. The declaration is recorded before the core walks the module
|
|
355
|
-
* so its reads can be matched against it — the rewrite that removes the call
|
|
356
|
-
* parentheses is only offered when every read is a plain `x()`.
|
|
357
|
-
*/
|
|
358
|
-
private recordRetiredAccessorDeclaration;
|
|
359
|
-
/** Returns true when the name is one of the retired accessor globals this pass owns. */
|
|
360
|
-
private recordRetiredAccessorRead;
|
|
361
|
-
/**
|
|
362
|
-
* D71 migration: one message per site, and a mechanical rewrite only where
|
|
363
|
-
* the compile can prove the rewrite. Where the
|
|
364
|
-
* accessor is used as a value there is no second spelling left to offer, so
|
|
365
|
-
* that site is told to declare the value and write an ordinary `def` where a
|
|
366
|
-
* callable is what the caller wants — and it gets no edit, because moving a
|
|
367
|
-
* reader out of a value position is the author's decision.
|
|
368
|
-
*/
|
|
369
|
-
private reportRetiredComputedFunction;
|
|
370
98
|
protected extensionFieldsOf(name: string): ReadonlyMap<string, ValueType> | null;
|
|
371
99
|
protected inferExtensionCall(callee: import("@velarscript/compiler/extension").ExtensionValueType, arguments_: readonly Expression[], argumentNames: readonly (string | null)[] | undefined, callSpan: Span): ValueType | undefined;
|
|
372
100
|
protected validateExtensionTypeSyntax(syntax: import("@velarscript/compiler/extension").TypeSyntax, validate: (syntax: import("@velarscript/compiler/extension").TypeSyntax) => boolean, resolve: (reference: TypeReference) => ValueType): boolean | undefined;
|
|
373
|
-
/**
|
|
374
|
-
* D43 item 69: a component body is a construction section, not a scope with
|
|
375
|
-
* an exit — its resources live until unmount. Ownership belongs to the
|
|
376
|
-
* lifecycle hook or to a function inside the component, so the setup section
|
|
377
|
-
* says so instead of releasing at the wrong moment.
|
|
378
|
-
*/
|
|
379
101
|
protected ownershipScopeRejection(): string | null;
|
|
380
|
-
/**
|
|
381
|
-
* D114 0.29.0 JX-I2: a component body has no function frame, so a `return` nested
|
|
382
|
-
* inside it — in a `match` arm, an `if`, a `for` — used to earn VEL3003 next to
|
|
383
|
-
* VEL5008 ("exactly one top-level return"), two rules its author can only read as
|
|
384
|
-
* contradicting each other. A lifecycle hook and a watch body are inside the same
|
|
385
|
-
* component and are *not* it: neither returns anything, so a `return` there keeps
|
|
386
|
-
* VEL3003.
|
|
387
|
-
*/
|
|
388
102
|
protected extensionOwnsFunctionlessReturn(): boolean;
|
|
389
103
|
protected invalidExtensionAwaitContext(): boolean;
|
|
390
104
|
protected invalidExtensionAwaitMessage(): string | null;
|
|
391
|
-
private componentType;
|
|
392
|
-
private analyzeResourceDeclaration;
|
|
393
|
-
private actionType;
|
|
394
|
-
private analyzeActionDeclaration;
|
|
395
|
-
private analyzeComponent;
|
|
396
|
-
private containsReadonlyView;
|
|
397
|
-
private validateComponentHandleType;
|
|
398
105
|
protected resolveAnnotation(reference: TypeReference | null): ValueType;
|
|
399
|
-
private normalizeComponentContracts;
|
|
400
|
-
private validateComponentHost;
|
|
401
|
-
private analyzeLookEntries;
|
|
402
|
-
/**
|
|
403
|
-
* LOK-D1: a `look:` literal is constructed once, where it is written. Its
|
|
404
|
-
* conditions and its values are snapshot positions — a reactive read inside
|
|
405
|
-
* one compiles cleanly and then never updates, which is the quietest trap in
|
|
406
|
-
* the visual language. The two spellings that stay live are the JSX
|
|
407
|
-
* expression position and the `look:property` directive, so the read is
|
|
408
|
-
* rejected here and both are taught.
|
|
409
|
-
*/
|
|
410
|
-
private reportLookSnapshotReads;
|
|
411
|
-
/**
|
|
412
|
-
* True when a name both belongs to a derived reactive declaration and still
|
|
413
|
-
* resolves to one here: a computed accessor is a zero-argument function, and a
|
|
414
|
-
* resource or action handle is a record with its reactive fields. An ordinary
|
|
415
|
-
* binding that happens to share the name — a function parameter, a local — is
|
|
416
|
-
* not a reactive read.
|
|
417
|
-
*/
|
|
418
|
-
private derivedReactiveRead;
|
|
419
|
-
/**
|
|
420
|
-
* LOK-U8: the velar/look builders check their numeric domains at run time, so
|
|
421
|
-
* a literal out-of-range colour used to compile clean and blank the page on
|
|
422
|
-
* the first paint. Literal arguments are checked in the same terms while the
|
|
423
|
-
* module compiles; dynamic arguments keep the runtime guard.
|
|
424
|
-
*/
|
|
425
|
-
private checkLookBuilderCall;
|
|
426
|
-
/**
|
|
427
|
-
* D103 rules 1 and 5 — what a checked token reference has to be at the site
|
|
428
|
-
* that writes it.
|
|
429
|
-
*
|
|
430
|
-
* The compiler cannot see a design system's values: no token stylesheet is an
|
|
431
|
-
* input to this compile, and the whole point of the contract is that the
|
|
432
|
-
* theme swaps values under the same names. So the reference itself is the
|
|
433
|
-
* only thing there is to check, and it is checked completely — a literal
|
|
434
|
-
* name, spelled as a CSS custom property identifier, and nothing else in the
|
|
435
|
-
* call. A computed name would leave a Look value with no checked part at all,
|
|
436
|
-
* which is the surface D50 rule 92 says is worse than none.
|
|
437
|
-
*/
|
|
438
|
-
private checkLookTokenCall;
|
|
439
|
-
/**
|
|
440
|
-
* D103 rule 4 — the migration off the one passthrough that used to work.
|
|
441
|
-
*
|
|
442
|
-
* The rewrite carries the `token` import when the module does not already
|
|
443
|
-
* have one, because a fix that leaves a module naming an unimported builder
|
|
444
|
-
* is not mechanical. A `var(--x, fallback)` reference has no rewrite: rule 5
|
|
445
|
-
* closed the contract against per-site fallbacks, so the message says that
|
|
446
|
-
* rather than offering a migration that would silently drop the fallback.
|
|
447
|
-
*/
|
|
448
|
-
private reportLookColorVarReference;
|
|
449
|
-
/** The one edit that gives this module a `token` import, in the shape D103's migration needs. */
|
|
450
|
-
private lookTokenImportEdit;
|
|
451
|
-
private checkAnimateBuilderCall;
|
|
452
|
-
private checkAnimationKeyword;
|
|
453
|
-
private analyzeKeyframes;
|
|
454
|
-
/** Whether a builder call this compile refused on its own arguments lies inside `sourceSpan`. */
|
|
455
|
-
private refusedBuilderCallWithin;
|
|
456
|
-
private reportKeyframeSnapshotReads;
|
|
457
|
-
/**
|
|
458
|
-
* D104 rule 2 — the wider half of the promise VEL5039 already made. A
|
|
459
|
-
* repeated property name is refused because the second entry overwrites the
|
|
460
|
-
* first and Look has no source order to settle which is meant; a shorthand
|
|
461
|
-
* beside a longhand it writes is the same defect with two spellings, and it
|
|
462
|
-
* is the one that hid thirty-six dead declarations in a consumer's shell.
|
|
463
|
-
* Reports once against the entry that completes the pair.
|
|
464
|
-
*/
|
|
465
|
-
private reportLookShorthandOverlap;
|
|
466
|
-
/**
|
|
467
|
-
* The same rule where the properties are written as element directives. A
|
|
468
|
-
* `look:` directive lowers to exactly the rule a block entry does, so an
|
|
469
|
-
* element carrying `look:padding` and `look:paddingTop` has the pair in the
|
|
470
|
-
* same scope as surely as a block does. The `style:` directives are not
|
|
471
|
-
* checked here: they compose one inline style object, where the browser's own
|
|
472
|
-
* source order settles the pair.
|
|
473
|
-
*/
|
|
474
|
-
private reportLookDirectiveOverlap;
|
|
475
|
-
/**
|
|
476
|
-
* Records one entry in its lowered scope (condition signature plus target) so
|
|
477
|
-
* two sibling blocks with the same condition report the property they both
|
|
478
|
-
* set. Returns false when the entry repeats. LOK-I4: the charter's duplicate
|
|
479
|
-
* promise used to hold only inside a single indented scope.
|
|
480
|
-
*/
|
|
481
|
-
private recordLookEntry;
|
|
482
|
-
/**
|
|
483
|
-
* The vocabulary checks a Look property shares between the block spelling and
|
|
484
|
-
* the `look:`/`style:` directives. Returns false when the entry is already
|
|
485
|
-
* reported and its value needs no further checking. LOK-I1: an unrecognized
|
|
486
|
-
* property no longer co-reports a `stringType` fallback assignment error.
|
|
487
|
-
*/
|
|
488
|
-
private analyzeLookValue;
|
|
489
|
-
/** Whether this value is written as a call to the module's `token` builder, alias included. */
|
|
490
|
-
private isLookTokenCall;
|
|
491
|
-
/**
|
|
492
|
-
* A complete CSS filter function whose arguments fit the checked Look
|
|
493
|
-
* builders has one equivalent source spelling. The parser deliberately
|
|
494
|
-
* stops at the first function or argument grammar it cannot prove, leaving
|
|
495
|
-
* arbitrary CSS and externally defined filter functions as ordinary text.
|
|
496
|
-
*/
|
|
497
|
-
private adviseLookFilterSpelling;
|
|
498
|
-
/** Uses an existing alias when present and lists only builders the fix must import. */
|
|
499
|
-
private localizeLookBuilderCall;
|
|
500
|
-
/** Rewrites either a Look entry expression or the synthetic value of a JSX Look directive. */
|
|
501
|
-
private lookBuilderRewrite;
|
|
502
|
-
/** Adds missing builders to the module's one velar/look import in stable order. */
|
|
503
|
-
private lookBuilderImportEdit;
|
|
504
|
-
/** How this module spells a call to the token builder, honouring an aliased import. */
|
|
505
|
-
private lookTokenCallText;
|
|
506
|
-
/**
|
|
507
|
-
* The edits that replace one written Look value with the checked token call,
|
|
508
|
-
* in the spelling of the site that wrote it.
|
|
509
|
-
*
|
|
510
|
-
* A `look:property="text"` directive is analyzed through a synthetic literal
|
|
511
|
-
* standing for the whole attribute, so the rewrite replaces the attribute:
|
|
512
|
-
* splicing a call between an attribute's quotes is not JSX, and a fix that
|
|
513
|
-
* produces a parse error is not a mechanical fix. The `look:property={...}`
|
|
514
|
-
* spelling carries a real expression whose span is the value alone, and is
|
|
515
|
-
* rewritten in place like a block entry.
|
|
516
|
-
*/
|
|
517
|
-
private lookTokenRewrite;
|
|
518
|
-
/**
|
|
519
|
-
* D103 rule 4, free-text half — an advisory rather than a refusal.
|
|
520
|
-
*
|
|
521
|
-
* `fontFamily`, `backdropFilter` and the other free-text kinds accept
|
|
522
|
-
* arbitrary CSS text by construction, and a `var()` inside a larger value is
|
|
523
|
-
* a legitimate spelling with no single token to rewrite it to: the tail of a
|
|
524
|
-
* font stack, one layer of a filter list. Refusing there would refuse real
|
|
525
|
-
* CSS. What is advised is the narrow case where the *whole* value is one
|
|
526
|
-
* reference, because there `token("--name")` is the checked spelling of the
|
|
527
|
-
* same thing and the rewrite is unambiguous — which is the bar the `A`
|
|
528
|
-
* roster is written to.
|
|
529
|
-
*/
|
|
530
|
-
private adviseLookTokenSpelling;
|
|
531
|
-
/**
|
|
532
|
-
* `subject` names the position in the message. It is the property itself
|
|
533
|
-
* everywhere except the `transition(...)` builder, whose first argument takes
|
|
534
|
-
* `transitionProperty`'s vocabulary but is not written as that property — a
|
|
535
|
-
* refusal that named the longhand there would name a spelling the author
|
|
536
|
-
* never wrote.
|
|
537
|
-
*/
|
|
538
|
-
private validateLookStringVocabulary;
|
|
539
|
-
/**
|
|
540
|
-
* D65 rule 168 closed the closed sets against misspelled literals, and D65
|
|
541
|
-
* item 3 makes a `const` string a first-class design token — so the two have
|
|
542
|
-
* to agree. A name or a record field that folds to a bare CSS keyword is
|
|
543
|
-
* checked exactly as the literal spelling of it is; anything that folds to
|
|
544
|
-
* composed CSS text (a builder result, a unit, a gradient) is not a keyword
|
|
545
|
-
* and is left to the type and to the builder's own checks.
|
|
546
|
-
*/
|
|
547
|
-
private foldedLookKeyword;
|
|
548
|
-
/**
|
|
549
|
-
* LOK-D3: a bare number on a length property reaches CSS as a declaration the
|
|
550
|
-
* browser discards. The union already rejects it; this diagnostic replaces the
|
|
551
|
-
* union dump with the unit the author meant to write.
|
|
552
|
-
*/
|
|
553
|
-
private reportLookNumberWithoutUnit;
|
|
554
|
-
private inferLookCondition;
|
|
555
|
-
private checkViewportThreshold;
|
|
556
|
-
private inferJsx;
|
|
557
|
-
/**
|
|
558
|
-
* WEB-S3: `srcdoc` builds a whole document out of a string, and that document
|
|
559
|
-
* inherits this page's origin — so it is a second raw-HTML boundary next to
|
|
560
|
-
* the one the charter names (`unsafe:html`), reachable with no marker at all.
|
|
561
|
-
* The marker this one gets is `sandbox`, because sandbox is what actually
|
|
562
|
-
* takes the origin away; requiring it makes the boundary visible where it is
|
|
563
|
-
* crossed. `allow-scripts allow-same-origin` together hands the origin back,
|
|
564
|
-
* so the pair is refused by name rather than accepted as a sandbox.
|
|
565
|
-
*/
|
|
566
|
-
private reportIframeSrcdocSandbox;
|
|
567
|
-
/**
|
|
568
|
-
* WEB-S2: the analyzer already refuses an anchor that opens a window without
|
|
569
|
-
* 'noopener', so a URL attribute whose value is a script scheme cannot be the
|
|
570
|
-
* one URL question it declines to ask. A written-down URL is answered here; a
|
|
571
|
-
* value that arrives at run time is answered by the runtime attribute check.
|
|
572
|
-
*/
|
|
573
|
-
private reportUrlAttributeScheme;
|
|
574
|
-
private checkKeyedInterpolation;
|
|
575
|
-
private reportIneffectiveJsxKeys;
|
|
576
|
-
private analyzeComponentElement;
|
|
577
|
-
/**
|
|
578
|
-
* The `look=` attribute on either host kind. A Look block written inline is
|
|
579
|
-
* reported without inferring its entries, so the one directive-level message
|
|
580
|
-
* stands alone; an empty list names the accepted family rather than rendering
|
|
581
|
-
* `List<unknown>` (LOK-I3, LOK-I6).
|
|
582
|
-
*/
|
|
583
|
-
private analyzeJsxLookAttribute;
|
|
584
|
-
/**
|
|
585
|
-
* Composition is how a Look overrides another one: `...baseLook` puts the two
|
|
586
|
-
* in an order the reader can see, and everything after it wins. Two looks
|
|
587
|
-
* placed side by side on one element state no order at all, so a property both
|
|
588
|
-
* of them set has no answer the source gives — the winner used to fall out of
|
|
589
|
-
* whichever rule the stylesheet happened to carry last. The shape is refused
|
|
590
|
-
* rather than ordered by fiat, and the refusal names the spelling that states
|
|
591
|
-
* the order the author meant.
|
|
592
|
-
*/
|
|
593
|
-
private reportIndependentLookCollisions;
|
|
594
|
-
private analyzeComponentRef;
|
|
595
|
-
private analyzeNativeJsxAttribute;
|
|
596
|
-
/**
|
|
597
|
-
* A14: `condition ? "true" : "false"` is the expanded spelling of the Core
|
|
598
|
-
* text conversion `str(condition)`. Keep that conversion explicit at a DOM
|
|
599
|
-
* text boundary instead of teaching every attribute its own coercion rule.
|
|
600
|
-
*
|
|
601
|
-
* The rule does not reach component props or HTML bool-presence attributes.
|
|
602
|
-
* A string "false" keeps such an attribute present; accepting that spelling
|
|
603
|
-
* as canonical would hide a likely presence bug whose direct expression is
|
|
604
|
-
* the bool itself.
|
|
605
|
-
*/
|
|
606
|
-
private adviseNativeBooleanTextConversion;
|
|
607
|
-
/** Directives and compiler-owned control attributes do not use DOM text conversion. */
|
|
608
|
-
private plainNativeTextAttribute;
|
|
609
|
-
/**
|
|
610
|
-
* D90 coherence-3: DOM attribute names and ARIA are documented as checked
|
|
611
|
-
* surfaces, and nothing checked them — `className="panel"` compiled clean and
|
|
612
|
-
* emitted a dead attribute, while the sibling React reflex `onClick=` on the
|
|
613
|
-
* same element was already refused. So a model got a clean bill of health on
|
|
614
|
-
* exactly the half of its React habit that silently breaks the page.
|
|
615
|
-
*
|
|
616
|
-
* The rule diagnoses names that are KNOWN wrong, never names that are merely
|
|
617
|
-
* unknown. HTML lets a document carry attributes no roster can enumerate, so
|
|
618
|
-
* `foo="bar"`, `data-*`, and a framework's own prefixes stay legal; a false
|
|
619
|
-
* positive there would block a correct program, which is worse than the
|
|
620
|
-
* silence it replaces. Three closed rosters answer three closed questions:
|
|
621
|
-
* the React / JavaScript-property spellings, the ARIA attribute names (ARIA,
|
|
622
|
-
* unlike HTML, admits no custom names), and the ARIA and role vocabularies.
|
|
623
|
-
*
|
|
624
|
-
* D61 bounds the value half. Every native attribute uses the same presence
|
|
625
|
-
* rule: false/null remove it, true writes an empty value, and strings carry
|
|
626
|
-
* literal text. A token vocabulary is therefore read only against a string
|
|
627
|
-
* literal; expression values are runtime questions. A14 separately shortens
|
|
628
|
-
* an explicit bool-to-text conditional to `str(bool)` when that rewrite is
|
|
629
|
-
* provably equivalent.
|
|
630
|
-
*
|
|
631
|
-
* Returns true when it reported, so the caller does not stack a value-shape
|
|
632
|
-
* message on an attribute whose name is already answered.
|
|
633
|
-
*/
|
|
634
|
-
private reportNativeAttributeSpelling;
|
|
635
|
-
/**
|
|
636
|
-
* GRM-A4: an event handler runs for effect and returns null. The hole this
|
|
637
|
-
* closes is `on:click={() => {}}`: after a fat arrow, braces build a record,
|
|
638
|
-
* never a block, so the empty-record factory used to be accepted as a handler
|
|
639
|
-
* and silently did nothing on every click.
|
|
640
|
-
*/
|
|
641
|
-
private checkEventHandlerResult;
|
|
642
|
-
/**
|
|
643
|
-
* D47 rule 84(A): a bind target is a writable reactive location — a state
|
|
644
|
-
* name, or a record-field / List-index / Map-key path rooted in one. A
|
|
645
|
-
* computed accessor, a const, and a function result stay rejected: nothing
|
|
646
|
-
* would receive the write.
|
|
647
|
-
*/
|
|
648
|
-
private isWritableBindTarget;
|
|
649
|
-
/**
|
|
650
|
-
* Walks a member/index path inward to its root state binding, checking every
|
|
651
|
-
* segment is a writable location: a declared record field, a List element, or
|
|
652
|
-
* a Map value. Returns the root state name, or null when the path is not a
|
|
653
|
-
* writable reactive location.
|
|
654
|
-
*/
|
|
655
|
-
private bindPathRoot;
|
|
656
|
-
/**
|
|
657
|
-
* D47 rule 84: `bind:group` binds a set of inputs that share one decision.
|
|
658
|
-
* A radio group holds the selected input's `value`; a checkbox group holds the
|
|
659
|
-
* checked values as a List<string>, so checking and unchecking are membership
|
|
660
|
-
* changes.
|
|
661
|
-
*/
|
|
662
|
-
private analyzeBindGroup;
|
|
663
|
-
private eventAssignedStateBinding;
|
|
664
|
-
private isLookInput;
|
|
665
|
-
private isClassInput;
|
|
666
|
-
private isJsxRenderable;
|
|
667
106
|
/**
|
|
668
|
-
*
|
|
669
|
-
*
|
|
670
|
-
*
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* or refuses a non-finite number. An enum member is text at runtime and is
|
|
675
|
-
* assignable to `string`, so it rides the same branch it always did.
|
|
676
|
-
*
|
|
677
|
-
* Everything else stays on the full dynamic region, and the reason is always
|
|
678
|
-
* the same one: it does not render as *one* node.
|
|
679
|
-
* - `bool` renders **zero** nodes (`__velarAppend` returns on `true`/`false`),
|
|
680
|
-
* so a text node would be an added child where an element previously had
|
|
681
|
-
* none — observable to `:empty`, to `childNodes`, and to anything that
|
|
682
|
-
* walks them.
|
|
683
|
-
* - An optional of either renders zero nodes when null and one when present,
|
|
684
|
-
* so it needs an anchor to come back to.
|
|
685
|
-
* - `WebNode`, lists, unions, `any` and every named type can hold markup or
|
|
686
|
-
* several nodes, which is what the comment pair exists to bracket.
|
|
687
|
-
*
|
|
688
|
-
* Widening this set is a semantic ruling, not an optimisation: it would
|
|
689
|
-
* change the node count of a rendered document.
|
|
107
|
+
* The one host the `analysis/` collaborators read this analyzer through,
|
|
108
|
+
* built here because a `private` member cannot be read outside the class it is
|
|
109
|
+
* declared in (TS2341, D114 line 512). Every table the walk replaces once per
|
|
110
|
+
* program and every depth a collaborator moves arrives as an accessor pair, so
|
|
111
|
+
* a collaborator reads the live value and keeps its own `host.jsxDepth += 1`
|
|
112
|
+
* text.
|
|
690
113
|
*/
|
|
691
|
-
private
|
|
692
|
-
private isJsxAttributeValue;
|
|
693
|
-
private isOptionalString;
|
|
114
|
+
private analysisHost;
|
|
694
115
|
/**
|
|
695
|
-
* The
|
|
696
|
-
*
|
|
697
|
-
*
|
|
698
|
-
*
|
|
699
|
-
* of the same value, reaches the same runtime position, and until now was
|
|
700
|
-
* checked by nothing: `{path: "no-leading-slash", component: 5}` compiled
|
|
701
|
-
* clean and handed `5` to the Router as a component. Closing the sink rather
|
|
702
|
-
* than the spelling means asking the same questions wherever a route arrives,
|
|
703
|
-
* so this reports exactly what `route(...)` reports, word for word.
|
|
704
|
-
*
|
|
705
|
-
* The runtime is already the second referee (D90 R19): `routerTable`
|
|
706
|
-
* validates every path and refuses a component that is not callable. Nothing
|
|
707
|
-
* here changes which programs run — it moves a refusal the author would have
|
|
708
|
-
* met at mount to the place the source shows the mistake.
|
|
709
|
-
*
|
|
710
|
-
* The `any` component slot is skipped here rather than inside
|
|
711
|
-
* `checkWebRouteComponent`, which is why that method carries no `any` arm:
|
|
712
|
-
* this loop and the Router `fallback` attribute are its only two callers, and
|
|
713
|
-
* both filter first. An `any` reaches this slot for real — `web.lazy` answers
|
|
714
|
-
* `anyType` from each of its error paths — and it arrives with the author's
|
|
715
|
-
* real message already reported, so a second "received any" would be a
|
|
716
|
-
* cascade. The `route(...)` twin skips it for the same reason.
|
|
116
|
+
* The base-analyzer operations the collaborators perform, bound to this
|
|
117
|
+
* analyzer. They are their own object because they are plain function values:
|
|
118
|
+
* spreading them into the host above copies the bindings, while an accessor
|
|
119
|
+
* has to be written in the literal that becomes the host.
|
|
717
120
|
*/
|
|
718
|
-
private
|
|
719
|
-
private checkWebRouteComponent;
|
|
720
|
-
private analyzeInlineVisualAttribute;
|
|
121
|
+
private analyzerOperations;
|
|
721
122
|
}
|
|
722
123
|
//# sourceMappingURL=analyzer.d.ts.map
|