Skip to content

Commit 1959dc7

Browse files
committed
use spaces instead of tabs
1 parent 92183d4 commit 1959dc7

33 files changed

+954
-956
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"printWidth": 100
2+
"printWidth": 100,
3+
"useTabs": false
34
}

docs/src/content/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { defineCollection } from 'astro:content';
2-
import { docsSchema } from '@astrojs/starlight/schema';
1+
import { defineCollection } from "astro:content";
2+
import { docsSchema } from "@astrojs/starlight/schema";
33

44
export const collections = {
5-
docs: defineCollection({ schema: docsSchema() }),
5+
docs: defineCollection({ schema: docsSchema() }),
66
};

docs/src/content/docs/introduction/quick-start.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ A proper documentation will come soon !
1515

1616
<PackageManagers pkg="usegl" frame="false" pkgManagers={["pnpm", "npm", "yarn", "bun"]} />
1717

18-
1918
## Usage
2019

2120
<Code lang="js" code={`
2221
import { useWebGLCanvas } from "usegl";
2322
2423
useWebGLCanvas({
25-
canvas: document.querySelector("canvas"),
26-
fragment: /* glsl */ \`
27-
varying vec2 vUv;
28-
uniform float uTime;
29-
30-
void main() {
31-
gl_FragColor = vec4(vUv, sin(uTime) / 2. + .5, 1.);
32-
}
33-
\`
24+
canvas: document.querySelector("canvas"),
25+
fragment: /_ glsl _/ \`
26+
varying vec2 vUv;
27+
uniform float uTime;
28+
29+
void main() {
30+
gl_FragColor = vec4(vUv, sin(uTime) / 2. + .5, 1.);
31+
}
32+
\`
33+
3434
});
35-
`} />
35+
`} />

docs/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"jsx": "react-jsx",
55
"jsxImportSource": "react"
66
}
7-
}
7+
}

eslint.config.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import unjs from "eslint-config-unjs";
22

33
export default unjs({
4-
rules: {
5-
"unicorn/filename-case": "off",
6-
"unicorn/no-null": "off",
7-
"@typescript-eslint/consistent-type-imports": "error",
8-
"@typescript-eslint/triple-slash-reference": "off",
9-
},
4+
rules: {
5+
"unicorn/filename-case": "off",
6+
"unicorn/no-null": "off",
7+
"@typescript-eslint/consistent-type-imports": "error",
8+
"@typescript-eslint/triple-slash-reference": "off",
9+
},
1010
});

lib/CHANGELOG.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Changelog
22

3-
43
## v0.2.0
54

65
[compare changes](https://github.com/jsulpis/usegl/compare/v0.1.0...v0.2.0)
@@ -11,7 +10,7 @@
1110
- Allow to provide the canvas as a CSS selector ([a7f8d0f](https://github.com/jsulpis/usegl/commit/a7f8d0f))
1211
- Add useLoop hook with play/pause controls ([f3e2cf3](https://github.com/jsulpis/usegl/commit/f3e2cf3))
1312
- Add useBoundingRect hook ([8d1851e](https://github.com/jsulpis/usegl/commit/8d1851e))
14-
- ⚠️ Change onPointerEvents to usePointerEvents and add more events ([ddeabd9](https://github.com/jsulpis/usegl/commit/ddeabd9))
13+
- ⚠️ Change onPointerEvents to usePointerEvents and add more events ([ddeabd9](https://github.com/jsulpis/usegl/commit/ddeabd9))
1514

1615
### 🩹 Fixes
1716

@@ -20,7 +19,7 @@
2019

2120
### 💅 Refactors
2221

23-
- ⚠️ Change `onCanvasResize` to `useResizeObserver` and provide controls on the observer ([31e38ff](https://github.com/jsulpis/usegl/commit/31e38ff))
22+
- ⚠️ Change `onCanvasResize` to `useResizeObserver` and provide controls on the observer ([31e38ff](https://github.com/jsulpis/usegl/commit/31e38ff))
2423

2524
### 🏡 Chore
2625

@@ -39,12 +38,11 @@
3938

4039
#### ⚠️ Breaking Changes
4140

42-
- ⚠️ Change onPointerEvents to usePointerEvents and add more events ([ddeabd9](https://github.com/jsulpis/usegl/commit/ddeabd9))
43-
- ⚠️ Change `onCanvasResize` to `useResizeObserver` and provide controls on the observer ([31e38ff](https://github.com/jsulpis/usegl/commit/31e38ff))
41+
- ⚠️ Change onPointerEvents to usePointerEvents and add more events ([ddeabd9](https://github.com/jsulpis/usegl/commit/ddeabd9))
42+
- ⚠️ Change `onCanvasResize` to `useResizeObserver` and provide controls on the observer ([31e38ff](https://github.com/jsulpis/usegl/commit/31e38ff))
4443

4544
## v0.1.0
4645

47-
4846
### 🚀 Enhancements
4947

5048
- Add a first version of useWebGLCanvas, onCanvasResize, and add a gradient demo ([f464f08](https://github.com/jsulpis/usegl/commit/f464f08))
@@ -79,4 +77,3 @@
7977
- Separate packages for docs and lib ([1857c1c](https://github.com/jsulpis/usegl/commit/1857c1c))
8078
- Add license ([e0801ca](https://github.com/jsulpis/usegl/commit/e0801ca))
8179
- Setup unjs package template ([0dc0d0c](https://github.com/jsulpis/usegl/commit/0dc0d0c))
82-

lib/astro.config.mjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
66

77
// https://astro.build/config
88
export default defineConfig({
9-
srcDir: "./playground/src",
10-
publicDir: "./playground/public",
11-
vite: {
12-
resolve: {
13-
alias: {
14-
usegl: resolve(__dirname, "./src/index.ts"),
15-
},
16-
},
17-
},
18-
devToolbar: {
19-
enabled: false,
20-
},
9+
srcDir: "./playground/src",
10+
publicDir: "./playground/public",
11+
vite: {
12+
resolve: {
13+
alias: {
14+
usegl: resolve(__dirname, "./src/index.ts"),
15+
},
16+
},
17+
},
18+
devToolbar: {
19+
enabled: false,
20+
},
2121
});

lib/package.json

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
{
2-
"name": "usegl",
3-
"version": "0.2.0",
4-
"description": "Lightweight hooks library for WebGL",
5-
"repository": "jsulpis/usegl",
6-
"license": "MIT",
7-
"author": "Julien SULPIS",
8-
"sideEffects": false,
9-
"type": "module",
10-
"exports": {
11-
".": {
12-
"types": "./dist/index.d.ts",
13-
"import": "./dist/index.mjs"
14-
}
15-
},
16-
"main": "./dist/index.mjs",
17-
"module": "./dist/index.mjs",
18-
"types": "./dist/index.d.ts",
19-
"files": [
20-
"dist"
21-
],
22-
"scripts": {
23-
"build": "unbuild",
24-
"dev": "astro dev",
25-
"format": "prettier src --check",
26-
"format:fix": "prettier src --write",
27-
"lint": "eslint src",
28-
"lint:fix": "eslint src --fix",
29-
"prepack": "pnpm build",
30-
"release": "changelogen --release --clean",
31-
"test": "playwright test",
32-
"test:local": "docker build -t usegl . && docker run --rm -v $(pwd)/test-results:/app/test-results usegl /bin/sh -c 'xvfb-run pnpm run test'",
33-
"test:ui": "playwright test --ui",
34-
"test:update": "docker build -t usegl . && docker run --rm -v $(pwd)/test-results:/app/test-results -v $(pwd)/tests/__screenshots__:/app/tests/__screenshots__ usegl",
35-
"typecheck": "tsc --noEmit && astro check"
36-
},
37-
"devDependencies": {
38-
"@astrojs/check": "0.9.4",
39-
"@playwright/test": "1.48.1",
40-
"@types/node": "22.1.0",
41-
"astro": "4.16.7",
42-
"changelogen": "0.5.5",
43-
"eslint": "9.8.0",
44-
"eslint-config-unjs": "0.3.2",
45-
"prettier": "3.3.3",
46-
"typescript": "5.5.4",
47-
"unbuild": "3.0.0-rc.7"
48-
},
49-
"changelog": {
50-
"excludeAuthors": [
51-
""
52-
]
53-
}
2+
"name": "usegl",
3+
"version": "0.2.0",
4+
"description": "Lightweight hooks library for WebGL",
5+
"repository": "jsulpis/usegl",
6+
"license": "MIT",
7+
"author": "Julien SULPIS",
8+
"sideEffects": false,
9+
"type": "module",
10+
"exports": {
11+
".": {
12+
"types": "./dist/index.d.ts",
13+
"import": "./dist/index.mjs"
14+
}
15+
},
16+
"main": "./dist/index.mjs",
17+
"module": "./dist/index.mjs",
18+
"types": "./dist/index.d.ts",
19+
"files": [
20+
"dist"
21+
],
22+
"scripts": {
23+
"build": "unbuild",
24+
"dev": "astro dev",
25+
"format": "prettier src --check",
26+
"format:fix": "prettier src --write",
27+
"lint": "eslint src",
28+
"lint:fix": "eslint src --fix",
29+
"prepack": "pnpm build",
30+
"release": "changelogen --release --clean",
31+
"test": "playwright test",
32+
"test:local": "docker build -t usegl . && docker run --rm -v $(pwd)/test-results:/app/test-results usegl /bin/sh -c 'xvfb-run pnpm run test'",
33+
"test:ui": "playwright test --ui",
34+
"test:update": "docker build -t usegl . && docker run --rm -v $(pwd)/test-results:/app/test-results -v $(pwd)/tests/__screenshots__:/app/tests/__screenshots__ usegl",
35+
"typecheck": "tsc --noEmit && astro check"
36+
},
37+
"devDependencies": {
38+
"@astrojs/check": "0.9.4",
39+
"@playwright/test": "1.48.1",
40+
"@types/node": "22.1.0",
41+
"astro": "4.16.7",
42+
"changelogen": "0.5.5",
43+
"eslint": "9.8.0",
44+
"eslint-config-unjs": "0.3.2",
45+
"prettier": "3.3.3",
46+
"typescript": "5.5.4",
47+
"unbuild": "3.0.0-rc.7"
48+
},
49+
"changelog": {
50+
"excludeAuthors": [
51+
""
52+
]
53+
}
5454
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export function incrementRenderCount() {
2-
const renderCountElement = document.querySelector("#renderCount");
3-
renderCountElement.textContent = `${Number(renderCountElement.textContent) + 1}`;
2+
const renderCountElement = document.querySelector("#renderCount");
3+
renderCountElement.textContent = `${Number(renderCountElement.textContent) + 1}`;
44
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { readdirSync } from "node:fs";
22

33
export const sections = readdirSync("playground/src/pages", { withFileTypes: true })
4-
.filter((file) => file.isDirectory())
5-
.map((folder) => folder.name);
4+
.filter((file) => file.isDirectory())
5+
.map((folder) => folder.name);
66

77
export const routes = sections.flatMap((section) => {
8-
const files = readdirSync(`playground/src/pages/${section}`);
8+
const files = readdirSync(`playground/src/pages/${section}`);
99

10-
return files.map((file) => {
11-
const route = file.replace(".astro", "");
12-
return { section, route };
13-
});
10+
return files.map((file) => {
11+
const route = file.replace(".astro", "");
12+
return { section, route };
13+
});
1414
});

0 commit comments

Comments
 (0)