Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d63add7
Add more chain for v6
1cedrus Aug 18, 2025
bf24faf
Add nextjs template for legacy and v6 [WIP]
1cedrus Aug 19, 2025
18fd0d3
Change the way create-typink work
1cedrus Aug 23, 2025
145a544
Merge branch 'refs/heads/main' into feature/create-typink-improvement
1cedrus Aug 24, 2025
3df73b9
Merge branch 'feature/add-new-template' into feature/create-typink-im…
1cedrus Aug 24, 2025
a0d3287
Add templates
1cedrus Aug 25, 2025
e29d8cf
Update yarn.lock
1cedrus Aug 25, 2025
4446260
Remove tests of old create-typink impl
1cedrus Aug 25, 2025
36743fb
Remove wrong add templates
1cedrus Aug 25, 2025
c827529
Add templates
1cedrus Aug 25, 2025
25fcff8
Update template options
1cedrus Aug 25, 2025
56c3b1a
Revert package.json
1cedrus Aug 25, 2025
211d62b
Fix wrong config in options
1cedrus Aug 25, 2025
b3a0aa2
Update yarn.lock
1cedrus Aug 25, 2025
a1c7c75
Use giget to download templates
1cedrus Aug 26, 2025
33d2fdf
Merge branch 'refs/heads/main' into feature/create-typink-improvement
1cedrus Aug 26, 2025
693e936
Update yarn.lock
1cedrus Aug 26, 2025
58b1455
Update the typink vesion of templates
1cedrus Aug 26, 2025
981615b
Refactor code
1cedrus Aug 26, 2025
cb12f52
Add more questions
1cedrus Aug 27, 2025
191784e
Refactor & Update render string
1cedrus Aug 27, 2025
7a60e1c
Fix template not download
1cedrus Aug 27, 2025
95b2241
Refactor templates
1cedrus Aug 27, 2025
24137e5
Update templates
1cedrus Aug 28, 2025
9b6b71b
Resolve conflicts when update to typink 0.4
1cedrus Aug 29, 2025
7425303
Change default network
1cedrus Aug 30, 2025
fa21b95
Add tests
1cedrus Aug 30, 2025
98ef2c9
Update tests
1cedrus Aug 30, 2025
b8d4504
Update tests
1cedrus Aug 30, 2025
09f84b4
Use bun to tests
1cedrus Aug 30, 2025
26c8cdb
Add missing components
1cedrus Aug 30, 2025
ae1ed26
Fix errors when build nextjs template prj
1cedrus Aug 30, 2025
3e3eb1d
Fix errors
1cedrus Aug 30, 2025
e4f24bb
Remove --port in vite templates
1cedrus Aug 30, 2025
2d3b941
misc fix
sinzii Aug 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
122 changes: 122 additions & 0 deletions .github/workflows/create-typink-template-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Create-Typink Template Tests

on:
push:
workflow_dispatch:
merge_group:

env:
TYPINK_TEMPLATE_BRANCH: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'yarn'

- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install repo deps
run: yarn install --immutable

- name: Build create-typink CLI
run: yarn workspace create-typink build

- name: CLI smoke tests
run: |
node packages/create-typink/dist/index.js --help

# Invalid template should be rejected
if node packages/create-typink/dist/index.js --name "test" --template "invalid-template" 2>&1 | grep -q "not supported"; then
echo "✅ CLI correctly rejects invalid template"
else
echo "❌ CLI should reject invalid template"
exit 1
fi

# Invalid project name should be rejected
if node packages/create-typink/dist/index.js --name "Invalid Name With Spaces" --template "legacy-typink-vite" 2>&1 | grep -q "not a valid package name"; then
echo "✅ CLI correctly rejects invalid project name"
else
echo "❌ CLI should reject invalid project name"
exit 1
fi

- name: Test all templates (Node 20 + Bun)
shell: bash
run: |
set -euo pipefail

TEMPLATES=(
legacy-typink-vite
legacy-subconnectv2-vite
legacy-talisman-vite
legacy-typink-nextjs
legacy-subconnectv2-nextjs
legacy-talisman-nextjs
v6-typink-vite
v6-subconnectv2-vite
v6-talisman-vite
v6-typink-nextjs
v6-subconnectv2-nextjs
v6-talisman-nextjs
)

for T in "${TEMPLATES[@]}"; do
WORKDIR="/tmp/typink-test-${T}-20"
APPDIR="${WORKDIR}/test-app-${T}"

echo "=== Creating ${T} (Node 20 + Bun) ==="
rm -rf "$WORKDIR"
mkdir -p "$WORKDIR"
cd "$WORKDIR"

node ${{ github.workspace }}/packages/create-typink/dist/index.js \
--name "test-app-${T}" \
--template "${T}" \
--skip-install \
--no-git

cd "$APPDIR"

# Install deps with Bun
bun install --no-progress

# Build with Bun (runs package.json "build" script)
bun run build

# Verify build artifacts
if [[ "$T" == *"nextjs"* ]]; then
if [ ! -d ".next" ]; then
echo "❌ Next.js build failed for ${T} - .next directory not found"
exit 1
fi
echo "✅ Next.js build successful for ${T}"
else
if [ ! -d "dist" ]; then
echo "❌ Vite build failed for ${T} - dist directory not found"
exit 1
fi
echo "✅ Vite build successful for ${T}"
fi

# TypeScript check if tsconfig exists
if [ -f "tsconfig.json" ]; then
bun x tsc --noEmit
echo "✅ TypeScript compilation successful for ${T}"
fi

# Clean up
rm -rf "$WORKDIR"
done
96 changes: 0 additions & 96 deletions .github/workflows/create-typink-tests.yml

This file was deleted.

4 changes: 2 additions & 2 deletions packages/create-typink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "src/index.ts",
"type": "module",
"scripts": {
"build": "tsc --project tsconfig.build.json && cp -R ./bin ./dist && cp -R ./src/templates ./dist",
"build": "tsc --project tsconfig.build.json && cp -R ./bin ./dist",
"clean": "rm -rf ./dist && rm -rf ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo",
"test": "npx vitest --watch=false"
},
Expand All @@ -20,8 +20,8 @@
"@dedot/utils": "^0.15.2",
"arg": "^5.0.2",
"chalk": "^5.5.0",
"ejs": "^3.1.10",
"execa": "^9.5.2",
"giget": "^1.2.3",
"inquirer": "^12.9.2",
"listr2": "^8.3.3",
"prettier": "^3.6.2",
Expand Down
14 changes: 4 additions & 10 deletions packages/create-typink/src/createProject.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import { Options } from './types.js';
import { Listr } from 'listr2';
import { fileURLToPath } from 'url';
import * as path from 'path';
import chalk from 'chalk';
import {
copyTemplateFiles,
createFirstCommit,
createProjectDirectory,
installPackages,
createFirstCommit,
copyTemplateFiles,
prettierFormat,
installPackages,
} from './tasks/index.js';

export async function createProject(options: Options) {
const { projectName, skipInstall, noGit } = options;

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const templateDirectory = path.resolve(__dirname, './templates');
const targetDirectory = path.resolve(process.cwd(), projectName!);

const tasks = new Listr(
Expand All @@ -28,7 +22,7 @@ export async function createProject(options: Options) {
},
{
title: `🚀 Initialize new Typink dApp`,
task: (_, task) => copyTemplateFiles(options, templateDirectory, targetDirectory, task),
task: (_, task) => copyTemplateFiles(options, targetDirectory, task),
},
{
title: `📦 Install dependencies with ${chalk.green.bold(options.pkgManager.name)}`,
Expand Down
Loading