@astryxdesign/cli 0.1.1-canary.17acc48 → 0.1.1-canary.3d46f0a

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": "@astryxdesign/cli",
3
- "version": "0.1.1-canary.17acc48",
3
+ "version": "0.1.1-canary.3d46f0a",
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",
@@ -54,9 +54,9 @@
54
54
  "jscodeshift": "^17.3.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "@astryxdesign/core": "0.1.1-canary.17acc48",
58
- "@astryxdesign/lab": "0.1.1-canary.17acc48",
59
- "@astryxdesign/theme-neutral": "0.1.1-canary.17acc48"
57
+ "@astryxdesign/core": "0.1.1-canary.3d46f0a",
58
+ "@astryxdesign/lab": "0.1.1-canary.3d46f0a",
59
+ "@astryxdesign/theme-neutral": "0.1.1-canary.3d46f0a"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "@astryxdesign/core": {
@@ -70,9 +70,9 @@
70
70
  }
71
71
  },
72
72
  "devDependencies": {
73
- "@astryxdesign/core": "0.1.1-canary.17acc48",
74
- "@astryxdesign/lab": "0.1.1-canary.17acc48",
75
- "@astryxdesign/theme-neutral": "0.1.1-canary.17acc48"
73
+ "@astryxdesign/core": "0.1.1-canary.3d46f0a",
74
+ "@astryxdesign/lab": "0.1.1-canary.3d46f0a",
75
+ "@astryxdesign/theme-neutral": "0.1.1-canary.3d46f0a"
76
76
  },
77
77
  "scripts": {
78
78
  "astryx": "node bin/astryx.mjs",
@@ -29,37 +29,6 @@ import {requireInteractive} from '../utils/interactive.mjs';
29
29
  const VALID_FEATURES = ['agents', 'theme', 'template'];
30
30
  const run = getRunPrefix();
31
31
 
32
- /**
33
- * Build the "Next steps" lines printed at the end of `astryx init`.
34
- *
35
- * Theme guidance must match the runtime recommendation emitted by core's
36
- * <Theme> component (packages/core/src/theme/Theme.tsx): the pre-built theme
37
- * path (`/built` import + `theme.css`) plus the base CSS import, so users
38
- * don't end up with an unstyled app or the slower runtime style-injection
39
- * path. See https://github.com/facebook/astryx/issues/3080.
40
- *
41
- * Exported for testing.
42
- *
43
- * @param {string} runPrefix package-manager run prefix (e.g. `npx`)
44
- * @returns {string[]} ordered list of human-facing lines
45
- */
46
- export function getNextSteps(runPrefix) {
47
- return [
48
- '',
49
- ' Next steps:',
50
- " 1. Import base styles: import '@astryxdesign/core/reset.css'",
51
- " and import '@astryxdesign/core/astryx.css'",
52
- " 2. Import components: import { Button } from '@astryxdesign/core'",
53
- ' 3. Optionally add a theme (use the pre-built path for performance):',
54
- " import { neutralTheme } from '@astryxdesign/theme-neutral/built'",
55
- " import '@astryxdesign/theme-neutral/theme.css'",
56
- ' <Theme theme={neutralTheme}>...</Theme>',
57
- ` For custom themes, run \`${runPrefix} astryx theme build <file>\` to generate the built artifacts.`,
58
- ` 4. ${runPrefix} astryx --help for all commands`,
59
- '',
60
- ];
61
- }
62
-
63
32
  function isCancel(value) {
64
33
  if (p.isCancel(value)) {
65
34
  p.cancel('Setup cancelled.');
@@ -281,8 +250,13 @@ export function registerInit(program) {
281
250
  // Outro
282
251
  p.outro('Design system initialized!');
283
252
 
284
- for (const line of getNextSteps(run)) {
285
- humanLog(line);
286
- }
253
+ humanLog('');
254
+ humanLog(' Next steps:');
255
+ humanLog(" 1. Import components: import { Button } from '@astryxdesign/core'");
256
+ humanLog(' 2. Optionally add a theme:');
257
+ humanLog(" import { neutralTheme } from '@astryxdesign/theme-neutral'");
258
+ humanLog(' <Theme theme={neutralTheme}>...</Theme>');
259
+ humanLog(` 3. ${run} astryx --help for all commands`);
260
+ humanLog('');
287
261
  });
288
262
  }
@@ -1,46 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Regression test for `astryx init` "Next steps" theme guidance.
5
- *
6
- * The init command previously steered users toward the slower runtime
7
- * style-injection path:
8
- *
9
- * import { neutralTheme } from '@astryxdesign/theme-neutral'
10
- * <Theme theme={neutralTheme}>...</Theme>
11
- *
12
- * ...which contradicted the runtime console warning emitted by core's
13
- * <Theme> component (packages/core/src/theme/Theme.tsx) recommending the
14
- * pre-built path, and left users with an unstyled app because the base CSS
15
- * imports were never mentioned (facebook/astryx#3080).
16
- *
17
- * These assertions lock in the corrected guidance: base CSS imports, the
18
- * pre-built (`/built` + `theme.css`) theme path, and the custom-theme build
19
- * command.
20
- */
21
-
22
- import {describe, it, expect} from 'vitest';
23
- import {getNextSteps} from './init.mjs';
24
-
25
- describe('init Next steps theme guidance', () => {
26
- const text = getNextSteps('npx').join('\n');
27
-
28
- it('mentions the base CSS imports so the app is not left unstyled', () => {
29
- expect(text).toContain("'@astryxdesign/core/reset.css'");
30
- expect(text).toContain("'@astryxdesign/core/astryx.css'");
31
- });
32
-
33
- it('uses the pre-built theme path matching the runtime recommendation', () => {
34
- expect(text).toContain("'@astryxdesign/theme-neutral/built'");
35
- expect(text).toContain("'@astryxdesign/theme-neutral/theme.css'");
36
- });
37
-
38
- it('mentions building custom themes via `astryx theme build`', () => {
39
- expect(text).toContain('astryx theme build <file>');
40
- });
41
-
42
- it('does not steer users to the runtime style-injection import', () => {
43
- // The bare source import (no `/built`) is the slow runtime-injection path.
44
- expect(text).not.toContain("from '@astryxdesign/theme-neutral'");
45
- });
46
- });
@@ -1,15 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
- export const doc = {
5
- type: 'block',
6
- exampleFor: 'CommandPaletteEmpty',
7
- name: 'CommandPaletteEmpty',
8
- displayName: 'Command Palette Empty',
9
- description:
10
- 'Command palette empty state shown when no commands are available.',
11
- isReady: true,
12
- isShowcase: true,
13
- aspectRatio: 4 / 3,
14
- componentsUsed: ['CommandPalette', 'CommandPaletteEmpty', 'Text'],
15
- };
@@ -1,26 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- import {useMemo} from 'react';
6
- import {CommandPalette} from '@astryxdesign/core/CommandPalette';
7
- import {Text} from '@astryxdesign/core/Text';
8
- import {createStaticSource} from '@astryxdesign/core/Typeahead';
9
-
10
- export default function CommandPaletteEmptyShowcase() {
11
- const emptySource = useMemo(() => createStaticSource([]), []);
12
-
13
- return (
14
- <CommandPalette
15
- isOpen
16
- isInline
17
- onOpenChange={() => {}}
18
- searchSource={emptySource}
19
- emptyBootstrapText={
20
- <Text type="supporting" color="secondary">
21
- No commands available yet
22
- </Text>
23
- }
24
- />
25
- );
26
- }