Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
codimd: build with nodejs-8_x
Browse files Browse the repository at this point in the history
This diff regenerates the package sets for `codimd` and `codemirror`
using NodeJS 8 to get rid of the deprecated[1] `nodejs-6_x`.

Additionally the following issues had to be fixed during the update:

* The package `js-sequence-diagram` has been removed from the NPM
  registry and was replaced by a security holding package[2]. The
  package was published by a third-party (upstream only supports bower
  builds), so it's unclear whether the package will re-appear[3].

  As the tarballs still exist (and the hash didn't change), the package
  will be loaded manually into the build env.

* For the babel-related packages, `dontNpmInstall` will be set for
  `node2nix` installs as some of those packages bundle a
  `package-lock.json` that triggers `ENOTCACHED` errors for optional
  dependencies[4].

For now it should be sufficient to use NodeJS 8 (`codimd` v1.2.x doesn't
support NodeJS 10), in the long term we probably want to use `yarn2nix`
here with NodeJS 10. This is much rather a fix to get rid of another
NodeJS 6 dependency.

[1] `nodejs-6_x` is about to be deprecated, see #58976
[2] https://www.npmjs.com/package/js-sequence-diagrams,
    https://github.com/npm/security-holder
[3] bramp/js-sequence-diagrams#212
[4] svanderburg/node2nix#134
  • Loading branch information
Ma27 committed Apr 7, 2019
1 parent 7bff738 commit 5feec42
Show file tree
Hide file tree
Showing 10 changed files with 3,104 additions and 2,338 deletions.
4 changes: 2 additions & 2 deletions pkgs/servers/web-apps/codimd/CodeMirror/default.nix
@@ -1,4 +1,4 @@
{ stdenv, pkgs, buildEnv, fetchFromGitHub, nodejs-6_x, phantomjs2, which }:
{ stdenv, pkgs, buildEnv, fetchFromGitHub, nodejs-8_x, phantomjs2, which }:

let
nodePackages = import ./node.nix {
Expand All @@ -22,7 +22,7 @@ stdenv.mkDerivation {
};

nativeBuildInputs = [ which ];
buildInputs = [ nodejs-6_x phantomjs-prebuilt ] ++ (stdenv.lib.attrVals [
buildInputs = [ nodejs-8_x phantomjs-prebuilt ] ++ (stdenv.lib.attrVals [
"blint-^1"
"node-static-0.6.0"
"rollup-^0.41.0"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/web-apps/codimd/CodeMirror/generate.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix

node2nix -6 -i deps.json \
node2nix -8 -i deps.json \
-e ../../../../development/node-packages/node-env.nix \
--no-copy-node-env \
-c node.nix

0 comments on commit 5feec42

Please sign in to comment.