aboutsummaryrefslogtreecommitdiffstats
path: root/build
Commit message (Collapse)AuthorAgeFilesLines
* Modernize JS build scripts (#19824)silverwind2022-06-062-33/+28
| | | | | | | | | | - Remove __dirname, use file URLs instead - Upgrade fabric dependency - Use fs/promises syntax, this breaks node 12 but we require 14 already The change in public/img/favicon.svg is not caused by the fabric upgrade, but it seems it was not properly generated when introduced. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add the possibility to allow the user to have a favicon which differs from ↵Jan-Eric Schober2022-05-231-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the main logo (#18542) * Changed the filename of the favicon SVG This allows the user to have a favicon which differs from the logo. * Added favicon.svg This is needed to accommodate the changes for allowing the user to have a differing logo and favicon * Adjusted page to accommodate what icon is used as favicon * Added functionality to also generate the favicon.svg via generate-images.js * Adjusted the description for the new favicon compatibility Co-authored-by: silverwind <me@silverwind.io> * Updated generate-images.js to generate favicons from a separate favicons.svg file This belongs to PR #18542. * Added description on how custom favicons can be generated * Replaced space indents with tabs * Synced changes with current state of the file * Synced changes with current state of the file Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Remove legacy `+build:` constraint (#19582)wxiaoguang2022-05-027-7/+0
| | | Go 1.17 and later use modern `//go:build` constraints, the old `// +build:` constraints should be removed.
* Use `go run` for tool dependencies, require go 1.17 (#18874)silverwind2022-03-151-3/+3
| | | | | | | | | | This ensures the tools only run in the versions we've tested and it also does not polute PATH with those tools so they are truly isolated. This syntax of `go run` requires go 1.17, so the minimum version is set accordingly. Fixes: https://github.com/go-gitea/gitea/issues/18867 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix `make fmt` and `make fmt-check` (#18633)silverwind2022-02-062-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Run 'make fmt' 'make fmt' currently produces this change, I'm not sure how CI did not fail on it, I made sure I have `mvdan.cc/gofumpt@latest`. * Fix 'make fmt-check' `make fmt-check` did not run all commands that `make fmt` did, resulting in missed diffs. Fix that by just depending on the `fmt` target. Includes: https://github.com/go-gitea/gitea/pull/18633 * Make gitea-fmt work with -l and -d and integrate gofumpt This implements -l, -w and -d with gitea-fmt and merges gofumpt. Signed-off-by: Andrew Thornton <art27@cantab.net> * as per silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review * use -l instead of -d for fmt-check Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net>
* format with gofumpt (#18184)65432022-01-207-25/+20
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Fix documents for development and bug report (#18249)wxiaoguang2022-01-131-2/+2
|
* Don't store assets modified time into generated files (#18193)Lunny Xiao2022-01-061-5/+10
|
* Update JS dependencies, adjust eslint config (#17904)silverwind2021-12-042-2/+2
| | | | | - Update all JS dependencies to latest versions - Add new lint rules, enable es2022 eslint parser features - Disable github/no-then, I feel the rule was too restricting
* Fix code formating (#17830)mscherer2021-11-271-1/+1
| | | * fix formatter, format imports first, then go fmt
* Add new JS linter rules (#17699)silverwind2021-11-222-2/+2
| | | | | | | | | | | | | | | | | | | | * Add new JS linter rules Adds a few useful rules from eslint-plugin-github. Notable changes: - Forbid dataset usage, its camel-casing behaviour makes it hard to grep for attributes. - Forbid .then() and .catch(), we should generally prefer await for new code. For rare cases where they are useful, a eslint-disable-line directive can be set. - Add docs js to linting * also enable github/array-foreach * small tweak Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Better builtin avatar generator (#17707)wxiaoguang2021-11-201-2/+2
| | | | | | | This PR fixes the builtin avatar generator. 1. The random background color makes some images very dirty. So now we only use white background for avatars. 2. We use left-right mirror avatars to satisfy #14799 3. Fix a small padding error in the algorithm
* Prepare and check test env during CI (#17725)wxiaoguang2021-11-192-0/+35
| | | | | | | | | | This PR should resolve the permission problems during CI, if the uid doesn't match, a more clear message is shown. * CI fails with unknown permission problems #17710 The new drone step dependencies: (root)prepare-test-env -> (gitea)build -> (gitea)test
* A better go code formatter, and now `make fmt` can run in Windows (#17684)wxiaoguang2021-11-174-0/+623
| | | | * go build / format tools * re-format imports
* Remove deprecated `extendDefaultPlugins` method of svgo (#17399)Mashiro2021-10-221-3/+4
|
* refactor: move from io/ioutil to io and os package (#17109)Eng Zer Jun2021-09-224-13/+11
| | | | | | | | | The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use filename as id/class prefix. (#16997)KN4CK3R2021-09-091-0/+1
| | | | | | | | | | | Currently the svg minifier (`make svg`) rewrites all `id` and `class` attributes in svg files. Every file gets the ids `a, b, ...`. If multiple svgs with ids are used on a page these ids are conflicting and the results are broken images. | minified ids | unique ids | | - | - | | ![grafik](https://user-images.githubusercontent.com/1666336/132579375-59d3996f-c4e5-43b8-8c8d-82280c90d9e3.png) | ![grafik](https://user-images.githubusercontent.com/1666336/132579413-05bf9285-4e3b-4d0d-8f95-90b212405b05.png) | This PR adds a prefix (the filename) to every id/class. Follow up problem: Because we embed svg images there are duplicated ids if one svg image is used multiple times on a page. As those ids refer to the same content it may be no real problem because browser handle that fine.
* Enable race detector for CI (#1441)Mura Li2021-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Enable race detector by default Set RACE_ENABLED=0 to disable it when release * Disable race detector for release builds * use `true` * fix * debug issue * fix * verbose * clean * Fix wrong merge * Fix coverage merge Co-authored-by: Mura Li <typeless@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add bundle download for repository (#14538)John Olheiser2021-08-245-0/+5
| | | | | | | | | | | | | | | | | * Add bundle download Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix build tags Signed-off-by: jolheiser <john.olheiser@gmail.com> * Download specific commit Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update JS dependencies (#16708)silverwind2021-08-171-13/+8
| | | | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies - Adapt to recent webpack changes - Add new lint rules and fix issues - Regenerate SVGs and update svgo api usage Fixes: https://github.com/go-gitea/gitea/pull/16492 * adapt jest config and sort keys Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add an abstract json layout to make it's easier to change json library (#16528)Lunny Xiao2021-07-241-3/+1
| | | | | | | | | | | * Add an abstract json layout to make it's easier to change json library * Fix import * Fix import sequence * Fix blank lines * Fix blank lines
* Use binary version of revive linter (#15739)silverwind2021-05-091-325/+0
| | | | Use the common `go get` method to install and run the revive linter, removing the useless build/lint.go and related vendor libraries.
* Make build scripts compatible with node 12 (#15479)silverwind2021-04-152-2/+4
| | | | | | | | | | * Make build scripts compatible with node 12 "fs/promises" is not in node 12, use a more compatible way to import it. Also, lock major down versions of the image build dependencies to prevent future surprises. * add node_modules dependency
* Add frontend testing, require node 12 (#15315)silverwind2021-04-082-15/+13
| | | | | | | | | | - Add basic frontend unit testing infrastructure using jest in ESM mode - Rename 'make test' to 'make test-backend' - Introduce 'make test-frontend' and 'make test' that runs both - Bump Node.js requirement to v12. v10 will be EOL in less than a month. - Convert all build-related JS files to ESM. I opted to run frontend tests run as part of the compliance pipeline because they complete fast and are not platform-specific like the golang tests.
* Update JS dependencies (#15033)silverwind2021-03-222-29/+19
| | | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies - For octicons, rename trashcan to trash - For svgo, migrate to v2 api, output seems to have slightly changed but icons look the same - For stylelint, update config, fix custom property duplicates - For monaco, drop legacy Edge support - For eslint, enable new rules, fix new issues - For less-loader, remove deprecated import syntax * update svgo usage in generate-images and rebuild logo.svg with it
* Migrate to use jsoniter instead of encoding/json (#14841)zeripath2021-03-011-1/+4
| | | | | | | | | | * Migrate to use jsoniter * fix tests * update gitea.com/go-chi/binding Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix typo in generate-emoji.go (#14570)Ikko Ashimine2021-02-041-1/+1
| | | | | modifer -> modifier Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use gitea.svg for public/img/gitea-gitea.svg instead of logo.svg (#14479)Kyle D2021-01-271-1/+1
|
* Consolidate Logos and update README header (#14136)silverwind2021-01-011-39/+18
| | | | | | | | | | | | | | | | | | | | * Consolidate Logos and update README header - Remove unused `logo-lg.png`, `logo-sm.png` and `logo-192.png`. - Consolidate `favicon.svg` and `logo.svg` to just `logo.svg`. - Remove Safari Mask icon, it seems to work fine with just `favicon.png` (no SVG support). - Remove Fluid Icon. It only served Firefox and SVG works just fine there. - Update customization instructions. - Update README.md to use SVG icon, increase logo size and center it and badges. * Update README_ZH.md Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * Update README_ZH.md Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* gitea png to logo (#13974)Kyle D2020-12-181-9/+28
| | | | | | | | | | | * gitea png to logo.svg * gitea safari svg to logo * minify svgs * Update english docs * Update missing section on customizing logo
* Clean up SVG (#13680)techknowlogick2020-12-171-19/+2
| | | | | | | | | | | | | | | * Clean up SVG * update per feedback * fix css style * Delete gitea.png * no new line at end of file * fix newline? Co-authored-by: 6543 <6543@obermui.de>
* Improve migrate page and add card CSS (#13751)silverwind2020-12-051-11/+19
| | | | | | | - Use original gitea logo on migrate page - Add card styles and map colors to css vars - Tweak migrate page, adding hover effect to cards Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Format files (#13698)65432020-11-281-2/+2
| | | | | | | | | | | | | | | | * align "make help" * format * untouch build/generate-svg.js * untouch .eslintrc * combine editorconfig's * rm editorconfig Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* update revive lint to latest commit (#12921)techknowlogick2020-09-221-2/+2
| | | | | | | * update revive lint to latest commit * make fmt * change import
* Add github api token option to generate-license & generate-gitignore (#12700)zeripath2020-09-042-9/+32
| | | | | | | | | | | | | | * Add github api token option to generate-license & generate-gitignore Without api toke, Will face rate limit sometimes. Signed-off-by: a1012112796 <1012112796@qq.com> * Use Basic authentication with tokens Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Re-attempt to delete temporary upload if the file is locked by another ↵zeripath2020-08-112-2/+6
| | | | | | | | | | | process (#12447) Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Add SVG favicon (#12437)silverwind2020-08-061-0/+21
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Rework 'make generate-images' (#12316)silverwind2020-07-261-0/+80
| | | | | | | | | | | | | | | | | | | | | | | * Rework 'make generate-images' - Remove external dependencies and replace it with a node script that does does the same. - Move detail removal from gitea-sm.png to favicon.png - Remove favicon.ico and its generation, it is unused and we already serve favicon.png in its place. Fixes: https://github.com/go-gitea/gitea/issues/12314 * use proper centering value for preserveAspectRatio * fix lint * use fabric * better linting fix * fix typo * mention detail-remove class in docs
* Update Octicons to v10 (#12240)silverwind2020-07-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update Octicons to v10 Besides a few renames, these icons are no longer present in v10 that we've used, so had to change: file-symlink-directory -> file-submodule internal-repo -> repo repo-force-push -> repo-push repo-template-private -> repo-template Fixes: https://github.com/go-gitea/gitea/issues/11889 Ref: https://github.com/primer/octicons/releases/tag/v10.0.0 * add custom sliders svg for removed octicon-settings * apply suggestion * fix triangles and use play on admin dashboard * add custom mirror svg * add missing build files * unify custom svgs * move to octicon-repo-clone to gitea-mirror * use octicon-x on conflicts * tweak timeline icons * tweak comment buttons * update settings icon to octicons v1 * switch to octicon-mirror and octicon-tools * replace two wiki buttons with octicons * remove whitespace in svg sources * Fix filepath basename on Windows for SVG bindata (#12241) * move octicons to devDependencies * move back to dependencies * move svgo to devDependencies again Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Direct SVG rendering (#12157)silverwind2020-07-121-0/+63
| | | | | | | | | | | | Introduce 'make svg' which calls a node script that compiles svg files to `public/img/svg`. These files are vendored to not create a dependency on Node for the backend build. On the frontend side, configure webpack using `raw-loader` so SVGs can be imported as string. Also moved our existing SVGs to web_src/svg for consistency. Fixes: https://github.com/go-gitea/gitea/issues/11618
* Update emoji dataset with skin tone variants (#11678)mrsdizzie2020-06-021-14/+51
| | | | | | | | | * Update emoji dataset with skin tone variants Since the format of emoji that support skin tone modifiers is predictable we can add different variants into our dataset when generating it so that we can match and properly style most skin tone variants of emoji. No real code change here other than what generates the dataset and the data itself. * use escape unicode sequence in map Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Support unicode emojis and remove emojify.js (#11032)mrsdizzie2020-04-281-0/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support unicode emojis and remove emojify.js This PR replaces all use of emojify.js and adds unicode emoji support to various areas of gitea. This works in a few ways: First it adds emoji parsing support into gitea itself. This allows us to * Render emojis from valid alias (:smile:) * Detect unicode emojis and let us put them in their own class with proper aria-labels and styling * Easily allow for custom "emoji" * Support all emoji rendering and features without javascript * Uses plain unicode and lets the system render in appropriate emoji font * Doesn't leave us relying on external sources for updates/fixes/features That same list of emoji is also used to create a json file which replaces the part of emojify.js that populates the emoji search tribute. This file is about 35KB with GZIP turned on and I've set it to load after the page renders to not hinder page load time (and this removes loading emojify.js also) For custom "emoji" it uses a pretty simple scheme of just looking for /emojis/img/name.png where name is something a user has put in the "allowed reactions" setting we already have. The gitea reaction that was previously hard coded into a forked copy of emojify.js is included and works as a custom reaction under this method. The emoji data sourced here is from https://github.com/github/gemoji which is the gem library Github uses for their emoji rendering (and a data source for other sites). So we should be able to easily render any emoji and :alias: that Github can, removing any errors from migrated content. They also update it as well, so we can sync when there are new unicode emoji lists released. I've included a slimmed down and slightly modified forked copy of https://github.com/knq/emoji to make up our own emoji module. The code is pretty straight forward and again allows us to have a lot of flexibility in what happens. I had seen a few comments about performance in some of the other threads if we render this ourselves, but there doesn't seem to be any issue here. In a test it can parse, convert, and render 1,000 emojis inside of a large markdown table in about 100ms on my laptop (which is many more emojis than will ever be in any normal issue). This also prevents any flickering and other weirdness from using javascript to render some things while using go for others. Not included here are image fall back URLS. I don't really think they are necessary for anything new being written in 2020. However, managing the emoji ourselves would allow us to add these as a feature later on if it seems necessary. Fixes: https://github.com/go-gitea/gitea/issues/9182 Fixes: https://github.com/go-gitea/gitea/issues/8974 Fixes: https://github.com/go-gitea/gitea/issues/8953 Fixes: https://github.com/go-gitea/gitea/issues/6628 Fixes: https://github.com/go-gitea/gitea/issues/5130 * add new shared function emojiHTML * don't increase emoji size in issue title * Update templates/repo/issue/view_content/add_reaction.tmpl Co-Authored-By: 6543 <6543@obermui.de> * Support for emoji rendering in various templates * Render code and review comments as they should be * Better way to handle mail subjects * insert unicode from tribute selection * Add template helper for plain text when needed * Use existing replace function I forgot about * Don't include emoji greater than Unicode Version 12 Only include emoji and aliases in JSON * Update build/generate-emoji.go * Tweak regex slightly to really match everything including random invisible characters. Run tests for every emoji we have * final updates * code review * code review * hard code gitea custom emoji to match previous behavior * Update .eslintrc Co-Authored-By: silverwind <me@silverwind.io> * disable preempt Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Prevent support libraries from compiling into Gitea (#10964)guillep2k2020-04-051-21/+0
| | | | | | | | | | | * Prevent support libraries from compiling into Gitea * Fix tag position * Fix golangci-lint errors * Refactor to make it work Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
* Move gocovmerge as vendor (#10947)Lunny Xiao2020-04-042-0/+122
| | | | | | | | | * Move gocovmerge as vendor * Update Makefile Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Rename scripts to build and add revive command as a new build tool command ↵Lunny Xiao2020-04-036-0/+673
(#10942) Co-authored-by: techknowlogick <techknowlogick@gitea.io>