@geastack/cli 0.1.105 → 0.1.107

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/cli",
3
- "version": "0.1.105",
3
+ "version": "0.1.107",
4
4
  "description": "Command-line front door for GeaStack apps, targets, and local toolchains.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@clack/prompts": "^1.8.0",
40
40
  "@geastack/simulator": "^0.1.15",
41
- "@geastack/targets": "^0.1.105",
41
+ "@geastack/targets": "^0.1.107",
42
42
  "picocolors": "^1.1.1",
43
43
  "serialport": "^13.0.0"
44
44
  },
@@ -83,16 +83,38 @@ function linkTarget(file) {
83
83
  }
84
84
  }
85
85
 
86
+ function traversable(link) {
87
+ try {
88
+ readdirSync(link)
89
+ return true
90
+ } catch {
91
+ return false
92
+ }
93
+ }
94
+
86
95
  // Makes buildDir a junction to binaryDir. An existing link to it is kept, so
87
96
  // the build is incremental. Anything else at buildDir -- a build from before
88
97
  // builds moved, or a link to another directory -- is replaced; its CMake
89
98
  // cache names a different binary directory, so it could not be reused. When
90
99
  // buildDir is missing (deleted to force a clean build), binaryDir starts
91
100
  // empty as well, so deleting the build directory still means a clean build.
101
+ //
102
+ // A link to the right directory that this process cannot follow is made again,
103
+ // keeping what it points at. Windows marks a junction made by a sandboxed or
104
+ // lower-integrity process as an untrusted mount point, and refuses to traverse
105
+ // it from any other (ERROR_UNTRUSTED_MOUNT_POINT, which Node reports as
106
+ // UNKNOWN): a build first run from such a shell left a link every later build
107
+ // failed on, at its first write through it.
92
108
  export function linkEsp32BinaryDir(buildDir, binaryDir, log = () => {}) {
93
109
  if (binaryDir === buildDir) return
94
110
  const current = linkTarget(buildDir)
95
- if (current !== null && windowsPathKey(current) === windowsPathKey(binaryDir) && existsSync(binaryDir)) return
111
+ if (current !== null && windowsPathKey(current) === windowsPathKey(binaryDir) && existsSync(binaryDir)) {
112
+ if (traversable(buildDir)) return
113
+ log(`Re-creating ${buildDir}: this process cannot follow the link there`)
114
+ unlinkSync(buildDir)
115
+ symlinkSync(binaryDir, buildDir, 'junction')
116
+ return
117
+ }
96
118
  if (current !== null) {
97
119
  unlinkSync(buildDir)
98
120
  } else if (existsSync(buildDir)) {
@@ -95,6 +95,9 @@ const rangeFamilies = ['padding', 'gap', 'border', 'radius', 'font', 'line-heigh
95
95
  const compactStyleDefines = [['css-line-height', 'GEA_CSS_LINE_HEIGHT'], ['css-display-explicit', 'GEA_CSS_DISPLAY_EXPLICIT']]
96
96
  const nodeAuxFeatureDefines = [['node-listeners', 'GEA_UI_NODE_LISTENERS'], ['node-attributes', 'GEA_UI_NODE_ATTRIBUTES'], ['node-default-styles', 'GEA_UI_DEFAULT_STYLES']]
97
97
  const nodeFeatureDefines = [['node-images', 'GEA_UI_IMAGE_NODES'], ['node-inputs', 'GEA_UI_INPUT_NODES']]
98
+ // A separate marker: analyzers older than it never report node-videos.
99
+ const videoNodeAnalysis = 'node-video-analysis-v1'
100
+ const videoNodeMacro = 'GEA_UI_VIDEO_NODES'
98
101
  const rangeMacro = family => `GEA_CSS_U8_${family.replaceAll('-', '_').toUpperCase()}`
99
102
 
100
103
  export function withRendererFeatureDefines(defines, features, { devicePixelRatio } = {}) {
@@ -102,11 +105,13 @@ export function withRendererFeatureDefines(defines, features, { devicePixelRatio
102
105
  // version marker is not proof of unreachability: retain engine defaults.
103
106
  const generatedNames = new Set([...rendererFeatureDefines, ...cssFeatureVersions.flat(), ...nodeFeatureDefines, ...nodeAuxFeatureDefines, ...compactStyleDefines].map(([, name]) => name).concat(triangleOcclusionMacro, circleCacheMacros, rangeFamilies.map(rangeMacro), ['GEA_UI_CLASS_INLINE_TOKENS', 'GEA_UI_CLASS_OVERFLOW']))
104
107
  generatedNames.add('GEA_RUNTIME_REALMS')
108
+ generatedNames.add(videoNodeMacro)
105
109
  const result = defines.split(';').filter((define) => define && !generatedNames.has(define.split('=')[0]))
106
110
  if (features.includes('worker-realms')) result.push('GEA_RUNTIME_REALMS=1')
107
111
  if (features.includes('node-analysis-v1')) {
108
112
  for (const [feature, name] of nodeFeatureDefines) result.push(`${name}=${features.includes(feature) ? 1 : 0}`)
109
113
  }
114
+ if (features.includes(videoNodeAnalysis)) result.push(`${videoNodeMacro}=${features.includes('node-videos') ? 1 : 0}`)
110
115
  const storageProofs = features.filter(feature => feature.startsWith('css-storage-'))
111
116
  if (storageProofs.length && storageProofs.every(proof => proof === 'css-storage-v1')) {
112
117
  for (const [feature, name] of compactStyleDefines)
@@ -29,13 +29,14 @@ export function nativeCircleSourceNeedsSupport(text) {
29
29
  }
30
30
 
31
31
  export function withNativeCssFeatures(app, features) {
32
- if (!features.includes('renderer-occlusion-v1') && !features.includes('node-analysis-v1') && !features.includes('node-aux-v1') && !features.includes('css-storage-v1') && !features.some(feature => /^node-class-capacity-v1-[123]$/.test(feature)) && !features.some(feature => /^css-analysis-v(?:[1-9]|1[0123456789])$/.test(feature))) return features
32
+ if (!features.includes('renderer-occlusion-v1') && !features.includes('node-analysis-v1') && !features.includes('node-video-analysis-v1') && !features.includes('node-aux-v1') && !features.includes('css-storage-v1') && !features.some(feature => /^node-class-capacity-v1-[123]$/.test(feature)) && !features.some(feature => /^css-analysis-v(?:[1-9]|1[0123456789])$/.test(feature))) return features
33
33
  const sources = app.nativeSources || []
34
34
  const components = app.targetConfig?.esp32?.componentDirs || []
35
35
  if (!sources.length && !components.length) return features
36
36
  // The TS proof cannot bound custom native triangle producers, including
37
- // rendering hidden behind external headers or callback registration.
38
- features = [...new Set([...features, 'renderer-occlusion-triangles', 'node-listeners', 'node-attributes', 'node-default-styles'])]
37
+ // rendering hidden behind external headers or callback registration. Native
38
+ // code can also drive the video host directly.
39
+ features = [...new Set([...features, 'renderer-occlusion-triangles', 'node-listeners', 'node-attributes', 'node-default-styles', 'node-videos'])]
39
40
  // Opaque native CSS writes can supply gradient/transform values even when
40
41
  // every source-visible custom property is a literal colour. Keep their
41
42
  // renderer caches as well as semantic fields.