create-tauri-ui 0.3.2 → 1.0.0
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/README.md +188 -97
- package/assets/debug-panel/debug-events.ts.tmpl +97 -0
- package/assets/debug-panel/debug-panel.tsx.tmpl +1354 -0
- package/assets/debug-panel/tauri.ts.tmpl +53 -0
- package/assets/release.yml.tmpl +74 -0
- package/dist/index.mjs +483 -52
- package/index.js +2 -2
- package/package.json +53 -55
- package/templates/.shared/.github/workflows/release.yml +0 -112
- package/templates/.shared/src-tauri/Cargo.lock +0 -3835
- package/templates/.shared/src-tauri/Cargo.toml +0 -39
- package/templates/.shared/src-tauri/build.rs +0 -3
- package/templates/.shared/src-tauri/icons/128x128.png +0 -0
- package/templates/.shared/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/.shared/src-tauri/icons/32x32.png +0 -0
- package/templates/.shared/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/.shared/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/.shared/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/.shared/src-tauri/icons/icon.icns +0 -0
- package/templates/.shared/src-tauri/icons/icon.ico +0 -0
- package/templates/.shared/src-tauri/icons/icon.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/.shared/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/.shared/src-tauri/src/main.rs +0 -22
- package/templates/.shared/src-tauri/tauri.conf.json +0 -71
- package/templates/next/.env +0 -1
- package/templates/next/.github/workflows/release.yml +0 -108
- package/templates/next/.vscode/extensions.json +0 -3
- package/templates/next/LICENSE +0 -21
- package/templates/next/README.md +0 -95
- package/templates/next/app-icon.png +0 -0
- package/templates/next/components.json +0 -16
- package/templates/next/next-env.d.ts +0 -5
- package/templates/next/next.config.js +0 -14
- package/templates/next/package.json +0 -87
- package/templates/next/pnpm-lock.yaml +0 -4911
- package/templates/next/postcss.config.js +0 -6
- package/templates/next/prettier.config.js +0 -35
- package/templates/next/public/avatars/01.png +0 -0
- package/templates/next/public/avatars/02.png +0 -0
- package/templates/next/public/avatars/03.png +0 -0
- package/templates/next/public/avatars/04.png +0 -0
- package/templates/next/public/avatars/05.png +0 -0
- package/templates/next/src/app/examples/authentication/components/user-auth-form.tsx +0 -71
- package/templates/next/src/app/examples/authentication/page.tsx +0 -88
- package/templates/next/src/app/examples/cards/components/cookie-settings.tsx +0 -60
- package/templates/next/src/app/examples/cards/components/create-account.tsx +0 -60
- package/templates/next/src/app/examples/cards/components/date-picker.tsx +0 -20
- package/templates/next/src/app/examples/cards/components/github-card.tsx +0 -88
- package/templates/next/src/app/examples/cards/components/notifications.tsx +0 -53
- package/templates/next/src/app/examples/cards/components/payment-method.tsx +0 -129
- package/templates/next/src/app/examples/cards/components/report-an-issue.tsx +0 -85
- package/templates/next/src/app/examples/cards/components/share-document.tsx +0 -120
- package/templates/next/src/app/examples/cards/components/team-members.tsx +0 -149
- package/templates/next/src/app/examples/cards/page.tsx +0 -76
- package/templates/next/src/app/examples/dashboard/components/date-range-picker.tsx +0 -65
- package/templates/next/src/app/examples/dashboard/components/main-nav.tsx +0 -40
- package/templates/next/src/app/examples/dashboard/components/overview.tsx +0 -78
- package/templates/next/src/app/examples/dashboard/components/recent-sales.tsx +0 -71
- package/templates/next/src/app/examples/dashboard/components/search.tsx +0 -13
- package/templates/next/src/app/examples/dashboard/components/team-switcher.tsx +0 -213
- package/templates/next/src/app/examples/dashboard/components/user-nav.tsx +0 -62
- package/templates/next/src/app/examples/dashboard/page.tsx +0 -197
- package/templates/next/src/app/examples/forms/account/account-form.tsx +0 -219
- package/templates/next/src/app/examples/forms/account/page.tsx +0 -18
- package/templates/next/src/app/examples/forms/appearance/appearance-form.tsx +0 -164
- package/templates/next/src/app/examples/forms/appearance/page.tsx +0 -18
- package/templates/next/src/app/examples/forms/components/profile-form.tsx +0 -191
- package/templates/next/src/app/examples/forms/components/sidebar-nav.tsx +0 -44
- package/templates/next/src/app/examples/forms/display/display-form.tsx +0 -132
- package/templates/next/src/app/examples/forms/display/page.tsx +0 -17
- package/templates/next/src/app/examples/forms/layout.tsx +0 -59
- package/templates/next/src/app/examples/forms/notifications/notifications-form.tsx +0 -222
- package/templates/next/src/app/examples/forms/notifications/page.tsx +0 -17
- package/templates/next/src/app/examples/forms/page.tsx +0 -17
- package/templates/next/src/app/examples/layout.tsx +0 -7
- package/templates/next/src/app/examples/music/components/album-artwork.tsx +0 -95
- package/templates/next/src/app/examples/music/components/menu.tsx +0 -200
- package/templates/next/src/app/examples/music/components/podcast-empty-placeholder.tsx +0 -64
- package/templates/next/src/app/examples/music/components/sidebar.tsx +0 -204
- package/templates/next/src/app/examples/music/data/albums.ts +0 -71
- package/templates/next/src/app/examples/music/data/playlists.ts +0 -16
- package/templates/next/src/app/examples/music/page.tsx +0 -141
- package/templates/next/src/app/examples/playground/components/code-viewer.tsx +0 -89
- package/templates/next/src/app/examples/playground/components/maxlength-selector.tsx +0 -55
- package/templates/next/src/app/examples/playground/components/model-selector.tsx +0 -163
- package/templates/next/src/app/examples/playground/components/preset-actions.tsx +0 -122
- package/templates/next/src/app/examples/playground/components/preset-save.tsx +0 -44
- package/templates/next/src/app/examples/playground/components/preset-selector.tsx +0 -82
- package/templates/next/src/app/examples/playground/components/preset-share.tsx +0 -46
- package/templates/next/src/app/examples/playground/components/temperature-selector.tsx +0 -57
- package/templates/next/src/app/examples/playground/components/top-p-selector.tsx +0 -54
- package/templates/next/src/app/examples/playground/data/models.ts +0 -62
- package/templates/next/src/app/examples/playground/data/presets.ts +0 -47
- package/templates/next/src/app/examples/playground/page.tsx +0 -313
- package/templates/next/src/app/examples/tasks/components/columns.tsx +0 -120
- package/templates/next/src/app/examples/tasks/components/data-table-column-header.tsx +0 -71
- package/templates/next/src/app/examples/tasks/components/data-table-faceted-filter.tsx +0 -147
- package/templates/next/src/app/examples/tasks/components/data-table-pagination.tsx +0 -97
- package/templates/next/src/app/examples/tasks/components/data-table-row-actions.tsx +0 -69
- package/templates/next/src/app/examples/tasks/components/data-table-toolbar.tsx +0 -61
- package/templates/next/src/app/examples/tasks/components/data-table-view-options.tsx +0 -59
- package/templates/next/src/app/examples/tasks/components/data-table.tsx +0 -126
- package/templates/next/src/app/examples/tasks/components/user-nav.tsx +0 -62
- package/templates/next/src/app/examples/tasks/data/data.tsx +0 -71
- package/templates/next/src/app/examples/tasks/data/schema.ts +0 -13
- package/templates/next/src/app/examples/tasks/data/seed.ts +0 -20
- package/templates/next/src/app/examples/tasks/data/tasks.json +0 -702
- package/templates/next/src/app/examples/tasks/page.tsx +0 -49
- package/templates/next/src/app/layout.tsx +0 -47
- package/templates/next/src/app/page.tsx +0 -5
- package/templates/next/src/assets/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/templates/next/src/assets/logo.png +0 -0
- package/templates/next/src/components/about-dialog.tsx +0 -111
- package/templates/next/src/components/example/date-picker-with-range.tsx +0 -65
- package/templates/next/src/components/examples-nav.tsx +0 -70
- package/templates/next/src/components/greeting.tsx +0 -21
- package/templates/next/src/components/icons.tsx +0 -156
- package/templates/next/src/components/menu-mode-toggle.tsx +0 -47
- package/templates/next/src/components/menu.tsx +0 -224
- package/templates/next/src/components/mode-toggle.tsx +0 -43
- package/templates/next/src/components/page-header.tsx +0 -52
- package/templates/next/src/components/style-switcher.tsx +0 -19
- package/templates/next/src/components/tailwind-indicator.tsx +0 -18
- package/templates/next/src/components/theme-provider.tsx +0 -9
- package/templates/next/src/components/ui/accordion.tsx +0 -60
- package/templates/next/src/components/ui/alert-dialog.tsx +0 -145
- package/templates/next/src/components/ui/alert.tsx +0 -59
- package/templates/next/src/components/ui/aspect-ratio.tsx +0 -7
- package/templates/next/src/components/ui/avatar.tsx +0 -50
- package/templates/next/src/components/ui/badge.tsx +0 -36
- package/templates/next/src/components/ui/button.tsx +0 -56
- package/templates/next/src/components/ui/calendar.tsx +0 -64
- package/templates/next/src/components/ui/card.tsx +0 -79
- package/templates/next/src/components/ui/checkbox.tsx +0 -30
- package/templates/next/src/components/ui/collapsible.tsx +0 -11
- package/templates/next/src/components/ui/command.tsx +0 -155
- package/templates/next/src/components/ui/context-menu.tsx +0 -200
- package/templates/next/src/components/ui/dialog.tsx +0 -123
- package/templates/next/src/components/ui/dropdown-menu.tsx +0 -200
- package/templates/next/src/components/ui/form.tsx +0 -176
- package/templates/next/src/components/ui/hover-card.tsx +0 -29
- package/templates/next/src/components/ui/input.tsx +0 -25
- package/templates/next/src/components/ui/label.tsx +0 -26
- package/templates/next/src/components/ui/menubar.tsx +0 -236
- package/templates/next/src/components/ui/navigation-menu.tsx +0 -128
- package/templates/next/src/components/ui/popover.tsx +0 -31
- package/templates/next/src/components/ui/progress.tsx +0 -28
- package/templates/next/src/components/ui/radio-group.tsx +0 -44
- package/templates/next/src/components/ui/scroll-area.tsx +0 -48
- package/templates/next/src/components/ui/select.tsx +0 -121
- package/templates/next/src/components/ui/separator.tsx +0 -31
- package/templates/next/src/components/ui/sheet.tsx +0 -144
- package/templates/next/src/components/ui/skeleton.tsx +0 -15
- package/templates/next/src/components/ui/slider.tsx +0 -28
- package/templates/next/src/components/ui/switch.tsx +0 -29
- package/templates/next/src/components/ui/table.tsx +0 -114
- package/templates/next/src/components/ui/tabs.tsx +0 -55
- package/templates/next/src/components/ui/textarea.tsx +0 -24
- package/templates/next/src/components/ui/toast.tsx +0 -127
- package/templates/next/src/components/ui/toaster.tsx +0 -35
- package/templates/next/src/components/ui/toggle.tsx +0 -45
- package/templates/next/src/components/ui/tooltip.tsx +0 -30
- package/templates/next/src/components/ui/use-toast.ts +0 -192
- package/templates/next/src/data/albums.ts +0 -71
- package/templates/next/src/data/playlists.ts +0 -16
- package/templates/next/src/hooks/use-lock-body.ts +0 -12
- package/templates/next/src/hooks/use-mounted.ts +0 -11
- package/templates/next/src/hooks/use-mutation-observer.ts +0 -20
- package/templates/next/src/lib/fonts.ts +0 -11
- package/templates/next/src/lib/utils.ts +0 -6
- package/templates/next/src/styles/globals.css +0 -88
- package/templates/next/src-tauri/Cargo.lock +0 -3835
- package/templates/next/src-tauri/Cargo.toml +0 -39
- package/templates/next/src-tauri/build.rs +0 -3
- package/templates/next/src-tauri/icons/128x128.png +0 -0
- package/templates/next/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/next/src-tauri/icons/32x32.png +0 -0
- package/templates/next/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/next/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/icon.icns +0 -0
- package/templates/next/src-tauri/icons/icon.ico +0 -0
- package/templates/next/src-tauri/icons/icon.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/next/src-tauri/src/main.rs +0 -22
- package/templates/next/src-tauri/tauri.conf.json +0 -71
- package/templates/next/tailwind.config.js +0 -78
- package/templates/next/tsconfig.json +0 -35
- package/templates/sveltekit/.github/workflows/release.yml +0 -108
- package/templates/sveltekit/.prettierignore +0 -13
- package/templates/sveltekit/.prettierrc +0 -8
- package/templates/sveltekit/README.md +0 -1
- package/templates/sveltekit/app-icon.png +0 -0
- package/templates/sveltekit/package.json +0 -85
- package/templates/sveltekit/pnpm-lock.yaml +0 -4177
- package/templates/sveltekit/postcss.config.cjs +0 -13
- package/templates/sveltekit/src/app.d.ts +0 -18
- package/templates/sveltekit/src/app.html +0 -16
- package/templates/sveltekit/src/assets/Inter.var.woff2 +0 -0
- package/templates/sveltekit/src/index.test.ts +0 -7
- package/templates/sveltekit/src/lib/components/docs/TailwindIndicator.svelte +0 -10
- package/templates/sveltekit/src/lib/components/docs/charts/Bar.svelte +0 -152
- package/templates/sveltekit/src/lib/components/docs/dashboard/DashboardPage.svelte +0 -108
- package/templates/sveltekit/src/lib/components/docs/dashboard/MainNav.svelte +0 -31
- package/templates/sveltekit/src/lib/components/docs/dashboard/Overview.svelte +0 -5
- package/templates/sveltekit/src/lib/components/docs/dashboard/RecentSales.svelte +0 -61
- package/templates/sveltekit/src/lib/components/docs/dashboard/Search.svelte +0 -7
- package/templates/sveltekit/src/lib/components/docs/dashboard/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/examples-nav/ExampleCodeLink.svelte +0 -19
- package/templates/sveltekit/src/lib/components/docs/examples-nav/ExamplesNav.svelte +0 -27
- package/templates/sveltekit/src/lib/components/docs/examples-nav/index.ts +0 -2
- package/templates/sveltekit/src/lib/components/docs/icons/Apple.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/Aria.svelte +0 -11
- package/templates/sveltekit/src/lib/components/docs/icons/GitHub.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/Google.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/Logo.svelte +0 -17
- package/templates/sveltekit/src/lib/components/docs/icons/Minimize.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/Npm.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/PayPal.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/Pnpm.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/Radix.svelte +0 -14
- package/templates/sveltekit/src/lib/components/docs/icons/RadixSvelte.svelte +0 -14
- package/templates/sveltekit/src/lib/components/docs/icons/Tailwind.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/Yarn.svelte +0 -12
- package/templates/sveltekit/src/lib/components/docs/icons/index.ts +0 -78
- package/templates/sveltekit/src/lib/components/docs/index.ts +0 -6
- package/templates/sveltekit/src/lib/components/docs/light-switch/LightSwitch.svelte +0 -75
- package/templates/sveltekit/src/lib/components/docs/light-switch/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/docs/light-switch/light-switch.ts +0 -87
- package/templates/sveltekit/src/lib/components/docs/light-switch/local-storage-store.ts +0 -81
- package/templates/sveltekit/src/lib/components/ui/accordion/Accordion.svelte +0 -11
- package/templates/sveltekit/src/lib/components/ui/accordion/AccordionContent.svelte +0 -19
- package/templates/sveltekit/src/lib/components/ui/accordion/AccordionItem.svelte +0 -13
- package/templates/sveltekit/src/lib/components/ui/accordion/AccordionTrigger.svelte +0 -21
- package/templates/sveltekit/src/lib/components/ui/accordion/index.ts +0 -4
- package/templates/sveltekit/src/lib/components/ui/alert/Alert.svelte +0 -29
- package/templates/sveltekit/src/lib/components/ui/alert/AlertDescription.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/alert/AlertTitle.svelte +0 -15
- package/templates/sveltekit/src/lib/components/ui/alert/index.ts +0 -3
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogAction.svelte +0 -12
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogCancel.svelte +0 -15
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogContent.svelte +0 -22
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogDescription.svelte +0 -14
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogFooter.svelte +0 -13
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogHeader.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogOverlay.svelte +0 -15
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogPortal.svelte +0 -9
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogTitle.svelte +0 -11
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/index.ts +0 -12
- package/templates/sveltekit/src/lib/components/ui/aspect-ratio/AspectRatio.svelte +0 -13
- package/templates/sveltekit/src/lib/components/ui/aspect-ratio/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/avatar/Avatar.svelte +0 -14
- package/templates/sveltekit/src/lib/components/ui/avatar/AvatarFallback.svelte +0 -14
- package/templates/sveltekit/src/lib/components/ui/avatar/AvatarImage.svelte +0 -17
- package/templates/sveltekit/src/lib/components/ui/avatar/index.ts +0 -3
- package/templates/sveltekit/src/lib/components/ui/badge/Badge.svelte +0 -39
- package/templates/sveltekit/src/lib/components/ui/badge/index.ts +0 -21
- package/templates/sveltekit/src/lib/components/ui/button/Button.svelte +0 -47
- package/templates/sveltekit/src/lib/components/ui/button/index.ts +0 -28
- package/templates/sveltekit/src/lib/components/ui/card/Card.svelte +0 -18
- package/templates/sveltekit/src/lib/components/ui/card/CardContent.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/card/CardDescription.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/card/CardFooter.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/card/CardHeader.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/card/CardTitle.svelte +0 -16
- package/templates/sveltekit/src/lib/components/ui/card/index.ts +0 -6
- package/templates/sveltekit/src/lib/components/ui/checkbox/Checkbox.svelte +0 -23
- package/templates/sveltekit/src/lib/components/ui/checkbox/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/collapsible/index.ts +0 -7
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogContent.svelte +0 -29
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogDescription.svelte +0 -14
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogFooter.svelte +0 -13
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogHeader.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogOverlay.svelte +0 -15
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogPortal.svelte +0 -13
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogTitle.svelte +0 -14
- package/templates/sveltekit/src/lib/components/ui/dialog/index.ts +0 -12
- package/templates/sveltekit/src/lib/components/ui/hover-card/HoverCardContent.svelte +0 -24
- package/templates/sveltekit/src/lib/components/ui/hover-card/index.ts +0 -6
- package/templates/sveltekit/src/lib/components/ui/input/Input.svelte +0 -30
- package/templates/sveltekit/src/lib/components/ui/input/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/label/Label.svelte +0 -16
- package/templates/sveltekit/src/lib/components/ui/label/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/progress/Progress.svelte +0 -22
- package/templates/sveltekit/src/lib/components/ui/progress/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/radio-group/RadioGroup.svelte +0 -13
- package/templates/sveltekit/src/lib/components/ui/radio-group/RadioGroupItem.svelte +0 -23
- package/templates/sveltekit/src/lib/components/ui/radio-group/index.ts +0 -2
- package/templates/sveltekit/src/lib/components/ui/select/SelectContent.svelte +0 -26
- package/templates/sveltekit/src/lib/components/ui/select/SelectItem.svelte +0 -29
- package/templates/sveltekit/src/lib/components/ui/select/SelectLabel.svelte +0 -14
- package/templates/sveltekit/src/lib/components/ui/select/SelectSeparator.svelte +0 -9
- package/templates/sveltekit/src/lib/components/ui/select/SelectTrigger.svelte +0 -21
- package/templates/sveltekit/src/lib/components/ui/select/index.ts +0 -10
- package/templates/sveltekit/src/lib/components/ui/separator/Separator.svelte +0 -22
- package/templates/sveltekit/src/lib/components/ui/separator/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetContent.svelte +0 -27
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetDescription.svelte +0 -11
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetFooter.svelte +0 -13
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetHeader.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetOverlay.svelte +0 -15
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetPortal.svelte +0 -28
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetTitle.svelte +0 -14
- package/templates/sveltekit/src/lib/components/ui/sheet/index.ts +0 -102
- package/templates/sveltekit/src/lib/components/ui/skeleton/Skeleton.svelte +0 -8
- package/templates/sveltekit/src/lib/components/ui/skeleton/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/slider/Slider.svelte +0 -22
- package/templates/sveltekit/src/lib/components/ui/slider/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/switch/Switch.svelte +0 -32
- package/templates/sveltekit/src/lib/components/ui/switch/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/table/Table.svelte +0 -12
- package/templates/sveltekit/src/lib/components/ui/table/TableBody.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/table/TableCaption.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/table/TableCell.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/table/TableFooter.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/table/TableHead.svelte +0 -16
- package/templates/sveltekit/src/lib/components/ui/table/TableHeader.svelte +0 -10
- package/templates/sveltekit/src/lib/components/ui/table/TableRow.svelte +0 -16
- package/templates/sveltekit/src/lib/components/ui/table/index.ts +0 -8
- package/templates/sveltekit/src/lib/components/ui/tabs/TabsContent.svelte +0 -20
- package/templates/sveltekit/src/lib/components/ui/tabs/TabsList.svelte +0 -17
- package/templates/sveltekit/src/lib/components/ui/tabs/TabsTrigger.svelte +0 -20
- package/templates/sveltekit/src/lib/components/ui/tabs/index.ts +0 -7
- package/templates/sveltekit/src/lib/components/ui/textarea/Textarea.svelte +0 -30
- package/templates/sveltekit/src/lib/components/ui/textarea/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/toggle/Toggle.svelte +0 -44
- package/templates/sveltekit/src/lib/components/ui/toggle/index.ts +0 -1
- package/templates/sveltekit/src/lib/components/ui/tooltip/TooltipContent.svelte +0 -22
- package/templates/sveltekit/src/lib/components/ui/tooltip/index.ts +0 -6
- package/templates/sveltekit/src/lib/config/components.ts +0 -306
- package/templates/sveltekit/src/lib/config/docs.ts +0 -356
- package/templates/sveltekit/src/lib/config/site.ts +0 -15
- package/templates/sveltekit/src/lib/types/docs.ts +0 -50
- package/templates/sveltekit/src/lib/types/nav.ts +0 -18
- package/templates/sveltekit/src/lib/utils.ts +0 -75
- package/templates/sveltekit/src/routes/+layout.svelte +0 -48
- package/templates/sveltekit/src/routes/+layout.ts +0 -4
- package/templates/sveltekit/src/routes/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/+page.ts +0 -6
- package/templates/sveltekit/src/routes/authentication/+page.svelte +0 -57
- package/templates/sveltekit/src/routes/authentication/+page.ts +0 -7
- package/templates/sveltekit/src/routes/authentication/UserAuthForm.svelte +0 -61
- package/templates/sveltekit/src/routes/cards/+page.svelte +0 -26
- package/templates/sveltekit/src/routes/cards/+page.ts +0 -7
- package/templates/sveltekit/src/routes/cards/CookieSettings.svelte +0 -52
- package/templates/sveltekit/src/routes/cards/CreateAccount.svelte +0 -52
- package/templates/sveltekit/src/routes/cards/DemoContainer.svelte +0 -10
- package/templates/sveltekit/src/routes/cards/Notifications.svelte +0 -38
- package/templates/sveltekit/src/routes/cards/PaymentMethod.svelte +0 -110
- package/templates/sveltekit/src/routes/cards/ReportAnIssue.svelte +0 -71
- package/templates/sveltekit/src/routes/cards/ShareDocument.svelte +0 -91
- package/templates/sveltekit/src/routes/dashboard/+page.svelte +0 -5
- package/templates/sveltekit/src/routes/dashboard/+page.ts +0 -7
- package/templates/sveltekit/src/routes/forms/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/music/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/music/albums.ts +0 -61
- package/templates/sveltekit/src/routes/music/playlists.ts +0 -16
- package/templates/sveltekit/src/routes/playground/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/tasks/+page.svelte +0 -0
- package/templates/sveltekit/src/styles/globals.css +0 -125
- package/templates/sveltekit/src/styles/mdsvex.css +0 -80
- package/templates/sveltekit/src-tauri/Cargo.lock +0 -3835
- package/templates/sveltekit/src-tauri/Cargo.toml +0 -39
- package/templates/sveltekit/src-tauri/build.rs +0 -3
- package/templates/sveltekit/src-tauri/icons/128x128.png +0 -0
- package/templates/sveltekit/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/32x32.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/icon.icns +0 -0
- package/templates/sveltekit/src-tauri/icons/icon.ico +0 -0
- package/templates/sveltekit/src-tauri/icons/icon.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/sveltekit/src-tauri/src/main.rs +0 -22
- package/templates/sveltekit/src-tauri/tauri.conf.json +0 -71
- package/templates/sveltekit/static/avatars/01.png +0 -0
- package/templates/sveltekit/static/avatars/02.png +0 -0
- package/templates/sveltekit/static/avatars/03.png +0 -0
- package/templates/sveltekit/static/avatars/04.png +0 -0
- package/templates/sveltekit/static/avatars/05.png +0 -0
- package/templates/sveltekit/static/favicon.ico +0 -0
- package/templates/sveltekit/svelte.config.js +0 -22
- package/templates/sveltekit/tailwind.config.js +0 -67
- package/templates/sveltekit/tsconfig.json +0 -13
- package/templates/sveltekit/vite.config.js +0 -12
- package/templates/vite/.github/workflows/release.yml +0 -108
- package/templates/vite/.vscode/extensions.json +0 -3
- package/templates/vite/README.md +0 -7
- package/templates/vite/app-icon.png +0 -0
- package/templates/vite/components.json +0 -16
- package/templates/vite/index.html +0 -16
- package/templates/vite/package.json +0 -83
- package/templates/vite/pnpm-lock.yaml +0 -5176
- package/templates/vite/postcss.config.js +0 -6
- package/templates/vite/prettier.config.cjs +0 -35
- package/templates/vite/public/avatars/01.png +0 -0
- package/templates/vite/public/avatars/02.png +0 -0
- package/templates/vite/public/avatars/03.png +0 -0
- package/templates/vite/public/avatars/04.png +0 -0
- package/templates/vite/public/avatars/05.png +0 -0
- package/templates/vite/src/App.tsx +0 -39
- package/templates/vite/src/assets/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/templates/vite/src/components/about-dialog.tsx +0 -101
- package/templates/vite/src/components/icons.tsx +0 -154
- package/templates/vite/src/components/menu-mode-toggle.tsx +0 -47
- package/templates/vite/src/components/menu.tsx +0 -212
- package/templates/vite/src/components/tailwind-indicator.tsx +0 -18
- package/templates/vite/src/components/theme-provider.tsx +0 -9
- package/templates/vite/src/components/ui/accordion.tsx +0 -58
- package/templates/vite/src/components/ui/alert-dialog.tsx +0 -143
- package/templates/vite/src/components/ui/alert.tsx +0 -59
- package/templates/vite/src/components/ui/aspect-ratio.tsx +0 -5
- package/templates/vite/src/components/ui/avatar.tsx +0 -48
- package/templates/vite/src/components/ui/badge.tsx +0 -36
- package/templates/vite/src/components/ui/button.tsx +0 -56
- package/templates/vite/src/components/ui/calendar.tsx +0 -62
- package/templates/vite/src/components/ui/card.tsx +0 -79
- package/templates/vite/src/components/ui/checkbox.tsx +0 -28
- package/templates/vite/src/components/ui/collapsible.tsx +0 -9
- package/templates/vite/src/components/ui/command.tsx +0 -153
- package/templates/vite/src/components/ui/context-menu.tsx +0 -198
- package/templates/vite/src/components/ui/dialog.tsx +0 -121
- package/templates/vite/src/components/ui/dropdown-menu.tsx +0 -198
- package/templates/vite/src/components/ui/form.tsx +0 -176
- package/templates/vite/src/components/ui/hover-card.tsx +0 -27
- package/templates/vite/src/components/ui/input.tsx +0 -25
- package/templates/vite/src/components/ui/label.tsx +0 -24
- package/templates/vite/src/components/ui/menubar.tsx +0 -234
- package/templates/vite/src/components/ui/navigation-menu.tsx +0 -128
- package/templates/vite/src/components/ui/popover.tsx +0 -29
- package/templates/vite/src/components/ui/progress.tsx +0 -26
- package/templates/vite/src/components/ui/radio-group.tsx +0 -42
- package/templates/vite/src/components/ui/scroll-area.tsx +0 -46
- package/templates/vite/src/components/ui/select.tsx +0 -119
- package/templates/vite/src/components/ui/separator.tsx +0 -29
- package/templates/vite/src/components/ui/sheet.tsx +0 -142
- package/templates/vite/src/components/ui/skeleton.tsx +0 -15
- package/templates/vite/src/components/ui/slider.tsx +0 -26
- package/templates/vite/src/components/ui/switch.tsx +0 -27
- package/templates/vite/src/components/ui/table.tsx +0 -114
- package/templates/vite/src/components/ui/tabs.tsx +0 -53
- package/templates/vite/src/components/ui/textarea.tsx +0 -24
- package/templates/vite/src/components/ui/toast.tsx +0 -127
- package/templates/vite/src/components/ui/toaster.tsx +0 -33
- package/templates/vite/src/components/ui/toggle.tsx +0 -43
- package/templates/vite/src/components/ui/tooltip.tsx +0 -28
- package/templates/vite/src/components/ui/use-toast.ts +0 -192
- package/templates/vite/src/dashboard/components/date-range-picker.tsx +0 -65
- package/templates/vite/src/dashboard/components/main-nav.tsx +0 -38
- package/templates/vite/src/dashboard/components/overview.tsx +0 -78
- package/templates/vite/src/dashboard/components/recent-sales.tsx +0 -71
- package/templates/vite/src/dashboard/components/search.tsx +0 -13
- package/templates/vite/src/dashboard/components/team-switcher.tsx +0 -213
- package/templates/vite/src/dashboard/components/user-nav.tsx +0 -62
- package/templates/vite/src/dashboard/page.tsx +0 -191
- package/templates/vite/src/lib/utils.ts +0 -19
- package/templates/vite/src/main.tsx +0 -10
- package/templates/vite/src/styles/globals.css +0 -88
- package/templates/vite/src/vite-env.d.ts +0 -1
- package/templates/vite/src-tauri/Cargo.lock +0 -3835
- package/templates/vite/src-tauri/Cargo.toml +0 -39
- package/templates/vite/src-tauri/build.rs +0 -3
- package/templates/vite/src-tauri/icons/128x128.png +0 -0
- package/templates/vite/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/vite/src-tauri/icons/32x32.png +0 -0
- package/templates/vite/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/vite/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/icon.icns +0 -0
- package/templates/vite/src-tauri/icons/icon.ico +0 -0
- package/templates/vite/src-tauri/icons/icon.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/vite/src-tauri/src/main.rs +0 -22
- package/templates/vite/src-tauri/tauri.conf.json +0 -71
- package/templates/vite/tailwind.config.js +0 -78
- package/templates/vite/tsconfig.json +0 -26
- package/templates/vite/tsconfig.node.json +0 -9
- package/templates/vite/vite.config.ts +0 -33
- /package/{templates/.shared → assets}/app-icon.png +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,52 +1,483 @@
|
|
|
1
|
-
import
|
|
2
|
-
`)).join(`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`).
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
import s from"node:fs";import a from"node:path";import S from"node:process";import{text as _,confirm as P,select as we,multiselect as ve,isCancel as xe,cancel as W,log as h,intro as ye,spinner as be,outro as ke,note as K}from"@clack/prompts";import A from"picocolors";import z from"node:os";import{execFile as Ee}from"node:child_process";import{fileURLToPath as I}from"node:url";const D=new Set;let Y=!1,X=!1;class L extends Error{constructor(t,r,n,i){super(t),this.stdout=r,this.stderr=n,this.code=i}}class w extends Error{constructor(t,r,n){super(r),this.tool=t,this.stderr=n}}class u extends Error{constructor(t,r){super(r),this.file=t}}function $e(e){return e?.trim().replace(/\/+$/g,"")}function q(e,t){s.statSync(e).isDirectory()?Z(e,t):(s.mkdirSync(a.dirname(t),{recursive:!0}),s.copyFileSync(e,t))}function R(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function J(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Z(e,t){s.mkdirSync(t,{recursive:!0});for(const r of s.readdirSync(e)){const n=a.resolve(e,r),i=a.resolve(t,r);q(n,i)}}function je(e){const t=s.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function l(e,t){const r=s.readFileSync(e,"utf-8");s.writeFileSync(e,t(r),"utf-8")}function m(e,t){const r=JSON.parse(s.readFileSync(e,"utf-8")),n=t(r);s.writeFileSync(e,JSON.stringify(n,null,2)+`
|
|
2
|
+
`)}async function C(e,t,r){return await new Promise((n,i)=>{Ee(e,t,{cwd:r?.cwd,env:{...process.env,...r?.env},maxBuffer:1024*1024*10},(o,c,N)=>{if(o){i(new L(`Command failed: ${e} ${t.join(" ")}`,c,N,typeof o.code=="number"?o.code:null));return}n(c.trim())})})}function Q(e){return s.mkdtempSync(a.join(z.tmpdir(),e))}function O(e){D.add(e)}function f(e){D.delete(e)}function g(e){s.existsSync(e)&&s.rmSync(e,{recursive:!0,force:!0})}function Se(){const e=[...D].sort((t,r)=>r.length-t.length);for(const t of e)try{g(t)}catch{}finally{D.delete(t)}}function _e(){if(Y)return;Y=!0;const e=(t,r)=>{X&&process.exit(r),X=!0,Se(),process.exit(r)};process.once("SIGINT",()=>e("SIGINT",130)),process.once("SIGTERM",()=>e("SIGTERM",143))}function Pe(e){return e.replace(/^@[^/]+\//,"").replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}const De={name:"astro",async apply(e,t){l(a.join(e,"astro.config.mjs"),r=>{if(r.includes("server: {"))return r;const n=r.lastIndexOf(`
|
|
3
|
+
})`);if(n===-1)throw new u("astro.config.mjs","Could not find the Astro config closing brace.");return`${r.slice(0,n)}
|
|
4
|
+
server: {
|
|
5
|
+
port: 1420,
|
|
6
|
+
},${r.slice(n)}`})},tauriConfig(){return{frontendDist:"../dist",devUrl:"http://localhost:1420",beforeDevCommand:"bun run dev",beforeBuildCommand:"bun run build"}}},Le={name:"next",async apply(e,t){l(a.join(e,"next.config.mjs"),r=>{if(r.includes('output: "export"'))return r;if(!r.includes("const nextConfig = {}"))throw new u("next.config.mjs","Could not find the default Next.js config shape.");return r.replace("const nextConfig = {}",`const nextConfig = {
|
|
7
|
+
output: "export",
|
|
8
|
+
images: {
|
|
9
|
+
unoptimized: true,
|
|
10
|
+
},
|
|
11
|
+
}`)}),m(a.join(e,"package.json"),r=>(r.scripts?.dev&&(r.scripts.dev=r.scripts.dev.replace("next dev --turbopack","next dev --turbopack -p 1420")),r))},tauriConfig(){return{frontendDist:"../out",devUrl:"http://localhost:1420",beforeDevCommand:"bun run dev",beforeBuildCommand:"bun run build"}}};function Ce(e){if(e.includes("strictPort: true"))return e;const t=e.lastIndexOf(`
|
|
12
|
+
})`);if(t===-1)throw new u("vite.config.ts","Could not find the React Router Vite config closing brace.");return`${e.slice(0,t)}
|
|
13
|
+
server: {
|
|
14
|
+
port: 1420,
|
|
15
|
+
strictPort: true,
|
|
16
|
+
},${e.slice(t)}`}const Te={name:"react-router",async apply(e,t){l(a.join(e,"react-router.config.ts"),r=>{if(r.includes("ssr: false"))return r;if(!r.includes("ssr: true"))throw new u("react-router.config.ts","Could not find the SSR flag in the generated React Router config.");return r.replace("ssr: true","ssr: false")}),l(a.join(e,"vite.config.ts"),Ce)},tauriConfig(){return{frontendDist:"../build/client",devUrl:"http://localhost:1420",beforeDevCommand:"bun run dev",beforeBuildCommand:"bun run build"}}};function Ge(e){if(e.includes("strictPort: true"))return e;const t=e.lastIndexOf(`
|
|
17
|
+
})`);if(t===-1)throw new u("vite.config.ts","Could not find the TanStack Start config closing brace.");return`${e.slice(0,t)}
|
|
18
|
+
server: {
|
|
19
|
+
port: 1420,
|
|
20
|
+
strictPort: true,
|
|
21
|
+
},${e.slice(t)}`}const Ne={name:"start",async apply(e,t){l(a.join(e,"vite.config.ts"),r=>{let n=Ge(r);if(!n.includes("tanstackStart({ spa: { enabled: true } })")){if(!n.includes("tanstackStart(),"))throw new u("vite.config.ts","Could not find tanstackStart() in the generated Vite config.");n=n.replace("tanstackStart(),","tanstackStart({ spa: { enabled: true } }),")}return n}),m(a.join(e,"package.json"),r=>(r.scripts?.dev&&(r.scripts.dev=r.scripts.dev.replace("--port 3000","--port 1420")),r))},tauriConfig(){return{frontendDist:"../.output/public",devUrl:"http://localhost:1420",beforeDevCommand:"bun run dev",beforeBuildCommand:"bun run build"}}};function Ae(e){if(e.includes("strictPort: true"))return e;const t=e.lastIndexOf(`
|
|
22
|
+
})`);if(t===-1)throw new u("vite.config.ts","Could not find the Vite config closing brace.");return`${e.slice(0,t)}
|
|
23
|
+
server: {
|
|
24
|
+
port: 1420,
|
|
25
|
+
strictPort: true,
|
|
26
|
+
},${e.slice(t)}`}const Ie={name:"vite",async apply(e,t){l(a.join(e,"vite.config.ts"),Ae)},tauriConfig(){return{frontendDist:"../dist",devUrl:"http://localhost:1420",beforeDevCommand:"bun run dev",beforeBuildCommand:"bun run build"}}},Re={vite:Ie,next:Le,start:Ne,"react-router":Te,astro:De};function Oe(e){return Re[e]}async function ee(e,t){try{await C("bunx",["--bun","shadcn@latest",...t],{cwd:e})}catch(r){throw r instanceof L?new w("shadcn","shadcn CLI failed while updating the frontend scaffold.",r.stderr||r.stdout):r}}const Fe="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Crect width='96' height='96' rx='24' fill='%23181f2a'/%3E%3Ccircle cx='48' cy='34' r='18' fill='%23f8fafc'/%3E%3Cpath d='M18 82c6-14 18-22 30-22s24 8 30 22' fill='%23f8fafc'/%3E%3C/svg%3E";function Ue(e){const t=a.join(e,"app/layout.tsx");s.existsSync(t)&&l(t,r=>{let n=r;if(n.includes('import { TooltipProvider } from "@/components/ui/tooltip"')||(n=n.replace(`import { ThemeProvider } from "@/components/theme-provider"
|
|
27
|
+
`,`import { ThemeProvider } from "@/components/theme-provider"
|
|
28
|
+
import { TooltipProvider } from "@/components/ui/tooltip"
|
|
29
|
+
`)),n.includes("<TooltipProvider>"))return n;const i=n.replace(/<ThemeProvider>([\s\S]*?)<\/ThemeProvider>/,"<ThemeProvider><TooltipProvider>$1</TooltipProvider></ThemeProvider>");if(i===n)throw new u(t,"Could not wrap the Next.js layout with TooltipProvider.");return i})}function Ve(e,t){const r=t.template==="next"?a.join(e,"components/app-sidebar.tsx"):t.template==="react-router"?a.join(e,"app/components/app-sidebar.tsx"):a.join(e,"src/components/app-sidebar.tsx");s.existsSync(r)&&l(r,n=>n.replace('avatar: "/avatars/shadcn.jpg"',`avatar: "${Fe}"`))}function v(e,t,r,n){return`import type { CSSProperties } from "react"
|
|
30
|
+
import { AppSidebar } from "${t}components/app-sidebar"
|
|
31
|
+
import { ChartAreaInteractive } from "${t}components/chart-area-interactive"
|
|
32
|
+
import { DataTable } from "${t}components/data-table"
|
|
33
|
+
import { SectionCards } from "${t}components/section-cards"
|
|
34
|
+
import { SiteHeader } from "${t}components/site-header"
|
|
35
|
+
import {
|
|
36
|
+
SidebarInset,
|
|
37
|
+
SidebarProvider,
|
|
38
|
+
} from "${t}components/ui/sidebar"
|
|
39
|
+
import { TooltipProvider } from "${t}components/ui/tooltip"
|
|
40
|
+
${n?`import { Greet } from "${t}components/greet"
|
|
41
|
+
`:""}import data from "${r}"
|
|
42
|
+
|
|
43
|
+
export default function ${e}() {
|
|
44
|
+
return (
|
|
45
|
+
<TooltipProvider>
|
|
46
|
+
<SidebarProvider
|
|
47
|
+
style={
|
|
48
|
+
{
|
|
49
|
+
"--sidebar-width": "calc(var(--spacing) * 72)",
|
|
50
|
+
"--header-height": "calc(var(--spacing) * 12)",
|
|
51
|
+
} as CSSProperties
|
|
52
|
+
}
|
|
53
|
+
>
|
|
54
|
+
<AppSidebar variant="inset" />
|
|
55
|
+
<SidebarInset>
|
|
56
|
+
<SiteHeader />
|
|
57
|
+
<div className="flex flex-1 flex-col">
|
|
58
|
+
<div className="@container/main flex flex-1 flex-col gap-2">
|
|
59
|
+
<div className="flex flex-col gap-4 py-4 md:gap-6 md:py-6">
|
|
60
|
+
<SectionCards />
|
|
61
|
+
${n?` <div className="px-4 lg:px-6">
|
|
62
|
+
<Greet />
|
|
63
|
+
</div>
|
|
64
|
+
`:""} <div className="px-4 lg:px-6">
|
|
65
|
+
<ChartAreaInteractive />
|
|
66
|
+
</div>
|
|
67
|
+
<DataTable data={data} />
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</SidebarInset>
|
|
72
|
+
</SidebarProvider>
|
|
73
|
+
</TooltipProvider>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
`}function Be(e){return`import { createFileRoute } from "@tanstack/react-router"
|
|
77
|
+
${v("DashboardPage","@/","@/app/dashboard/data.json",e)}export const Route = createFileRoute("/")({
|
|
78
|
+
component: DashboardPage,
|
|
79
|
+
})
|
|
80
|
+
`}function Me(e){return v("DashboardShell","@/","@/app/dashboard/data.json",e).replace("export default function DashboardShell()","export function DashboardShell()")}function He(e,t){try{s.renameSync(e,t);return}catch(r){if(!(r instanceof Error)||!("code"in r)||r.code!=="EXDEV")throw r}s.cpSync(e,t,{recursive:!0,force:!0}),s.rmSync(e,{recursive:!0,force:!0})}async function We(e){s.mkdirSync(a.dirname(e.targetDir),{recursive:!0});const t=Q("create-tauri-ui-frontend-"),r=a.join(t,e.projectName);O(t);try{if(await C("bunx",["--bun","shadcn@latest","init","--name",e.projectName,"--template",e.template,"--preset",e.preset,"--yes"],{cwd:t}),!s.existsSync(r))throw new Error("shadcn CLI did not produce the expected project directory.");s.rmSync(a.join(r,"node_modules"),{recursive:!0,force:!0}),He(r,e.targetDir)}catch(n){if(n instanceof L){f(t);try{g(t)}catch{}throw new w("shadcn","shadcn CLI failed while creating the frontend scaffold.",n.stderr||n.stdout)}f(t);try{g(t)}catch{}throw n}finally{f(t);try{g(t)}catch{}}return e.targetDir}async function Ke(e){const t=Q("create-tauri-ui-"),r="tauri-native";O(t);try{await C("bunx",["create-tauri-app",r,"--template","vanilla-ts","--manager","bun","--identifier",e.identifier,"--yes"],{cwd:t})}catch(n){if(n instanceof L){f(t);try{g(t)}catch{}throw new w("cta","create-tauri-app failed while creating the native scaffold.",n.stderr||n.stdout)}f(t);try{g(t)}catch{}throw n}return{tempDir:t,projectDir:a.join(t,r)}}async function ze(e,t){await ee(e,["add","dashboard-01","--yes"]),Ve(e,t);const r=t.template==="next"?a.join(e,"components/site-header.tsx"):t.template==="react-router"?a.join(e,"app/components/site-header.tsx"):a.join(e,"src/components/site-header.tsx");switch(s.existsSync(r)&&l(r,n=>n.includes("<Button")?n:n.replace(/import \{ Button \} from ["'][@~]\/components\/ui\/button["']\n/,"")),t.template){case"next":Ue(e),s.writeFileSync(a.join(e,"app/page.tsx"),v("Page","@/","@/app/dashboard/data.json",t.includeInvokeExample));return;case"vite":s.writeFileSync(a.join(e,"src/App.tsx"),v("App","@/","@/app/dashboard/data.json",t.includeInvokeExample));return;case"start":s.writeFileSync(a.join(e,"src/routes/index.tsx"),Be(t.includeInvokeExample));return;case"react-router":s.writeFileSync(a.join(e,"app/routes/home.tsx"),v("Home","~/","~/dashboard/data.json",t.includeInvokeExample));return;case"astro":s.writeFileSync(a.join(e,"src/components/dashboard-shell.tsx"),Me(t.includeInvokeExample)),s.writeFileSync(a.join(e,"src/pages/index.astro"),`---
|
|
81
|
+
import Layout from "@/layouts/main.astro"
|
|
82
|
+
import { DashboardShell } from "@/components/dashboard-shell"
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
<Layout>
|
|
86
|
+
<DashboardShell client:load />
|
|
87
|
+
</Layout>
|
|
88
|
+
`);return;default:throw new u(e,`No starter UI implementation exists for template "${t.template}".`)}}async function te(e,t){await ee(e,["add",t,"--yes"])}const T="use tauri_plugin_log::{Target, TargetKind};",re=` log::info!("greet command executed for {}", name);
|
|
89
|
+
`,ne=` log::info!("opening external link in system browser: {}", url);
|
|
90
|
+
`,ie=` log::info!("main webview finished loading");
|
|
91
|
+
`,Ye=` .plugin(
|
|
92
|
+
tauri_plugin_log::Builder::new()
|
|
93
|
+
.targets([
|
|
94
|
+
Target::new(TargetKind::Stdout),
|
|
95
|
+
Target::new(TargetKind::LogDir { file_name: None }),
|
|
96
|
+
Target::new(TargetKind::Webview),
|
|
97
|
+
])
|
|
98
|
+
.build(),
|
|
99
|
+
)
|
|
100
|
+
`;function Xe(){const e=a.dirname(I(import.meta.url)),t=[a.resolve(e,"../assets/debug-panel"),a.resolve(e,"../../assets/debug-panel")];return t.find(r=>s.existsSync(r))??t[0]}const qe=Xe();function Je(e){return e==="react-router"?"~/":"@/"}function ae(e,t){switch(t.template){case"next":return a.join(e,"components");case"vite":case"start":case"astro":return a.join(e,"src/components");case"react-router":return a.join(e,"app/components")}}function Ze(e,t){switch(t.template){case"next":return a.join(e,"lib");case"vite":case"start":case"astro":return a.join(e,"src/lib");case"react-router":return a.join(e,"app/lib")}}function Qe(e,t){return a.join(ae(e,t),"ui")}function x(e){switch(e.template){case"next":return"@/components/debug-panel";case"vite":return"./components/debug-panel.tsx";case"start":return"../components/debug-panel";case"react-router":return"./components/debug-panel";case"astro":return"@/components/debug-panel"}}async function et(e,t){for(const r of["button","badge","sheet","tabs","toggle-group"]){const n=a.join(Qe(e,t),`${r}.tsx`);s.existsSync(n)||await te(e,r)}}function F(e){return s.readFileSync(a.join(qe,e),"utf-8")}function tt(e,t){const r=a.join(ae(e,t),"debug-panel.tsx"),n=Ze(e,t);s.mkdirSync(a.dirname(r),{recursive:!0}),s.mkdirSync(n,{recursive:!0}),s.writeFileSync(r,F("debug-panel.tsx.tmpl").split("__ALIAS_PREFIX__").join(Je(t.template)),"utf-8"),s.writeFileSync(a.join(n,"debug-events.ts"),F("debug-events.ts.tmpl"),"utf-8"),s.writeFileSync(a.join(n,"tauri.ts"),F("tauri.ts.tmpl"),"utf-8")}function rt(e){m(a.join(e,"package.json"),t=>(t.dependencies=t.dependencies||{},t.dependencies["@tauri-apps/plugin-log"]||(t.dependencies["@tauri-apps/plugin-log"]="^2"),t))}function oe(e,t){if(e.includes(t))return e;if(!e.includes(`[dependencies]
|
|
101
|
+
`))throw new Error(`Could not find [dependencies] while inserting ${t}.`);return e.replace(`[dependencies]
|
|
102
|
+
`,`[dependencies]
|
|
103
|
+
${t}
|
|
104
|
+
`)}function nt(e){const t=a.join(e,"src-tauri/Cargo.toml"),r=a.join(e,"src-tauri/src/lib.rs");l(t,n=>{let i=n;return i=oe(i,'tauri-plugin-log = "2"'),i=oe(i,'log = "0.4"'),i}),m(a.join(e,"src-tauri/capabilities/default.json"),n=>(n.permissions=Array.isArray(n.permissions)?n.permissions:[],n.permissions.includes("log:default")||n.permissions.push("log:default"),n)),l(r,n=>{let i=n;if(i.includes(T)||(i.includes(`use tauri_plugin_opener::OpenerExt;
|
|
105
|
+
`)?i=i.replace(`use tauri_plugin_opener::OpenerExt;
|
|
106
|
+
`,`use tauri_plugin_opener::OpenerExt;
|
|
107
|
+
${T}
|
|
108
|
+
`):i.includes(`use tauri::webview::PageLoadEvent;
|
|
109
|
+
`)?i=i.replace(`use tauri::webview::PageLoadEvent;
|
|
110
|
+
`,`use tauri::webview::PageLoadEvent;
|
|
111
|
+
${T}
|
|
112
|
+
`):i=`${T}
|
|
113
|
+
${i}`),i.includes("tauri_plugin_log::Builder::new()"))return i;const o=i.replace(` tauri::Builder::default()
|
|
114
|
+
`,` tauri::Builder::default()
|
|
115
|
+
${Ye}`);if(o===i)throw new u(r,"Could not register the Tauri log plugin.");return i=o,!i.includes(re.trim())&&i.includes(` let message = format!("Hello, {}! You've been greeted from Rust!", name);
|
|
116
|
+
`)&&(i=i.replace(` let message = format!("Hello, {}! You've been greeted from Rust!", name);
|
|
117
|
+
`,` let message = format!("Hello, {}! You've been greeted from Rust!", name);
|
|
118
|
+
${re}`)),!i.includes(ne.trim())&&i.includes(` let _ = webview.opener().open_url(url.as_str(), None::<&str>);
|
|
119
|
+
`)&&(i=i.replace(` let _ = webview.opener().open_url(url.as_str(), None::<&str>);
|
|
120
|
+
`,`${ne} let _ = webview.opener().open_url(url.as_str(), None::<&str>);
|
|
121
|
+
`)),!i.includes(ie.trim())&&i.includes(` let _ = webview.window().show();
|
|
122
|
+
`)&&(i=i.replace(` let _ = webview.window().show();
|
|
123
|
+
`,`${ie} let _ = webview.window().show();
|
|
124
|
+
`)),i})}function it(e,t){const r=a.join(e,"src/main.tsx"),n=x(t);l(r,i=>{let o=i;if(o.includes(`import { DebugPanel } from "${n}"`)||(o=o.replace(`import { ExternalLinkGuard } from "./components/external-link-guard.tsx"
|
|
125
|
+
`,`import { ExternalLinkGuard } from "./components/external-link-guard.tsx"
|
|
126
|
+
import { DebugPanel } from "${n}"
|
|
127
|
+
`)),o.includes("<DebugPanel />"))return o;const c=o.replace(`<ExternalLinkGuard />
|
|
128
|
+
<main><App /></main>`,`<ExternalLinkGuard />
|
|
129
|
+
{import.meta.env.DEV ? <DebugPanel /> : null}
|
|
130
|
+
<main><App /></main>`);if(c===o)throw new u(r,"Could not mount DebugPanel in the Vite entrypoint.");return c})}function at(e,t){const r=a.join(e,"app/layout.tsx"),n=x(t);l(r,i=>{let o=i;if(o.includes(`import { DebugPanel } from "${n}"`)||(o.includes(`import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
131
|
+
`)?o=o.replace(`import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
132
|
+
`,`import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
133
|
+
import { DebugPanel } from "${n}"
|
|
134
|
+
`):o.includes(`import { ThemeProvider } from "@/components/theme-provider"
|
|
135
|
+
`)&&(o=o.replace(`import { ThemeProvider } from "@/components/theme-provider"
|
|
136
|
+
`,`import { ThemeProvider } from "@/components/theme-provider"
|
|
137
|
+
import { DebugPanel } from "${n}"
|
|
138
|
+
`))),o.includes("<DebugPanel />"))return o;const c=o.replace("<ExternalLinkGuard />{children}",'<ExternalLinkGuard />{process.env.NODE_ENV === "development" ? <DebugPanel /> : null}{children}');if(c===o)throw new u(r,"Could not mount DebugPanel in the Next.js layout.");return c})}function ot(e,t){const r=a.join(e,"src/routes/__root.tsx"),n=x(t);l(r,i=>{let o=i;if(o.includes(`import { DebugPanel } from "${n}"`)||(o=o.replace(`import { ExternalLinkGuard } from "../components/external-link-guard"
|
|
139
|
+
`,`import { ExternalLinkGuard } from "../components/external-link-guard"
|
|
140
|
+
import { DebugPanel } from "${n}"
|
|
141
|
+
`)),o.includes("<DebugPanel />"))return o;const c=o.replace("<main><ExternalLinkGuard />{children}</main>","<main><ExternalLinkGuard />{import.meta.env.DEV ? <DebugPanel /> : null}{children}</main>");if(c===o)throw new u(r,"Could not mount DebugPanel in the TanStack Start root route.");return c})}function st(e,t){const r=a.join(e,"app/root.tsx"),n=x(t);l(r,i=>{let o=i;if(o.includes(`import { DebugPanel } from "${n}"`)||(o=o.replace(`import { ExternalLinkGuard } from "./components/external-link-guard"
|
|
142
|
+
`,`import { ExternalLinkGuard } from "./components/external-link-guard"
|
|
143
|
+
import { DebugPanel } from "${n}"
|
|
144
|
+
`)),o.includes("<DebugPanel />"))return o;const c=o.replace(`<ExternalLinkGuard />
|
|
145
|
+
{children}`,`<ExternalLinkGuard />
|
|
146
|
+
{import.meta.env.DEV ? <DebugPanel /> : null}
|
|
147
|
+
{children}`);if(c===o)throw new u(r,"Could not mount DebugPanel in the React Router root layout.");return c})}function ct(e,t){const r=a.join(e,"src/layouts/main.astro"),n=x(t);l(r,i=>{let o=i;if(o.includes(`import { DebugPanel } from "${n}"`)||(o=o.replace(`import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
148
|
+
`,`import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
149
|
+
import { DebugPanel } from "${n}"
|
|
150
|
+
`)),o.includes("<DebugPanel client:load />"))return o;const c=o.replace("<main><ExternalLinkGuard client:load /><slot /></main>","<main><ExternalLinkGuard client:load />{import.meta.env.DEV ? <DebugPanel client:load /> : null}<slot /></main>");if(c===o)throw new u(r,"Could not mount DebugPanel in the Astro layout.");return c})}async function lt(e,t){switch(await et(e,t),tt(e,t),rt(e),nt(e),t.template){case"vite":it(e,t);return;case"next":at(e,t);return;case"start":ot(e,t);return;case"react-router":st(e,t);return;case"astro":ct(e,t);return}}const U="use tauri_plugin_opener::OpenerExt;",ut=`fn external_navigation_plugin<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
|
|
151
|
+
tauri::plugin::Builder::<R>::new("external-navigation")
|
|
152
|
+
.on_navigation(|webview, url| {
|
|
153
|
+
let is_internal_host = matches!(
|
|
154
|
+
url.host_str(),
|
|
155
|
+
Some("localhost") | Some("127.0.0.1") | Some("tauri.localhost") | Some("::1")
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
let is_internal = url.scheme() == "tauri" || is_internal_host;
|
|
159
|
+
|
|
160
|
+
if is_internal {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
let is_external_link = matches!(url.scheme(), "http" | "https" | "mailto" | "tel");
|
|
165
|
+
|
|
166
|
+
if is_external_link {
|
|
167
|
+
let _ = webview.opener().open_url(url.as_str(), None::<&str>);
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
true
|
|
172
|
+
})
|
|
173
|
+
.build()
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
`,pt=`"use client"
|
|
177
|
+
|
|
178
|
+
import { useEffect } from "react"
|
|
179
|
+
|
|
180
|
+
const DEBUG_EVENT_NAME = "ctui:debug"
|
|
181
|
+
const EXTERNAL_PROTOCOLS = new Set(["http:", "https:", "mailto:", "tel:"])
|
|
182
|
+
|
|
183
|
+
function isModifiedClick(event: MouseEvent) {
|
|
184
|
+
return (
|
|
185
|
+
event.defaultPrevented ||
|
|
186
|
+
event.button !== 0 ||
|
|
187
|
+
event.metaKey ||
|
|
188
|
+
event.ctrlKey ||
|
|
189
|
+
event.shiftKey ||
|
|
190
|
+
event.altKey
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function shouldOpenExternally(anchor: HTMLAnchorElement) {
|
|
195
|
+
const href = anchor.getAttribute("href")
|
|
196
|
+
|
|
197
|
+
if (!href || href.startsWith("#") || anchor.hasAttribute("download")) {
|
|
198
|
+
return false
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
try {
|
|
202
|
+
const url = new URL(anchor.href, window.location.href)
|
|
203
|
+
|
|
204
|
+
if (!EXTERNAL_PROTOCOLS.has(url.protocol)) {
|
|
205
|
+
return false
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (url.protocol === "mailto:" || url.protocol === "tel:") {
|
|
209
|
+
return true
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return url.origin !== window.location.origin
|
|
213
|
+
} catch {
|
|
214
|
+
return false
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async function openExternalLink(href: string) {
|
|
219
|
+
const { openUrl } = await import("@tauri-apps/plugin-opener")
|
|
220
|
+
await openUrl(href)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function emitExternalLinkDebugEvent(href: string) {
|
|
224
|
+
if (typeof window === "undefined") {
|
|
225
|
+
return
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
window.dispatchEvent(
|
|
229
|
+
new CustomEvent(DEBUG_EVENT_NAME, {
|
|
230
|
+
detail: {
|
|
231
|
+
id: crypto.randomUUID(),
|
|
232
|
+
kind: "external-link",
|
|
233
|
+
href,
|
|
234
|
+
timestamp: new Date().toISOString(),
|
|
235
|
+
},
|
|
236
|
+
})
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function ExternalLinkGuard() {
|
|
241
|
+
useEffect(() => {
|
|
242
|
+
function handleClick(event: MouseEvent) {
|
|
243
|
+
if (isModifiedClick(event)) {
|
|
244
|
+
return
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const target = event.target
|
|
248
|
+
|
|
249
|
+
if (!(target instanceof Element)) {
|
|
250
|
+
return
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const anchor = target.closest("a[href]")
|
|
254
|
+
|
|
255
|
+
if (!(anchor instanceof HTMLAnchorElement)) {
|
|
256
|
+
return
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (!shouldOpenExternally(anchor)) {
|
|
260
|
+
return
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
event.preventDefault()
|
|
264
|
+
emitExternalLinkDebugEvent(anchor.href)
|
|
265
|
+
void openExternalLink(anchor.href)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
document.addEventListener("click", handleClick, true)
|
|
269
|
+
|
|
270
|
+
return () => {
|
|
271
|
+
document.removeEventListener("click", handleClick, true)
|
|
272
|
+
}
|
|
273
|
+
}, [])
|
|
274
|
+
|
|
275
|
+
return null
|
|
276
|
+
}
|
|
277
|
+
`;function y(e){s.mkdirSync(a.dirname(e),{recursive:!0}),s.writeFileSync(e,pt,"utf-8")}function dt(e){const t=a.join(e,"src-tauri/src/lib.rs");l(t,r=>{let n=r;if(n.includes(U)||(n.includes(`use tauri::webview::PageLoadEvent;
|
|
278
|
+
`)?n=n.replace(`use tauri::webview::PageLoadEvent;
|
|
279
|
+
`,`use tauri::webview::PageLoadEvent;
|
|
280
|
+
${U}
|
|
281
|
+
`):n=`${U}
|
|
282
|
+
${n}`),!n.includes("fn external_navigation_plugin<R: tauri::Runtime>()")){if(!n.includes("#[cfg_attr(mobile, tauri::mobile_entry_point)]"))throw new u(t,"Could not find the Tauri entry point while inserting the external navigation plugin.");n=n.replace("#[cfg_attr(mobile, tauri::mobile_entry_point)]",`${ut}#[cfg_attr(mobile, tauri::mobile_entry_point)]`)}if(!n.includes(".plugin(external_navigation_plugin())")){if(!n.includes(".plugin(tauri_plugin_opener::init())"))throw new u(t,"Could not find the opener plugin while inserting the external navigation guard.");n=n.replace(` .plugin(tauri_plugin_opener::init())
|
|
283
|
+
`,` .plugin(tauri_plugin_opener::init())
|
|
284
|
+
.plugin(external_navigation_plugin())
|
|
285
|
+
`)}return n})}function mt(e){const t=a.join(e,"src/components/external-link-guard.tsx"),r=a.join(e,"src/main.tsx");y(t),l(r,n=>{let i=n;if(i.includes('import { ExternalLinkGuard } from "./components/external-link-guard.tsx"')||(i=i.replace(`import { ThemeProvider } from "@/components/theme-provider.tsx"
|
|
286
|
+
`,`import { ThemeProvider } from "@/components/theme-provider.tsx"
|
|
287
|
+
import { ExternalLinkGuard } from "./components/external-link-guard.tsx"
|
|
288
|
+
`)),i.includes("<ExternalLinkGuard />"))return i;const o=i.replace(`<ThemeProvider>
|
|
289
|
+
<main><App /></main>`,`<ThemeProvider>
|
|
290
|
+
<ExternalLinkGuard />
|
|
291
|
+
<main><App /></main>`);if(o===i)throw new u(r,"Could not mount ExternalLinkGuard in the Vite entrypoint.");return o})}function ft(e){const t=a.join(e,"components/external-link-guard.tsx"),r=a.join(e,"app/layout.tsx");y(t),l(r,n=>{let i=n;if(i.includes('import { ExternalLinkGuard } from "@/components/external-link-guard"')||(i.includes(`import { TooltipProvider } from "@/components/ui/tooltip"
|
|
292
|
+
`)?i=i.replace(`import { TooltipProvider } from "@/components/ui/tooltip"
|
|
293
|
+
`,`import { TooltipProvider } from "@/components/ui/tooltip"
|
|
294
|
+
import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
295
|
+
`):i=i.replace(`import { ThemeProvider } from "@/components/theme-provider"
|
|
296
|
+
`,`import { ThemeProvider } from "@/components/theme-provider"
|
|
297
|
+
import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
298
|
+
`)),i.includes("<ExternalLinkGuard />"))return i;const o=i.replace("<main>{children}</main>","<main><ExternalLinkGuard />{children}</main>");if(o===i)throw new u(r,"Could not mount ExternalLinkGuard in the Next.js layout.");return o})}function gt(e){const t=a.join(e,"src/components/external-link-guard.tsx"),r=a.join(e,"src/routes/__root.tsx");y(t),l(r,n=>{let i=n;if(i.includes('import { ExternalLinkGuard } from "../components/external-link-guard"')||(i=i.replace(`import appCss from "../styles.css?url"
|
|
299
|
+
`,`import appCss from "../styles.css?url"
|
|
300
|
+
import { ExternalLinkGuard } from "../components/external-link-guard"
|
|
301
|
+
`)),i.includes("<ExternalLinkGuard />"))return i;const o=i.replace("<main>{children}</main>","<main><ExternalLinkGuard />{children}</main>");if(o===i)throw new u(r,"Could not mount ExternalLinkGuard in the TanStack Start root route.");return o})}function ht(e){const t=a.join(e,"app/components/external-link-guard.tsx"),r=a.join(e,"app/root.tsx");y(t),l(r,n=>{let i=n;if(i.includes('import { ExternalLinkGuard } from "./components/external-link-guard"')||(i=i.replace(`import "./app.css"
|
|
302
|
+
`,`import "./app.css"
|
|
303
|
+
import { ExternalLinkGuard } from "./components/external-link-guard"
|
|
304
|
+
`)),i.includes("<ExternalLinkGuard />"))return i;const o=i.replace(`<body>
|
|
305
|
+
{children}`,`<body>
|
|
306
|
+
<ExternalLinkGuard />
|
|
307
|
+
{children}`);if(o===i)throw new u(r,"Could not mount ExternalLinkGuard in the React Router root layout.");return o})}function wt(e){const t=a.join(e,"src/components/external-link-guard.tsx"),r=a.join(e,"src/layouts/main.astro");y(t),l(r,n=>{let i=n;if(i.includes('import { ExternalLinkGuard } from "@/components/external-link-guard"')||(i=i.replace(`import "@/styles/global.css"
|
|
308
|
+
`,`import "@/styles/global.css"
|
|
309
|
+
import { ExternalLinkGuard } from "@/components/external-link-guard"
|
|
310
|
+
`)),i.includes("<ExternalLinkGuard client:load />"))return i;const o=i.replace(` <body>
|
|
311
|
+
<main><slot /></main>
|
|
312
|
+
</body>`,` <body>
|
|
313
|
+
<main><ExternalLinkGuard client:load /><slot /></main>
|
|
314
|
+
</body>`);if(o===i)throw new u(r,"Could not mount ExternalLinkGuard in the Astro layout.");return o})}async function vt(e,t){switch(dt(e),t.template){case"vite":mt(e);return;case"next":ft(e);return;case"start":gt(e);return;case"react-router":ht(e);return;case"astro":wt(e);return}}const V="use tauri::webview::PageLoadEvent;",xt=` .on_page_load(|webview, payload| {
|
|
315
|
+
if webview.label() == "main" && matches!(payload.event(), PageLoadEvent::Finished) {
|
|
316
|
+
let _ = webview.window().show();
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
`;async function yt(e){m(a.join(e,"src-tauri/tauri.conf.json"),r=>{r.app=r.app||{},r.app.windows=Array.isArray(r.app.windows)?r.app.windows:[{}];const n=r.app.windows[0]||{};return r.app.windows[0]={...n,visible:!1},r});const t=a.join(e,"src-tauri/src/lib.rs");l(t,r=>{let n=r;if(n.includes(V)||(n.includes(`use tauri::Manager;
|
|
320
|
+
`)?n=n.replace(`use tauri::Manager;
|
|
321
|
+
`,`${V}
|
|
322
|
+
`):n=`${V}
|
|
323
|
+
${n}`),n.includes(".on_page_load("))return n;const i=n.replace(" .run(tauri::generate_context!())",`${xt} .run(tauri::generate_context!())`);if(i===n)throw new u(t,"Could not insert the startup flash-prevention page-load hook.");return i})}function bt(){const e=a.dirname(I(import.meta.url)),t=[a.resolve(e,"../assets"),a.resolve(e,"../../assets")];return t.find(r=>s.existsSync(r))??t[0]}const kt=bt();async function Et(e){q(a.join(kt,"app-icon.png"),a.join(e,"app-icon.png"))}function $t(e){return`"use client"
|
|
324
|
+
|
|
325
|
+
import { useState } from "react"
|
|
326
|
+
import { Button } from "${e}components/ui/button"
|
|
327
|
+
import { Input } from "${e}components/ui/input"
|
|
328
|
+
import { trackedInvoke } from "${e}lib/tauri"
|
|
329
|
+
|
|
330
|
+
export function Greet() {
|
|
331
|
+
const [name, setName] = useState("")
|
|
332
|
+
const [greeting, setGreeting] = useState("")
|
|
333
|
+
|
|
334
|
+
async function handleGreet() {
|
|
335
|
+
const result = await trackedInvoke<string>("greet", {
|
|
336
|
+
name: name.trim() || "World",
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
setGreeting(result)
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return (
|
|
343
|
+
<div className="rounded-xl border bg-card p-4 shadow-sm">
|
|
344
|
+
<div className="mb-4 space-y-1">
|
|
345
|
+
<h2 className="font-medium">Rust bridge</h2>
|
|
346
|
+
<p className="text-sm text-muted-foreground">
|
|
347
|
+
Call the bundled Tauri command and render the response from Rust.
|
|
348
|
+
</p>
|
|
349
|
+
</div>
|
|
350
|
+
<div className="flex flex-col gap-3 sm:flex-row">
|
|
351
|
+
<Input
|
|
352
|
+
value={name}
|
|
353
|
+
onChange={(event) => setName(event.target.value)}
|
|
354
|
+
placeholder="Enter a name"
|
|
355
|
+
/>
|
|
356
|
+
<Button onClick={handleGreet} disabled={!name.trim()}>
|
|
357
|
+
Greet
|
|
358
|
+
</Button>
|
|
359
|
+
</div>
|
|
360
|
+
{greeting ? (
|
|
361
|
+
<p className="mt-3 text-sm text-muted-foreground">{greeting}</p>
|
|
362
|
+
) : null}
|
|
363
|
+
</div>
|
|
364
|
+
)
|
|
365
|
+
}
|
|
366
|
+
`}function jt(e,t){return`import { Greet } from "${t}components/greet"
|
|
367
|
+
|
|
368
|
+
export default function ${e}() {
|
|
369
|
+
return (
|
|
370
|
+
<div className="flex min-h-svh items-center justify-center p-6">
|
|
371
|
+
<div className="w-full max-w-xl space-y-6">
|
|
372
|
+
<div className="space-y-2">
|
|
373
|
+
<h1 className="text-2xl font-semibold tracking-tight">Project ready!</h1>
|
|
374
|
+
<p className="text-sm text-muted-foreground">
|
|
375
|
+
Your shadcn frontend and Tauri native layer are wired together.
|
|
376
|
+
</p>
|
|
377
|
+
</div>
|
|
378
|
+
<Greet />
|
|
379
|
+
</div>
|
|
380
|
+
</div>
|
|
381
|
+
)
|
|
382
|
+
}
|
|
383
|
+
`}function St(){return`import { createFileRoute } from "@tanstack/react-router"
|
|
384
|
+
import { Greet } from "@/components/greet"
|
|
385
|
+
|
|
386
|
+
export const Route = createFileRoute("/")({
|
|
387
|
+
component: Home,
|
|
388
|
+
})
|
|
389
|
+
|
|
390
|
+
function Home() {
|
|
391
|
+
return (
|
|
392
|
+
<div className="flex min-h-svh items-center justify-center p-6">
|
|
393
|
+
<div className="w-full max-w-xl space-y-6">
|
|
394
|
+
<div className="space-y-2">
|
|
395
|
+
<h1 className="text-2xl font-semibold tracking-tight">Project ready!</h1>
|
|
396
|
+
<p className="text-sm text-muted-foreground">
|
|
397
|
+
Your shadcn frontend and Tauri native layer are wired together.
|
|
398
|
+
</p>
|
|
399
|
+
</div>
|
|
400
|
+
<Greet />
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
)
|
|
404
|
+
}
|
|
405
|
+
`}function se(e,t){switch(e){case"next":return a.join(t,"app/page.tsx");case"vite":return a.join(t,"src/App.tsx");case"start":return a.join(t,"src/routes/index.tsx");case"react-router":return a.join(t,"app/routes/home.tsx");case"astro":return a.join(t,"src/pages/index.astro")}}function _t(e,t){switch(e){case"next":return a.join(t,"components/greet.tsx");case"vite":case"start":case"astro":return a.join(t,"src/components/greet.tsx");case"react-router":return a.join(t,"app/components/greet.tsx")}}async function Pt(e,t){t.includeStarterUI||await te(e,"input");const r=t.template==="react-router"?"~/":"@/";if(s.writeFileSync(_t(t.template,e),$t(r)),t.includeStarterUI)return;if(t.template==="astro"){s.writeFileSync(se(t.template,e),`---
|
|
406
|
+
import Layout from "@/layouts/main.astro"
|
|
407
|
+
import { Greet } from "@/components/greet"
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
<Layout>
|
|
411
|
+
<div class="flex min-h-svh items-center justify-center p-6">
|
|
412
|
+
<div class="w-full max-w-xl space-y-6">
|
|
413
|
+
<div class="space-y-2">
|
|
414
|
+
<h1 class="text-2xl font-semibold tracking-tight">Project ready!</h1>
|
|
415
|
+
<p class="text-sm text-muted-foreground">
|
|
416
|
+
Your shadcn frontend and Tauri native layer are wired together.
|
|
417
|
+
</p>
|
|
418
|
+
</div>
|
|
419
|
+
<Greet client:load />
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
</Layout>
|
|
423
|
+
`);return}const n=t.template==="start"?St():jt(t.template==="vite"?"App":t.template==="react-router"?"Home":"Page",r);s.writeFileSync(se(t.template,e),n)}const b=`
|
|
424
|
+
html,
|
|
425
|
+
body {
|
|
426
|
+
height: 100%;
|
|
427
|
+
overscroll-behavior: none;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
body {
|
|
431
|
+
overflow: hidden;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
main {
|
|
435
|
+
height: 100%;
|
|
436
|
+
overflow: auto;
|
|
437
|
+
overscroll-behavior: none;
|
|
438
|
+
}
|
|
439
|
+
`,Dt=`
|
|
440
|
+
#root {
|
|
441
|
+
height: 100%;
|
|
442
|
+
}
|
|
443
|
+
`;function k(e,t){l(e,r=>r.includes("overscroll-behavior: none;")?r:`${r.trimEnd()}
|
|
444
|
+
${t}`)}function E(e,t,r){l(e,n=>{if(n.includes("<main>"))return n;const i=n.replace(t,r);if(i===n)throw new u(e,"Could not insert the scroll container <main> wrapper.");return i})}async function Lt(e,t){switch(t.template){case"next":k(a.join(e,"app/globals.css"),b),E(a.join(e,"app/layout.tsx"),/\{children\}/,"<main>{children}</main>");return;case"vite":k(a.join(e,"src/index.css"),`${b}${Dt}`),E(a.join(e,"src/main.tsx"),/<App \/>/,"<main><App /></main>");return;case"start":k(a.join(e,"src/styles.css"),b),E(a.join(e,"src/routes/__root.tsx"),/\{children\}/,"<main>{children}</main>");return;case"react-router":k(a.join(e,"app/app.css"),b),E(a.join(e,"app/root.tsx"),/return <Outlet \/>/,"return <main><Outlet /></main>");return;case"astro":k(a.join(e,"src/styles/global.css"),b),E(a.join(e,"src/layouts/main.astro"),/<slot \/>/,"<main><slot /></main>");return;default:throw new u(e,`No scroll container battery implementation exists for template "${t.template}".`)}}const $=`
|
|
445
|
+
@layer base {
|
|
446
|
+
body {
|
|
447
|
+
@apply select-none;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
input,
|
|
451
|
+
textarea,
|
|
452
|
+
[contenteditable="true"],
|
|
453
|
+
pre,
|
|
454
|
+
code {
|
|
455
|
+
@apply select-text;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
@layer utilities {
|
|
460
|
+
.ui-selectable {
|
|
461
|
+
@apply select-text;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
`;function j(e,t){l(e,r=>r.includes(".ui-selectable")?r:`${r.trimEnd()}
|
|
465
|
+
${t}`)}async function Ct(e,t){switch(t.template){case"next":j(a.join(e,"app/globals.css"),$);return;case"vite":j(a.join(e,"src/index.css"),$);return;case"start":j(a.join(e,"src/styles.css"),$);return;case"react-router":j(a.join(e,"app/app.css"),$);return;case"astro":j(a.join(e,"src/styles/global.css"),$);return;default:throw new u(e,`No selection behavior battery implementation exists for template "${t.template}".`)}}function Tt(){const e=a.dirname(I(import.meta.url)),t=[a.resolve(e,"../assets"),a.resolve(e,"../../assets")];return t.find(r=>s.existsSync(r))??t[0]}const Gt=Tt();function Nt(e){const t=[];for(const r of e){if(r==="macos-latest"){t.push({name:"macOS Apple Silicon",platform:"macos-latest",args:"--target aarch64-apple-darwin"},{name:"macOS Intel",platform:"macos-latest",args:"--target x86_64-apple-darwin"});continue}if(r==="ubuntu-latest"){t.push({name:"Linux",platform:"ubuntu-22.04",args:""});continue}t.push({name:"Windows",platform:r,args:""})}return t.map(r=>` - name: "${r.name}"
|
|
466
|
+
platform: "${r.platform}"
|
|
467
|
+
args: "${r.args}"`).join(`
|
|
468
|
+
`)}async function At(e,t){const r=s.readFileSync(a.join(Gt,"release.yml.tmpl"),"utf-8").replace("{{PLATFORMS}}",Nt(t.targetOS)),n=a.join(e,".github/workflows");s.mkdirSync(n,{recursive:!0}),s.writeFileSync(a.join(n,"release.yml"),r)}const It=1400,Rt=918;async function Ot(e,t,r){Z(a.join(t,"src-tauri"),a.join(e,"src-tauri")),m(a.join(e,"package.json"),o=>(o.name=r.packageName,o.dependencies=o.dependencies||{},o.dependencies["@tauri-apps/api"]="^2",o.dependencies["@tauri-apps/plugin-opener"]="^2",o.devDependencies=o.devDependencies||{},o.devDependencies["@tauri-apps/cli"]="^2",o.scripts=o.scripts||{},o.scripts.tauri="tauri",o));const n=Pe(r.packageName),i=`${n}_lib`;l(a.join(e,"src-tauri/Cargo.toml"),o=>o.replace(/^name = "tauri-app"$/m,`name = "${n}"`).replace(/^name = "tauri_app_lib"$/m,`name = "${i}"`)),l(a.join(e,"src-tauri/src/main.rs"),o=>o.replace("tauri_app_lib::run()",`${i}::run()`))}async function Ft(e,t,r){m(a.join(e,"src-tauri/tauri.conf.json"),n=>{n.productName=t.projectName,n.identifier=t.identifier,n.build={...n.build,...r},n.app=n.app||{},n.app.windows=Array.isArray(n.app.windows)?n.app.windows:[{}];const i=n.app.windows[0]||{};return n.app.windows[0]={...i,title:t.projectName,center:!0,width:It,height:Rt},n})}const B=["vite","next","start","react-router","astro"],M=["windows-latest","macos-latest","ubuntu-latest"],ce="tauri-ui",le="b0",Ut={vite:"Vite",next:"Next.js",start:"TanStack Start","react-router":"React Router",astro:"Astro"};function p(e,t="Operation cancelled"){if(xe(e))throw new Error(t);return e}function Vt(e){if(B.includes(e))return e;throw new Error(`Unsupported template "${e}". Expected one of: ${B.join(", ")}`)}function ue(e){try{return`com.${J(z.userInfo().username)||"example"}.${e}`}catch{return`com.example.${e}`}}function G(e){return{placeholder:e,defaultValue:e}}async function Bt(e,t=process.cwd()){let r=$e(e.targetDir);if(r||(r=p(await _({message:"Project name",...G(ce)}))),r||(r=ce),r===".")throw new Error("Scaffolding into the current directory is not supported yet.");const n=a.resolve(t,r),i=a.basename(n),o=R(i)?i:J(i);if(s.existsSync(n)&&!je(n))if(e.force)s.rmSync(n,{recursive:!0,force:!0});else{if(e.yes)throw new Error(`Target directory "${r}" is not empty. Re-run with --force to overwrite it.`);if(!p(await P({message:`Target directory "${r}" is not empty. Remove it and continue?`,initialValue:!1})))throw new Error("Operation cancelled");s.rmSync(n,{recursive:!0,force:!0})}let c=o;R(i)||(e.yes?c=o:c=p(await _({message:"Package name",...G(o),validate(d){if(!d||!R(d))return"Enter a valid package.json name"}})));const N=e.template?Vt(e.template):e.yes?"vite":p(await we({message:"Frontend template",initialValue:"vite",options:B.map(d=>({value:d,label:Ut[d]}))})),de=e.identifier?e.identifier:e.yes?ue(c):p(await _({message:"App identifier",...G(ue(c))})),me=e.preset?e.preset:e.yes?le:p(await _({message:"shadcn preset",...G(le)})),fe=e.includeStarterUI??(e.yes?!0:p(await P({message:"Include starter UI?",initialValue:!0}))),ge=e.includeInvokeExample??(e.yes?!0:p(await P({message:"Include Rust invoke example?",initialValue:!0}))),H=e.includeWorkflow??(e.yes?!0:p(await P({message:"Include GitHub release workflow?",initialValue:!0}))),he=H?e.yes?[...M]:p(await ve({message:"Target operating systems",initialValues:[...M],required:!0,options:M.map(d=>({value:d,label:d}))})):[];return{projectName:i,packageName:c,template:N,identifier:de,preset:me,includeStarterUI:fe,includeInvokeExample:ge,includeWorkflow:H,targetOS:he,targetDir:n}}function Mt(){console.log(`Usage: create-tauri-ui [target-dir] [options]
|
|
469
|
+
|
|
470
|
+
Options:
|
|
471
|
+
-t, --template <name> vite | next | start | react-router | astro
|
|
472
|
+
--identifier <value> set the Tauri app identifier
|
|
473
|
+
--preset <value> set the shadcn preset (default: b0)
|
|
474
|
+
--starter include the starter dashboard
|
|
475
|
+
--no-starter skip the starter dashboard
|
|
476
|
+
--invoke-example include the Rust invoke example
|
|
477
|
+
--no-invoke-example skip the Rust invoke example
|
|
478
|
+
--workflow include the GitHub release workflow
|
|
479
|
+
--no-workflow skip the GitHub release workflow
|
|
480
|
+
-f, --force overwrite an existing target directory
|
|
481
|
+
-y, --yes accept defaults
|
|
482
|
+
-h, --help display help`)}function Ht(e){const t={},r=[],n=(i,o)=>{const c=e[i+1];if(!c||c.startsWith("-"))throw new Error(`Missing value for ${o}`);return c};for(let i=0;i<e.length;i+=1){const o=e[i];switch(o){case"-h":case"--help":t.help=!0;break;case"-t":case"--template":t.template=n(i,o),i+=1;break;case"--identifier":t.identifier=n(i,o),i+=1;break;case"--preset":t.preset=n(i,o),i+=1;break;case"--starter":t.includeStarterUI=!0;break;case"--no-starter":t.includeStarterUI=!1;break;case"--invoke-example":case"--example":t.includeInvokeExample=!0;break;case"--no-invoke-example":case"--no-example":t.includeInvokeExample=!1;break;case"--workflow":t.includeWorkflow=!0;break;case"--no-workflow":t.includeWorkflow=!1;break;case"-f":case"--force":t.force=!0;break;case"-y":case"--yes":t.yes=!0;break;default:if(o.startsWith("-"))throw new Error(`Unknown flag: ${o}`);r.push(o)}}if(r.length>1)throw new Error("Only one target directory may be provided.");return r[0]&&(t.targetDir=r[0]),t}function Wt(e){const t=a.relative(S.cwd(),e)||".";return t.includes(" ")?`"${t}"`:t}function Kt(e){s.rmSync(a.join(e,"node_modules"),{recursive:!0,force:!0})}function zt(e,t){const r=[`cd ${Wt(e)}`,"bun install","bun run tauri dev","bunx tauri icon app-icon.png"];K(r.join(`
|
|
483
|
+
`),"Next steps"),t&&K("Configure the GitHub release workflow secrets before publishing builds.","Release workflow")}async function Yt(){try{await C("bun",["--version"])}catch{throw new Error("bun is required. Install it from https://bun.sh.")}}function pe(e){return e instanceof w?{message:e.message,detail:e.stderr.trim()}:e instanceof Error?{message:e.message,detail:""}:{message:"An unknown error occurred.",detail:""}}async function Xt(){const e=Ht(S.argv.slice(2));if(e.help){Mt();return}ye(A.bold("create-tauri-ui")),await Yt();const t=await Bt(e);_e(),O(t.targetDir);const r=be();let n;try{r.start("Creating the shadcn frontend scaffold"),await We(t),r.message("Creating the Tauri native scaffold");const i=await Ke(t);n=i.tempDir,r.message("Merging the native layer into the frontend project"),await Ot(t.targetDir,i.projectDir,t);const o=Oe(t.template);r.message(`Patching the ${t.template} project for Tauri`);try{await o.apply(t.targetDir,t)}catch(c){if(c instanceof u)h.warn(`${c.message} (${c.file})`);else throw c}if(await Ft(t.targetDir,t,o.tauriConfig()),r.message("Applying the startup flash-prevention battery"),await yt(t.targetDir),r.message("Applying the desktop scroll container battery"),await Lt(t.targetDir,t),r.message("Applying the external link guard battery"),await vt(t.targetDir,t),r.message("Applying the development debug panel battery"),await lt(t.targetDir,t),r.message("Applying the desktop selection-behavior battery"),await Ct(t.targetDir,t),t.includeStarterUI){r.message("Installing the starter dashboard");try{await ze(t.targetDir,t)}catch(c){if(c instanceof w)h.warn(c.message),c.stderr.trim()&&h.message(c.stderr.trim());else throw c}}t.includeInvokeExample&&(r.message("Adding the Rust invoke example"),await Pt(t.targetDir,t)),t.includeWorkflow&&(r.message("Writing the GitHub release workflow"),await At(t.targetDir,t)),r.message("Copying the app icon source"),await Et(t.targetDir),Kt(t.targetDir),f(t.targetDir),r.stop("Project ready"),zt(t.targetDir,t.includeWorkflow),ke(`Scaffolded ${A.cyan(t.projectName)} in ${A.dim(t.targetDir)}`)}catch(i){const o=pe(i);r.error("Scaffolding failed"),W(o.message),o.detail&&h.message(o.detail),S.exitCode=1}finally{if(n){f(n);try{g(n)}catch{}}}}Xt().catch(e=>{const t=pe(e);W(t.message),t.detail&&h.message(t.detail),S.exit(1)});
|