js: use builtin packages for binaries
- add webpack
This commit is contained in:
parent
6b8a5f1b04
commit
6f967a47bf
6 changed files with 3621 additions and 437 deletions
|
|
@ -36,6 +36,7 @@ syntax: regexp
|
|||
^htmlcov
|
||||
^junit\.xml$
|
||||
^node_modules/
|
||||
^node_binaries/
|
||||
^pylint.log$
|
||||
^rcextensions/
|
||||
^result$
|
||||
|
|
|
|||
4
Makefile
4
Makefile
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
.PHONY: clean docs docs-clean docs-cleanup test test-clean test-only test-only-postgres test-only-mysql web-build
|
||||
|
||||
WEBPACK=./node_modules/webpack/bin/webpack.js
|
||||
GRUNT=grunt
|
||||
NODE_PATH=./node_modules
|
||||
WEBPACK=./node_binaries/webpack
|
||||
GRUNT=./node_binaries/grunt
|
||||
|
||||
|
||||
clean:
|
||||
|
|
|
|||
35
default.nix
35
default.nix
|
|
@ -54,7 +54,7 @@ let
|
|||
in
|
||||
!builtins.elem (basename path) [
|
||||
".git" ".hg" "__pycache__" ".eggs" ".idea" ".dev"
|
||||
"bower_components" "node_modules"
|
||||
"bower_components" "node_modules" "node_binaries"
|
||||
"build" "data" "result" "tmp"] &&
|
||||
!builtins.elem ext ["egg-info" "pyc"] &&
|
||||
# TODO: johbo: This check is wrong, since "path" contains an absolute path,
|
||||
|
|
@ -111,20 +111,25 @@ let
|
|||
linkNodeAndBowerPackages = ''
|
||||
export RHODECODE_CE_PATH=${rhodecode-enterprise-ce-src}
|
||||
|
||||
echo "[BEGIN]: Link node packages"
|
||||
rm -fr node_modules
|
||||
mkdir node_modules
|
||||
echo "[BEGIN]: Link node packages and binaries"
|
||||
# johbo: Linking individual packages allows us to run "npm install"
|
||||
# inside of a shell to try things out. Re-entering the shell will
|
||||
# restore a clean environment.
|
||||
rm -fr node_modules
|
||||
mkdir node_modules
|
||||
ln -s ${nodeDependencies}/lib/node_modules/* node_modules/
|
||||
echo "[DONE]: Link node packages"
|
||||
export NODE_PATH=./node_modules
|
||||
|
||||
rm -fr node_binaries
|
||||
mkdir node_binaries
|
||||
ln -s ${nodeDependencies}/bin/* node_binaries/
|
||||
echo "[DONE ]: Link node packages and binaries"
|
||||
|
||||
echo "[BEGIN]: Link bower packages"
|
||||
rm -fr bower_components
|
||||
mkdir bower_components
|
||||
ln -s ${bowerComponents}/bower_components/* bower_components/
|
||||
echo "[DONE]: Link bower packages"
|
||||
echo "[DONE ]: Link bower packages"
|
||||
'';
|
||||
|
||||
releaseName = "RhodeCodeEnterpriseCE-${version}";
|
||||
|
|
@ -154,8 +159,6 @@ let
|
|||
buildInputs =
|
||||
attrs.buildInputs or [] ++ [
|
||||
rhodecode-testdata
|
||||
pkgs.nodePackages.bower
|
||||
pkgs.nodePackages.grunt-cli
|
||||
];
|
||||
|
||||
#NOTE: option to inject additional propagatedBuildInputs
|
||||
|
|
@ -188,10 +191,12 @@ let
|
|||
'';
|
||||
|
||||
preBuild = ''
|
||||
echo "Building frontend assets"
|
||||
echo "[BEGIN]: Building frontend assets"
|
||||
${linkNodeAndBowerPackages}
|
||||
grunt
|
||||
make web-build
|
||||
rm -fr node_modules
|
||||
rm -fr node_binaries
|
||||
echo "[DONE ]: Building frontend assets"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
|
@ -208,14 +213,14 @@ let
|
|||
echo "Writing enterprise-ce meta information for rccontrol to nix-support/rccontrol"
|
||||
mkdir -p $out/nix-support/rccontrol
|
||||
cp -v rhodecode/VERSION $out/nix-support/rccontrol/version
|
||||
echo "[DONE]: enterprise-ce meta information for rccontrol written"
|
||||
echo "[DONE ]: enterprise-ce meta information for rccontrol written"
|
||||
|
||||
mkdir -p $out/etc
|
||||
cp configs/production.ini $out/etc
|
||||
echo "[DONE]: saved enterprise-ce production.ini into $out/etc"
|
||||
echo "[DONE ]: saved enterprise-ce production.ini into $out/etc"
|
||||
|
||||
cp -r rhodecode/config/rcextensions $out/etc/rcextensions.tmpl
|
||||
echo "[DONE]: saved enterprise-ce rcextensions into $out/etc/rcextensions.tmpl"
|
||||
echo "[DONE ]: saved enterprise-ce rcextensions into $out/etc/rcextensions.tmpl"
|
||||
|
||||
# python based programs need to be wrapped
|
||||
mkdir -p $out/bin
|
||||
|
|
@ -230,7 +235,7 @@ let
|
|||
ln -s ${self.pyramid}/bin/prequest $out/bin/
|
||||
ln -s ${self.pyramid}/bin/pserve $out/bin/
|
||||
|
||||
echo "[DONE]: created symlinks into $out/bin"
|
||||
echo "[DONE ]: created symlinks into $out/bin"
|
||||
DEPS="$out/bin/supervisorctl \
|
||||
$out/bin/supervisord \
|
||||
$out/bin/paster \
|
||||
|
|
@ -250,7 +255,7 @@ let
|
|||
--set PYTHONHASHSEED random
|
||||
done
|
||||
|
||||
echo "[DONE]: enterprise-ce binary wrapping"
|
||||
echo "[DONE ]: enterprise-ce binary wrapping"
|
||||
|
||||
# rhodecode-tools don't need wrapping
|
||||
ln -s ${self.rhodecode-tools}/bin/rhodecode-* $out/bin/
|
||||
|
|
|
|||
21
package.json
21
package.json
|
|
@ -9,25 +9,28 @@
|
|||
"url" : "https://code.rhodecode.com/rhodecode-enterprise-ce"
|
||||
},
|
||||
"devDependencies": {
|
||||
"appenlight-client": "git+https://git@github.com/AppEnlight/appenlight-client-js.git#0.5.1",
|
||||
"bower": "^1.8.4",
|
||||
"clipboard": "^2.0.1",
|
||||
"exports-loader": "^0.6.4",
|
||||
"favico.js": "^0.3.10",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-contrib-copy": "^1.0.0",
|
||||
"grunt-cli": "^1.3.1",
|
||||
"grunt-contrib-concat": "^0.5.1",
|
||||
"grunt-contrib-copy": "^1.0.0",
|
||||
"grunt-contrib-jshint": "^0.12.0",
|
||||
"grunt-contrib-less": "^1.1.0",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"vulcanize": "^1.16.0",
|
||||
"grunt-vulcanize": "^1.0.0",
|
||||
"node2nix": "^1.0.0",
|
||||
"jshint": "^2.9.1-rc3",
|
||||
"bower": "^1.8.4",
|
||||
"jquery": "1.11.3",
|
||||
"favico.js": "^0.3.10",
|
||||
"clipboard": "^2.0.1",
|
||||
"qrious": "^4.0.2",
|
||||
"jshint": "^2.9.1-rc3",
|
||||
"moment": "^2.18.1",
|
||||
"mousetrap": "^1.6.1",
|
||||
"qrious": "^4.0.2",
|
||||
"sticky-sidebar": "3.3.1",
|
||||
"vulcanize": "^1.16.0",
|
||||
"waypoints": "4.0.1",
|
||||
"appenlight-client": "git+https://git@github.com/AppEnlight/appenlight-client-js.git#0.5.1"
|
||||
"webpack": "4.23.1",
|
||||
"webpack-cli": "3.1.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,17 +30,17 @@ NodeJS dependencies
|
|||
Generate node-packages.nix file with all dependencies from NPM and package.json file
|
||||
This should be run before entering nix-shell.
|
||||
|
||||
The sed at the end fixex a bug with http rewrite of re-generated packages
|
||||
|
||||
.. code:: shell
|
||||
|
||||
rm -rf node_modules
|
||||
rm -rf node_modules &&
|
||||
nix-shell pkgs/shell-generate.nix --command "
|
||||
node2nix --input package.json \
|
||||
-o pkgs/node-packages.nix \
|
||||
-e pkgs/node-env.nix \
|
||||
-c pkgs/node-default.nix \
|
||||
-d --flatten --nodejs-8 "
|
||||
|
||||
# fix bug with http rewrite of re-generated packages
|
||||
-d --flatten --nodejs-8 " &&
|
||||
sed -i -e 's/http:\/\//https:\/\//g' pkgs/node-packages.nix
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue