@astryxdesign/cli 0.1.4-canary.c679f18 → 0.1.4-canary.cb78dd0
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 +9 -9
- package/src/commands/agent-docs.mjs +7 -5
- package/src/commands/agent-docs.test.mjs +33 -0
- package/src/commands/init.mjs +1 -1
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.doc.mjs +1 -1
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.tsx +44 -0
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.doc.mjs +15 -0
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.tsx +107 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.1.4-canary.
|
|
3
|
+
"version": "0.1.4-canary.cb78dd0",
|
|
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",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"zod": "^4.4.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@astryxdesign/charts": "0.1.4-canary.
|
|
79
|
-
"@astryxdesign/core": "0.1.4-canary.
|
|
80
|
-
"@astryxdesign/lab": "0.1.4-canary.
|
|
81
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.
|
|
78
|
+
"@astryxdesign/charts": "0.1.4-canary.cb78dd0",
|
|
79
|
+
"@astryxdesign/core": "0.1.4-canary.cb78dd0",
|
|
80
|
+
"@astryxdesign/lab": "0.1.4-canary.cb78dd0",
|
|
81
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.cb78dd0",
|
|
82
82
|
"gpt-tokenizer": "^3.4.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@astryxdesign/charts": "0.1.4-canary.
|
|
100
|
-
"@astryxdesign/core": "0.1.4-canary.
|
|
101
|
-
"@astryxdesign/lab": "0.1.4-canary.
|
|
102
|
-
"@astryxdesign/theme-neutral": "0.1.4-canary.
|
|
99
|
+
"@astryxdesign/charts": "0.1.4-canary.cb78dd0",
|
|
100
|
+
"@astryxdesign/core": "0.1.4-canary.cb78dd0",
|
|
101
|
+
"@astryxdesign/lab": "0.1.4-canary.cb78dd0",
|
|
102
|
+
"@astryxdesign/theme-neutral": "0.1.4-canary.cb78dd0",
|
|
103
103
|
"gpt-tokenizer": "^3.4.0"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* - Claude Code: CLAUDE.md (root) or .claude/CLAUDE.md
|
|
10
10
|
* - Cursor: .cursorrules
|
|
11
11
|
* - Codex/generic: AGENTS.md
|
|
12
|
+
* - Hermes Agent: .hermes.md or HERMES.md (existing), else AGENTS.md
|
|
12
13
|
*
|
|
13
14
|
* Auto-detect: discovers existing files and updates them in place.
|
|
14
15
|
* Default (no existing files): creates .claude/CLAUDE.md.
|
|
15
16
|
*
|
|
16
|
-
* --agent <tool>: target a specific tool preset (claude, cursor, codex, all)
|
|
17
|
+
* --agent <tool>: target a specific tool preset (claude, cursor, codex, hermes, all)
|
|
17
18
|
* --agent-docs-path <path>: explicit file path(s)
|
|
18
19
|
*/
|
|
19
20
|
|
|
@@ -46,6 +47,7 @@ const AGENT_PRESETS = {
|
|
|
46
47
|
claude: [CLAUDE_MD, CLAUDE_DIR_MD],
|
|
47
48
|
cursor: ['.cursorrules', AGENTS_MD],
|
|
48
49
|
codex: [AGENTS_MD],
|
|
50
|
+
hermes: ['.hermes.md', 'HERMES.md', AGENTS_MD],
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
/**
|
|
@@ -64,7 +66,7 @@ export function discoverAgentDocs(targetDir) {
|
|
|
64
66
|
* Searches for existing files first, falls back to default creation path.
|
|
65
67
|
*
|
|
66
68
|
* @param {string} targetDir
|
|
67
|
-
* @param {string} agent - Preset name: 'claude', 'cursor', 'codex', 'all'
|
|
69
|
+
* @param {string} agent - Preset name: 'claude', 'cursor', 'codex', 'hermes', 'all'
|
|
68
70
|
* @returns {{inject: string[], create: string[]}} Files to inject into vs create fresh
|
|
69
71
|
*/
|
|
70
72
|
export function resolveAgentPaths(targetDir, agent) {
|
|
@@ -386,7 +388,7 @@ export function removeAgentDocs(targetDir) {
|
|
|
386
388
|
* @param {object} [options]
|
|
387
389
|
* @param {boolean} [options.zh]
|
|
388
390
|
* @param {string} [options.lang]
|
|
389
|
-
* @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', 'all'
|
|
391
|
+
* @param {string} [options.agent] - Tool preset: 'claude', 'cursor', 'codex', 'hermes', 'all'
|
|
390
392
|
* @param {string[]} [options.paths] - Explicit paths (overrides agent/auto-detect)
|
|
391
393
|
* @param {boolean} [options.onlyReplace] - Only update files that already have Astryx markers (for upgrades)
|
|
392
394
|
* @returns {string[]} List of files written
|
|
@@ -468,14 +470,14 @@ export function installAgentDocs(targetDir, {zh = false, lang, agent, paths, onl
|
|
|
468
470
|
return written;
|
|
469
471
|
}
|
|
470
472
|
|
|
471
|
-
const VALID_AGENTS = ['claude', 'cursor', 'codex', 'all'];
|
|
473
|
+
const VALID_AGENTS = ['claude', 'cursor', 'codex', 'hermes', 'all'];
|
|
472
474
|
|
|
473
475
|
export function registerAgentDocs(program) {
|
|
474
476
|
program
|
|
475
477
|
.command('agent-docs')
|
|
476
478
|
.description('Install/update the component index for AI coding agents')
|
|
477
479
|
.option('--remove', 'Remove the design system section from all agent doc files')
|
|
478
|
-
.option('--agent <tool>', 'Target tool: claude, cursor, codex, all')
|
|
480
|
+
.option('--agent <tool>', 'Target tool: claude, cursor, codex, hermes, all')
|
|
479
481
|
.option('--agent-docs-path <path...>', 'Explicit file path(s) to write to')
|
|
480
482
|
.action(options => {
|
|
481
483
|
const targetDir = process.cwd();
|
|
@@ -449,6 +449,17 @@ describe('installAgentDocs', () => {
|
|
|
449
449
|
expect(fs.existsSync(path.join(tmpDir, 'AGENTS.md'))).toBe(true);
|
|
450
450
|
});
|
|
451
451
|
|
|
452
|
+
it('respects --agent hermes preset: creates AGENTS.md', () => {
|
|
453
|
+
setupCorePackage(tmpDir);
|
|
454
|
+
|
|
455
|
+
const written = installAgentDocs(tmpDir, {agent: 'hermes'});
|
|
456
|
+
|
|
457
|
+
expect(written).toEqual(['AGENTS.md']);
|
|
458
|
+
const content = fs.readFileSync(path.join(tmpDir, 'AGENTS.md'), 'utf-8');
|
|
459
|
+
expect(content).toContain('<!-- ASTRYX:START -->');
|
|
460
|
+
expect(fs.existsSync(path.join(tmpDir, '.claude'))).toBe(false);
|
|
461
|
+
});
|
|
462
|
+
|
|
452
463
|
it('respects explicit --paths', () => {
|
|
453
464
|
setupCorePackage(tmpDir);
|
|
454
465
|
|
|
@@ -548,4 +559,26 @@ describe('resolveAgentPaths', () => {
|
|
|
548
559
|
expect(result.create).toContain('AGENTS.md');
|
|
549
560
|
expect(result.create).toContain('.claude/CLAUDE.md');
|
|
550
561
|
});
|
|
562
|
+
|
|
563
|
+
it('hermes preset creates AGENTS.md when nothing exists', () => {
|
|
564
|
+
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
565
|
+
expect(result).toEqual({inject: [], create: ['AGENTS.md']});
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
it('hermes preset finds existing .hermes.md', () => {
|
|
569
|
+
fs.writeFileSync(path.join(tmpDir, '.hermes.md'), '');
|
|
570
|
+
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
571
|
+
expect(result).toEqual({inject: ['.hermes.md'], create: []});
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
it('hermes preset finds existing HERMES.md when no .hermes.md', () => {
|
|
575
|
+
fs.writeFileSync(path.join(tmpDir, 'HERMES.md'), '');
|
|
576
|
+
const result = resolveAgentPaths(tmpDir, 'hermes');
|
|
577
|
+
expect(result).toEqual({inject: ['HERMES.md'], create: []});
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
it('claude preset still creates .claude/CLAUDE.md when nothing exists (hermes is additive)', () => {
|
|
581
|
+
const result = resolveAgentPaths(tmpDir, 'claude');
|
|
582
|
+
expect(result).toEqual({inject: [], create: ['.claude/CLAUDE.md']});
|
|
583
|
+
});
|
|
551
584
|
});
|
package/src/commands/init.mjs
CHANGED
|
@@ -198,7 +198,7 @@ export function registerInit(program) {
|
|
|
198
198
|
.option('--features <list>', 'Comma-separated features to install (agents, theme, template)')
|
|
199
199
|
.option('--all', 'Install all features, no prompts')
|
|
200
200
|
.option('--remove-agents', 'Remove AI agent docs from all agent doc files')
|
|
201
|
-
.option('--agent <tool>', 'Target AI tool for agent docs: claude, cursor, codex, all')
|
|
201
|
+
.option('--agent <tool>', 'Target AI tool for agent docs: claude, cursor, codex, hermes, all')
|
|
202
202
|
.option('--agent-docs-path <path...>', 'Explicit file path(s) for agent docs')
|
|
203
203
|
.action(async (options) => {
|
|
204
204
|
const targetDir = process.cwd();
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'Code — Terminal',
|
|
8
8
|
displayName: 'Code — Terminal',
|
|
9
9
|
description:
|
|
10
|
-
'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages
|
|
10
|
+
'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages. Reach for a dark syntax preset instead of hand-rolling a dark box with custom CSS.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 16 / 9,
|
|
13
13
|
componentsUsed: ['CodeBlock', 'SyntaxTheme'],
|
|
@@ -0,0 +1,14 @@
|
|
|
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: 'ContextMenuItem',
|
|
7
|
+
name: 'ContextMenuItem — Basic',
|
|
8
|
+
displayName: 'ContextMenuItem — Basic',
|
|
9
|
+
description:
|
|
10
|
+
'Context menu items with labels and secondary descriptions. Use ContextMenuItem to render custom menu entries with consistent styling.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['ContextMenu', 'ContextMenuItem'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {ContextMenu, ContextMenuItem} from '@astryxdesign/core/ContextMenu';
|
|
6
|
+
|
|
7
|
+
export default function ContextMenuItemBasic() {
|
|
8
|
+
return (
|
|
9
|
+
<ContextMenu
|
|
10
|
+
menuContent={
|
|
11
|
+
<>
|
|
12
|
+
<ContextMenuItem
|
|
13
|
+
label="Edit"
|
|
14
|
+
description="Modify this item"
|
|
15
|
+
onClick={() => {}}
|
|
16
|
+
/>
|
|
17
|
+
<ContextMenuItem
|
|
18
|
+
label="Duplicate"
|
|
19
|
+
description="Create a copy"
|
|
20
|
+
onClick={() => {}}
|
|
21
|
+
/>
|
|
22
|
+
<ContextMenuItem
|
|
23
|
+
label="Delete"
|
|
24
|
+
description="This action cannot be undone"
|
|
25
|
+
onClick={() => {}}
|
|
26
|
+
/>
|
|
27
|
+
</>
|
|
28
|
+
}>
|
|
29
|
+
<div
|
|
30
|
+
style={{
|
|
31
|
+
padding: '48px',
|
|
32
|
+
borderWidth: '2px',
|
|
33
|
+
borderStyle: 'dashed',
|
|
34
|
+
borderColor: 'var(--color-border)',
|
|
35
|
+
borderRadius: '8px',
|
|
36
|
+
textAlign: 'center',
|
|
37
|
+
color: 'var(--color-text-secondary)',
|
|
38
|
+
userSelect: 'none',
|
|
39
|
+
}}>
|
|
40
|
+
Right-click this area
|
|
41
|
+
</div>
|
|
42
|
+
</ContextMenu>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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: 'ContextMenuItem',
|
|
7
|
+
name: 'ContextMenuItem',
|
|
8
|
+
displayName: 'Context Menu Item',
|
|
9
|
+
description:
|
|
10
|
+
'Context menu with custom-rendered items using ContextMenuItem for icons and descriptions.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
isShowcase: true,
|
|
13
|
+
aspectRatio: 16 / 9,
|
|
14
|
+
componentsUsed: ['ContextMenu', 'ContextMenuItem'],
|
|
15
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {ContextMenu, ContextMenuItem} from '@astryxdesign/core/ContextMenu';
|
|
6
|
+
|
|
7
|
+
const PencilIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
8
|
+
<svg
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
strokeWidth={1.5}
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
{...props}>
|
|
16
|
+
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
|
|
17
|
+
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const CopyIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
22
|
+
<svg
|
|
23
|
+
viewBox="0 0 24 24"
|
|
24
|
+
fill="none"
|
|
25
|
+
stroke="currentColor"
|
|
26
|
+
strokeWidth={1.5}
|
|
27
|
+
strokeLinecap="round"
|
|
28
|
+
strokeLinejoin="round"
|
|
29
|
+
{...props}>
|
|
30
|
+
<rect x="9" y="9" width="13" height="13" rx="2" />
|
|
31
|
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
|
|
32
|
+
</svg>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const ShareIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
36
|
+
<svg
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
fill="none"
|
|
39
|
+
stroke="currentColor"
|
|
40
|
+
strokeWidth={1.5}
|
|
41
|
+
strokeLinecap="round"
|
|
42
|
+
strokeLinejoin="round"
|
|
43
|
+
{...props}>
|
|
44
|
+
<circle cx="18" cy="5" r="3" />
|
|
45
|
+
<circle cx="6" cy="12" r="3" />
|
|
46
|
+
<circle cx="18" cy="19" r="3" />
|
|
47
|
+
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />
|
|
48
|
+
<line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
|
|
49
|
+
</svg>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const TrashIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
53
|
+
<svg
|
|
54
|
+
viewBox="0 0 24 24"
|
|
55
|
+
fill="none"
|
|
56
|
+
stroke="currentColor"
|
|
57
|
+
strokeWidth={1.5}
|
|
58
|
+
strokeLinecap="round"
|
|
59
|
+
strokeLinejoin="round"
|
|
60
|
+
{...props}>
|
|
61
|
+
<polyline points="3 6 5 6 21 6" />
|
|
62
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
63
|
+
</svg>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export default function ContextMenuItemShowcase() {
|
|
67
|
+
return (
|
|
68
|
+
<ContextMenu
|
|
69
|
+
menuContent={
|
|
70
|
+
<>
|
|
71
|
+
<ContextMenuItem
|
|
72
|
+
icon={PencilIcon}
|
|
73
|
+
label="Edit"
|
|
74
|
+
description="Modify this item"
|
|
75
|
+
onClick={() => {}}
|
|
76
|
+
/>
|
|
77
|
+
<ContextMenuItem
|
|
78
|
+
icon={CopyIcon}
|
|
79
|
+
label="Duplicate"
|
|
80
|
+
description="Create a copy"
|
|
81
|
+
onClick={() => {}}
|
|
82
|
+
/>
|
|
83
|
+
<ContextMenuItem icon={ShareIcon} label="Share" onClick={() => {}} />
|
|
84
|
+
<ContextMenuItem
|
|
85
|
+
icon={TrashIcon}
|
|
86
|
+
label="Delete"
|
|
87
|
+
description="This action cannot be undone"
|
|
88
|
+
onClick={() => {}}
|
|
89
|
+
/>
|
|
90
|
+
</>
|
|
91
|
+
}>
|
|
92
|
+
<div
|
|
93
|
+
style={{
|
|
94
|
+
padding: '48px',
|
|
95
|
+
borderWidth: '2px',
|
|
96
|
+
borderStyle: 'dashed',
|
|
97
|
+
borderColor: 'var(--color-border)',
|
|
98
|
+
borderRadius: '8px',
|
|
99
|
+
textAlign: 'center',
|
|
100
|
+
color: 'var(--color-text-secondary)',
|
|
101
|
+
userSelect: 'none',
|
|
102
|
+
}}>
|
|
103
|
+
Right-click this area
|
|
104
|
+
</div>
|
|
105
|
+
</ContextMenu>
|
|
106
|
+
);
|
|
107
|
+
}
|