@astryxdesign/cli 0.7.14-canary.g05da5aa → 0.7.14-canary.gfb823d9

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.
@@ -203,6 +203,8 @@ function ShowcaseNavigation() {
203
203
  width: 400,
204
204
  'aria-label': 'Sign in',
205
205
  });
206
+ // A new key on each open mounts a new form, so a reopened dialog starts empty.
207
+ const signInOpens = useRef(0);
206
208
  return (
207
209
  <>
208
210
  <TopNav
@@ -249,7 +251,14 @@ function ShowcaseNavigation() {
249
251
  <Button
250
252
  label="Sign in"
251
253
  variant="primary"
252
- onClick={() => signIn.show(<SignInForm onClose={signIn.hide} />)}
254
+ onClick={() =>
255
+ signIn.show(
256
+ <SignInForm
257
+ key={++signInOpens.current}
258
+ onClose={signIn.hide}
259
+ />,
260
+ )
261
+ }
253
262
  />
254
263
  </HStack>
255
264
  }
@@ -260,8 +269,7 @@ function ShowcaseNavigation() {
260
269
  }
261
270
 
262
271
  /** Sign in opens a real dialog, so a theme's header, close control, fields
263
- * and footer buttons can be reviewed together. Its content mounts on first
264
- * open, so the page carries no hidden duplicate fields. */
272
+ * and footer buttons can be reviewed together. */
265
273
  function SignInForm({onClose}: {onClose: () => void}) {
266
274
  const [email, setEmail] = useState('');
267
275
  const [password, setPassword] = useState('');
@@ -7,10 +7,11 @@
7
7
  * @input An absolute `file:` URL, with any query its caller adds to name a
8
8
  * fresh module.
9
9
  * @output The module's namespace object, as a plain `import()` gives it.
10
- * @position Called by the doc importers (../doc-compiler/import.mjs). The
11
- * node test project loads this file natively, as the CLI does
12
- * (vitest.config.ts). The doc files that a catalog command imports then load
13
- * natively as well, without a request to the test runner for each of them.
10
+ * @position Called by the doc importers (../doc-compiler/import.mjs) and the
11
+ * module loader (./module-loader.mjs). The node test project loads this file
12
+ * natively, as the CLI does (vitest.config.ts). The doc files a catalog
13
+ * command or a theme build imports then load natively too. None of them is
14
+ * a request to the test runner.
14
15
  */
15
16
  /**
16
17
  * Import the module at `url`.
@@ -6,10 +6,11 @@
6
6
  * @input An absolute `file:` URL, with any query its caller adds to name a
7
7
  * fresh module.
8
8
  * @output The module's namespace object, as a plain `import()` gives it.
9
- * @position Called by the doc importers (../doc-compiler/import.mjs). The
10
- * node test project loads this file natively, as the CLI does
11
- * (vitest.config.ts). The doc files that a catalog command imports then load
12
- * natively as well, without a request to the test runner for each of them.
9
+ * @position Called by the doc importers (../doc-compiler/import.mjs) and the
10
+ * module loader (./module-loader.mjs). The node test project loads this file
11
+ * natively, as the CLI does (vitest.config.ts). The doc files a catalog
12
+ * command or a theme build imports then load natively too. None of them is
13
+ * a request to the test runner.
13
14
  */
14
15
 
15
16
  /**
@@ -26,6 +26,7 @@ import {pathToFileURL} from 'node:url';
26
26
  import * as fs from 'node:fs';
27
27
  import {createJiti} from 'jiti';
28
28
  import {findPresentFiles} from './present-files.mjs';
29
+ import {importUrl} from './import-url.mjs';
29
30
 
30
31
  export {findPresentFiles};
31
32
 
@@ -231,12 +232,15 @@ async function importModule(file, fresh) {
231
232
  return await getJiti().import(file);
232
233
  }
233
234
  const url = pathToFileURL(file);
234
- if (!fresh) return await readInTurn(file, () => import(url.href));
235
+ // The node test project loads import-url.mjs natively. An import from here
236
+ // would be a request to the test runner, and a theme build reads every Core
237
+ // doc through it.
238
+ if (!fresh) return await readInTurn(file, () => importUrl(url.href));
235
239
  // Node chooses the format again, as for the first import: a package's
236
240
  // "type", the extension, or the source's syntax. The query names a new ES
237
241
  // module. A CommonJS module also needs its cache entry gone.
238
242
  url.searchParams.set('astryx-fresh', String(++freshImportNonce));
239
- return await readFreshInTurn(file, () => import(url.href));
243
+ return await readFreshInTurn(file, () => importUrl(url.href));
240
244
  }
241
245
 
242
246
  /**
@@ -300,7 +304,6 @@ export function readFreshInTurn(file, read) {
300
304
  });
301
305
  }
302
306
 
303
-
304
307
  /**
305
308
  * Import a user-authored module, take its default export, and validate it
306
309
  * through an authoring parser. This is the single load/validation boundary for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.14-canary.g05da5aa",
3
+ "version": "0.7.14-canary.gfb823d9",
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",
@@ -125,7 +125,7 @@
125
125
  "zod": "^4.6.7"
126
126
  },
127
127
  "peerDependencies": {
128
- "@astryxdesign/core": "0.7.14-canary.g05da5aa"
128
+ "@astryxdesign/core": "0.7.14-canary.gfb823d9"
129
129
  },
130
130
  "peerDependenciesMeta": {
131
131
  "@astryxdesign/core": {
@@ -133,10 +133,10 @@
133
133
  }
134
134
  },
135
135
  "devDependencies": {
136
- "@astryxdesign/charts": "0.7.14-canary.g05da5aa",
137
- "@astryxdesign/core": "0.7.14-canary.g05da5aa",
138
- "@astryxdesign/lab": "0.7.14-canary.g05da5aa",
139
- "@astryxdesign/theme-neutral": "0.7.14-canary.g05da5aa",
136
+ "@astryxdesign/charts": "0.7.14-canary.gfb823d9",
137
+ "@astryxdesign/core": "0.7.14-canary.gfb823d9",
138
+ "@astryxdesign/lab": "0.7.14-canary.gfb823d9",
139
+ "@astryxdesign/theme-neutral": "0.7.14-canary.gfb823d9",
140
140
  "@heroicons/react": "^2.2.0",
141
141
  "@stylexjs/stylex": "^0.19.1",
142
142
  "@types/babel__core": "^7.20.5",