git.iko.soy/typeable/nixpkgs
on master help sign in
Change to nodePackages and nodePackages_latest

currently LTS 12.x and Current 14.x

commit2312f5fbc4a5031450f575a860a6c38dd35a47e9 authorChristian Albrecht <christian.albrecht@mayflower.de> dateFri 29 May 2020, 18:25 (6 years ago) parent8a03e80
2 files changed+14−17
doc/languages-frameworks/node.section.md+9−10 pkgs/top-level/all-packages.nix+5−7
doc/languages-frameworks/node.section.md+9−10
@@ -12,10 +12,9 @@ When it is desired to use NPM libraries in a development project, use the
1212`node2nix` generator directly on the `package.json` configuration file of the
1313project.
1414
15−The package set also provides support for multiple Node.js versions. The policy
16−is that a new package should be added to the collection for the latest stable LTS
17−release (which is currently 10.x), unless there is an explicit reason to support
18−a different release.
15+The package set provides support for the official stable Node.js versions.
16+The latest stable LTS release in `nodePackages`, as well as the latest stable
17+Current release in `nodePackages_latest`.
1918
2019If your package uses native addons, you need to examine what kind of native
2120build system it uses. Here are some examples:
@@ -26,7 +25,7 @@ build system it uses. Here are some examples:
2625
2726After you have identified the correct system, you need to override your package
2827expression while adding in build system as a build input. For example, `dat`
29−requires `node-gyp-build`, so we override its expression in `default-v12.nix`:
28+requires `node-gyp-build`, so we override its expression in `default.nix`:
3029
3130```nix
3231dat = nodePackages.dat.override (oldAttrs: {
@@ -36,14 +35,14 @@ dat = nodePackages.dat.override (oldAttrs: {
3635
3736To add a package from NPM to nixpkgs:
3837
39− 1. Modify `pkgs/development/node-packages/node-packages-v12.json` to add, update
40− or remove package entries. (Or `pkgs/development/node-packages/node-packages-v8.json`
41− for packages depending on Node.js 8.x)
38+ 1. Modify `pkgs/development/node-packages/node-packages.json` to add, update
39+ or remove package entries to have it included in `nodePackages` and
40+ `nodePackages_latest`.
4241 2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`.
4342 3. Build your new package to test your changes:
4443 `cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
45− To build against a specific Node.js version (e.g. 12.x):
46− `nix-build -A nodePackages_12_x.<new-or-updated-package>`
44+ To build against the latest stable Current Node.js version (e.g. 14.x):
45+ `nix-build -A nodePackages_latest.<new-or-updated-package>`
4746 4. Add and commit all modified and generated files.
4847
4948For more information about the generation process, consult the
pkgs/top-level/all-packages.nix+5−7
@@ -4827,7 +4827,7 @@ in
48274827
48284828 nodejs = hiPrio nodejs-12_x;
48294829
4830− nodejs-slim = nodejs-slim-10_x;
4830+ nodejs-slim = nodejs-slim-12_x;
48314831
48324832
48334833 nodejs-10_x = callPackage ../development/web/nodejs/v10.nix { };
@@ -4851,16 +4851,14 @@ in
48514851 nodejs_latest = nodejs-14_x;
48524852 nodejs-slim_latest = nodejs-slim-14_x;
48534853
4854− nodePackages_13_x = dontRecurseIntoAttrs (callPackage ../development/node-packages/default-v13.nix {
4855− nodejs = pkgs.nodejs-13_x;
4854+ nodePackages_latest = dontRecurseIntoAttrs (callPackage ../development/node-packages/default.nix {
4855+ nodejs = pkgs.nodejs_latest;
48564856 });
48574857
4858− nodePackages_12_x = dontRecurseIntoAttrs (callPackage ../development/node-packages/default-v12.nix {
4859− nodejs = pkgs.nodejs-12_x;
4858+ nodePackages = dontRecurseIntoAttrs (callPackage ../development/node-packages/default.nix {
4859+ nodejs = pkgs.nodejs;
48604860 });
48614861
4862− nodePackages = nodePackages_12_x;
4863−
48644862 now-cli = callPackage ../development/web/now-cli {};
48654863
48664864 file-rename = callPackage ../tools/filesystems/file-rename { };