2017-09-20 23:35:11 -04:00
|
|
|
{
|
2025-02-21 03:23:03 -05:00
|
|
|
"name": "forgejo",
|
2021-04-08 06:41:57 -04:00
|
|
|
"type": "module",
|
2019-07-02 15:11:24 -04:00
|
|
|
"engines": {
|
2025-03-25 18:32:46 -04:00
|
|
|
"node": ">= 20.0.0"
|
2019-07-02 15:11:24 -04:00
|
|
|
},
|
2020-01-14 13:02:08 -05:00
|
|
|
"dependencies": {
|
2025-10-21 06:39:03 -04:00
|
|
|
"@citation-js/core": "0.7.21",
|
|
|
|
|
"@citation-js/plugin-bibtex": "0.7.21",
|
2026-01-16 10:59:46 -05:00
|
|
|
"@citation-js/plugin-software-formats": "0.6.2",
|
2026-01-05 02:55:09 -05:00
|
|
|
"@codemirror/autocomplete": "6.20.0",
|
|
|
|
|
"@codemirror/commands": "6.10.1",
|
2026-01-04 17:52:33 -05: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 02:55:09 -05:00
|
|
|
"@codemirror/lang-liquid": "6.3.1",
|
2026-01-04 17:52:33 -05: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 02:55:09 -05:00
|
|
|
"@codemirror/language": "6.12.1",
|
2026-01-18 15:27:29 -05:00
|
|
|
"@codemirror/search": "6.6.0",
|
|
|
|
|
"@codemirror/state": "6.5.4",
|
|
|
|
|
"@codemirror/view": "6.39.11",
|
2024-03-03 11:23:14 -05:00
|
|
|
"@github/markdown-toolbar-element": "2.2.3",
|
2024-10-23 19:07:53 -04:00
|
|
|
"@github/quote-selection": "2.1.0",
|
2026-01-26 16:53:03 -05: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 08:42:35 -04:00
|
|
|
"@google/model-viewer": "4.1.0",
|
2026-01-05 02:55:59 -05:00
|
|
|
"@lezer/highlight": "1.2.3",
|
2022-10-10 08:02:20 -04:00
|
|
|
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
|
2024-12-12 19:03:57 -05:00
|
|
|
"@primer/octicons": "19.14.0",
|
2025-04-04 21:24:46 -04:00
|
|
|
"ansi_up": "6.0.5",
|
2026-01-14 04:21:20 -05:00
|
|
|
"asciinema-player": "3.14.0",
|
2025-10-13 21:31:05 -04:00
|
|
|
"chart.js": "4.5.1",
|
2024-02-15 17:21:13 -05:00
|
|
|
"chartjs-adapter-dayjs-4": "1.0.4",
|
2024-11-26 19:03:02 -05:00
|
|
|
"chartjs-plugin-zoom": "2.2.0",
|
2025-11-08 06:37:52 -05:00
|
|
|
"clippie": "4.1.9",
|
2024-04-04 23:35:37 -04:00
|
|
|
"css-loader": "7.0.0",
|
2025-09-04 09:06:59 -04:00
|
|
|
"dayjs": "1.11.18",
|
2021-12-04 01:43:14 -05:00
|
|
|
"dropzone": "6.0.0-beta.2",
|
2022-10-10 08:02:20 -04:00
|
|
|
"easymde": "2.18.0",
|
2026-01-01 23:28:14 -05:00
|
|
|
"esbuild-loader": "4.4.2",
|
2021-04-24 06:07:22 -04:00
|
|
|
"escape-goat": "4.0.0",
|
2025-01-06 01:43:52 -05:00
|
|
|
"fast-glob": "3.3.3",
|
2025-10-25 20:44:08 -04:00
|
|
|
"htmx.org": "2.0.8",
|
2024-12-25 17:08:03 -05:00
|
|
|
"idiomorph": "0.3.0",
|
2023-08-29 14:29:13 -04:00
|
|
|
"jquery": "3.7.1",
|
2025-12-18 09:16:17 -05:00
|
|
|
"katex": "0.16.27",
|
2025-12-06 06:59:57 -05:00
|
|
|
"mermaid": "11.12.2",
|
2026-01-23 07:35:06 -05:00
|
|
|
"mini-css-extract-plugin": "2.10.0",
|
2025-10-29 12:47:48 -04:00
|
|
|
"minimatch": "10.1.1",
|
2024-02-15 21:20:50 -05:00
|
|
|
"pdfobject": "2.3.0",
|
2025-09-07 07:19:41 -04:00
|
|
|
"postcss": "8.5.6",
|
|
|
|
|
"postcss-loader": "8.2.0",
|
2025-06-10 19:10:44 -04:00
|
|
|
"postcss-nesting": "13.0.2",
|
2024-02-02 04:36:32 -05:00
|
|
|
"pretty-ms": "9.0.0",
|
2024-11-28 19:02:57 -05:00
|
|
|
"sortablejs": "1.15.6",
|
2025-12-18 16:53:20 -05:00
|
|
|
"swagger-ui-dist": "5.31.0",
|
2025-10-01 21:13:16 -04:00
|
|
|
"tailwindcss": "3.4.18",
|
2023-03-26 01:25:41 -04:00
|
|
|
"throttle-debounce": "5.0.0",
|
2023-07-09 06:17:22 -04:00
|
|
|
"tinycolor2": "1.6.0",
|
2022-07-18 18:33:34 -04:00
|
|
|
"tippy.js": "6.3.7",
|
2023-06-26 22:45:24 -04:00
|
|
|
"toastify-js": "1.12.0",
|
2020-05-20 22:00:43 -04:00
|
|
|
"tributejs": "5.1.3",
|
2022-01-14 10:03:31 -05:00
|
|
|
"uint8-to-base64": "0.2.0",
|
2024-04-03 05:15:06 -04:00
|
|
|
"vanilla-colorful": "0.7.2",
|
2026-01-23 06:58:47 -05:00
|
|
|
"vue": "3.5.27",
|
2025-11-04 17:37:12 -05:00
|
|
|
"vue-chartjs": "5.3.3",
|
2024-02-02 04:36:32 -05:00
|
|
|
"vue-loader": "17.4.2",
|
2023-04-02 19:47:14 -04:00
|
|
|
"vue3-calendar-heatmap": "2.0.5",
|
2025-12-21 20:14:23 -05:00
|
|
|
"webpack": "5.104.1",
|
2024-12-24 15:05:17 -05:00
|
|
|
"webpack-cli": "6.0.1",
|
2025-09-08 20:12:12 -04:00
|
|
|
"wrap-ansi": "9.0.2"
|
2019-05-16 01:57:47 -04:00
|
|
|
},
|
2020-03-18 22:45:23 -04:00
|
|
|
"devDependencies": {
|
2025-10-22 17:02:35 -04:00
|
|
|
"@axe-core/playwright": "4.11.0",
|
2025-04-23 11:43:26 -04:00
|
|
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
2025-12-03 10:53:37 -05:00
|
|
|
"@playwright/test": "1.57.0",
|
2025-04-26 04:40:28 -04:00
|
|
|
"@stoplight/spectral-cli": "6.15.0",
|
2025-12-03 10:22:00 -05:00
|
|
|
"@stylistic/eslint-plugin": "5.6.1",
|
2025-08-02 21:39:00 -04:00
|
|
|
"@stylistic/stylelint-plugin": "4.0.0",
|
2025-12-20 13:56:09 -05:00
|
|
|
"@vitejs/plugin-vue": "6.0.3",
|
2025-12-20 15:36:37 -05:00
|
|
|
"@vitest/coverage-v8": "4.0.16",
|
2025-12-28 03:48:43 -05:00
|
|
|
"@vitest/eslint-plugin": "1.6.4",
|
2024-05-07 22:05:00 -04:00
|
|
|
"@vue/test-utils": "2.4.6",
|
2025-12-20 13:57:19 -05:00
|
|
|
"eslint": "9.39.2",
|
2025-06-29 03:37:44 -04:00
|
|
|
"eslint-import-resolver-typescript": "4.4.4",
|
2025-10-09 07:29:12 -04:00
|
|
|
"eslint-plugin-array-func": "5.1.0",
|
2025-06-29 03:37:44 -04:00
|
|
|
"eslint-plugin-import-x": "4.16.1",
|
2025-03-09 15:01:47 -04:00
|
|
|
"eslint-plugin-no-jquery": "3.1.1",
|
2024-11-01 04:19:28 -04:00
|
|
|
"eslint-plugin-no-use-extend-native": "0.7.2",
|
2025-12-03 10:22:00 -05:00
|
|
|
"eslint-plugin-playwright": "2.4.0",
|
2025-08-08 21:39:02 -04:00
|
|
|
"eslint-plugin-regexp": "2.10.0",
|
2025-10-09 07:29:12 -04:00
|
|
|
"eslint-plugin-sonarjs": "3.0.5",
|
2025-02-21 03:23:03 -05:00
|
|
|
"eslint-plugin-toml": "0.12.0",
|
2025-12-03 11:46:30 -05:00
|
|
|
"eslint-plugin-unicorn": "62.0.0",
|
2024-03-26 05:41:40 -04:00
|
|
|
"eslint-plugin-vitest-globals": "1.5.0",
|
2025-12-03 10:22:00 -05:00
|
|
|
"eslint-plugin-vue": "10.6.2",
|
2025-10-09 07:29:12 -04:00
|
|
|
"eslint-plugin-vue-scoped-css": "2.12.0",
|
|
|
|
|
"eslint-plugin-wc": "3.0.2",
|
2026-01-27 08:08:44 -05:00
|
|
|
"globals": "17.1.0",
|
2025-12-02 00:40:47 -05:00
|
|
|
"happy-dom": "20.0.11",
|
2024-09-10 00:54:38 -04:00
|
|
|
"license-checker-rseidelsohn": "4.4.2",
|
2025-12-20 13:58:25 -05:00
|
|
|
"markdownlint-cli": "0.47.0",
|
2026-01-23 07:36:06 -05:00
|
|
|
"postcss-html": "1.8.1",
|
2025-11-08 06:37:43 -05:00
|
|
|
"sharp": "0.34.5",
|
2025-12-03 10:22:00 -05:00
|
|
|
"stylelint": "16.26.1",
|
2024-02-02 04:36:32 -05:00
|
|
|
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
|
2025-03-09 15:01:47 -04:00
|
|
|
"stylelint-declaration-strict-value": "1.10.11",
|
2025-12-22 12:14:20 -05:00
|
|
|
"stylelint-value-no-unknown-custom-properties": "6.1.0",
|
2025-06-29 07:57:15 -04:00
|
|
|
"svgo": "4.0.0",
|
2025-10-02 04:41:19 -04:00
|
|
|
"typescript": "5.9.3",
|
2025-12-28 00:27:32 -05:00
|
|
|
"typescript-eslint": "8.50.1",
|
2025-12-02 19:59:25 -05:00
|
|
|
"vite-string-plugin": "1.4.9",
|
2025-12-20 15:36:37 -05:00
|
|
|
"vitest": "4.0.16"
|
2020-03-18 22:45:23 -04:00
|
|
|
},
|
2026-01-04 17:52:33 -05:00
|
|
|
"browserslist": ["defaults"],
|
2025-12-18 16:53:20 -05:00
|
|
|
"scarfSettings": {
|
|
|
|
|
"enabled": false
|
|
|
|
|
}
|
2018-03-05 20:22:16 -05:00
|
|
|
}
|