diff options
author | silverwind <me@silverwind.io> | 2019-05-16 07:57:47 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-05-16 08:57:47 +0300 |
commit | d9dcd093403b3194bcf3b4be36eaf90250e06ed1 (patch) | |
tree | f2b18a690ae35773e7e6f06e3c312f3a2a9902ea /docs | |
parent | 775a5a5b0f4c1a7aa7b301569fe89d7c6e751c46 (diff) | |
download | gitea-d9dcd093403b3194bcf3b4be36eaf90250e06ed1.tar.gz gitea-d9dcd093403b3194bcf3b4be36eaf90250e06ed1.zip |
add make targets for js and css, add js linter (#6952)
* add make targets for js,css, add javascript linter
- add `make js`, deprecating `make javascripts`
- add `make css`, deprecating `make generate-stylesheets` and
`make stylesheets-check`
- changed the unclean css check to only run on CI
- add JS linting via eslint with basic configuration and fixed
discovered issues
- changed autoprefixer to use official `postcss-cli` avoiding the need
to loop in the makefile
- moved browserslist to package.json so other future tools can use it
too.
- update documentation for new make targets and added JS section
* fix indentation
* move functions used in html to 'exported' list
* Run lessc binary without having to install anything to node_modules
* use relative paths to node bin scripts, removing npx
* Revert "use relative paths to node bin scripts, removing npx"
This reverts commit 119b725525a8430b32ee7a6e6009b4ece544e39b.
* fix lessc and postcss plugins
* check for node_modules and use actual bin names
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/doc/advanced/hacking-on-gitea.en-us.md | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/docs/content/doc/advanced/hacking-on-gitea.en-us.md b/docs/content/doc/advanced/hacking-on-gitea.en-us.md index 1fabc1a118..48a4510545 100644 --- a/docs/content/doc/advanced/hacking-on-gitea.en-us.md +++ b/docs/content/doc/advanced/hacking-on-gitea.en-us.md @@ -136,30 +136,36 @@ You should lint, vet and spell-check with: make vet lint misspell-check ``` -### Updating the stylesheets +### Updating CSS -To generate the stylsheets, you will need [Node.js](https://nodejs.org/) at version 8.0 or above. +To generate the CSS, you will need [Node.js](https://nodejs.org/) 8.0 or greater and the build dependencies: -At present we use [less](http://lesscss.org/) and [postcss](https://postcss.org) to generate our stylesheets. Do -**not** edit the files in `public/css/` directly, as they are generated from -`lessc` from the files in `public/less/`. +```bash +npm install +``` -If you wish to work on the stylesheets, you will need to install `lessc` the -less compiler and `postcss`. The recommended way to do this is using `npm install`: +At present we use [less](http://lesscss.org/) and [postcss](https://postcss.org) to generate our CSS. Do +**not** edit the files in `public/css` directly, as they are generated from `lessc` from the files in `public/less`. + +Edit files in `public/less`, run the linter, regenerate the CSS and commit all changed files: ```bash -cd "$GOPATH/src/code.gitea.io/gitea" -npm install +make css ``` -You can then edit the less stylesheets and regenerate the stylesheets using: +### Updating JS + +To run the JavaScript linter you will need [Node.js](https://nodejs.org/) 8.0 or greater and the build dependencies: ```bash -make generate-stylesheets +npm install ``` -You should commit both the changes to the css and the less files when making -PRs. +Edit files in `public/js` and run the linter: + +```bash +make js +``` ### Updating the API |