Skip to content

Commit a20aebc

Browse files
chore: typegpu-cli minor improvements (#2557)
Co-authored-by: Aleksander Katan <56294622+aleksanderkatan@users.noreply.github.com>
1 parent 03d7120 commit a20aebc

6 files changed

Lines changed: 10 additions & 59 deletions

File tree

packages/typegpu-cli/src/create.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ export async function createProject(cwd: string) {
7373
if (steps.length > 0) {
7474
msg += ` To get started run:\n\n`;
7575
msg += steps.join('\n');
76+
msg += `\n\n`;
77+
msg += `\
78+
Note: If you are using VS Code or Cursor, you may need to run
79+
“TypeScript: Select TypeScript Version” and choose
80+
“Use Workspace Version” to enable tsover.`;
7681
}
7782

7883
p.outro(msg);

packages/typegpu-cli/src/utils/files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ export function copyTemplate(templateDir: string, projectDir: string, packageNam
7070
failAndExit(`[INTERNAL] Invalid package.json in template ${templateDir}`, pkg.summary);
7171
}
7272
pkg.name = packageName;
73-
fs.writeFileSync(destPackage, JSON.stringify(pkg, null, 2));
73+
fs.writeFileSync(destPackage, JSON.stringify(pkg, null, 2) + '\n' /* to make oxfmt happy */);
7474
}

packages/typegpu-cli/src/utils/pm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function pmFromUserAgent(userAgent: string | undefined) {
1818
if (pm === undefined) {
1919
failAndExit(`Cannot determine package manager from user agent env.`);
2020
}
21-
return pm as unknown as Agent;
21+
return pm as Agent;
2222
}
2323

2424
function runCommand(command: string, args: string[], interactive?: boolean) {

packages/typegpu-cli/templates/template-vite-simple/_package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
"build": "tsc && vite build",
99
"preview": "vite preview",
1010
"check": "oxlint && oxfmt --check",
11-
"fix": "oxlint --fix && oxfmt"
11+
"fix": "oxlint --fix && oxfmt",
12+
"types": "tsc --p ./tsconfig.json --noEmit"
1213
},
1314
"dependencies": {
14-
"@typegpu/color": "^0.11.0",
15-
"@typegpu/noise": "^0.11.0",
1615
"typegpu": "^0.11.6"
1716
},
1817
"devDependencies": {

packages/typegpu-cli/templates/template-vite-simple/src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import tgpu, { common, d } from 'typegpu';
22

33
const root = await tgpu.init();
44

5-
// oxlint-disable-next-line typescript/no-non-null-assertion
6-
const canvas = document.querySelector<HTMLCanvasElement>('#canvas')!;
5+
const canvas = document.querySelector<HTMLCanvasElement>('#canvas') as HTMLCanvasElement;
76
const context = root.configureContext({ canvas });
87

98
const pipeline = root.createRenderPipeline({

packages/typegpu-cli/templates/template-vite-simple/src/style.css

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -69,58 +69,6 @@ p {
6969
margin: 0;
7070
}
7171

72-
.slider {
73-
appearance: none;
74-
width: 200px;
75-
height: 4px;
76-
border-radius: 2px;
77-
background: var(--accent-bg);
78-
border: none;
79-
outline: none;
80-
cursor: pointer;
81-
touch-action: pan-y;
82-
margin-bottom: 24px;
83-
84-
&::-webkit-slider-runnable-track {
85-
height: 4px;
86-
background: var(--accent-bg);
87-
border-radius: 2px;
88-
}
89-
90-
&::-webkit-slider-thumb {
91-
appearance: none;
92-
width: 18px;
93-
height: 18px;
94-
margin-top: -7px;
95-
border-radius: 50%;
96-
background: var(--accent);
97-
cursor: pointer;
98-
transition: opacity 0.2s;
99-
}
100-
101-
&::-moz-range-track {
102-
height: 4px;
103-
background: var(--accent-bg);
104-
border-radius: 2px;
105-
border: none;
106-
}
107-
108-
&::-moz-range-thumb {
109-
width: 18px;
110-
height: 18px;
111-
border-radius: 50%;
112-
background: var(--accent);
113-
cursor: pointer;
114-
border: none;
115-
}
116-
117-
&:focus-visible {
118-
outline: 2px solid var(--accent);
119-
outline-offset: 4px;
120-
border-radius: 4px;
121-
}
122-
}
123-
12472
#typegpu picture {
12573
display: flex;
12674
align-items: center;

0 commit comments

Comments
 (0)