2017-09-21 05:35:11 +02:00
|
|
|
{
|
2025-02-21 08:23:03 +00:00
|
|
|
"name": "forgejo",
|
2021-04-08 12:41:57 +02:00
|
|
|
"type": "module",
|
2019-07-02 21:11:24 +02:00
|
|
|
"engines": {
|
2025-03-25 22:32:46 +00:00
|
|
|
"node": ">= 20.0.0"
|
2019-07-02 21:11:24 +02:00
|
|
|
},
|
2020-01-14 19:02:08 +01:00
|
|
|
"dependencies": {
|
2025-10-21 12:39:03 +02:00
|
|
|
"@citation-js/core": "0.7.21",
|
|
|
|
|
"@citation-js/plugin-bibtex": "0.7.21",
|
2026-01-16 16:59:46 +01:00
|
|
|
"@citation-js/plugin-software-formats": "0.6.2",
|
2026-01-05 08:55:09 +01:00
|
|
|
"@codemirror/autocomplete": "6.20.0",
|
|
|
|
|
"@codemirror/commands": "6.10.1",
|
2026-01-04 23:52:33 +01:00
|
|
|
"@codemirror/lang-cpp": "6.0.3",
|
|
|
|
|
"@codemirror/lang-css": "6.3.1",
|
|
|
|
|
"@codemirror/lang-go": "6.0.1",
|
|
|
|
|
"@codemirror/lang-html": "6.4.11",
|
|
|
|
|
"@codemirror/lang-java": "6.0.2",
|
|
|
|
|
"@codemirror/lang-javascript": "6.2.4",
|
|
|
|
|
"@codemirror/lang-json": "6.0.2",
|
|
|
|
|
"@codemirror/lang-less": "6.0.2",
|
2026-01-05 08:55:09 +01:00
|
|
|
"@codemirror/lang-liquid": "6.3.1",
|
2026-01-04 23:52:33 +01:00
|
|
|
"@codemirror/lang-markdown": "6.5.0",
|
|
|
|
|
"@codemirror/lang-php": "6.0.2",
|
|
|
|
|
"@codemirror/lang-python": "6.2.1",
|
|
|
|
|
"@codemirror/lang-rust": "6.0.2",
|
|
|
|
|
"@codemirror/lang-sass": "6.0.2",
|
|
|
|
|
"@codemirror/lang-xml": "6.1.0",
|
|
|
|
|
"@codemirror/lang-yaml": "6.1.2",
|
2026-01-05 08:55:09 +01:00
|
|
|
"@codemirror/language": "6.12.1",
|
2026-01-18 21:27:29 +01:00
|
|
|
"@codemirror/search": "6.6.0",
|
|
|
|
|
"@codemirror/state": "6.5.4",
|
|
|
|
|
"@codemirror/view": "6.39.11",
|
2024-03-03 17:23:14 +01:00
|
|
|
"@github/markdown-toolbar-element": "2.2.3",
|
2024-10-24 01:07:53 +02:00
|
|
|
"@github/quote-selection": "2.1.0",
|
2026-01-26 22:53:03 +01:00
|
|
|
"@github/text-expander-element": "2.9.4",
|
add model viewer for `.glb` (GLTF) model in file view (#8111)
## Motivation
The GLTF (`.gltf`, `.glb`) 3D model format is very popular for game development and visual productions.
For an indie game studio, it would be convenient for a team to view textured 3D models directly from the Forgejo interface (otherwise they need to be downloaded and opened). [Perforce](https://www.perforce.com/products/helix-dam), [Diversion](https://www.diversion.dev/), and GitHub all have this capability to differing extents.
Some discussion on 3D file support here: https://codeberg.org/forgejo/forgejo/issues/5188
## Changes
Adds a model viewer similar to [GitHub STL viewer](https://github.com/assimp/assimp/blob/master/test/models/STL/Spider_ascii.stl) for `.glb` model files, and lays some groundwork to support future files. Uses the [model-viewer](https://modelviewer.dev/) library by Google and three.js. The model viewer is interactive and can be rotated and scaled.

## How to Test
1) Create a new repository or use an existing one.
2) Upload a `.glb` file such as `tests/testdata/data/viewer/Unicode❤♻Test.glb` (CC0 1.0 Universal)
3) View the file in the repository.
- Similar to image files, the 3D model should be rendered in a viewer.
- Use mouse clicks to turn and zoom.
## Licenses
Libraries used for this change include three.js and @google/model-viewer, which are MIT and Apache-2.0 licenses respectively. Both of these are compatible with Forgejo's GPL3.0 license.
## Future Plans
1) `.gltf` was not attempted because it is a multiple file format, referencing other files in the same directory. Still need to experiment with this to see if it can work. `.glb` is a single file containing a `.gltf` and all of its other file/texture dependencies so was easier to implement.
2) The PR diff still shows the model as an unviewable bin file, but clicking the "View File" button takes you to a view screen where this model viewer is used. It would be nice to view the before and after of the model in two side-by-side model viewers, akin to reviewing a change in an image.
3) Also inserted stubs for adding contexts for GLTF, STL, OBJ, and 3MF. These ultimately don't do anything yet as only `.glb` files can be detected by the type sniffer of all of these.
## Checklist
The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).
### Tests
- I added test coverage for checking GLB file content using the first few bytes.
- [x] in their respective `typesniffer_test.go` for unit tests.
### Documentation
- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.
### Release notes
- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.
<!--start release-notes-assistant-->
## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface features
- [PR](https://codeberg.org/forgejo/forgejo/pulls/8111): <!--number 8111 --><!--line 0 --><!--description YWRkIG1vZGVsIHZpZXdlciBmb3IgYC5nbGJgIChHTFRGKSBtb2RlbCBpbiBmaWxlIHZpZXc=-->add model viewer for `.glb` (GLTF) model in file view<!--description-->
<!--end release-notes-assistant-->
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8111
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Co-authored-by: Alex Smith <amsmith.pro@pm.me>
Co-committed-by: Alex Smith <amsmith.pro@pm.me>
2025-06-21 14:42:35 +02:00
|
|
|
"@google/model-viewer": "4.1.0",
|
2026-01-05 08:55:59 +01:00
|
|
|
"@lezer/highlight": "1.2.3",
|
2022-10-10 14:02:20 +02:00
|
|
|
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
|
2024-12-13 00:03:57 +00:00
|
|
|
"@primer/octicons": "19.14.0",
|
2025-04-05 01:24:46 +00:00
|
|
|
"ansi_up": "6.0.5",
|
2026-01-14 10:21:20 +01:00
|
|
|
"asciinema-player": "3.14.0",
|
2025-10-14 03:31:05 +02:00
|
|
|
"chart.js": "4.5.1",
|
2024-02-16 01:21:13 +03:00
|
|
|
"chartjs-adapter-dayjs-4": "1.0.4",
|
2024-11-27 00:03:02 +00:00
|
|
|
"chartjs-plugin-zoom": "2.2.0",
|
2025-11-08 12:37:52 +01:00
|
|
|
"clippie": "4.1.9",
|
2024-04-05 05:35:37 +02:00
|
|
|
"css-loader": "7.0.0",
|
2025-09-04 15:06:59 +02:00
|
|
|
"dayjs": "1.11.18",
|
2021-12-03 22:43:14 -08:00
|
|
|
"dropzone": "6.0.0-beta.2",
|
2022-10-10 14:02:20 +02:00
|
|
|
"easymde": "2.18.0",
|
2026-01-02 05:28:14 +01:00
|
|
|
"esbuild-loader": "4.4.2",
|
2021-04-24 12:07:22 +02:00
|
|
|
"escape-goat": "4.0.0",
|
2025-01-06 06:43:52 +00:00
|
|
|
"fast-glob": "3.3.3",
|
2025-10-26 02:44:08 +02:00
|
|
|
"htmx.org": "2.0.8",
|
2024-12-25 23:08:03 +01:00
|
|
|
"idiomorph": "0.3.0",
|
2023-08-29 23:59:13 +05:30
|
|
|
"jquery": "3.7.1",
|
2025-12-18 15:16:17 +01:00
|
|
|
"katex": "0.16.27",
|
2025-12-06 12:59:57 +01:00
|
|
|
"mermaid": "11.12.2",
|
2026-01-23 13:35:06 +01:00
|
|
|
"mini-css-extract-plugin": "2.10.0",
|
2025-10-29 17:47:48 +01:00
|
|
|
"minimatch": "10.1.1",
|
2024-02-16 03:20:50 +01:00
|
|
|
"pdfobject": "2.3.0",
|
2025-09-07 13:19:41 +02:00
|
|
|
"postcss": "8.5.6",
|
|
|
|
|
"postcss-loader": "8.2.0",
|
2025-06-11 01:10:44 +02:00
|
|
|
"postcss-nesting": "13.0.2",
|
2024-02-02 10:36:32 +01:00
|
|
|
"pretty-ms": "9.0.0",
|
2024-11-29 00:02:57 +00:00
|
|
|
"sortablejs": "1.15.6",
|
2025-12-18 22:53:20 +01:00
|
|
|
"swagger-ui-dist": "5.31.0",
|
2025-10-02 03:13:16 +02:00
|
|
|
"tailwindcss": "3.4.18",
|
2023-03-26 13:25:41 +08:00
|
|
|
"throttle-debounce": "5.0.0",
|
2023-07-09 12:17:22 +02:00
|
|
|
"tinycolor2": "1.6.0",
|
2022-07-19 00:33:34 +02:00
|
|
|
"tippy.js": "6.3.7",
|
2023-06-27 04:45:24 +02:00
|
|
|
"toastify-js": "1.12.0",
|
2020-05-21 04:00:43 +02:00
|
|
|
"tributejs": "5.1.3",
|
2022-01-14 23:03:31 +08:00
|
|
|
"uint8-to-base64": "0.2.0",
|
2024-04-03 11:15:06 +02:00
|
|
|
"vanilla-colorful": "0.7.2",
|
2026-01-23 12:58:47 +01:00
|
|
|
"vue": "3.5.27",
|
2025-11-04 23:37:12 +01:00
|
|
|
"vue-chartjs": "5.3.3",
|
2024-02-02 10:36:32 +01:00
|
|
|
"vue-loader": "17.4.2",
|
2023-04-03 01:47:14 +02:00
|
|
|
"vue3-calendar-heatmap": "2.0.5",
|
2025-12-22 02:14:23 +01:00
|
|
|
"webpack": "5.104.1",
|
2024-12-24 20:05:17 +00:00
|
|
|
"webpack-cli": "6.0.1",
|
2025-09-09 02:12:12 +02:00
|
|
|
"wrap-ansi": "9.0.2"
|
2019-05-16 07:57:47 +02:00
|
|
|
},
|
2020-03-19 03:45:23 +01:00
|
|
|
"devDependencies": {
|
2025-10-22 23:02:35 +02:00
|
|
|
"@axe-core/playwright": "4.11.0",
|
2025-04-23 15:43:26 +00:00
|
|
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
2025-12-03 16:53:37 +01:00
|
|
|
"@playwright/test": "1.57.0",
|
2025-04-26 08:40:28 +00:00
|
|
|
"@stoplight/spectral-cli": "6.15.0",
|
2025-12-03 16:22:00 +01:00
|
|
|
"@stylistic/eslint-plugin": "5.6.1",
|
2025-08-03 03:39:00 +02:00
|
|
|
"@stylistic/stylelint-plugin": "4.0.0",
|
2025-12-20 19:56:09 +01:00
|
|
|
"@vitejs/plugin-vue": "6.0.3",
|
2025-12-20 21:36:37 +01:00
|
|
|
"@vitest/coverage-v8": "4.0.16",
|
2025-12-28 09:48:43 +01:00
|
|
|
"@vitest/eslint-plugin": "1.6.4",
|
2024-05-08 02:05:00 +00:00
|
|
|
"@vue/test-utils": "2.4.6",
|
2025-12-20 19:57:19 +01:00
|
|
|
"eslint": "9.39.2",
|
2025-06-29 09:37:44 +02:00
|
|
|
"eslint-import-resolver-typescript": "4.4.4",
|
2025-10-09 13:29:12 +02:00
|
|
|
"eslint-plugin-array-func": "5.1.0",
|
2025-06-29 09:37:44 +02:00
|
|
|
"eslint-plugin-import-x": "4.16.1",
|
2025-03-09 19:01:47 +00:00
|
|
|
"eslint-plugin-no-jquery": "3.1.1",
|
2024-11-01 08:19:28 +00:00
|
|
|
"eslint-plugin-no-use-extend-native": "0.7.2",
|
2025-12-03 16:22:00 +01:00
|
|
|
"eslint-plugin-playwright": "2.4.0",
|
2025-08-09 03:39:02 +02:00
|
|
|
"eslint-plugin-regexp": "2.10.0",
|
2025-10-09 13:29:12 +02:00
|
|
|
"eslint-plugin-sonarjs": "3.0.5",
|
2025-02-21 08:23:03 +00:00
|
|
|
"eslint-plugin-toml": "0.12.0",
|
2025-12-03 17:46:30 +01:00
|
|
|
"eslint-plugin-unicorn": "62.0.0",
|
2024-03-26 10:41:40 +01:00
|
|
|
"eslint-plugin-vitest-globals": "1.5.0",
|
2025-12-03 16:22:00 +01:00
|
|
|
"eslint-plugin-vue": "10.6.2",
|
2025-10-09 13:29:12 +02:00
|
|
|
"eslint-plugin-vue-scoped-css": "2.12.0",
|
|
|
|
|
"eslint-plugin-wc": "3.0.2",
|
2026-01-27 14:08:44 +01:00
|
|
|
"globals": "17.1.0",
|
2025-12-02 06:40:47 +01:00
|
|
|
"happy-dom": "20.0.11",
|
2024-09-10 04:54:38 +00:00
|
|
|
"license-checker-rseidelsohn": "4.4.2",
|
2025-12-20 19:58:25 +01:00
|
|
|
"markdownlint-cli": "0.47.0",
|
2026-01-23 13:36:06 +01:00
|
|
|
"postcss-html": "1.8.1",
|
2025-11-08 12:37:43 +01:00
|
|
|
"sharp": "0.34.5",
|
2025-12-03 16:22:00 +01:00
|
|
|
"stylelint": "16.26.1",
|
2024-02-02 10:36:32 +01:00
|
|
|
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
|
2025-03-09 19:01:47 +00:00
|
|
|
"stylelint-declaration-strict-value": "1.10.11",
|
2025-12-22 18:14:20 +01:00
|
|
|
"stylelint-value-no-unknown-custom-properties": "6.1.0",
|
2025-06-29 13:57:15 +02:00
|
|
|
"svgo": "4.0.0",
|
2025-10-02 10:41:19 +02:00
|
|
|
"typescript": "5.9.3",
|
2025-12-28 06:27:32 +01:00
|
|
|
"typescript-eslint": "8.50.1",
|
2025-12-03 01:59:25 +01:00
|
|
|
"vite-string-plugin": "1.4.9",
|
2025-12-20 21:36:37 +01:00
|
|
|
"vitest": "4.0.16"
|
2020-03-19 03:45:23 +01:00
|
|
|
},
|
2026-01-04 23:52:33 +01:00
|
|
|
"browserslist": ["defaults"],
|
2025-12-18 22:53:20 +01:00
|
|
|
"scarfSettings": {
|
|
|
|
|
"enabled": false
|
|
|
|
|
}
|
2018-03-06 02:22:16 +01:00
|
|
|
}
|