@threlte/gltf 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +3 -3
- package/cli.js +3 -24
- package/package.json +1 -1
- package/threlte-banner.jpg +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @threlte/gltf
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 15a15873: Removed pascal-casing of output file in favor of more reliable output file naming for automation purposes. The output file will now be 1:1 filename.glb -> filename.svelte.
|
|
8
|
+
|
|
9
|
+
## 1.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- ee1d319: Update package READMEs to fix banners.
|
|
14
|
+
|
|
3
15
|
## 1.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
<a href="https://threlte.xyz">
|
|
17
|
-
<img src="
|
|
17
|
+
<img src="https://threlte.xyz/logo/threlte-banner.jpg"/>
|
|
18
18
|
</a>
|
|
19
19
|
|
|
20
20
|
## Rapidly Build Interactive 3D Apps for the Web
|
|
@@ -52,7 +52,7 @@ This helps with performance optimization for asset-heavy Threlte apps. It also a
|
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
Usage
|
|
55
|
-
$ npx @threlte/gltf [Model.glb] [options]
|
|
55
|
+
$ npx @threlte/gltf@latest [Model.glb] [options]
|
|
56
56
|
|
|
57
57
|
Options
|
|
58
58
|
--output, -o Output file name/path
|
|
@@ -94,7 +94,7 @@ Have questions? Feel free to ask in our [Discord support forum](https://discord.
|
|
|
94
94
|
First you run your model through `@threlte/gltf`. `npx` allows you to use npm packages without installing them.
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
|
-
npx @threlte/gltf model.gltf --transform
|
|
97
|
+
npx @threlte/gltf@latest model.gltf --transform
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
This will create a `Model.svelte` file that plots out all of the assets contents.
|
package/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ const __dirname = dirname(__filename)
|
|
|
12
12
|
const cli = meow(
|
|
13
13
|
`
|
|
14
14
|
Usage
|
|
15
|
-
$ npx @threlte/gltf [Model.glb] [options]
|
|
15
|
+
$ npx @threlte/gltf@latest [Model.glb] [options]
|
|
16
16
|
|
|
17
17
|
Options
|
|
18
18
|
--output, -o Output file name/path
|
|
@@ -65,26 +65,6 @@ const cli = meow(
|
|
|
65
65
|
|
|
66
66
|
const { packageJson } = readPackageUpSync({ cwd: __dirname, normalize: false })
|
|
67
67
|
|
|
68
|
-
function toPascalCase(str) {
|
|
69
|
-
return (
|
|
70
|
-
str
|
|
71
|
-
.replace(/(\w)(\w*)/g, function (g0, g1, g2) {
|
|
72
|
-
// capitalize first letter of g1, leave the reset as-is and return the result
|
|
73
|
-
return g1.toUpperCase() + g2
|
|
74
|
-
})
|
|
75
|
-
// replace every non-word character with an empty string and capitalize the first following letter
|
|
76
|
-
.replace(/\W+(.)/g, function (g0, g1) {
|
|
77
|
-
return g1.toUpperCase()
|
|
78
|
-
})
|
|
79
|
-
// replace every non-word character with an empty string
|
|
80
|
-
.replace(/\s+/g, '')
|
|
81
|
-
// make first letter uppercase
|
|
82
|
-
.replace(/^\w/, function (g0) {
|
|
83
|
-
return g0.toUpperCase()
|
|
84
|
-
})
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
68
|
if (cli.input.length === 0) {
|
|
89
69
|
console.log(cli.help)
|
|
90
70
|
} else {
|
|
@@ -96,13 +76,12 @@ Command: npx @threlte/gltf@${packageJson.version} ${process.argv.slice(2).join('
|
|
|
96
76
|
const file = cli.input[0]
|
|
97
77
|
let nameExt = file.match(/[-_\w]+[.][\w]+$/i)[0]
|
|
98
78
|
let name = nameExt.split('.').slice(0, -1).join('.')
|
|
99
|
-
const
|
|
100
|
-
const output = baseName + '.svelte'
|
|
79
|
+
const output = name + '.svelte'
|
|
101
80
|
const showLog = (log) => {
|
|
102
81
|
console.info('log:', log)
|
|
103
82
|
}
|
|
104
83
|
try {
|
|
105
|
-
|
|
84
|
+
await gltf(file, output, {
|
|
106
85
|
...config,
|
|
107
86
|
showLog,
|
|
108
87
|
timeout: 0,
|
package/package.json
CHANGED
package/threlte-banner.jpg
DELETED
|
Binary file
|