@aex.is/zero 0.1.1 → 0.1.3
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/README.md +6 -0
- package/dist/config/frameworks.js +95 -0
- package/dist/config/modules.js +69 -0
- package/dist/engine/env.js +10 -0
- package/dist/engine/installers.js +36 -0
- package/dist/engine/scaffold.js +251 -0
- package/{src/engine/templates.ts → dist/engine/templates.js} +1 -8
- package/dist/env/detect.js +36 -0
- package/dist/index.js +39 -0
- package/dist/types.js +1 -0
- package/dist/ui/App.js +75 -0
- package/dist/ui/components/SelectList.js +67 -0
- package/dist/ui/screens/Confirm.js +22 -0
- package/dist/ui/screens/DomainPrompt.js +11 -0
- package/dist/ui/screens/FrameworkSelect.js +12 -0
- package/dist/ui/screens/Intro.js +18 -0
- package/dist/ui/screens/ModuleSelect.js +12 -0
- package/dist/ui/screens/NamePrompt.js +18 -0
- package/package.json +6 -5
- package/src/config/frameworks.ts +0 -110
- package/src/config/modules.ts +0 -82
- package/src/engine/env.ts +0 -12
- package/src/engine/installers.ts +0 -44
- package/src/engine/scaffold.ts +0 -296
- package/src/env/detect.ts +0 -40
- package/src/index.ts +0 -48
- package/src/types.ts +0 -12
- package/src/ui/App.tsx +0 -139
- package/src/ui/components/SelectList.tsx +0 -114
- package/src/ui/screens/Confirm.tsx +0 -62
- package/src/ui/screens/DomainPrompt.tsx +0 -29
- package/src/ui/screens/FrameworkSelect.tsx +0 -34
- package/src/ui/screens/Intro.tsx +0 -31
- package/src/ui/screens/ModuleSelect.tsx +0 -34
- package/src/ui/screens/NamePrompt.tsx +0 -37
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { SelectList, SelectItem } from '../components/SelectList.js';
|
|
4
|
-
import { frameworks } from '../../config/frameworks.js';
|
|
5
|
-
import { modules } from '../../config/modules.js';
|
|
6
|
-
import type { FrameworkId, ModuleId } from '../../types.js';
|
|
7
|
-
|
|
8
|
-
export type ConfirmAction =
|
|
9
|
-
| 'continue'
|
|
10
|
-
| 'edit-name'
|
|
11
|
-
| 'edit-domain'
|
|
12
|
-
| 'edit-framework'
|
|
13
|
-
| 'edit-modules'
|
|
14
|
-
| 'cancel';
|
|
15
|
-
|
|
16
|
-
interface ConfirmProps {
|
|
17
|
-
name: string;
|
|
18
|
-
domain: string;
|
|
19
|
-
framework: FrameworkId;
|
|
20
|
-
modules: ModuleId[];
|
|
21
|
-
onAction: (action: ConfirmAction) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const actionItems: SelectItem[] = [
|
|
25
|
-
{ id: 'continue', label: 'Continue' },
|
|
26
|
-
{ id: 'edit-name', label: 'Edit name' },
|
|
27
|
-
{ id: 'edit-domain', label: 'Edit domain' },
|
|
28
|
-
{ id: 'edit-framework', label: 'Edit framework' },
|
|
29
|
-
{ id: 'edit-modules', label: 'Edit modules' },
|
|
30
|
-
{ id: 'cancel', label: 'Cancel' }
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
export function Confirm({ name, domain, framework, modules: selectedModules, onAction }: ConfirmProps) {
|
|
34
|
-
const [selection, setSelection] = useState<ConfirmAction>('continue');
|
|
35
|
-
|
|
36
|
-
const frameworkLabel = frameworks.find((item) => item.id === framework)?.label ?? framework;
|
|
37
|
-
const moduleLabels = selectedModules
|
|
38
|
-
.map((id) => modules.find((item) => item.id === id)?.label ?? id)
|
|
39
|
-
.join(', ');
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<Box flexDirection="column">
|
|
43
|
-
<Text color="cyan">Confirm</Text>
|
|
44
|
-
<Box flexDirection="column" marginTop={1}>
|
|
45
|
-
<Text>App name: {name}</Text>
|
|
46
|
-
<Text>Domain: {domain || 'None'}</Text>
|
|
47
|
-
<Text>Framework: {frameworkLabel}</Text>
|
|
48
|
-
<Text>Modules: {moduleLabels || 'None'}</Text>
|
|
49
|
-
</Box>
|
|
50
|
-
<Box marginTop={1}>
|
|
51
|
-
<SelectList
|
|
52
|
-
items={actionItems}
|
|
53
|
-
selectedIds={[selection]}
|
|
54
|
-
onChange={(next) => setSelection(next[0] as ConfirmAction)}
|
|
55
|
-
onSubmit={() => onAction(selection)}
|
|
56
|
-
multi={false}
|
|
57
|
-
hint="Select an action and press Enter."
|
|
58
|
-
/>
|
|
59
|
-
</Box>
|
|
60
|
-
</Box>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import TextInput from 'ink-text-input';
|
|
4
|
-
|
|
5
|
-
interface DomainPromptProps {
|
|
6
|
-
initialValue: string;
|
|
7
|
-
onSubmit: (value: string) => void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function DomainPrompt({ initialValue, onSubmit }: DomainPromptProps) {
|
|
11
|
-
const [value, setValue] = useState(initialValue);
|
|
12
|
-
|
|
13
|
-
const handleSubmit = () => {
|
|
14
|
-
onSubmit(value.trim());
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Box flexDirection="column">
|
|
19
|
-
<Text color="cyan">Domain (optional)</Text>
|
|
20
|
-
<Text color="gray">Press Enter to continue or leave blank.</Text>
|
|
21
|
-
<TextInput
|
|
22
|
-
value={value}
|
|
23
|
-
onChange={setValue}
|
|
24
|
-
onSubmit={handleSubmit}
|
|
25
|
-
placeholder="example.com"
|
|
26
|
-
/>
|
|
27
|
-
</Box>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { SelectList, SelectItem } from '../components/SelectList.js';
|
|
4
|
-
import { frameworks } from '../../config/frameworks.js';
|
|
5
|
-
import type { FrameworkId } from '../../types.js';
|
|
6
|
-
|
|
7
|
-
interface FrameworkSelectProps {
|
|
8
|
-
value: FrameworkId;
|
|
9
|
-
onChange: (value: FrameworkId) => void;
|
|
10
|
-
onConfirm: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function FrameworkSelect({ value, onChange, onConfirm }: FrameworkSelectProps) {
|
|
14
|
-
const items: SelectItem[] = frameworks.map((framework) => ({
|
|
15
|
-
id: framework.id,
|
|
16
|
-
label: framework.label,
|
|
17
|
-
description: framework.description
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Box flexDirection="column">
|
|
22
|
-
<Text color="cyan">Framework</Text>
|
|
23
|
-
<Text color="gray">Use arrows to move, space to select, Enter to confirm.</Text>
|
|
24
|
-
<SelectList
|
|
25
|
-
items={items}
|
|
26
|
-
selectedIds={[value]}
|
|
27
|
-
onChange={(next) => onChange(next[0] as FrameworkId)}
|
|
28
|
-
onSubmit={onConfirm}
|
|
29
|
-
multi={false}
|
|
30
|
-
hint="( ) radio select"
|
|
31
|
-
/>
|
|
32
|
-
</Box>
|
|
33
|
-
);
|
|
34
|
-
}
|
package/src/ui/screens/Intro.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box, Text, useInput } from 'ink';
|
|
3
|
-
|
|
4
|
-
interface IntroProps {
|
|
5
|
-
onContinue: () => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const introArt = [
|
|
9
|
-
' _____',
|
|
10
|
-
' / ___ \\ ',
|
|
11
|
-
' / / _ \\ \\ ',
|
|
12
|
-
' | |/ /| |',
|
|
13
|
-
' \\ \\_/ / /',
|
|
14
|
-
' \\___/_/'
|
|
15
|
-
].join('\n');
|
|
16
|
-
|
|
17
|
-
export function Intro({ onContinue }: IntroProps) {
|
|
18
|
-
useInput((input, key) => {
|
|
19
|
-
if (key.return || input === ' ') {
|
|
20
|
-
onContinue();
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Box flexDirection="column">
|
|
26
|
-
<Text>{introArt}</Text>
|
|
27
|
-
<Text color="cyan">Aexis Zero</Text>
|
|
28
|
-
<Text color="gray">Press Enter to begin.</Text>
|
|
29
|
-
</Box>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { SelectList, SelectItem } from '../components/SelectList.js';
|
|
4
|
-
import { modules } from '../../config/modules.js';
|
|
5
|
-
import type { ModuleId } from '../../types.js';
|
|
6
|
-
|
|
7
|
-
interface ModuleSelectProps {
|
|
8
|
-
value: ModuleId[];
|
|
9
|
-
onChange: (value: ModuleId[]) => void;
|
|
10
|
-
onConfirm: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function ModuleSelect({ value, onChange, onConfirm }: ModuleSelectProps) {
|
|
14
|
-
const items: SelectItem[] = modules.map((module) => ({
|
|
15
|
-
id: module.id,
|
|
16
|
-
label: module.label,
|
|
17
|
-
description: module.description
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Box flexDirection="column">
|
|
22
|
-
<Text color="cyan">Modules</Text>
|
|
23
|
-
<Text color="gray">Use arrows to move, space to toggle, Enter to confirm.</Text>
|
|
24
|
-
<SelectList
|
|
25
|
-
items={items}
|
|
26
|
-
selectedIds={value}
|
|
27
|
-
onChange={(next) => onChange(next as ModuleId[])}
|
|
28
|
-
onSubmit={onConfirm}
|
|
29
|
-
multi
|
|
30
|
-
hint="[ ] multi-select"
|
|
31
|
-
/>
|
|
32
|
-
</Box>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import TextInput from 'ink-text-input';
|
|
4
|
-
|
|
5
|
-
interface NamePromptProps {
|
|
6
|
-
initialValue: string;
|
|
7
|
-
onSubmit: (value: string) => void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function NamePrompt({ initialValue, onSubmit }: NamePromptProps) {
|
|
11
|
-
const [value, setValue] = useState(initialValue);
|
|
12
|
-
const [error, setError] = useState('');
|
|
13
|
-
|
|
14
|
-
const handleSubmit = () => {
|
|
15
|
-
const trimmed = value.trim();
|
|
16
|
-
if (!trimmed) {
|
|
17
|
-
setError('App name is required.');
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
setError('');
|
|
21
|
-
onSubmit(trimmed);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Box flexDirection="column">
|
|
26
|
-
<Text color="cyan">App name</Text>
|
|
27
|
-
<Text color="gray">Required. Press Enter to continue.</Text>
|
|
28
|
-
<TextInput
|
|
29
|
-
value={value}
|
|
30
|
-
onChange={setValue}
|
|
31
|
-
onSubmit={handleSubmit}
|
|
32
|
-
placeholder="my-app"
|
|
33
|
-
/>
|
|
34
|
-
{error ? <Text color="red">{error}</Text> : null}
|
|
35
|
-
</Box>
|
|
36
|
-
);
|
|
37
|
-
}
|