@astryxdesign/cli 0.7.6-canary.52b8f55 → 0.7.6-canary.53b86f3

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.
@@ -109,7 +109,7 @@ export const docs = {
109
109
  content: [
110
110
  {
111
111
  type: 'prose',
112
- text: 'Some users experience motion sensitivity; animation that feels polished to one person can cause discomfort for another. Astryx components already switch to instant changes when the OS reduced-motion setting is on. Do the same in your own animations with `@media (prefers-reduced-motion: reduce)`.',
112
+ text: 'Some users experience motion sensitivity; animation that feels polished to one person can cause discomfort for another. When the OS reduced-motion setting is on, Astryx components change at once under a mouse or trackpad, and under a finger they cross-fade instead of moving: opacity only, in 200 ms or less. A value that changes in place, such as a progress fill, takes its new value at once under any pointer. Do the same in your own animations with `@media (prefers-reduced-motion: reduce)`, adding `(pointer: coarse)` for the touch cross-fade.',
113
113
  },
114
114
  ],
115
115
  },
@@ -26,6 +26,16 @@
26
26
 
27
27
  import * as fs from 'node:fs';
28
28
  import * as path from 'node:path';
29
+ import {fileStamp, recordContentRead} from '../fs/read-record.mjs';
30
+
31
+ /**
32
+ * What `isAmbient` found for each file, per TypeScript, kept while the
33
+ * file's stamp (`fileStamp`) is the same. A process that compares a package
34
+ * more than once reads the same config each time, and reading a file the way
35
+ * TypeScript does costs far more than a stat.
36
+ * @type {WeakMap<object, Map<string, {stamp: string, ambient: boolean}>>}
37
+ */
38
+ const ambientByFile = new WeakMap();
29
39
 
30
40
  /**
31
41
  * Whether a file the config includes declares types every file sees: a
@@ -36,6 +46,30 @@ import * as path from 'node:path';
36
46
  */
37
47
  function isAmbient(ts, file) {
38
48
  if (/\.d\.[cm]?ts$/.test(file)) return true;
49
+ // A kept answer still counts as reading the file, so an operation that
50
+ // keeps its own result while what it read is unchanged sees a change to it.
51
+ recordContentRead(file);
52
+ const stamp = fileStamp(file);
53
+ if (stamp === '-') return false;
54
+ let known = ambientByFile.get(ts);
55
+ if (known == null) {
56
+ known = new Map();
57
+ ambientByFile.set(ts, known);
58
+ }
59
+ const key = path.resolve(file);
60
+ const seen = known.get(key);
61
+ if (seen && seen.stamp === stamp) return seen.ambient;
62
+ const ambient = readAmbient(ts, file);
63
+ known.set(key, {stamp, ambient});
64
+ return ambient;
65
+ }
66
+
67
+ /**
68
+ * `isAmbient` for a file that is not a declaration file, read afresh.
69
+ * @param {any} ts
70
+ * @param {string} file
71
+ */
72
+ function readAmbient(ts, file) {
39
73
  let text;
40
74
  try {
41
75
  text = fs.readFileSync(file, 'utf8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.6-canary.52b8f55",
3
+ "version": "0.7.6-canary.53b86f3",
4
4
  "displayName": "CLI",
5
5
  "description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
6
6
  "author": "Meta Open Source",
@@ -124,10 +124,10 @@
124
124
  "zod": "^4.4.3"
125
125
  },
126
126
  "peerDependencies": {
127
- "@astryxdesign/charts": "0.7.6-canary.52b8f55",
128
- "@astryxdesign/core": "0.7.6-canary.52b8f55",
129
- "@astryxdesign/lab": "0.7.6-canary.52b8f55",
130
- "@astryxdesign/theme-neutral": "0.7.6-canary.52b8f55"
127
+ "@astryxdesign/charts": "0.7.6-canary.53b86f3",
128
+ "@astryxdesign/core": "0.7.6-canary.53b86f3",
129
+ "@astryxdesign/lab": "0.7.6-canary.53b86f3",
130
+ "@astryxdesign/theme-neutral": "0.7.6-canary.53b86f3"
131
131
  },
132
132
  "peerDependenciesMeta": {
133
133
  "@astryxdesign/charts": {
@@ -144,10 +144,10 @@
144
144
  }
145
145
  },
146
146
  "devDependencies": {
147
- "@astryxdesign/charts": "0.7.6-canary.52b8f55",
148
- "@astryxdesign/core": "0.7.6-canary.52b8f55",
149
- "@astryxdesign/lab": "0.7.6-canary.52b8f55",
150
- "@astryxdesign/theme-neutral": "0.7.6-canary.52b8f55",
147
+ "@astryxdesign/charts": "0.7.6-canary.53b86f3",
148
+ "@astryxdesign/core": "0.7.6-canary.53b86f3",
149
+ "@astryxdesign/lab": "0.7.6-canary.53b86f3",
150
+ "@astryxdesign/theme-neutral": "0.7.6-canary.53b86f3",
151
151
  "@heroicons/react": "^2.2.0",
152
152
  "@stylexjs/stylex": "^0.19.0",
153
153
  "@types/babel__core": "^7.20.5",
@@ -155,6 +155,7 @@
155
155
  "recharts": "^3.9.2"
156
156
  },
157
157
  "scripts": {
158
+ "api:report": "node ../../scripts/api-report/cli.mjs --package .",
158
159
  "astryx": "node clients/cli/bin/astryx.mjs",
159
160
  "postinstall": "node scripts/postinstall.mjs",
160
161
  "test": "cd ../.. && vitest run packages/cli",