Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to CLI+API, typescript, and more #286

Open
wants to merge 152 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
3ea4de8
Refactor GLTFJSX readme.md
hichemfantar Sep 11, 2024
134d8c0
Refactor gitignore and add vscode extensions.json
hichemfantar Sep 11, 2024
f1bd52e
format with prettier
hichemfantar Sep 11, 2024
7971774
Refactor readme.md to update usage section
hichemfantar Sep 11, 2024
1d6b4b7
Refactor readme.md to update usage section
hichemfantar Sep 11, 2024
00f00ca
Refactor conditional rendering to best practices in readme.md
hichemfantar Sep 11, 2024
4017af9
Refactor conditional rendering to fix syntax error in readme.md
hichemfantar Sep 11, 2024
b65badb
feat: Add options to configure pruning unused vertex attributes and e…
hichemfantar Sep 24, 2024
99921f2
update docs
hichemfantar Sep 24, 2024
a92a2f3
fix: Enable corepack during CI workflow
hichemfantar Sep 25, 2024
bea28b7
chore: Update .gitignore to include Yarn related files
hichemfantar Sep 25, 2024
f3c4a6b
chore: Update yarn patch release
hichemfantar Sep 25, 2024
ed4f824
Remove example/ from .npmignore
hichemfantar Sep 25, 2024
1f93c2a
Merge branch 'master' into customize-prune-options
hichemfantar Sep 25, 2024
049e333
Refactor command line options for attribute and leaf node preservation
hichemfantar Sep 25, 2024
325a912
revert keepleaves changes
hichemfantar Sep 30, 2024
325dc43
revert change
hichemfantar Sep 30, 2024
fd6caf3
Merge branch 'master' into customize-prune-options
hichemfantar Nov 11, 2024
6141c9a
Merge remote-tracking branch 'hichemfantar/small-improvements' into a…
rosskevin Jan 17, 2025
56465c9
Merge remote-tracking branch 'hichemfantar/customize-prune-options' i…
rosskevin Jan 17, 2025
7751056
setting up basics for yarn, prettier, eslint, ts
rosskevin Jan 17, 2025
d984afa
Update workflow to prepare for auto integration
rosskevin Jan 17, 2025
58b4530
move cli.js to src
rosskevin Jan 17, 2025
0ed7a2a
extension rename to ts
rosskevin Jan 17, 2025
31f4d88
latest wf file
rosskevin Jan 17, 2025
2af1830
ncu (npm-check-updates) all dependencies without previous resolutions
rosskevin Jan 17, 2025
e1337e7
move module/resolution forward to nodenext
rosskevin Jan 17, 2025
4da56d0
temporarily capture bin/loader work, but the more I progress, the mor…
rosskevin Jan 17, 2025
5235ba7
first pass at cli/gltfjsx types for cli options and total options
rosskevin Jan 17, 2025
6da254d
disable workflow for the moment
rosskevin Jan 17, 2025
2efd4e8
checkpoint type conversion progress - multiple bugs found/fixed while…
rosskevin Jan 18, 2025
7ba5eaa
working on transform logic with one-to-many material fixes
rosskevin Jan 18, 2025
454a6af
checkpoint work on transformGltfToJsx
rosskevin Jan 18, 2025
d922442
first pass on transformGltfToJsx done
rosskevin Jan 18, 2025
803c1f4
first pass through all errors
rosskevin Jan 18, 2025
578e4c5
switch back to main repo example loaders to try meshopt
rosskevin Jan 20, 2025
4ae8910
Add a test model
rosskevin Jan 20, 2025
bedd83b
rename
rosskevin Jan 20, 2025
d4358e7
mv old loaders/mid-conversion out of the way - delete later
rosskevin Jan 20, 2025
a0e9600
rm comments
rosskevin Jan 20, 2025
28fe721
stop interferring with npx glftsx for reference output
rosskevin Jan 20, 2025
3d33d91
rename
rosskevin Jan 20, 2025
6b59353
generate meshopt reference output
rosskevin Jan 20, 2025
5f4a14d
gen old reference for gltf
rosskevin Jan 20, 2025
7082a99
mv old build and draco deps out of the way - causing problems wit esl…
rosskevin Jan 20, 2025
95fd8ac
lint:fix
rosskevin Jan 20, 2025
2453f15
checkpoint lint fixes
rosskevin Jan 20, 2025
168c406
linted
rosskevin Jan 20, 2025
359d843
lint success
rosskevin Jan 20, 2025
ff66c5e
prep for vitest
rosskevin Jan 20, 2025
a251284
start refactor/rename for clarity and tests
rosskevin Jan 20, 2025
159878c
renames for clarity
rosskevin Jan 20, 2025
5d58f50
more renames reorg
rosskevin Jan 20, 2025
dd342c7
More directly link help text with the mechanism that actually transforms
rosskevin Jan 20, 2025
3351a2c
separating concerns for unit testing
rosskevin Jan 21, 2025
413d4b3
basic separation of concerns complete for testability
rosskevin Jan 21, 2025
c3315f4
added first test showing expected failure to load using GLTFLoader fr…
rosskevin Jan 21, 2025
f551a3e
add optionalDependencies to support runtime needs
rosskevin Jan 21, 2025
aab816e
Setup global-jsdom instead of jsdom-global for both testing and node …
rosskevin Jan 21, 2025
a657fff
provide reference load path for model resources
rosskevin Jan 21, 2025
2cec1b1
model reads with nodenext patch for node-three-gltf
rosskevin Jan 22, 2025
caf76ce
meshopt load test works
rosskevin Jan 22, 2025
089a426
wrong import
rosskevin Jan 22, 2025
807c01d
ncu and af libs now also public on npm repo as opposed to just gh repo
rosskevin Jan 22, 2025
f29c938
nodenext and GLTF type
rosskevin Jan 22, 2025
c07a743
draco loads
rosskevin Jan 23, 2025
f4d005d
unused
rosskevin Jan 23, 2025
c54de6e
refactor | extract utility functions
rosskevin Jan 23, 2025
50b2397
back to og flag for output
rosskevin Jan 23, 2025
3e6b281
code reenable draco transform
rosskevin Jan 23, 2025
daebaf2
cleanup
rosskevin Jan 23, 2025
5c46f7a
refactor, setup createJsx test
rosskevin Jan 23, 2025
f4b461e
stepping through, clarity in naming, reuse name functions
rosskevin Jan 23, 2025
ece7a1d
separating analyze from printing
rosskevin Jan 23, 2025
1908beb
add a shallow equal function for comparing props
rosskevin Jan 23, 2025
50ff636
one pass on prune.ts logic
rosskevin Jan 23, 2025
8849be4
first pass separation of analyze+prune and print
rosskevin Jan 23, 2025
58d1223
it prints, not right but it’s progress
rosskevin Jan 23, 2025
0fa9522
fix boolean prop printing
rosskevin Jan 23, 2025
b60af34
fix string prop serialization
rosskevin Jan 23, 2025
9b40001
fixed material types iteration
rosskevin Jan 24, 2025
9cbafd7
fix invalid animations type output when there are not animations
rosskevin Jan 24, 2025
e9a7de0
gltf, draco, and meshopt all loading and generating
rosskevin Jan 24, 2025
d2976c7
cleanup/organization
rosskevin Jan 24, 2025
2d6b8ff
rely on `is` type guards to determine types, and move r3f specific fu…
rosskevin Jan 24, 2025
a191d96
setup logger interface/class instead of console.log and passing debug…
rosskevin Jan 24, 2025
8a9a2f3
fixed log reorg
rosskevin Jan 24, 2025
c725f7b
simplify pruning by bringing it into AnalyzedGLTF, simplify options i…
rosskevin Jan 24, 2025
8729e51
Refactored pruning into functional strategies, easier to read, mainta…
rosskevin Jan 24, 2025
e872fa8
remove old code
rosskevin Jan 24, 2025
747118c
remove old code
rosskevin Jan 24, 2025
0ceb5ea
add utils to clean up main
rosskevin Jan 24, 2025
fad67c7
move util fn
rosskevin Jan 25, 2025
a1417e2
rename method to visit
rosskevin Jan 25, 2025
0ad9edb
wip ts-morph generation
rosskevin Jan 26, 2025
7fc5ec4
refactor new generator into class for extendability
rosskevin Jan 26, 2025
40b56d7
attempted jsx emitting in addition to tsx, but was a build artifact/f…
rosskevin Jan 26, 2025
f18e5f9
Both jsx and tsx output are working
rosskevin Jan 27, 2025
9602925
fix options
rosskevin Jan 27, 2025
9568b65
organize convenience helper methods
rosskevin Jan 27, 2025
45f899d
add instanceall templated code
rosskevin Jan 27, 2025
659cd71
move renames to template substitution (easier), add draco-instanceall…
rosskevin Jan 27, 2025
c9c8785
added animation types
rosskevin Jan 27, 2025
ba52d3a
checkpoint generation
rosskevin Jan 27, 2025
6dfbc12
Create convenience method to determine if scene includes x
rosskevin Jan 27, 2025
e05f57d
add back prettier
rosskevin Jan 27, 2025
c084a08
add test for includes
rosskevin Jan 27, 2025
4c3ec6e
gather root group element for generation
rosskevin Jan 27, 2025
3df1fc8
first pass GenerateR3F done
rosskevin Jan 28, 2025
af41e2f
add some failing tests for instanceall
rosskevin Jan 28, 2025
6aa4893
cleanup children handling e.g. removed node vs non-removed
rosskevin Jan 28, 2025
64a73e8
fix instanceall detection in test generate
rosskevin Jan 28, 2025
ffc6693
instanceall r3f generation looks comparable to old with FlightHelmet
rosskevin Jan 28, 2025
d813808
cleanup, remove old files, simpler options/types, some renaming for c…
rosskevin Jan 29, 2025
ba888d1
remove getInfo in favor of more direct access
rosskevin Jan 29, 2025
e853434
move calculateProps into AnalyzedGLTF
rosskevin Jan 29, 2025
b61e898
docs
rosskevin Jan 29, 2025
c91aaa4
some renaming/cleanup
rosskevin Jan 29, 2025
629df34
better fixture helpers
rosskevin Jan 29, 2025
006cbdb
better encapsulation
rosskevin Jan 29, 2025
a00ad65
cleanup
rosskevin Jan 29, 2025
60cb42f
fix fixture options
rosskevin Jan 29, 2025
79c5b13
simplify the element string generate
rosskevin Jan 29, 2025
891fb5a
simplifying conditionals/grouping in calculateProps
rosskevin Jan 29, 2025
b53b3f0
doc
rosskevin Jan 30, 2025
7092607
setup tsup for build
rosskevin Jan 30, 2025
472cb96
make sure exports are included in the build, some renames for clarity
rosskevin Jan 31, 2025
800f5a9
cleanup pack
rosskevin Jan 31, 2025
538e3cf
move test files to top level, remove OldReference files
rosskevin Jan 31, 2025
304addd
ncu
rosskevin Jan 31, 2025
1ce1f50
ignore my local large/complex test model
rosskevin Jan 31, 2025
36b02a2
test and fix resolveComponentName
rosskevin Jan 31, 2025
be30d86
more flexible fixture type resolution
rosskevin Jan 31, 2025
9a2e273
add back original cli option output
rosskevin Jan 31, 2025
560764b
some debug, move utility readPackage()
rosskevin Jan 31, 2025
be2b07d
turn on splitting to share code between entry points
rosskevin Jan 31, 2025
3ea4401
fix eslint test move
rosskevin Jan 31, 2025
7ead70f
break cli into main function vs input
rosskevin Jan 31, 2025
00751ba
rename
rosskevin Jan 31, 2025
4fc6ab7
remove patch now that PR was accepted
rosskevin Jan 31, 2025
f60c864
Explicitly dispose the dracoLoader for now
rosskevin Jan 31, 2025
6d862ef
implement —console
rosskevin Jan 31, 2025
841b623
enable workflows
rosskevin Jan 31, 2025
2430a8a
add the auto dependencies
rosskevin Jan 31, 2025
0443c6d
rename to load
rosskevin Feb 3, 2025
276be7e
Merge readme/extenssion updates from #275, update usage from cli output
rosskevin Feb 3, 2025
7007bdf
verify model file exists
rosskevin Feb 3, 2025
9313f08
move member properties to public instead of creating accessors - simp…
rosskevin Feb 3, 2025
806c490
consistency
rosskevin Feb 3, 2025
0f6e164
better generate assertions
rosskevin Feb 3, 2025
3f90b9b
instanced meshes should receive shadow props
rosskevin Feb 3, 2025
90cbee7
assert generated shadow props
rosskevin Feb 3, 2025
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
12 changes: 10 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# These are supported funding model platforms

github: drcmda
open_collective: react-three-fiber
github: drcmda # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
open_collective: react-three-fiber # Replace with a single Open Collective username
# patreon: # Replace with a single Patreon username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# otechie: # Replace with a single Otechie username
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
22 changes: 0 additions & 22 deletions .github/workflows/main.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on: [push]

jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3

- name: Prepare repository
run: git fetch --unshallow --tags

- uses: actions/setup-node@v4
with:
node-version: 'latest'
cache: 'yarn'

# allow the lock file to change (updating our own workspace versions in monorepo)
- run: yarn install --no-immutable
- run: yarn test
- run: yarn build

# commit back the lock file change if it works
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply yarn.lock changes

- run: yarn release
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,27 @@ ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
.DS_Store
.vscode
.docz/
package-lock.json
coverage/
.idea
yarn-error.log
tmp*

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
*.tsbuildinfo
/.eslintcache
New.tsx

test/models/*/Old*

# local testing
test/models/a6
test/r3f/GenA6*
6 changes: 6 additions & 0 deletions .ncurc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
packageFile: './package.json',
packageManager: 'yarn',
// target: (name: string, versionRange: SemVer[]) => string
// target: (name) => (name === '@react-three/fiber' ? '@rc' : 'latest'),
}
14 changes: 13 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
example/
.github
.vscode
.yarn
.eslintcache
.ncurc.cjs
.prettierignore
.yarnrc.yml
src
eslint.config.*
logo.svg
tsconfig.*
tsup.config.*
yarn.lock
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
*.snap
tmp
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"davidanson.vscode-markdownlint"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.useFlatConfig": true,
"typescript.enablePromptUseWorkspaceTsdk": true,
"testing.automaticallyOpenPeekView": "never"
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build:ide",
"problemMatcher": ["$tsc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Binary file removed .yarn/install-state.gz
Binary file not shown.
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.6.0.cjs
98 changes: 0 additions & 98 deletions cli.js

This file was deleted.

16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import af from '@alienfast/eslint-config'
import tseslint from 'typescript-eslint'

/**
* Project eslint configuration.
*
* View config with `npx @eslint/config-inspector`
*/
export default tseslint.config({
name: 'project',
extends: [...af.configs.recommended],
rules: {
'no-console': 'off',
},
ignores: ['node_modules', 'dist', 'test/models'],
})
Loading