-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe604ba
commit 013859b
Showing
9 changed files
with
84 additions
and
75 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 |
---|---|---|
|
@@ -43,6 +43,7 @@ ckan_deb/DEBIAN/prerm | |
|
||
# node.js | ||
node_modules/ | ||
package-lock.json | ||
|
||
# docker | ||
contrib/docker/.env |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ Instructions for installing |nodejs| can be found on the |nodejs| `website | |
On Ubuntu, run the following to install |nodejs| official repository and the node | ||
package:: | ||
|
||
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | ||
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash - | ||
sudo apt-get install -y nodejs | ||
|
||
.. note:: If you use the package on the default Ubuntu repositories (eg ``sudo apt-get install nodejs``), | ||
|
@@ -34,22 +34,18 @@ package:: | |
|
||
ln -s /usr/bin/nodejs /usr/bin/node | ||
|
||
Also npm (the |nodejs| package manager) needs to be installed separately:: | ||
|
||
sudo apt-get install npm | ||
|
||
For more information, refer to the |nodejs| `instructions | ||
<https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions>`_. | ||
|
||
Less can then be installed via the node package manager (npm). | ||
We also use ``nodewatch`` to make our Less compiler a watcher | ||
Dependencies can then be installed via the node package manager (npm). | ||
We use ``gulp`` to make our Less compiler a watcher | ||
style script. | ||
|
||
``cd`` into the CKAN source folder (eg |virtualenv|/src/ckan ) and run: | ||
|
||
:: | ||
|
||
$ npm install [email protected] nodewatch | ||
$ npm install | ||
|
||
|
||
You may need to use ``sudo`` depending on your CKAN install type. | ||
|
@@ -127,11 +123,13 @@ before beginning development by running: | |
|
||
:: | ||
|
||
$ ./bin/less | ||
$ npm run watch | ||
|
||
This will watch for changes to all of the less files and automatically | ||
rebuild the CSS for you. To quit the script press ``ctrl-c``. There is also | ||
``--production`` flag for compiling the production ``main.css``. | ||
rebuild the CSS for you. To quit the script press ``ctrl-c``. If you | ||
need sourcemaps for debugging, set `DEBUG` environment variable. I.e:: | ||
|
||
$ DEBUG=1 npm run watch | ||
|
||
There are many Less files which attempt to group the styles in useful | ||
groups. The main two are: | ||
|
@@ -146,7 +144,7 @@ ckan.less: | |
|
||
.. Note:: | ||
Whenever a CSS change effects ``main.less`` it's important than after | ||
the merge into master that a ``$ ./bin/less --production`` should be | ||
the merge into master that a ``$ npm run build`` should be | ||
run and commited. | ||
|
||
There is a basic pattern primer available at: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const path = require("path"); | ||
const { src, watch, dest } = require("gulp"); | ||
const less = require("gulp-less"); | ||
const if_ = require("gulp-if"); | ||
const sourcemaps = require("gulp-sourcemaps"); | ||
const rename = require("gulp-rename"); | ||
|
||
console.log(process.argv); | ||
const with_sourcemaps = () => !!process.env.DEBUG; | ||
const renamer = path => { | ||
if (process.argv[3]) { | ||
path.basename = process.argv[3].slice(1); | ||
} | ||
return path; | ||
}; | ||
|
||
const build = () => | ||
src(__dirname + "/ckan/public/base/less/main.less") | ||
.pipe(if_(with_sourcemaps(), sourcemaps.init())) | ||
.pipe(less()) | ||
.pipe(if_(with_sourcemaps(), sourcemaps.write())) | ||
.pipe(rename(renamer)) | ||
.pipe(dest(__dirname + "/ckan/public/base/css/")); | ||
|
||
const watchSource = () => | ||
watch( | ||
__dirname + "/ckan/public/base/less/**/*.less", | ||
{ ignoreInitial: false }, | ||
build | ||
); | ||
|
||
exports.build = build; | ||
exports.watch = watchSource; |
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,29 @@ | ||
{ | ||
"name": "ckan", | ||
"version": "1.0.0", | ||
"description": "CKAN: The Open Source Data Portal Software ==========================================", | ||
"dependencies": { | ||
"gulp": "^4.0.2", | ||
"gulp-if": "^3.0.0", | ||
"gulp-less": "^4.0.1", | ||
"gulp-rename": "^2.0.0", | ||
"gulp-sourcemaps": "^2.6.5" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"watch": "gulp watch", | ||
"build": "gulp build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ckan/ckan.git" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/ckan/ckan/issues" | ||
}, | ||
"homepage": "https://github.com/ckan/ckan#readme" | ||
} |