diff --git a/.eslintrc.js b/.eslintrc.js index 349bc61b8df..41defa8f62d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,19 +1,24 @@ module.exports = { + extends: ["eslint:recommended"], rules: { - indent: [2, 4], - camelcase: 0, - "require-jsdoc": 0, - quotes: [2, "double"], - "no-multiple-empty-lines": [2, {max: 2}], - "quote-props": [2, "as-needed"], - "brace-style": [2, "1tbs", {allowSingleLine: true}] + indent: ["error", 4], + quotes: "off", + "no-multiple-empty-lines": ["error", { max: 2, maxEOF: 0 }], + "quote-props": ["error", "as-needed"], + "brace-style": ["error", "1tbs", { allowSingleLine: true }], + semi: ["error", "always"], + "newline-per-chained-call": ["error"] }, env: { browser: true, - jquery: true + jquery: true, + node: true }, globals: { d3: true }, - extends: "google" -}; + parserOptions: { + sourceType: "module", + ecmaVersion: 2015 + } +}; \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3c76eff85c6..d65d46ede43 100644 --- a/.gitignore +++ b/.gitignore @@ -16,17 +16,18 @@ .DS_store # Simulated Subversion default ignores end here /.coverage +/.factoryboy_random_state /.mypy_cache +/.parcel-cache /.project /.pydevproject /.Python /.settings /.tmp -/.factoryboy_random_state /attic /bin -/etc /env +/etc /ghostdriver.log /htmlcov /include @@ -38,6 +39,7 @@ /mergelog /mergequeue /minimum-requirements.txt +/node_modules /pip-selfcheck.json /selenium /settings_local.py diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 6ffb15e4bae..00000000000 --- a/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2008,2018, The IETF Trust -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000000..2e96fc42551 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,27 @@ +Copyright (c) 2008, 2018, The IETF Trust +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index cb0b0781dca..22fc19842f1 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ - [Docker Dev Environment](docker/README.md) - [Continuous Integration](#continuous-integration) - [Database & Assets](#database--assets) +- [Bootstrap 5 Upgrade](#bootstrap-5-upgrade) --- @@ -154,3 +155,139 @@ Additional data files used by the datatracker (e.g. instance drafts, charters, r https://www.ietf.org/standards/ids/internet-draft-mirror-sites/ > A script is available at `docker/scripts/app-rsync-extras.sh` to automatically fetch these resources via rsync. + +--- + +# Bootstrap 5 Update + +An update of the UI to use Bootstrap 5 is under way. The following notes describe this work-in-progress and should +be integrated with the rest of the document as the details and processes become final. + +## Intro + +We now use `npm` to manage assets for the Datatracker, and `parcel` to +package them. `npm` maintains its `node` packages under `node_modules`. + +The Datatracker includes these packages from the various Javascript and +CSS files in `ietf/static/js` and `ietf/static/css`, respectively. +Static images are likewise in `ietf/static/images`. + +Whenever changes are made to the files under `ietf/static`, you must +re-run `parcel` to package them: + +``` shell +npx parcel build +``` + +This will create packages under `ietf/static/dist/ietf`, which are then +served by the Django development server, and which must be uploaded to +the CDN. + +## Use Bootstrap Whenever You Can + +The "new" datatracker uses Twitter Bootstrap for the UI. + +Get familiar with and use +those UI elements, CSS classes, etc. instead of cooking up your own. + +Some ground rules: + +- Think hard before tweaking the bootstrap CSS, it will make it harder + to upgrade to future releases. +- No `').appendTo('head') - - $('