dappbooster 3.0.1 → 3.0.2
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/dist/app.d.ts +1 -2
- package/dist/app.js +16 -15
- package/dist/cli.js +2 -2
- package/dist/components/Ask.js +3 -10
- package/dist/components/Divider.d.ts +1 -1
- package/dist/components/Divider.js +2 -2
- package/dist/components/MainTitle.d.ts +1 -1
- package/dist/components/MainTitle.js +2 -3
- package/dist/components/Multiselect/MultiSelect.d.ts +1 -2
- package/dist/components/Multiselect/MultiSelect.js +11 -13
- package/dist/components/Multiselect/components/Checkbox.d.ts +1 -2
- package/dist/components/Multiselect/components/Checkbox.js +2 -3
- package/dist/components/Multiselect/components/Indicator.d.ts +1 -2
- package/dist/components/Multiselect/components/Indicator.js +2 -3
- package/dist/components/Multiselect/components/Item.d.ts +1 -2
- package/dist/components/Multiselect/components/Item.js +2 -2
- package/dist/components/steps/CloneRepo/CloneRepo.d.ts +1 -1
- package/dist/components/steps/CloneRepo/CloneRepo.js +2 -4
- package/dist/components/steps/CloneRepo/Commands.d.ts +1 -1
- package/dist/components/steps/CloneRepo/Commands.js +2 -15
- package/dist/components/steps/FileCleanup.js +6 -35
- package/dist/components/steps/Install/CustomInstallation.d.ts +1 -1
- package/dist/components/steps/Install/CustomInstallation.js +2 -7
- package/dist/components/steps/Install/FullInstallation.d.ts +1 -1
- package/dist/components/steps/Install/FullInstallation.js +2 -4
- package/dist/components/steps/Install/Install.js +3 -15
- package/dist/components/steps/Install/InstallAllPackages.d.ts +1 -1
- package/dist/components/steps/Install/InstallAllPackages.js +2 -4
- package/dist/components/steps/InstallationMode.js +3 -5
- package/dist/components/steps/OptionalPackages.d.ts +3 -2
- package/dist/components/steps/OptionalPackages.js +6 -7
- package/dist/components/steps/PostInstall.d.ts +1 -1
- package/dist/components/steps/PostInstall.js +4 -64
- package/dist/components/steps/ProjectName.js +3 -2
- package/package.json +1 -1
- package/readme.md +9 -4
package/dist/app.d.ts
CHANGED
package/dist/app.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Box } from 'ink';
|
|
2
|
-
import
|
|
3
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
4
|
import MainTitle from './components/MainTitle.js';
|
|
4
5
|
import CloneRepo from './components/steps/CloneRepo/CloneRepo.js';
|
|
5
6
|
import FileCleanup from './components/steps/FileCleanup.js';
|
|
@@ -14,26 +15,28 @@ const App = () => {
|
|
|
14
15
|
const [currentStep, setCurrentStep] = useState(1);
|
|
15
16
|
const [setupType, setSetupType] = useState();
|
|
16
17
|
const [selectedFeatures, setSelectedFeatures] = useState();
|
|
17
|
-
const finishStep = useCallback(() => setCurrentStep(
|
|
18
|
+
const finishStep = useCallback(() => setCurrentStep((prevStep) => prevStep + 1), []);
|
|
18
19
|
const onSelectSetupType = useCallback((item) => setSetupType(item), []);
|
|
19
20
|
const onSelectSelectedFeatures = useCallback((selectedItems) => setSelectedFeatures([...selectedItems]), []);
|
|
20
21
|
const steps = useMemo(() => [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
_jsx(ProjectName, { onCompletion: finishStep, onSubmit: setProjectName, projectName: projectName }, 1),
|
|
23
|
+
_jsx(CloneRepo, { onCompletion: finishStep, projectName: projectName }, 2),
|
|
24
|
+
_jsx(InstallationMode, { onCompletion: finishStep, onSelect: onSelectSetupType }, 3),
|
|
25
|
+
// TODO: add a skip parameter to all (or most) steps
|
|
26
|
+
// to allow skipping when testing, etc.
|
|
27
|
+
_jsx(OptionalPackages, { onCompletion: finishStep, onSubmit: onSelectSelectedFeatures, skip: setupType?.value === 'full' }, 4),
|
|
28
|
+
_jsx(Install, { installationConfig: {
|
|
26
29
|
installationType: setupType?.value,
|
|
27
30
|
selectedFeatures: selectedFeatures,
|
|
28
|
-
}, onCompletion: finishStep, projectName: projectName,
|
|
29
|
-
|
|
31
|
+
}, onCompletion: finishStep, projectName: projectName }, 5),
|
|
32
|
+
_jsx(FileCleanup, { installationConfig: {
|
|
30
33
|
installationType: setupType?.value,
|
|
31
34
|
selectedFeatures: selectedFeatures,
|
|
32
|
-
}, onCompletion: finishStep, projectName: projectName,
|
|
33
|
-
|
|
35
|
+
}, onCompletion: finishStep, projectName: projectName }, 6),
|
|
36
|
+
_jsx(PostInstall, { projectName: projectName, installationConfig: {
|
|
34
37
|
installationType: setupType?.value,
|
|
35
38
|
selectedFeatures: selectedFeatures,
|
|
36
|
-
},
|
|
39
|
+
} }, 7),
|
|
37
40
|
], [
|
|
38
41
|
finishStep,
|
|
39
42
|
onSelectSelectedFeatures,
|
|
@@ -42,8 +45,6 @@ const App = () => {
|
|
|
42
45
|
onSelectSetupType,
|
|
43
46
|
projectName,
|
|
44
47
|
]);
|
|
45
|
-
return (
|
|
46
|
-
React.createElement(MainTitle, null),
|
|
47
|
-
steps.map((item, index) => canShowStep(currentStep, index + 1) && item)));
|
|
48
|
+
return (_jsxs(Box, { flexDirection: 'column', rowGap: 1, width: 80, children: [_jsx(MainTitle, {}), steps.map((item, index) => canShowStep(currentStep, index + 1) && item)] }));
|
|
48
49
|
};
|
|
49
50
|
export default App;
|
package/dist/cli.js
CHANGED
package/dist/components/Ask.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Box, Text } from 'ink';
|
|
2
3
|
import TextInput from 'ink-text-input';
|
|
3
|
-
import
|
|
4
|
+
import { useMemo, useState } from 'react';
|
|
4
5
|
import { isAnswerConfirmed } from '../utils/utils.js';
|
|
5
6
|
const Ask = ({ question, onSubmit, answer, tip, errorMessage, placeholder }) => {
|
|
6
7
|
const [input, setInput] = useState('');
|
|
7
8
|
const answered = useMemo(() => isAnswerConfirmed(answer, errorMessage), [answer, errorMessage]);
|
|
8
|
-
return (
|
|
9
|
-
React.createElement(Box, { flexDirection: 'column' },
|
|
10
|
-
React.createElement(Box, null,
|
|
11
|
-
React.createElement(Text, { color: 'whiteBright' },
|
|
12
|
-
question,
|
|
13
|
-
": "),
|
|
14
|
-
answered ? (React.createElement(Text, { bold: true, color: 'green' }, answer)) : (React.createElement(TextInput, { onChange: setInput, onSubmit: onSubmit, placeholder: placeholder, value: input }))),
|
|
15
|
-
tip && React.createElement(Text, { color: 'gray' }, tip)),
|
|
16
|
-
errorMessage && (React.createElement(Text, { bold: true, color: 'red' }, errorMessage))));
|
|
9
|
+
return (_jsxs(Box, { flexDirection: 'column', rowGap: 1, children: [_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Box, { children: [_jsxs(Text, { color: 'whiteBright', children: [question, ": "] }), answered ? (_jsx(Text, { bold: true, color: 'green', children: answer })) : (_jsx(TextInput, { onChange: setInput, onSubmit: onSubmit, placeholder: placeholder, value: input }))] }), tip && _jsx(Text, { color: 'gray', children: tip })] }), errorMessage && (_jsx(Text, { bold: true, color: 'red', children: errorMessage }))] }));
|
|
17
10
|
};
|
|
18
11
|
export default Ask;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import BaseDivider from 'ink-divider';
|
|
2
|
-
|
|
3
|
-
const Divider = ({ title }) => (React.createElement(BaseDivider, { titlePadding: 2, titleColor: 'whiteBright', title: title }));
|
|
3
|
+
const Divider = ({ title }) => (_jsx(BaseDivider, { titlePadding: 2, titleColor: 'whiteBright', title: title }));
|
|
4
4
|
export default Divider;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import BigText from 'ink-big-text';
|
|
2
3
|
import Gradient from 'ink-gradient';
|
|
3
|
-
|
|
4
|
-
const MainTitle = () => (React.createElement(Gradient, { colors: ['#ff438c', '#bb1d79', '#8b46a4', '#6a2581'] },
|
|
5
|
-
React.createElement(BigText, { lineHeight: 1, font: 'chrome', text: "dAppBooster" })));
|
|
4
|
+
const MainTitle = () => (_jsx(Gradient, { colors: ['#ff438c', '#bb1d79', '#8b46a4', '#6a2581'], children: _jsx(BigText, { lineHeight: 1, font: 'chrome', text: "dAppBooster" }) }));
|
|
6
5
|
export default MainTitle;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import CheckBox from './components/Checkbox.js';
|
|
3
2
|
import Indicator from './components/Indicator.js';
|
|
4
3
|
import ItemComponent from './components/Item.js';
|
|
@@ -28,6 +27,6 @@ type MultiSelectProps<T> = {
|
|
|
28
27
|
onSubmit?: (selectedItems: Item<T>[]) => void;
|
|
29
28
|
onHighlight?: (highlightedItem: Item<T>) => void;
|
|
30
29
|
};
|
|
31
|
-
declare const MultiSelect: <T>({ items, defaultSelected, focus, initialIndex, indicatorComponent, checkboxComponent, itemComponent, limit, onSelect, onUnselect, onSubmit, onHighlight, }: MultiSelectProps<T>) =>
|
|
30
|
+
declare const MultiSelect: <T>({ items, defaultSelected, focus, initialIndex, indicatorComponent, checkboxComponent, itemComponent, limit, onSelect, onUnselect, onSubmit, onHighlight, }: MultiSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
32
31
|
export default MultiSelect;
|
|
33
32
|
export { Indicator, ItemComponent, CheckBox, type Item };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Box, useInput } from 'ink';
|
|
2
|
-
import
|
|
3
|
+
import { createElement, useCallback, useState } from 'react';
|
|
3
4
|
import CheckBox from './components/Checkbox.js';
|
|
4
5
|
import Indicator from './components/Indicator.js';
|
|
5
6
|
import ItemComponent from './components/Item.js';
|
|
@@ -51,18 +52,15 @@ const MultiSelect = ({ items = [], defaultSelected = [], focus = true, initialIn
|
|
|
51
52
|
handleSelect(slicedItems[highlightedIndex]);
|
|
52
53
|
}
|
|
53
54
|
}, [onHighlight, handleSelect, handleSubmit, slicedItems, highlightedIndex]), { isActive: focus });
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
isHighlighted,
|
|
64
|
-
})));
|
|
65
|
-
})));
|
|
55
|
+
return (_jsx(Box, { flexDirection: "column", children: slicedItems.map((item, index) => {
|
|
56
|
+
const key = item.key || item.label;
|
|
57
|
+
const isHighlighted = index === highlightedIndex;
|
|
58
|
+
const isSelected = includesItems(item, selectedItems);
|
|
59
|
+
return (_jsxs(Box, { children: [createElement(indicatorComponent, { isHighlighted }), createElement(checkboxComponent, { isSelected }), createElement(itemComponent, {
|
|
60
|
+
...item,
|
|
61
|
+
isHighlighted,
|
|
62
|
+
})] }, key));
|
|
63
|
+
}) }));
|
|
66
64
|
};
|
|
67
65
|
export default MultiSelect;
|
|
68
66
|
export { Indicator, ItemComponent, CheckBox };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
type CheckBoxProps = {
|
|
3
2
|
isSelected: boolean;
|
|
4
3
|
};
|
|
5
|
-
declare const CheckBox: ({ isSelected }: CheckBoxProps) =>
|
|
4
|
+
declare const CheckBox: ({ isSelected }: CheckBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default CheckBox;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import figures from 'figures';
|
|
2
3
|
import { Box, Text } from 'ink';
|
|
3
|
-
|
|
4
|
-
const CheckBox = ({ isSelected = false }) => (React.createElement(Box, { marginRight: 1 },
|
|
5
|
-
React.createElement(Text, { color: isSelected ? 'green' : 'white' }, isSelected ? figures.circleFilled : figures.circle)));
|
|
4
|
+
const CheckBox = ({ isSelected = false }) => (_jsx(Box, { marginRight: 1, children: _jsx(Text, { color: isSelected ? 'green' : 'white', children: isSelected ? figures.circleFilled : figures.circle }) }));
|
|
6
5
|
export default CheckBox;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
type IndicatorProps = {
|
|
3
2
|
isHighlighted: boolean;
|
|
4
3
|
};
|
|
5
|
-
declare const Indicator: ({ isHighlighted }: IndicatorProps) =>
|
|
4
|
+
declare const Indicator: ({ isHighlighted }: IndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default Indicator;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import figures from 'figures';
|
|
2
3
|
import { Box, Text } from 'ink';
|
|
3
|
-
|
|
4
|
-
const Indicator = ({ isHighlighted = false }) => (React.createElement(Box, { marginRight: 1 },
|
|
5
|
-
React.createElement(Text, { color: isHighlighted ? 'green' : undefined }, isHighlighted ? figures.pointer : ' ')));
|
|
4
|
+
const Indicator = ({ isHighlighted = false }) => (_jsx(Box, { marginRight: 1, children: _jsx(Text, { color: isHighlighted ? 'green' : undefined, children: isHighlighted ? figures.pointer : ' ' }) }));
|
|
6
5
|
export default Indicator;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
type ItemProps = {
|
|
3
2
|
isHighlighted: boolean;
|
|
4
3
|
label: string;
|
|
5
4
|
};
|
|
6
|
-
declare const Item: ({ isHighlighted, label }: ItemProps) =>
|
|
5
|
+
declare const Item: ({ isHighlighted, label }: ItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default Item;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Text } from 'ink';
|
|
2
|
-
|
|
3
|
-
const Item = ({ isHighlighted = false, label }) => (React.createElement(Text, { color: isHighlighted ? 'green' : 'white', bold: isHighlighted }, label));
|
|
3
|
+
const Item = ({ isHighlighted = false, label }) => (_jsx(Text, { color: isHighlighted ? 'green' : 'white', bold: isHighlighted, children: label }));
|
|
4
4
|
export default Item;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Divider from '../../Divider.js';
|
|
3
3
|
import Commands from './Commands.js';
|
|
4
4
|
/**
|
|
@@ -7,7 +7,5 @@ import Commands from './Commands.js';
|
|
|
7
7
|
* @param onCompletion
|
|
8
8
|
* @constructor
|
|
9
9
|
*/
|
|
10
|
-
const CloneRepo = ({ projectName, onCompletion }) => (
|
|
11
|
-
React.createElement(Divider, { title: 'Git tasks' }),
|
|
12
|
-
React.createElement(Commands, { projectName: projectName, onCompletion: onCompletion })));
|
|
10
|
+
const CloneRepo = ({ projectName, onCompletion }) => (_jsxs(_Fragment, { children: [_jsx(Divider, { title: 'Git tasks' }), _jsx(Commands, { projectName: projectName, onCompletion: onCompletion })] }));
|
|
13
11
|
export default CloneRepo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { join } from 'node:path';
|
|
2
3
|
import * as process from 'node:process';
|
|
3
4
|
import { Box, Text } from 'ink';
|
|
4
5
|
import { Script, Spawn } from 'ink-spawn';
|
|
5
|
-
import React from 'react';
|
|
6
6
|
import { repoUrl } from '../../../constants/config.js';
|
|
7
7
|
/**
|
|
8
8
|
* Executes all the commands to clone the dAppBooster repository.
|
|
@@ -11,19 +11,6 @@ import { repoUrl } from '../../../constants/config.js';
|
|
|
11
11
|
*/
|
|
12
12
|
const Commands = ({ projectName, onCompletion }) => {
|
|
13
13
|
const projectFolder = join(process.cwd(), projectName);
|
|
14
|
-
return (
|
|
15
|
-
React.createElement(Script, null,
|
|
16
|
-
React.createElement(Box, { columnGap: 1 },
|
|
17
|
-
React.createElement(Text, { color: 'whiteBright' }, "Cloning dAppBooster in"),
|
|
18
|
-
React.createElement(Text, { italic: true }, projectName)),
|
|
19
|
-
React.createElement(Spawn, { shell: true, silent: true, successText: 'Done!', failureText: `Failed to clone the project, check if a folder called "${projectName}" already exists and your read/write permissions...`, runningText: 'Working...', command: "git", args: ['clone', '--depth', '1', '--no-checkout', repoUrl, projectName] }),
|
|
20
|
-
React.createElement(Text, { color: 'whiteBright' }, "Fetching tags"),
|
|
21
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'git', args: ['fetch', '--tags'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...' }),
|
|
22
|
-
React.createElement(Text, { color: 'whiteBright' }, "Checking out latest tag"),
|
|
23
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, command: "git", args: ['checkout $(git describe --tags `git rev-list --tags --max-count=1`)'], successText: "Done!", failureText: 'Error...' }),
|
|
24
|
-
React.createElement(Text, { color: 'whiteBright' }, "Removing .git folder"),
|
|
25
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, command: "rm", args: ['-rf', '.git'], successText: "Done!", failureText: 'Error...' }),
|
|
26
|
-
React.createElement(Text, { color: 'whiteBright' }, "Initializing Git repository"),
|
|
27
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, command: "git", args: ['init'], successText: "Done!", failureText: 'Error...', onCompletion: onCompletion }))));
|
|
14
|
+
return (_jsx(Box, { flexDirection: 'column', gap: 0, children: _jsxs(Script, { children: [_jsxs(Box, { columnGap: 1, children: [_jsx(Text, { color: 'whiteBright', children: "Cloning dAppBooster in" }), _jsx(Text, { italic: true, children: projectName })] }), _jsx(Spawn, { shell: true, silent: true, successText: 'Done!', failureText: `Failed to clone the project, check if a folder called "${projectName}" already exists and your read/write permissions...`, runningText: 'Working...', command: "git", args: ['clone', '--depth', '1', '--no-checkout', repoUrl, projectName] }), _jsx(Text, { color: 'whiteBright', children: "Fetching tags" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'git', args: ['fetch', '--tags'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...' }), _jsx(Text, { color: 'whiteBright', children: "Checking out latest tag" }), _jsx(Spawn, { shell: true, cwd: projectFolder, command: "git", args: ['checkout $(git describe --tags `git rev-list --tags --max-count=1`)'], successText: "Done!", failureText: 'Error...' }), _jsx(Text, { color: 'whiteBright', children: "Removing .git folder" }), _jsx(Spawn, { shell: true, cwd: projectFolder, command: "rm", args: ['-rf', '.git'], successText: "Done!", failureText: 'Error...' }), _jsx(Text, { color: 'whiteBright', children: "Initializing Git repository" }), _jsx(Spawn, { shell: true, cwd: projectFolder, command: "git", args: ['init'], successText: "Done!", failureText: 'Error...', onCompletion: onCompletion })] }) }));
|
|
28
15
|
};
|
|
29
16
|
export default Commands;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { Box, Text } from 'ink';
|
|
4
5
|
import { Script, Spawn } from 'ink-spawn';
|
|
5
|
-
import
|
|
6
|
+
import { useMemo } from 'react';
|
|
6
7
|
import { featureSelected, getProjectFolder } from '../../utils/utils.js';
|
|
7
8
|
import Divider from '../Divider.js';
|
|
8
9
|
const packageJSONCleanup = (projectFolder, selectedFeatures) => {
|
|
@@ -34,39 +35,9 @@ const FileCleanup = ({ onCompletion, installationConfig, projectName }) => {
|
|
|
34
35
|
const { installationType, selectedFeatures } = installationConfig;
|
|
35
36
|
const projectFolder = useMemo(() => getProjectFolder(projectName), [projectName]);
|
|
36
37
|
const currentHomeFolder = `${projectFolder}/src/components/pageComponents/home`;
|
|
37
|
-
return (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
installationType === 'custom' && (React.createElement(Script, { onCompletion: () => packageJSONCleanup(projectFolder, selectedFeatures) },
|
|
42
|
-
!featureSelected('demo', selectedFeatures) && (React.createElement(Script, null,
|
|
43
|
-
React.createElement(Text, { color: 'whiteBright' }, "Component demos"),
|
|
44
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', currentHomeFolder], runningText: 'Removing home files...', successText: 'Done!', failureText: 'Error...' }),
|
|
45
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "mkdir", args: ['-p', currentHomeFolder], runningText: 'Creating home folder...', successText: 'Done!', failureText: 'Error...' }),
|
|
46
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "cp", args: ['./.install-files/home/index.tsx', currentHomeFolder], runningText: 'Creating new home page index file...', successText: 'Done!', failureText: 'Error...' }))),
|
|
47
|
-
!featureSelected('subgraph', selectedFeatures) && (React.createElement(Script, null,
|
|
48
|
-
React.createElement(Text, { color: 'whiteBright' }, "Subgraph"),
|
|
49
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './src/subgraphs'], runningText: 'Removing subgraphs folder...', successText: 'Done!', failureText: 'Error...' }),
|
|
50
|
-
featureSelected('demo', selectedFeatures) && (React.createElement(Script, null,
|
|
51
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', `${currentHomeFolder}/Examples/demos/subgraphs`], runningText: 'Removing subgraphs demos folder...', successText: 'Done!', failureText: 'Error...' }),
|
|
52
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: [`${currentHomeFolder}/Examples/index.tsx`], runningText: 'Removing examples index file...', successText: 'Done!', failureText: 'Error...' }),
|
|
53
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "cp", args: [
|
|
54
|
-
'./.install-files/home/Examples/index.tsx',
|
|
55
|
-
`${currentHomeFolder}/Examples/index.tsx`,
|
|
56
|
-
], runningText: 'Creating new examples index file...', successText: 'Done!', failureText: 'Error...' }))))),
|
|
57
|
-
!featureSelected('typedoc', selectedFeatures) && (React.createElement(Script, null,
|
|
58
|
-
React.createElement(Text, { color: 'whiteBright' }, "Typedoc"),
|
|
59
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./typedoc.json'], runningText: 'Removing config...', successText: 'Done!', failureText: 'Error...' }))),
|
|
60
|
-
!featureSelected('vocs', selectedFeatures) && (React.createElement(Script, null,
|
|
61
|
-
React.createElement(Text, { color: 'whiteBright' }, "Vocs"),
|
|
62
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./vocs.config.ts'], runningText: 'Removing config...', successText: 'Done!', failureText: 'Error...' }),
|
|
63
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './docs'], runningText: 'Removing docs folder...', successText: 'Done!', failureText: 'Error...' }))),
|
|
64
|
-
!featureSelected('husky', selectedFeatures) && (React.createElement(Script, null,
|
|
65
|
-
React.createElement(Text, { color: 'whiteBright' }, "Husky"),
|
|
66
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './.husky'], runningText: 'Removing Husky folder...', successText: 'Done!', failureText: 'Error...' }),
|
|
67
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./.lintstagedrc.mjs'], runningText: 'Removing lint-staged config...', successText: 'Done!', failureText: 'Error...' }),
|
|
68
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./commitlint.config.js'], runningText: 'Removing commitlint config...', successText: 'Done!', failureText: 'Error...' }))))),
|
|
69
|
-
React.createElement(Text, { color: 'whiteBright' }, "Install script"),
|
|
70
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './.install-files'], runningText: 'Removing folder...', successText: 'Done!', failureText: 'Error...', onCompletion: onCompletion })))));
|
|
38
|
+
return (_jsxs(_Fragment, { children: [_jsx(Divider, { title: 'File cleanup' }), _jsx(Box, { flexDirection: 'column', gap: 0, children: _jsxs(Script, { children: [installationType === 'custom' && (_jsxs(Script, { onCompletion: () => packageJSONCleanup(projectFolder, selectedFeatures), children: [!featureSelected('demo', selectedFeatures) && (_jsxs(Script, { children: [_jsx(Text, { color: 'whiteBright', children: "Component demos" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', currentHomeFolder], runningText: 'Removing home files...', successText: 'Done!', failureText: 'Error...' }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "mkdir", args: ['-p', currentHomeFolder], runningText: 'Creating home folder...', successText: 'Done!', failureText: 'Error...' }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "cp", args: ['./.install-files/home/index.tsx', currentHomeFolder], runningText: 'Creating new home page index file...', successText: 'Done!', failureText: 'Error...' })] })), !featureSelected('subgraph', selectedFeatures) && (_jsxs(Script, { children: [_jsx(Text, { color: 'whiteBright', children: "Subgraph" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './src/subgraphs'], runningText: 'Removing subgraphs folder...', successText: 'Done!', failureText: 'Error...' }), featureSelected('demo', selectedFeatures) && (_jsxs(Script, { children: [_jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', `${currentHomeFolder}/Examples/demos/subgraphs`], runningText: 'Removing subgraphs demos folder...', successText: 'Done!', failureText: 'Error...' }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: [`${currentHomeFolder}/Examples/index.tsx`], runningText: 'Removing examples index file...', successText: 'Done!', failureText: 'Error...' }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "cp", args: [
|
|
39
|
+
'./.install-files/home/Examples/index.tsx',
|
|
40
|
+
`${currentHomeFolder}/Examples/index.tsx`,
|
|
41
|
+
], runningText: 'Creating new examples index file...', successText: 'Done!', failureText: 'Error...' })] }))] })), !featureSelected('typedoc', selectedFeatures) && (_jsxs(Script, { children: [_jsx(Text, { color: 'whiteBright', children: "Typedoc" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./typedoc.json'], runningText: 'Removing config...', successText: 'Done!', failureText: 'Error...' })] })), !featureSelected('vocs', selectedFeatures) && (_jsxs(Script, { children: [_jsx(Text, { color: 'whiteBright', children: "Vocs" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./vocs.config.ts'], runningText: 'Removing config...', successText: 'Done!', failureText: 'Error...' }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './docs'], runningText: 'Removing docs folder...', successText: 'Done!', failureText: 'Error...' })] })), !featureSelected('husky', selectedFeatures) && (_jsxs(Script, { children: [_jsx(Text, { color: 'whiteBright', children: "Husky" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './.husky'], runningText: 'Removing Husky folder...', successText: 'Done!', failureText: 'Error...' }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./.lintstagedrc.mjs'], runningText: 'Removing lint-staged config...', successText: 'Done!', failureText: 'Error...' }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['./commitlint.config.js'], runningText: 'Removing commitlint config...', successText: 'Done!', failureText: 'Error...' })] }))] })), _jsx(Text, { color: 'whiteBright', children: "Install script" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: "rm", args: ['-rf', './.install-files'], runningText: 'Removing folder...', successText: 'Done!', failureText: 'Error...', onCompletion: onCompletion })] }) })] }));
|
|
71
42
|
};
|
|
72
43
|
export default FileCleanup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Box, Text } from 'ink';
|
|
2
3
|
import { Script, Spawn } from 'ink-spawn';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { getPackages } from '../../../utils/utils.js';
|
|
5
5
|
import InstallAllPackages from './InstallAllPackages.js';
|
|
6
6
|
/**
|
|
@@ -21,11 +21,6 @@ const CustomInstallation = ({ onCompletion, selectedFeatures, projectFolder }) =
|
|
|
21
21
|
]
|
|
22
22
|
.join(' ')
|
|
23
23
|
.trim();
|
|
24
|
-
return (
|
|
25
|
-
React.createElement(InstallAllPackages, { projectFolder: projectFolder, onCompletion: onCompletion }))) : (React.createElement(Script, null,
|
|
26
|
-
React.createElement(Text, { color: 'whiteBright' }, "Installing packages"),
|
|
27
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'pnpm', args: ['remove', packagesToRemove], runningText: 'Working...', successText: 'Done!', failureText: 'Error...' }),
|
|
28
|
-
React.createElement(Text, { color: 'whiteBright' }, "Executing post-install scripts"),
|
|
29
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'pnpm', args: ['run', 'postinstall'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...', onCompletion: onCompletion })))));
|
|
24
|
+
return (_jsx(Box, { flexDirection: 'column', gap: 0, children: !packagesToRemove ? (_jsx(Script, { children: _jsx(InstallAllPackages, { projectFolder: projectFolder, onCompletion: onCompletion }) })) : (_jsxs(Script, { children: [_jsx(Text, { color: 'whiteBright', children: "Installing packages" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'pnpm', args: ['remove', packagesToRemove], runningText: 'Working...', successText: 'Done!', failureText: 'Error...' }), _jsx(Text, { color: 'whiteBright', children: "Executing post-install scripts" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'pnpm', args: ['run', 'postinstall'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...', onCompletion: onCompletion })] })) }));
|
|
30
25
|
};
|
|
31
26
|
export default CustomInstallation;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Box } from 'ink';
|
|
2
3
|
import { Script } from 'ink-spawn';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import InstallAllPackages from './InstallAllPackages.js';
|
|
5
5
|
const FullInstallation = ({ onCompletion, projectFolder }) => {
|
|
6
|
-
return (
|
|
7
|
-
React.createElement(Script, null,
|
|
8
|
-
React.createElement(InstallAllPackages, { projectFolder: projectFolder, onCompletion: onCompletion }))));
|
|
6
|
+
return (_jsx(Box, { flexDirection: 'column', gap: 0, children: _jsx(Script, { children: _jsx(InstallAllPackages, { projectFolder: projectFolder, onCompletion: onCompletion }) }) }));
|
|
9
7
|
};
|
|
10
8
|
export default FullInstallation;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { Box, Text } from 'ink';
|
|
2
3
|
import { Script, Spawn } from 'ink-spawn';
|
|
3
|
-
import
|
|
4
|
+
import { useMemo } from 'react';
|
|
4
5
|
import { getProjectFolder } from '../../../utils/utils.js';
|
|
5
6
|
import Divider from '../../Divider.js';
|
|
6
7
|
import CustomInstallation from './CustomInstallation.js';
|
|
@@ -11,19 +12,6 @@ const Install = ({ projectName, onCompletion, installationConfig }) => {
|
|
|
11
12
|
const title = installationType
|
|
12
13
|
? installationType[0]?.toUpperCase() + installationType.slice(1)
|
|
13
14
|
: '';
|
|
14
|
-
return (
|
|
15
|
-
React.createElement(Divider, { title: `${title ?? 'Full'} installation` }),
|
|
16
|
-
React.createElement(Box, { flexDirection: 'column', gap: 0 },
|
|
17
|
-
React.createElement(Script, null,
|
|
18
|
-
React.createElement(Box, { columnGap: 1 },
|
|
19
|
-
React.createElement(Text, { color: 'whiteBright' },
|
|
20
|
-
"Creating",
|
|
21
|
-
' ',
|
|
22
|
-
React.createElement(Text, { italic: true, color: 'white' }, ".env.local"),
|
|
23
|
-
' ',
|
|
24
|
-
"file")),
|
|
25
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'cp', args: ['.env.example', '.env.local'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...' }),
|
|
26
|
-
installationType === 'full' && (React.createElement(FullInstallation, { onCompletion: onCompletion, projectFolder: projectFolder })),
|
|
27
|
-
installationType === 'custom' && (React.createElement(CustomInstallation, { selectedFeatures: selectedFeatures, onCompletion: onCompletion, projectFolder: projectFolder }))))));
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsx(Divider, { title: `${title ?? 'Full'} installation` }), _jsx(Box, { flexDirection: 'column', gap: 0, children: _jsxs(Script, { children: [_jsx(Box, { columnGap: 1, children: _jsxs(Text, { color: 'whiteBright', children: ["Creating", ' ', _jsx(Text, { italic: true, color: 'white', children: ".env.local" }), ' ', "file"] }) }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'cp', args: ['.env.example', '.env.local'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...' }), installationType === 'full' && (_jsx(FullInstallation, { onCompletion: onCompletion, projectFolder: projectFolder })), installationType === 'custom' && (_jsx(CustomInstallation, { selectedFeatures: selectedFeatures, onCompletion: onCompletion, projectFolder: projectFolder }))] }) })] }));
|
|
28
16
|
};
|
|
29
17
|
export default Install;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Text } from 'ink';
|
|
2
3
|
import { Spawn } from 'ink-spawn';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
const InstallAllPackages = ({ projectFolder, onCompletion }) => {
|
|
5
|
-
return (
|
|
6
|
-
React.createElement(Text, { color: 'whiteBright' }, "Installing packages"),
|
|
7
|
-
React.createElement(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'pnpm', args: ['i'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...', onCompletion: onCompletion })));
|
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { color: 'whiteBright', children: "Installing packages" }), _jsx(Spawn, { shell: true, cwd: projectFolder, silent: true, command: 'pnpm', args: ['i'], runningText: 'Working...', successText: 'Done!', failureText: 'Error...', onCompletion: onCompletion })] }));
|
|
8
6
|
};
|
|
9
7
|
export default InstallAllPackages;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import figures from 'figures';
|
|
2
3
|
import { Text } from 'ink';
|
|
3
4
|
import SelectInput from 'ink-select-input';
|
|
4
|
-
import
|
|
5
|
+
import { useState } from 'react';
|
|
5
6
|
import Divider from '../Divider.js';
|
|
6
7
|
const installationTypeItems = [
|
|
7
8
|
{
|
|
@@ -20,9 +21,6 @@ const InstallationMode = ({ onCompletion, onSelect }) => {
|
|
|
20
21
|
onCompletion();
|
|
21
22
|
setIsFocused(false);
|
|
22
23
|
};
|
|
23
|
-
return (
|
|
24
|
-
React.createElement(Divider, { title: 'Installation setup' }),
|
|
25
|
-
React.createElement(Text, { color: 'whiteBright' }, "Choose installation type"),
|
|
26
|
-
React.createElement(SelectInput, { indicatorComponent: ({ isSelected }) => (React.createElement(Text, { color: "green" }, isSelected ? `${figures.pointer} ` : ' ')), itemComponent: ({ label, isSelected }) => (React.createElement(Text, { color: isSelected ? 'green' : 'white', bold: isSelected }, label)), isFocused: isFocused, items: installationTypeItems, onSelect: handleSelect })));
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(Divider, { title: 'Installation setup' }), _jsx(Text, { color: 'whiteBright', children: "Choose installation type" }), _jsx(SelectInput, { indicatorComponent: ({ isSelected }) => (_jsx(Text, { color: "green", children: isSelected ? `${figures.pointer} ` : ' ' })), itemComponent: ({ label, isSelected }) => (_jsx(Text, { color: isSelected ? 'green' : 'white', bold: isSelected, children: label })), isFocused: isFocused, items: installationTypeItems, onSelect: handleSelect })] }));
|
|
27
25
|
};
|
|
28
26
|
export default InstallationMode;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MultiSelectItem } from '../../types/types.js';
|
|
3
3
|
interface Props {
|
|
4
|
-
installation: InstallationType | undefined;
|
|
5
4
|
onCompletion: () => void;
|
|
6
5
|
onSubmit: (selectedItems: Array<MultiSelectItem>) => void;
|
|
6
|
+
skip?: boolean;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Step for selecting optional packages. Skipped if installation type is 'full'.
|
|
10
10
|
* @param onCompletion
|
|
11
11
|
* @param onSubmit
|
|
12
12
|
* @param installation
|
|
13
|
+
* @param skip
|
|
13
14
|
*/
|
|
14
15
|
declare const OptionalPackages: FC<Props>;
|
|
15
16
|
export default OptionalPackages;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Text } from 'ink';
|
|
2
|
-
import
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
3
4
|
import MultiSelect from '../Multiselect/index.js';
|
|
4
5
|
const customPackages = [
|
|
5
6
|
{
|
|
@@ -28,11 +29,11 @@ const customPackages = [
|
|
|
28
29
|
* @param onCompletion
|
|
29
30
|
* @param onSubmit
|
|
30
31
|
* @param installation
|
|
32
|
+
* @param skip
|
|
31
33
|
*/
|
|
32
|
-
const OptionalPackages = ({ onCompletion, onSubmit,
|
|
34
|
+
const OptionalPackages = ({ onCompletion, onSubmit, skip = false }) => {
|
|
33
35
|
const [isFocused, setIsFocused] = useState(true);
|
|
34
|
-
|
|
35
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: Run this only once
|
|
36
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: Run this only once, no matter what
|
|
36
37
|
useEffect(() => {
|
|
37
38
|
// full installation, do nothing
|
|
38
39
|
if (skip) {
|
|
@@ -44,8 +45,6 @@ const OptionalPackages = ({ onCompletion, onSubmit, installation }) => {
|
|
|
44
45
|
setIsFocused(false);
|
|
45
46
|
onCompletion();
|
|
46
47
|
};
|
|
47
|
-
return skip ? null : (
|
|
48
|
-
React.createElement(Text, { color: 'whiteBright' }, "Choose optional packages"),
|
|
49
|
-
React.createElement(MultiSelect, { defaultSelected: customPackages, focus: isFocused, items: customPackages, onSubmit: onHandleSubmit })));
|
|
48
|
+
return skip ? null : (_jsxs(_Fragment, { children: [_jsx(Text, { color: 'whiteBright', children: "Choose optional packages" }), _jsx(MultiSelect, { defaultSelected: customPackages, focus: isFocused, items: customPackages, onSubmit: onHandleSubmit })] }));
|
|
50
49
|
};
|
|
51
50
|
export default OptionalPackages;
|
|
@@ -1,67 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import figures from 'figures';
|
|
2
3
|
import { Box, Text } from 'ink';
|
|
3
4
|
import Link from 'ink-link';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
import { featureSelected } from '../../utils/utils.js';
|
|
6
6
|
import Divider from '../Divider.js';
|
|
7
|
-
const SubgraphWarningMessage = () => (
|
|
8
|
-
|
|
9
|
-
React.createElement(Text, { color: 'yellow' },
|
|
10
|
-
figures.warning,
|
|
11
|
-
figures.warning,
|
|
12
|
-
" ",
|
|
13
|
-
React.createElement(Text, { bold: true }, "WARNING:"),
|
|
14
|
-
" You ",
|
|
15
|
-
React.createElement(Text, { bold: true }, "MUST"),
|
|
16
|
-
" finish the subgraph's configuration manually ",
|
|
17
|
-
figures.warning,
|
|
18
|
-
figures.warning)),
|
|
19
|
-
React.createElement(Text, { bold: true }, "Follow these steps:"),
|
|
20
|
-
React.createElement(Box, { flexDirection: 'column' },
|
|
21
|
-
React.createElement(Text, null,
|
|
22
|
-
"1- Provide your own API key for ",
|
|
23
|
-
React.createElement(Text, { bold: true }, "PUBLIC_SUBGRAPHS_API_KEY"),
|
|
24
|
-
" in",
|
|
25
|
-
' ',
|
|
26
|
-
React.createElement(Text, { bold: true }, ".env.local"),
|
|
27
|
-
" You can get one at",
|
|
28
|
-
' ',
|
|
29
|
-
React.createElement(Link, { url: "https://thegraph.com/studio/apikeys" }, "https://thegraph.com/studio/apikeys")),
|
|
30
|
-
React.createElement(Text, null,
|
|
31
|
-
"2- After the API key is correctly configured, run ",
|
|
32
|
-
React.createElement(Text, { bold: true }, "pnpm subgraph-codegen"),
|
|
33
|
-
" in your console from the project's folder")),
|
|
34
|
-
React.createElement(Text, null,
|
|
35
|
-
"More configuration info in",
|
|
36
|
-
' ',
|
|
37
|
-
React.createElement(Link, { url: 'https://docs.dappbooster.dev/introduction/getting-started' }, "the docs"),
|
|
38
|
-
"."),
|
|
39
|
-
React.createElement(Text, { color: 'yellow', bold: true },
|
|
40
|
-
figures.info,
|
|
41
|
-
" Only after you have followed the previous steps you may proceed.")));
|
|
42
|
-
const PostInstallMessage = ({ projectName }) => (React.createElement(Box, { flexDirection: 'column', rowGap: 1, paddingBottom: 2 },
|
|
43
|
-
React.createElement(Text, { bold: true }, "To start development on your project:"),
|
|
44
|
-
React.createElement(Box, { flexDirection: 'column' },
|
|
45
|
-
React.createElement(Text, null,
|
|
46
|
-
"1- Move into the project's folder with ",
|
|
47
|
-
React.createElement(Text, { bold: true },
|
|
48
|
-
"cd ",
|
|
49
|
-
projectName)),
|
|
50
|
-
React.createElement(Text, null,
|
|
51
|
-
"2- Start the development server with ",
|
|
52
|
-
React.createElement(Text, { bold: true }, "pnpm dev"))),
|
|
53
|
-
React.createElement(Text, { bold: true }, "More info:"),
|
|
54
|
-
React.createElement(Box, { flexDirection: 'column' },
|
|
55
|
-
React.createElement(Text, null,
|
|
56
|
-
"- Check out ",
|
|
57
|
-
React.createElement(Text, { bold: true }, ".env.local"),
|
|
58
|
-
" for more configurations."),
|
|
59
|
-
React.createElement(Text, null,
|
|
60
|
-
"- Read the docs at",
|
|
61
|
-
' ',
|
|
62
|
-
React.createElement(Link, { url: "https://docs.dappbooster.dev" }, "https://docs.dappbooster.dev"),
|
|
63
|
-
" to know more about ",
|
|
64
|
-
React.createElement(Text, { bold: true }, "dAppBooster")))));
|
|
7
|
+
const SubgraphWarningMessage = () => (_jsxs(Box, { flexDirection: 'column', rowGap: 1, children: [_jsx(Box, { alignItems: 'center', borderColor: 'yellow', borderStyle: 'bold', flexDirection: 'column', justifyContent: 'center', padding: 1, children: _jsxs(Text, { color: 'yellow', children: [figures.warning, figures.warning, " ", _jsx(Text, { bold: true, children: "WARNING:" }), " You ", _jsx(Text, { bold: true, children: "MUST" }), " finish the subgraph's configuration manually ", figures.warning, figures.warning] }) }), _jsx(Text, { color: 'whiteBright', children: "Follow these steps:" }), _jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: ["1- Provide your own API key for ", _jsx(Text, { color: 'gray', children: "PUBLIC_SUBGRAPHS_API_KEY" }), " in", ' ', _jsx(Text, { color: 'gray', children: ".env.local" }), " You can get one", ' ', _jsx(Link, { url: "https://thegraph.com/studio/apikeys", children: "here" })] }), _jsxs(Text, { children: ["2- After the API key is correctly configured, run", ' ', _jsx(Text, { color: 'gray', children: "pnpm subgraph-codegen" }), " in your console from the project's folder"] })] }), _jsxs(Text, { children: ["More configuration info in", ' ', _jsx(Link, { url: 'https://docs.dappbooster.dev/introduction/getting-started', children: "the docs" }), "."] }), _jsxs(Text, { color: 'yellow', bold: true, children: [figures.info, " Only after you have followed the previous steps you may proceed."] })] }));
|
|
8
|
+
const PostInstallMessage = ({ projectName }) => (_jsxs(Box, { flexDirection: 'column', rowGap: 1, paddingBottom: 2, children: [_jsx(Text, { color: 'whiteBright', children: "To start development on your project:" }), _jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: ["1- Move into the project's folder with ", _jsxs(Text, { color: 'gray', children: ["cd ", projectName] })] }), _jsxs(Text, { children: ["2- Start the development server with ", _jsx(Text, { color: 'gray', children: "pnpm dev" })] })] }), _jsx(Text, { color: 'whiteBright', children: "More info:" }), _jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: ["- Check out ", _jsx(Text, { color: 'gray', children: ".env.local" }), " for more configurations."] }), _jsxs(Text, { children: ["- Read ", _jsx(Link, { url: "https://docs.dappbooster.dev", children: "the docs" }), " to know more about", ' ', _jsx(Text, { color: 'gray', children: "dAppBooster" }), "!"] }), _jsxs(Text, { children: ["- Report issues with this installer", ' ', _jsx(Link, { url: "https://github.com/BootNodeDev/dAppBoosterInstallScript/issues", children: "here" })] })] })] }));
|
|
65
9
|
/**
|
|
66
10
|
* Component to ask for the project name.
|
|
67
11
|
* @param selectedFeatures
|
|
@@ -70,10 +14,6 @@ const PostInstallMessage = ({ projectName }) => (React.createElement(Box, { flex
|
|
|
70
14
|
const PostInstall = ({ installationConfig, projectName }) => {
|
|
71
15
|
const { selectedFeatures, installationType } = installationConfig;
|
|
72
16
|
const subgraphSupport = featureSelected('subgraph', selectedFeatures);
|
|
73
|
-
return (
|
|
74
|
-
React.createElement(Divider, { title: 'Post-install instructions' }),
|
|
75
|
-
React.createElement(Box, { flexDirection: 'column', rowGap: 2 },
|
|
76
|
-
(subgraphSupport || installationType === 'full') && React.createElement(SubgraphWarningMessage, null),
|
|
77
|
-
React.createElement(PostInstallMessage, { projectName: projectName }))));
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(Divider, { title: 'Post-install instructions' }), _jsxs(Box, { flexDirection: 'column', rowGap: 2, children: [(subgraphSupport || installationType === 'full') && _jsx(SubgraphWarningMessage, {}), _jsx(PostInstallMessage, { projectName: projectName })] })] }));
|
|
78
18
|
};
|
|
79
19
|
export default PostInstall;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
2
3
|
import { isValidName } from '../../utils/utils.js';
|
|
3
4
|
import Ask from '../Ask.js';
|
|
4
5
|
/**
|
|
@@ -20,6 +21,6 @@ const ProjectName = ({ projectName, onSubmit, onCompletion }) => {
|
|
|
20
21
|
onCompletion();
|
|
21
22
|
}
|
|
22
23
|
}, [onSubmit, onCompletion]);
|
|
23
|
-
return (
|
|
24
|
+
return (_jsx(Ask, { answer: projectName, errorMessage: errorMessage, onSubmit: handleSubmit, question: 'Project name', tip: 'Letters (a–z, A–Z), numbers (0–9), and underscores (_) are allowed.' }));
|
|
24
25
|
};
|
|
25
26
|
export default ProjectName;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,14 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
An easy way to install and customize [dAppBooster](https://dappbooster.dev/)
|
|
4
4
|
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node >= 20
|
|
8
|
+
- pnpm
|
|
9
|
+
|
|
5
10
|
## Usage
|
|
6
11
|
|
|
12
|
+
<img src="./demo.svg" width="600">
|
|
13
|
+
|
|
7
14
|
```shell
|
|
8
|
-
|
|
15
|
+
pnpm dlx dappbooster
|
|
9
16
|
```
|
|
10
17
|
|
|
11
|
-
<img src="./demo.svg" width="600">
|
|
12
|
-
|
|
13
18
|
dAppBooster documentation: https://docs.dappbooster.dev/
|
|
14
19
|
|
|
15
20
|
## Development
|
|
@@ -31,7 +36,7 @@ pnpm i
|
|
|
31
36
|
You can run the script by doing
|
|
32
37
|
|
|
33
38
|
```shell
|
|
34
|
-
|
|
39
|
+
node cli.js
|
|
35
40
|
```
|
|
36
41
|
|
|
37
42
|
## Releasing new versions to NPM
|