Changeset - 1969f7dfb6b0
[Not reviewed]
default
1 5 1
domruf - 8 years ago 2017-12-18 22:20:10
dominikruf@gmail.com
move package.json to root directory

In the future we'll probably use it to manage more then just less/css stuff.
So the less directory is the wrong place.
The most common place is the root directory, so lets put it there.
Also, this way the --prefix parameter for npm is no longer required.
6 files changed with 10 insertions and 11 deletions:
0 comments (0 inline, 0 general)
MANIFEST.in
Show inline comments
 
include           .coveragerc
 
include           Apache-License-2.0.txt
 
include           CONTRIBUTORS
 
include           COPYING
 
include           Jenkinsfile
 
include           LICENSE-MERGELY.html
 
include           LICENSE.md
 
include           MIT-Permissive-License.txt
 
include           README.rst
 
include           dev_requirements.txt
 
include           development.ini
 
include           pytest.ini
 
include           requirements.txt
 
include           tox.ini
 
recursive-include docs *
 
recursive-include init.d *
 
recursive-include kallithea/alembic *
 
include           kallithea/bin/ldap_sync.conf
 
include           kallithea/lib/paster_commands/template.ini.mako
 
recursive-include kallithea/i18n *
 
recursive-include kallithea/public *
 
prune             kallithea/public/less/node_modules
 
recursive-include kallithea/public/less/node_modules/bootstrap *
 
recursive-include node_modules/bootstrap *
 
recursive-include kallithea/templates *
 
recursive-include kallithea/tests/fixtures *
 
recursive-include kallithea/tests/scripts *
 
include           kallithea/tests/models/test_dump_html_mails.ref.html
 
include           kallithea/tests/performance/test_vcs.py
 
include           kallithea/tests/vcs/aconfig
 
recursive-include scripts *
docs/contributing.rst
Show inline comments
 
@@ -16,50 +16,50 @@ https://kallithea-scm.org/repos/kallithe
 
of Kallithea.
 

	
 
For now, we use Bitbucket_ for `pull requests`_ and `issue tracking`_. The
 
issue tracker is for tracking bugs, not for support, discussion, or ideas --
 
please use the `mailing list`_ or :ref:`IRC <readme>` to reach the community.
 

	
 
We use Weblate_ to translate the user interface messages into languages other
 
than English. Join our project on `Hosted Weblate`_ to help us.
 
To register, you can use your Bitbucket or GitHub account. See :ref:`translations`
 
for more details.
 

	
 

	
 
Getting started
 
---------------
 

	
 
To get started with Kallithea development::
 

	
 
        hg clone https://kallithea-scm.org/repos/kallithea
 
        cd kallithea
 
        virtualenv ../kallithea-venv
 
        source ../kallithea-venv/bin/activate
 
        pip install --upgrade pip setuptools
 
        pip install --upgrade -e .
 
        pip install --upgrade -r dev_requirements.txt
 
        npm --prefix kallithea/public/less install     # install dependencies - both tools and data
 
        npm --prefix kallithea/public/less run less    # for generating css from less
 
        npm install     # install dependencies - both tools and data
 
        npm run less    # for generating css from less
 
        gearbox make-config my.ini
 
        gearbox setup-db -c my.ini --user=user --email=user@example.com --password=password --repos=/tmp
 
        gearbox serve -c my.ini --reload &
 
        firefox http://127.0.0.1:5000/
 

	
 
If you plan to use Bitbucket_ for sending contributions, you can also fork
 
Kallithea on Bitbucket_ first (https://bitbucket.org/conservancy/kallithea) and
 
then replace the clone step above by a clone of your fork. In this case, please
 
see :ref:`contributing-guidelines` below for configuring your fork correctly.
 

	
 

	
 
Contribution flow
 
-----------------
 

	
 
Starting from an existing Kallithea clone, make sure it is up to date with the
 
latest upstream changes::
 

	
 
        hg pull
 
        hg update
 

	
 
Review the :ref:`contributing-guidelines` and :ref:`coding-guidelines`.
 

	
 
If you are new to Mercurial, refer to Mercurial `Quick Start`_ and `Beginners
 
Guide`_ on the Mercurial wiki.
docs/setup.rst
Show inline comments
 
.. _setup:
 

	
 
=====
 
Setup
 
=====
 

	
 

	
 
Preparing front-end
 
-------------------
 

	
 
Temporarily, in the current Kallithea version, some extra steps are required to
 
build front-end files:
 

	
 
Find the right ``kallithea/public/less`` path with::
 

	
 
    python -c "import os, kallithea; print os.path.join(os.path.dirname(os.path.abspath(kallithea.__file__)), 'public', 'less')"
 

	
 
Then run::
 

	
 
    npm --prefix kallithea/public/less install
 
    npm --prefix kallithea/public/less run less
 
    npm install
 
    npm run less
 

	
 

	
 
Setting up Kallithea
 
--------------------
 

	
 
First, you will need to create a Kallithea configuration file. Run the
 
following command to do so::
 

	
 
    gearbox make-config my.ini
 

	
 
This will create the file ``my.ini`` in the current directory. This
 
configuration file contains the various settings for Kallithea, e.g.
 
proxy port, email settings, usage of static files, cache, Celery
 
settings, and logging. Extra settings can be specified like::
 

	
 
    gearbox make-config my.ini host=8.8.8.8 "[handler_console]" formatter=color_formatter
 

	
 
Next, you need to create the databases used by Kallithea. It is recommended to
 
use PostgreSQL or SQLite (default). If you choose a database other than the
 
default, ensure you properly adjust the database URL in your ``my.ini``
 
configuration file to use this other database. Kallithea currently supports
 
PostgreSQL, SQLite and MySQL databases. Create the database by running
 
the following command::
 

	
docs/upgrade.rst
Show inline comments
 
@@ -75,50 +75,50 @@ See the appropriate installation page fo
 
-----------------------------------
 

	
 
Please refer to the instructions for the installation method you
 
originally used to install Kallithea.
 

	
 
If you originally installed using pip, it is as simple as::
 

	
 
    pip install --upgrade kallithea
 

	
 
If you originally installed from version control, it is as simple as::
 

	
 
    cd my-kallithea-clone
 
    hg pull -u
 
    pip install --upgrade -e .
 

	
 
Temporarily, in the current version, an extra step is required to build
 
front-end files:
 

	
 
Find the right ``kallithea/public/less`` path with::
 

	
 
    python -c "import os, kallithea; print os.path.join(os.path.dirname(os.path.abspath(kallithea.__file__)), 'public', 'less')"
 

	
 
Then run::
 

	
 
    npm --prefix kallithea/public/less install
 
    npm --prefix kallithea/public/less run less
 
    npm install
 
    npm run less
 

	
 

	
 
5. Upgrade your configuration
 
-----------------------------
 

	
 
Run the following command to create a new configuration (``.ini``) file::
 

	
 
    gearbox make-config new.ini
 

	
 
Then compare it with your old config file and see what changed.
 

	
 
.. note::
 
    Please always make sure your ``.ini`` files are up to date. Errors
 
    can often be caused by missing parameters added in new versions.
 

	
 
.. _upgrade_db:
 

	
 

	
 
6. Upgrade your database
 
------------------------
 

	
 
.. note::
 
    If you are *downgrading* Kallithea, you should perform the database
 
    migration step *before* installing the older version. (That is,
kallithea/public/less/main.less
Show inline comments
 
/*!
 
 * Don't edit the css file directly.
 
 *
 
 * Instead, edit the less file(s) and regenerate the css:
 
 *
 
 * npm --prefix kallithea/public/less install
 
 * npm --prefix kallithea/public/less run less
 
 * npm install
 
 * npm run less
 
 *
 
 */
 

	
 
/* 3rd party styles */
 
@import "node_modules/bootstrap/less/bootstrap.less";
 
@import (inline) "../css/jquery.dataTables.css";
 
@import (less) "../js/select2/select2.css";
 
@import (less) "../js/select2/select2-bootstrap.css";
 

	
 
/* kallithea styles */
 
@import "kallithea-variables.less";
 
@import "kallithea-tags.less";
 
@import "yui-ac.less";
 
@import "kallithea-select2.less";
 
@import "kallithea-diff.less";
 
@import "style.less";
package.json
Show inline comments
 
file renamed from kallithea/public/less/package.json to package.json
 
{
 
  "name": "kallithea",
 
  "private": true,
 
  "dependencies": {
 
    "bootstrap": "3.3.7"
 
  },
 
  "devDependencies": {
 
    "less": "~2.7",
 
    "less-plugin-clean-css": "~1.5"
 
  },
 
  "scripts": {
 
    "less": "lessc --relative-urls main.less ../css/style.css"
 
    "less": "lessc --relative-urls kallithea/public/less/main.less kallithea/public/css/style.css"
 
  }
 
}
0 comments (0 inline, 0 general)