Skip to content

Commit 29f6beb

Browse files
authored
docs: add content, refactor content & rename dev README (#43)
1 parent fa7868f commit 29f6beb

File tree

3 files changed

+42
-31
lines changed

3 files changed

+42
-31
lines changed

.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.dev.md renamed to README-dev.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,6 @@ Development VM ID from Thorsten for this project: `014`<br>
3030
6. Install dependencies: `pnpm i`
3131
7. Happy coding <3
3232

33-
## lint and prettier
34-
35-
This project uses [antfu/eslint-config](https://github.com/antfu/eslint-config) for eslint most of the files.
36-
The following extend it:
37-
38-
- [antfu/eslint-plugin-format](https://github.com/antfu/eslint-plugin-format) for using external formatters like
39-
e.g. `prettier` for the file types that eslint cannot handle.
40-
- [azat-io/eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist) for
41-
sorting object keys, imports, etc. - with auto-fix.
42-
43-
Keep in mind that the plugin names are renamed, see
44-
[Plugins Rename](https://github.com/antfu/eslint-config?tab=readme-ov-file#plugins-renaming), e.g.:
45-
46-
```diff
47-
-// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
48-
+// eslint-disable-next-line ts/consistent-type-definitions
49-
type foo = { bar: 2 }
50-
```
51-
52-
[Why I don't use Prettier for every file type](https://antfu.me/posts/why-not-prettier)
53-
5433
## GitHub workflow commands inside commit messages
5534

5635
The commit message trigger must be present in the main commit message, so to say the first line, not the description.
@@ -128,6 +107,27 @@ Here's a more detailed explanation of how everything works:
128107

129108
See [PR #16](https://github.com/toddeTV/gltf-type-toolkit/pull/16), which introduces this logic for the first time.
130109

110+
## lint and prettier
111+
112+
This project uses [antfu/eslint-config](https://github.com/antfu/eslint-config) for eslint most of the files.
113+
The following extend it:
114+
115+
- [antfu/eslint-plugin-format](https://github.com/antfu/eslint-plugin-format) for using external formatters like
116+
e.g. `prettier` for the file types that eslint cannot handle.
117+
- [azat-io/eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist) for
118+
sorting object keys, imports, etc. - with auto-fix.
119+
120+
Keep in mind that the plugin names are renamed, see
121+
[Plugins Rename](https://github.com/antfu/eslint-config?tab=readme-ov-file#plugins-renaming), e.g.:
122+
123+
```diff
124+
-// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
125+
+// eslint-disable-next-line ts/consistent-type-definitions
126+
type foo = { bar: 2 }
127+
```
128+
129+
[Why I don't use Prettier for every file type](https://antfu.me/posts/why-not-prettier)
130+
131131
## Docs and helper websites
132132

133133
\[currently none\]

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ models in web projects, while being bundler-agnostic (Vite, Rollup, Webpack, esb
1010
## project overview
1111

1212
This plugin scans all model files in the project source, deconstructs the glTF JSON representation, and places
13-
generated type files next to them. It uses [three.js](https://github.com/mrdoob/three.js/) to parse the glTF files,
14-
including modifications like path resolutions etc.
13+
generated type files next to them. It creates [three.js](https://github.com/mrdoob/three.js/) types and uses
14+
it internally to parse the glTF files, including modifications like path resolutions etc.
1515

1616
With this plugin you get:
1717

@@ -47,10 +47,9 @@ With this plugin you get:
4747
- [React](https://react.dev/)
4848
- [Svelte](https://svelte.dev/)
4949
- [Vue3](https://vuejs.org/)
50+
- [Angular](https://angular.dev/)
5051
- ...
5152

52-
It will run when your dev server starts and also when you build your project.
53-
5453
## Sponsoring
5554

5655
If you like this plugin and want to support us, we would be very happy to see you as a sponsor on GitHub ❤️<br>
@@ -61,26 +60,30 @@ Thanks a lot for the support <3
6160
## Developer Documentation
6261

6362
For development-related information, including setup instructions for contributors, please refer to the
64-
[Developer README](./README.dev.md).
63+
Developer README [`README-dev.md`](./README-dev.md).
6564

6665
## Getting Started
6766

6867
### Installation
6968

70-
1. Install with your package manager (we use pnpm and recommend it):<br>
69+
1. Install with your package manager (we use pnpm and recommend it):
70+
7171
```bash
72-
# choose only one
72+
# choose your package manager
7373
pnpm add -D @todde.tv/gltf-type-toolkit
7474
npm install --save-dev @todde.tv/gltf-type-toolkit
7575
yarn add --dev @todde.tv/gltf-type-toolkit
7676
bun add --dev @todde.tv/gltf-type-toolkit
7777
```
78+
7879
2. Extend your `.gitignore` file to exclude generated files:
80+
7981
```sh
8082
# Generated glTF model files
8183
*.gltf.d.ts
8284
*.gltf.js
8385
```
86+
8487
3. Add the plugin to your build tool, for example with [Vite](https://vitejs.dev/):
8588

8689
```ts
@@ -106,15 +109,24 @@ For development-related information, including setup instructions for contributo
106109

107110
### usage example with explanations
108111

112+
The plugin will run on:
113+
114+
- on dependency installation
115+
- on dev server start
116+
- on project build
117+
109118
Here's an example of how to use the plugin. You can customize this example to suit your needs, such as saving models
110119
to different folders, changing paths, or adjusting how the model is handled after import.
111120

112121
1. Install the plugin (See [Installation](#installation) above).
122+
113123
2. Add a model to your project, here in the project source under `@/assets/models`. We copy the following in it:
124+
114125
1. `MyModel.gltf` The glTF JSON representation that describes the model.
115126
2. `MyModel.bin` The binary file of the model, compressed with the [Draco Compression](https://github.com/google/draco).
116127
3. `MyModel-texture1.png` A texture that the model uses.
117128
4. `MyModel-texture2.png` A second texture that the model uses.
129+
118130
3. Start your dev to generate all files. With our example model we get:
119131

120132
```diff
@@ -260,8 +272,8 @@ Project founder & head of project:
260272

261273
Honorable mentions to people that helped this project:
262274

263-
- [Andreas Fehn](https://github.com/fehnomenal) as contributor who helped incredible with the project and the magic
264-
behind the core. Thank you <3
275+
- [Andreas Fehn](https://github.com/fehnomenal) as contributor who helped incredible with the project. Thank you mate,
276+
you rock <3
265277

266278
Respectable mentions to projects that helped this project:
267279

0 commit comments

Comments
 (0)