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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/typegpu-cli/src/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ const GRADIENT_END = [0.216, 0.263, 0.82] as const;
const PROJECT_TEMPLATES = [
{
value: 'vite-simple',
label: 'Vite (Simple)',
label: 'Vite (Bare)',
},
{
value: 'vite-complex',
label: 'Vite (Complex - Domain Warping)',
},
{
value: 'vite-react',
label: 'Vite + React',
label: 'Vite + React (Bare)',
},
{
value: 'expo-simple',
label: 'Expo RN',
label: 'Expo RN (Bare)',
},
] as const;

Expand Down
22 changes: 22 additions & 0 deletions packages/typegpu-cli/templates/template-vite-complex/_gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
36 changes: 36 additions & 0 deletions packages/typegpu-cli/templates/template-vite-complex/_package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "typegpu-vanilla-vite-complex-project",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"check": "oxlint && oxfmt --check",
"fix": "oxlint --fix && oxfmt",
"types": "tsc --p ./tsconfig.json --noEmit"
},
"dependencies": {
"@typegpu/color": "^0.11.0",
"@typegpu/noise": "^0.11.0",
"typegpu": "^0.11.6"
},
"devDependencies": {
"@webgpu/types": "^0.1.70",
"eslint-plugin-typegpu": "^0.11.1",
"oxfmt": "^0.49.0",
"oxlint": "^1.64.0",
"typescript": "npm:tsover@6.0.1",
"unplugin-typegpu": "^0.11.4",
"vite": "^8.0.12"
},
"overrides": {
"typescript": "npm:tsover@6.0.1"
},
"pnpm": {
"overrides": {
"typescript": "npm:tsover@6.0.1"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.enablePromptUseWorkspaceTsdk": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
"vtsls": {
"settings": {
"typescript": {
"tsdk": "node_modules/typescript/lib"
}
}
}
}
}
102 changes: 102 additions & 0 deletions packages/typegpu-cli/templates/template-vite-complex/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/src/style.css" />
<title>typegpu-vanilla-vite-complex-project</title>
</head>
<body>
<div id="app">
<section id="center">
<canvas id="canvas"></canvas>
<input
type="range"
id="slider"
class="slider"
min="-2.5"
max="3.5"
step="0.01"
value="0.5"
/>
</section>

<div class="ticks"></div>

<section id="next-steps">
<div id="typegpu">
<picture>
<source srcset="/typegpu-logo-dark.svg" media="(prefers-color-scheme: dark)" />
<img class="typegpu-logo" src="/typegpu-logo-light.svg" alt="TypeGPU" />
</picture>

<p>Type-safe WebGPU</p>
<ul>
<li>
<a href="https://docs.swmansion.com/TypeGPU" target="_blank">
<svg class="button-icon" role="presentation" aria-hidden="true">
<use href="/icons.svg#documentation-icon"></use>
</svg>
Documentation
</a>
</li>
<li>
<a href="https://github.com/software-mansion/typegpu" target="_blank">
<svg class="button-icon" role="presentation" aria-hidden="true">
<use href="/icons.svg#github-icon"></use>
</svg>
GitHub
</a>
</li>
<li>
<a href="https://discord.gg/8jpfgDqPcM" target="_blank">
<svg class="button-icon" role="presentation" aria-hidden="true">
<use href="/icons.svg#discord-icon"></use>
</svg>
Discord
</a>
</li>
</ul>
</div>
<div id="vite">
<h2 class="title-with-icon">
Vite
<img class="icon" src="/vite.svg" alt="" />
</h2>
<p>Next generation frontend tooling</p>
<ul>
<li>
<a href="https://vite.dev/" target="_blank">
<svg class="button-icon" role="presentation" aria-hidden="true">
<use href="/icons.svg#vite-icon"></use>
</svg>
Explore Vite
</a>
</li>
<li>
<a href="https://github.com/vitejs/vite" target="_blank">
<svg class="button-icon" role="presentation" aria-hidden="true">
<use href="/icons.svg#github-icon"></use>
</svg>
GitHub
</a>
</li>
<li>
<a href="https://chat.vite.dev/" target="_blank">
<svg class="button-icon" role="presentation" aria-hidden="true">
<use href="/icons.svg#discord-icon"></use>
</svg>
Discord
</a>
</li>
</ul>
</div>
</section>

<div class="ticks"></div>
<section id="spacer"></section>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from 'oxlint';
import typegpu from 'eslint-plugin-typegpu';

export default defineConfig({
plugins: ['typescript', 'import', 'unicorn', 'oxc'],
jsPlugins: ['eslint-plugin-typegpu'],
categories: {
correctness: 'warn',
suspicious: 'warn',
},
rules: {
...typegpu.configs.recommended.rules,
'typescript/no-non-null-assertion': 'error',
'typescript/no-explicit-any': 'error',
'typescript/no-unsafe-type-assertion': 'off',
'import/no-named-as-default': 'off',
},
env: {
builtin: true,
},
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading