0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-15 06:31:39 +03:00
Commit graph

75 commits

Author SHA1 Message Date
Johannes Kirschbauer
dbd0345e71
Revert "Feat/build deno package" 2025-06-17 18:01:14 +02:00
aMOPel
32a9eaae70 doc: added more info and fixed a bug 2025-06-06 07:51:39 +02:00
aMOPel
9db1e30da8 fix for the readme cli build test 2025-06-05 15:01:33 +02:00
aMOPel
9dae270449 minor fixes 2025-06-05 13:56:08 +02:00
aMOPel
02b2beed9e added test case and improved api 2025-06-03 17:39:55 +02:00
aMOPel
2335220e54 nits 2025-06-03 12:49:35 +02:00
aMOPel
2857128ddd doc: refactored argument documention by using definition lists 2025-06-03 12:40:50 +02:00
aMOPel
c88d10c806 Update doc/languages-frameworks/javascript.section.md
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2025-06-03 12:40:50 +02:00
aMOPel
0ffa7b88a2 Update doc/languages-frameworks/javascript.section.md
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2025-06-03 12:40:50 +02:00
aMOPel
287b94f279 Update doc/languages-frameworks/javascript.section.md
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2025-06-03 12:40:50 +02:00
aMOPel
d1e5782bba Update doc/languages-frameworks/javascript.section.md
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2025-06-03 12:40:50 +02:00
aMOPel
486c503430 doc: added docs for buildDenoPackage 2025-06-03 12:39:39 +02:00
Niklas Hambüchen
ee6c2bd2eb doc: Fix missing pre/post hooks everywhere 2025-05-24 13:22:41 +00:00
adisbladis
4166518a86
doc/importNpmLock.buildNodeModules: Add note regarding package-lock-only (#393699) 2025-05-02 20:50:31 +02:00
Florian Klink
b25eeeb6d8 doc: document Yarn v3/v4 infrastructure
Move the existing `yarnConfigHook`, `yarnBuildHook` and
`yarnInstallHook` documentation below a Yarn v1 section.

Also move the documentation for the deprecated `yarn2nix` there, which
is Yarn v1 only.

Co-Authored-By: Yureka <yureka@cyberchaos.dev>
2025-04-23 17:25:20 +03:00
Pol Dellaiera
3218a4204f doc: do not reuse pname 2025-04-21 07:02:49 +02:00
Pol Dellaiera
ac04a5c492 doc: replace rev with tag 2025-04-21 07:02:49 +02:00
Pol Dellaiera
b4515ff6c2 doc: use finalAttrs pattern 2025-04-21 07:02:49 +02:00
Pol Dellaiera
47f000d991 doc: add missing phase hooks 2025-04-21 07:02:49 +02:00
Pol Dellaiera
540ddbcf2f doc: use writableTmpDirAsHomeHook 2025-04-21 07:02:46 +02:00
Pol Dellaiera
bcea0cf344 doc: update Nix code snippets format
Command: `mdcr --config doc/tests/mdcr-config.toml doc/`
2025-04-17 01:30:34 +02:00
Pol Dellaiera
5d979e79ce doc: fix various nix snippets 2025-04-17 01:30:34 +02:00
Winter
a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00
Pol Dellaiera
65a333600d treewide: replace rev with tag 2025-04-07 16:57:22 +02:00
adisbladis
6900384c1b doc/importNpmLock.buildNodeModules: Add note regarding package-lock-only
When using `buildNodeModules` to create `node_modules` commands like `npm install` & `npm add` that writes packages & executables needs to be used with `--package-lock-only`.
2025-03-28 11:12:15 +01:00
Pyrox
09cec0f560
pnpm.fetchDeps: pnpmWorkspace -> pnpmWorkspaces 2024-10-24 15:37:30 -04:00
lelgenio
ab4dc6ca78 doc/javascript: fix example usage of yarn hooks 2024-09-28 20:07:11 -03:00
Johannes Kirschbauer
71f01ce1fc
Doc/importNpmLock: general improvements (#340019)
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2024-09-07 07:59:02 +02:00
lelgenio
7783e118af yarnInstallHook: init 2024-09-04 11:15:47 -03:00
adisbladis
9c7ff7277c
importNpmLock.buildNodeModules: init
`importNpmLock.buildNodeModules` returns a derivation with a pre-built `node_modules` directory, as imported by `importNpmLock`.
This is to be used together with `importNpmLock.hooks.linkNodeModulesHook` to facilitate `nix-shell`/`nix develop` based development workflows:

```nix
pkgs.mkShell {
  packages = [
    importNpmLock.hooks.linkNodeModulesHook
    nodejs
  ];

  npmDeps = importNpmLock.buildNodeModules {
    npmRoot = ./.;
    inherit nodejs;
  };
}
```
will create a development shell where a `node_modules` directory is created & packages symlinked to the Nix store when activated.

This code is adapted from https://github.com/adisbladis/buildNodeModules
2024-08-29 06:12:07 -07:00
Pyrox
875c9f044f pnpm.fetchDeps: Add workspaces support and support for custom pnpm configuration commands
Solves #316908
2024-08-05 18:36:54 +03:00
Peder Bergebakken Sundt
99dec1f6b0 treewide: fix doc typos
Done with `fd \\\.md$ . --type f -x typos --write-changes`
2024-07-26 00:55:13 +02:00
Alexis Hildebrandt
ab42ca141a doc: Remove indefinite article and ending period from example meta.description
so that meta.description examples shown in the documentation
align with recommendations given in the "Meta attributes" section
in pkgs/README.md.

The changes were made with the following commands:
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*"([Aa]n?|[Tt]he)\s' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/"([Aa]n?|[Tt]he)\s(.)/"\U\2/'
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*".*\."' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/\."/"/'
2024-07-20 09:18:42 +02:00
Doron Behar
ee7cfec5aa doc/javascript: document yarn{Config,Build}Hook 2024-07-10 09:39:03 +03:00
Doron Behar
c704c02956 doc/javascript: pnpm: mention lack of monorepos/workspaces support 2024-06-03 17:09:22 +03:00
Sefa Eyeoglu
74f5ff78bf
pnpm.fetchDeps: init
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-06-02 19:56:11 +02:00
Eli Flanagan
693c7d91c9
doc: lowercase npm name
npm, Inc documentation asks to use lowercase. Their documentation also has consistent lowercase usage. e.g. <https://docs.npmjs.com/about-npm>
2024-03-29 11:10:49 -04:00
Janne Heß
fcc95ff817 treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
2024-03-28 09:28:12 +01:00
Eli Flanagan
f6b397eed0
doc: improve javascript conventions (#298127)
I created newlines per the <https://github.com/NixOS/nixpkgs/blob/master/doc/README.md#documentation-conventions> guide.

This paves the way for future contributions to not be distracted by expected conventions.
2024-03-22 14:36:09 -07:00
Doron Behar
290c16532c doc/mkYarnPackage: document better distPhase and doDist 2024-03-18 11:29:47 +02:00
adisbladis
434df3c94b
Merge pull request #289231 from adisbladis/fetchnpmlock
importNpmLock: init
2024-03-08 15:14:37 +13:00
Anderson Torres
e671d3bbbd Nix docs: remove with lib; from example code
Following [Best Practices](https://nix.dev/guides/best-practices#with-scopes),
`with` is a problematic language construction and should be avoided.

Usually it is employed like a "factorization": `[ X.A X.B X.C X.D ]` is written
`with X; [ A B C D ]`.

However, as shown in the link above, the syntatical rules of `with` are not so
intuitive, and this "distributive rule" is very selective, in the sense that
`with X; [ A B C D ]` is not equivalent to `[ X.A X.B X.C X.D ]`.

However, this factorization is still useful to "squeeze" some code, especially
in lists like `meta.maintainers`.

On the other hand, it becomes less justifiable in bigger scopes. This is
especially true in cases like `with lib;` in the top of expression and in sets
like `meta = with lib; { . . . }`.

That being said, this patch removes most of example code in the current
documentation.

The exceptions are, for now
- doc/functions/generators.section.md
- doc/languages-frameworks/coq.section.md

because, well, they are way more complicated, and I couldn't parse them
mentally - yet another reason why `with` should be avoided!
2024-03-06 11:40:09 -03:00
adisbladis
b6e4b86809 importNpmLock: init
This is an alternative to `fetchNpmDeps` that is notably different in that it uses metadata from `package.json` & `package-lock.json` instead of specifying a fixed-output hash.

Notable features:
- IFD free.
- Only fetches a node dependency once. No massive FODs.
- Support for URL, Git and path dependencies.
- Uses most of the existing `npmHooks`

`importNpmLock` can be used _only_ in the cases where we need to check in a `package-lock.json` in the tree.
Currently this means that we have 13 packages that would be candidates to use this function, though I expect most usage to be in private repositories.

This is upstreaming the builder portion of https://github.com/adisbladis/buildNodeModules into nixpkgs (different naming but the code is the same).
I will archive this repository and consider nixpkgs the new upstream once it's been merged.

For more explanations and rationale see https://discourse.nixos.org/t/buildnodemodules-the-dumbest-node-to-nix-packaging-tool-yet/35733

Example usage:
``` nix
stdenv.mkDerivation {
  pname = "my-nodejs-app";
  version = "0.1.0";

  src = ./.;

  nativeBuildInputs = [
    importNpmLock.hooks.npmConfigHook
    nodejs
    nodejs.passthru.python # for node-gyp
    npmHooks.npmBuildHook
    npmHooks.npmInstallHook
  ];

  npmDeps = buildNodeModules.fetchNodeModules {
    npmRoot = ./.;
  };
}
```
2024-03-05 12:23:28 +13:00
Midnight Veil
c1678c2567
doc: mkYarnPackage/mkYarnModules should use offlineCache to prevent IFD
This is not mentioned elsewhere, and can be confusing.
2023-12-09 17:54:22 +11:00
happysalada
7fb490674f buildNpmPackage: allow passing npmDeps 2023-11-16 11:57:48 +00:00
Fabian
cfd0999b5a
docs/javascript/introduction: fix GitHub search link 2023-11-12 19:32:37 +01:00
Yt
5aaeafbe26
buildNpmPackage: make nodejs overridable (#265171)
* buildNpmPackage: allow nodejs to be passed as argument

* Update doc/languages-frameworks/javascript.section.md

Co-authored-by: Lily Foster <lily@lily.flowers>

---------

Co-authored-by: Lily Foster <lily@lily.flowers>
2023-11-09 16:19:24 +00:00
Doron Behar
fc96f6d0fd buildNpmPackage: support makeWrapperArgs 2023-10-07 14:09:05 +03:00
Doron Behar
d6521ce186 docs/javascript/buildNpmPackage: Document fetchNpmDeps
Co-authored-by: Lily Foster <lily@lily.flowers>
2023-10-07 14:09:05 +03:00
Doron Behar
384b1e5b91 docs/javascript/buildNpmPackage: Document bin, man and npm pack behavior 2023-10-07 14:09:05 +03:00