Skip to content

Commit 2ecdf45

Browse files
committed
clean up cli options
1 parent f54e93a commit 2ecdf45

File tree

4 files changed

+6
-83
lines changed

4 files changed

+6
-83
lines changed

packages/create-typink/src/tasks/copyTemplateFiles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export async function copyTemplateFiles(
1111
targetDir: string,
1212
task: ListrTaskWrapper<any, typeof DefaultRenderer, typeof SimpleRenderer>,
1313
) {
14-
const { projectName, noGit, inkVersion, walletConnector, ui } = options;
15-
const template = `${inkVersion}-${walletConnector}-${ui}`;
14+
const { projectName, noGit, inkVersion } = options;
15+
const template = `${inkVersion}-nextjs`;
1616

1717
task.title = `🚀 Initializing new Typink dApp`;
1818

packages/create-typink/src/types.ts

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ export type BaseOptions = {
77
projectName: string | null;
88
skipInstall: boolean;
99
inkVersion: InkVersion | null;
10-
walletConnector: WalletConnector | null;
1110
networks: string[] | null;
12-
ui: UI | null;
1311
template: Template | null;
1412
// This option will be determined by the user agent instead of being set by the user
1513
pkgManager: PkgManagerInfo;
@@ -23,24 +21,8 @@ export type RawOptions = {
2321

2422
export type Options = BaseOptions & RawOptions;
2523

26-
// Template naming convention: {inkVersion}-{walletConnector}-{nextjs|vite}
27-
// inkVersion: legacy | v6
28-
// walletConnector: typink | subconnectv2 | talisman
29-
// ui: nextjs | vite
30-
export const TEMPLATES = [
31-
'legacy-typink-vite',
32-
'legacy-subconnectv2-vite',
33-
'legacy-talisman-vite',
34-
'legacy-typink-nextjs',
35-
'legacy-subconnectv2-nextjs',
36-
'legacy-talisman-nextjs',
37-
'v6-typink-vite',
38-
'v6-subconnectv2-vite',
39-
'v6-talisman-vite',
40-
'v6-typink-nextjs',
41-
'v6-subconnectv2-nextjs',
42-
'v6-talisman-nextjs',
43-
] as const;
24+
export const TEMPLATES = ['legacy-nextjs', 'v6-nextjs'] as const;
25+
4426
export type Template = (typeof TEMPLATES)[number];
4527

4628
export enum InkVersion {
@@ -61,43 +43,6 @@ export const INK_VERSIONS_CHOICES = [
6143
},
6244
] as const;
6345

64-
export enum WalletConnector {
65-
Typink = 'typink',
66-
SubConnectV2 = 'subconnectv2',
67-
Talisman = 'talisman',
68-
}
69-
70-
export const WALLET_CONNECTORS_CHOICES = [
71-
{
72-
name: 'Typink',
73-
value: WalletConnector.Typink,
74-
},
75-
{
76-
name: 'SubConnect V2',
77-
value: WalletConnector.SubConnectV2,
78-
},
79-
{
80-
name: 'Talisman Connect',
81-
value: WalletConnector.Talisman,
82-
},
83-
] as const;
84-
85-
export enum UI {
86-
Vite = 'vite',
87-
NextJS = 'nextjs',
88-
}
89-
90-
export const UI_CHOICES = [
91-
{
92-
name: 'Vite + Charka UI',
93-
value: UI.Vite,
94-
},
95-
{
96-
name: 'Next.JS + shadcn/ui',
97-
value: UI.NextJS,
98-
},
99-
] as const;
100-
10146
export const LEGACY_NETWORKS = [
10247
{
10348
name: 'Aleph Zero Testnet',

packages/create-typink/src/utils/options.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,15 @@ import {
77
LEGACY_NETWORKS,
88
Options,
99
TEMPLATES,
10-
UI,
11-
UI_CHOICES,
1210
V6_NETWORKS,
13-
WALLET_CONNECTORS_CHOICES,
14-
WalletConnector,
1511
} from '../types.js';
1612
import validate from 'validate-npm-package-name';
1713
import { stringCamelCase } from '@dedot/utils';
1814

1915
const defaultOptions: BaseOptions = {
2016
projectName: 'my-typink-app',
2117
inkVersion: InkVersion.InkV6,
22-
walletConnector: WalletConnector.Typink,
23-
ui: UI.Vite,
24-
template: 'legacy-typink-vite',
18+
template: 'v6-nextjs',
2519
networks: [],
2620
skipInstall: false,
2721
pkgManager: { name: 'npm' },
@@ -52,20 +46,6 @@ export async function promptMissingOptions(options: Options): Promise<Options> {
5246
choices: INK_VERSIONS_CHOICES,
5347
default: defaultOptions.inkVersion,
5448
},
55-
{
56-
type: 'list',
57-
name: 'walletConnector',
58-
message: 'Which wallet connector do you want to use?',
59-
choices: WALLET_CONNECTORS_CHOICES,
60-
default: defaultOptions.walletConnector,
61-
},
62-
{
63-
type: 'list',
64-
name: 'ui',
65-
message: 'Which UI template do you want to use?',
66-
choices: UI_CHOICES,
67-
default: defaultOptions.ui,
68-
},
6949
{
7050
type: 'checkbox',
7151
name: 'networks',
@@ -158,8 +138,6 @@ export function parseArguments(): Options {
158138
return {
159139
projectName: args['--name'] || null,
160140
inkVersion,
161-
walletConnector,
162-
ui,
163141
template: args['--template'] || null,
164142
networks: args['--networks'] || null,
165143
skipInstall: !!args['--skip-install'],

packages/create-typink/src/utils/render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function renderHelpMessage() {
1717
`);
1818
console.log(` ${chalk.bold.blue('Options:')}
1919
${chalk.gray('-n, --name')} Project name
20-
${chalk.gray('-t, --template')} Template {inkVersion}-{walletConnector}-{ui} [inkVersion: <legacy|v6>, walletConnector: <typink|subconnectv2|talisman>, ui: <nextjs|vite>] (e.g. legacy-typink-vite)
20+
${chalk.gray('-t, --template')} Template to use (available template: v6-nextjs, legacy-nextjs)
2121
${chalk.gray('-N, --networks')} Network [legacy: <Aleph Zero Testnet|Aleph Zero|Astar>, v6: <Passet Hub|Westend Asset Hub|Kusama Asset Hub>]
2222
${chalk.gray('--skip, --skip-install')} Skip packages installation
2323
${chalk.gray('--no-git')} Skip git initialization

0 commit comments

Comments
 (0)