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
 
@@ -10,21 +10,20 @@ 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
 
@@ -28,26 +28,26 @@ 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
docs/setup.rst
Show inline comments
 
@@ -8,26 +8,26 @@ 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.
docs/upgrade.rst
Show inline comments
 
@@ -87,26 +87,26 @@ If you originally installed from version
 
    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::
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";
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)