feat(create-typink): add network selection#263
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds network selection functionality to the create-typink CLI tool and updates all template files with improved standardization.
- Adds CLI support for network selection via
-N/--networksoption for both legacy (Aleph Zero, Astar) and v6 (Passet Hub, Kusama Asset Hub, etc.) ink versions - Standardizes template files by removing unused React imports, updating React DOM imports, adding ESLint configurations, and updating dependency versions
- Implements dynamic network configuration system with placeholder replacement in template files
Reviewed Changes
Copilot reviewed 82 out of 82 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/create-typink/src/utils/options.ts | Adds network selection prompts and validation logic |
| packages/create-typink/src/utils/networks.ts | Implements network configuration generation for templates |
| packages/create-typink/src/tasks/copyTemplateFiles.ts | Adds network placeholder replacement functionality |
| Multiple template files | Standardizes imports, adds ESLint configs, updates dependencies |
| .github/workflows/create-typink-template-tests.yml | Updates CI to test network selection functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...s/create-typink/templates/v6-subconnectv2-nextjs/src/providers/wallet-connector-provider.tsx
Show resolved
Hide resolved
...eate-typink/templates/legacy-subconnectv2-nextjs/src/providers/wallet-connector-provider.tsx
Show resolved
Hide resolved
| @@ -18,6 +18,7 @@ export function renderHelpMessage() { | |||
| console.log(` ${chalk.bold.blue('Options:')} | |||
| ${chalk.gray('-n, --name')} Project name | |||
| ${chalk.gray('-t, --template')} Template {inkVersion}-{walletConnector}-{ui} [inkVersion: <legacy|v6>, walletConnector: <typink|subconnectv2|talisman>, ui: <nextjs|vite>] (e.g. legacy-typink-vite) | |||
There was a problem hiding this comment.
We should generally improve this, the instruction here is a bit confusing for people. Maybe simplify this and have a list of template name below for people to pick.
| "@trivago/prettier-plugin-sort-imports": "^4.3.0", | ||
| "@typescript-eslint/eslint-plugin": "^6.21.0", | ||
| "@typescript-eslint/parser": "^6.21.0", | ||
| "eslint": "^8.57.1", |
There was a problem hiding this comment.
We should bump vite & eslint and related packages to latest version.
sinzii
left a comment
There was a problem hiding this comment.
Looking good to me generally, 2 things we can do to improve this but can be done in a different PR. Merging this for now since it's already too big.
Changes: