-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fixes: 4988] Rework static build process (#4989)
* updated gruntfile, excluded dependencies, updated package.json * new /static/lib build * new static/geonode build * updated templates for static file include (DEBUG_STATIC) * updated settings for leaflet * removed bower * fixed typo * updated uglify dev * updated dependencies * new static build * last tests
- Loading branch information
Showing
229 changed files
with
49,066 additions
and
15,922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
Frontend development | ||
==================== | ||
|
||
The GeoNode frontend dependencies can be found in geonode / static. To | ||
manage dependencies, we recommend the use of yarn package manager (https://yarnpkg.com/lang/en). | ||
|
||
First steps: | ||
------------ | ||
|
||
``yarn install`` | ||
|
||
Installs the required libraries to ./node_modules | ||
|
||
``yarn install <package>@version [--dev]`` | ||
|
||
Installs a paket with a defined version. Using ``–dev`` installs a | ||
dependency that is only available for the build process. | ||
|
||
``yarn remove <package>`` | ||
|
||
Removes a package. | ||
|
||
``yarn outdated`` | ||
|
||
Shows version information. | ||
|
||
``yarn why <package>`` | ||
|
||
Get information on why this package was installed. | ||
|
||
**For further information on how to install or use please visit the official yarn documentation.** | ||
|
||
File(Folder overview: | ||
---------------- | ||
|
||
``./static_dependencies.json`` | ||
|
||
includes all dependencies associated with each | ||
file. For example all files which should be minified to assets.min.js are named as values. | ||
All files that should be copied to lib folder (for DEBUG_STATIC) are values of key `other_dependencies` and so on. Before you can use a dependency it has to be added to package.json by use of yarn. | ||
|
||
``./Gruntfile.js`` | ||
|
||
reads the dependencies from static_dependencies.json | ||
and contains all workflows. | ||
|
||
geonode/static/geonode | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The ./geonode folder contains GeoNode’s stylesheets and javascript | ||
files. The CSS files are generated via less. CSS files should therefore | ||
never be changed directly but it’s corresponding less file. Further this folder | ||
should never be deleted! | ||
|
||
geonode/static/lib | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
The ./lib folder contains all the third-party files. | ||
This folder can be deleted as it will be | ||
fully generated by use of grunt ``development|production`` | ||
|
||
|
||
|
||
|
||
|
||
Example 1 – Change styling: | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
1. we start the development server with ``paver start``. | ||
2. we use ``grunt watch`` to watch all less files for change. | ||
3. we change styling in geonode / less | ||
4. If our changes are ok we create a new build with | ||
``grunt development`` (files are not minimized) or | ||
``grunt production`` (files are minimized) | ||
|
||
Example 2 – add/update a new library: | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
1. yarn add [email protected] | ||
2. ``vim static_dependencies.json`` Edit the file and add your dependency to its fitting | ||
destination. For example, assets.min.js | ||
3. Check if some Django template (for example, base.html) includes the file by use of ``DEBUG_STATIC=True`` | ||
and add it or adjust the version | ||
4. use `grunt production` to build the package | ||
|
||
**For further tasks have a look at gruntfile.js or ask for help in the | ||
development mailing list** | ||
|
||
Attention: Please make maintainers work easier and add a message to | ||
your commit why a library has been added. (For example, commit -m | ||
'select2 added for permissions form on layer detail page') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.