@geastack/geatsc-plugin-gea 0.1.26 → 0.1.27

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.
@@ -1,5 +1,6 @@
1
1
  export declare const nodeAnalysisVersion = "node-analysis-v1";
2
2
  export declare const nodeFeatures: readonly ["node-images", "node-inputs"];
3
3
  export declare const videoNodeAnalysisVersion = "node-video-analysis-v1";
4
+ export declare const svgNodeAnalysisVersion = "node-svg-analysis-v1";
4
5
  export declare function addUnknownNodeFeatures(features: Set<string>): void;
5
6
  export declare function addNodeFeatures(file: string, text: string, features: Set<string>): void;
@@ -4,6 +4,9 @@ export const nodeFeatures = ['node-images', 'node-inputs'];
4
4
  // Separate marker: an analyzer without it never reports node-videos, and its
5
5
  // absence must not let a newer CLI drop the video host from the firmware.
6
6
  export const videoNodeAnalysisVersion = 'node-video-analysis-v1';
7
+ // Same contract for inline SVG: only an analyzer carrying this marker may
8
+ // prove that no <svg> exists and let the CLI compile the SVG element out.
9
+ export const svgNodeAnalysisVersion = 'node-svg-analysis-v1';
7
10
  const nodeFreeCoreExports = new RegExp('^(?:' + [
8
11
  'Component', 'ReactiveComponent', 'Store', 'mount', 'Display', 'rgb', 'rgba',
9
12
  'touch', 'Input', 'Accelerometer', 'Magnetometer', 'Geolocation', 'geolocation', 'Clock', 'Battery', 'Memory', 'Profiler',
@@ -16,6 +19,7 @@ export function addUnknownNodeFeatures(features) {
16
19
  for (const feature of nodeFeatures)
17
20
  features.add(feature);
18
21
  features.add('node-videos');
22
+ features.add('node-svg');
19
23
  }
20
24
  // Native node payloads are selected from the whole discovered source graph.
21
25
  // CSS rendering features remain independent: a background image does not make
@@ -32,6 +36,10 @@ export function addNodeFeatures(file, text, features) {
32
36
  features.add('node-inputs');
33
37
  if (/^video$/i.test(value) || /^(?:VideoElement|HTMLVideoElement|createVideo)$/.test(value))
34
38
  features.add('node-videos');
39
+ // Shapes draw only inside an <svg> root, so the root tag is the proof.
40
+ // (`path`, `rect`, `line` are everyday identifiers and would prove nothing.)
41
+ if (/^svg$/i.test(value) || /^SVG[A-Z]\w*Element$/.test(value))
42
+ features.add('node-svg');
35
43
  };
36
44
  const visit = (node) => {
37
45
  if (ts.isIdentifier(node)) {
package/dist/analyze.js CHANGED
@@ -7,7 +7,7 @@ import { analyzeClassCapacity } from './analyze-classes.js';
7
7
  import ts from 'typescript';
8
8
  import path from 'node:path';
9
9
  import { createRequire } from 'node:module';
10
- import { nodeAnalysisVersion, videoNodeAnalysisVersion, addNodeFeatures, addUnknownNodeFeatures } from './analyze-nodes.js';
10
+ import { nodeAnalysisVersion, videoNodeAnalysisVersion, svgNodeAnalysisVersion, addNodeFeatures, addUnknownNodeFeatures } from './analyze-nodes.js';
11
11
  import { cssRangeObserver } from './analyze-css-ranges.js';
12
12
  import { cssAnalysisVersion, cssUsageObserver, addUnknownCssFeatures } from './analyze-css.js';
13
13
  import { addRendererFeatures, addUnknownRendererFeatures, rendererAnalysisVersion, rendererOcclusionAnalysisVersion, rendererVariableAnalysis } from './analyze-renderer.js';
@@ -32,7 +32,7 @@ export function capabilitiesToAnalyzePatch(capabilities) {
32
32
  // connection with "No server verification option set".
33
33
  export function analyzeSourceHostBindings(entry) {
34
34
  const bindings = new Set();
35
- const features = new Set([rendererAnalysisVersion, rendererOcclusionAnalysisVersion, cssAnalysisVersion, nodeAnalysisVersion, videoNodeAnalysisVersion, nodeAuxVersion]);
35
+ const features = new Set([rendererAnalysisVersion, rendererOcclusionAnalysisVersion, cssAnalysisVersion, nodeAnalysisVersion, videoNodeAnalysisVersion, svgNodeAnalysisVersion, nodeAuxVersion]);
36
36
  const discovery = discoverSourceFiles(entry);
37
37
  const classSources = new Map();
38
38
  let classUnknown = discovery.unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/geatsc-plugin-gea",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "Gea IR backend plugin for geatsc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {