Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/create_ton_appkit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,28 @@ jobs:
TARBALL="$(ls create-ton-appkit-*.tgz)"
echo "TARBALL=$(pwd)/$TARBALL" >> "$GITHUB_ENV"

- name: Install create-ton-appkit globally
shell: bash
run: npm install -g "$TARBALL"

- name: Scaffold a project
- name: Scaffold a project via "<pm> run" (${{ matrix.pm }})
shell: bash
working-directory: ${{ runner.temp }}
run: create-ton-appkit my-app -y --template react --app-url https://example.com
run: |
set -euo pipefail
APP_URL=https://example.com
tname="$(basename "$TARBALL")"; cp "$TARBALL" "./$tname"

printf '{"name":"_scaffolder","private":true,"scripts":{"scaffold":"create-ton-appkit my-app -y --template react --app-url %s"}}' "$APP_URL" > package.json
npm i "./$tname" >/dev/null 2>&1
case "${{ matrix.pm }}" in
npm) npm run scaffold ;;
pnpm) pnpm run scaffold ;;
yarn) yarn run scaffold ;;
bun) bun run scaffold ;;
esac

rm -rf node_modules package.json package-lock.json pnpm-lock.yaml yarn.lock bun.lock bun.lockb "$tname"
# Sanity-check the generated TonConnect manifest got the requested app URL.
manifest="my-app/public/tonconnect-manifest.json"
grep -q "\"url\": \"$APP_URL\"" "$manifest"
grep -q "\"iconUrl\": \"$APP_URL/favicon.svg\"" "$manifest"

- name: Install dependencies (${{ matrix.pm }})
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion packages/create-ton-appkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm create ton-appkit my-app --template react --app-url https://example.com -y
|------|-------|-------------|---------|
| `[project-name]` | | Project directory name | `my-ton-app` |
| `--template <name>` | `-t` | Template to use | `react` |
| `--app-url <url>` | | App URL for TonConnect manifest | `https://your-app.example.com` |
| `--app-url <url>` | | App URL for TonConnect manifest | `https://appkit-template.vercel.app` |
| `--overwrite` | `-o` | Overwrite existing directory | `false` |
| `--yes` | `-y` | Accept all defaults (non-interactive) | `false` |
| `--help` | `-h` | Show help message | |
Expand Down
6 changes: 3 additions & 3 deletions packages/create-ton-appkit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ async function run(): Promise<void> {
let appUrl = argv['app-url'] as string | undefined;
if (!appUrl) {
if (useDefaults) {
appUrl = 'https://your-app.example.com';
appUrl = 'https://appkit-template.vercel.app';
} else {
const result = await prompts.text({
message: 'App URL (for TonConnect manifest)',
placeholder: 'https://your-app.example.com',
defaultValue: 'https://your-app.example.com',
placeholder: 'https://appkit-template.vercel.app',
defaultValue: 'https://appkit-template.vercel.app',
Comment thread
skywardboundd marked this conversation as resolved.
});
if (prompts.isCancel(result)) {
prompts.cancel('Cancelled.');
Expand Down
2 changes: 1 addition & 1 deletion packages/create-ton-appkit/template-react/_env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
VITE_TONCENTER_API_KEY=

# Override the TonConnect manifest URL. Defaults to ${origin}/tonconnect-manifest.json.
# VITE_TONCONNECT_MANIFEST_URL=https://your-app.example.com/tonconnect-manifest.json
# VITE_TONCONNECT_MANIFEST_URL=https://appkit-template.vercel.app/tonconnect-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://your-app.example.com",
"url": "https://appkit-template.vercel.app",
"name": "TON AppKit Template",
"iconUrl": "https://your-app.example.com/favicon.svg"
"iconUrl": "https://appkit-template.vercel.app/favicon.svg"
}
Loading