!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

208 Members
60 Servers

Load older messages


SenderMessageTime
1 Dec 2023
@tensor5:matrix.orgNicola Squartini joined the room.14:38:39
@tensor5:matrix.orgNicola Squartini

Can someone help with this

mkYarnPackage {
  src = fetchFromGitHub {
    owner = "salesforcecli";
    repo = "cli";
    rev = "2.17.14";
    hash = "sha256-lliHmc/LJCEkZcxBdnSAqpYpnz7R/g6Q2Oi7hIB04B4=";
  };

  buildPhase = ''
    runHook preBuild
    yarn --offline build
    runHook postBuild
  '';

  postBuild = "npm prune --omit=dev";

  doDist = false;
}

the problem I'm trying to solve is pruning devDependencies

14:41:29
@kranzes:matrix.org@kranzes:matrix.orgWhy are you modifying the buildPhase14:42:38
@tensor5:matrix.orgNicola Squartini

Why are you modifying the buildPhase

if I remove that

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/nix/store/45wvk1m5j03v8la99fw7pilyh79yyvaf-salesforce-cli-2.17.14/libexec/@salesforce/cli/deps/@salesforce/cli/dist/flags.js' imported from /nix/store/45wvk1m5j03v8la99fw7pilyh79yyvaf-salesforce-cli-2.17.14/libexec/@salesforce/cli/deps/@salesforce/cli/bin/run.js

mkYarnPackage doesn't have a default build phase

14:47:51
@lily:lily.flowersLily Foster
In reply to @tensor5:matrix.org

Can someone help with this

mkYarnPackage {
  src = fetchFromGitHub {
    owner = "salesforcecli";
    repo = "cli";
    rev = "2.17.14";
    hash = "sha256-lliHmc/LJCEkZcxBdnSAqpYpnz7R/g6Q2Oi7hIB04B4=";
  };

  buildPhase = ''
    runHook preBuild
    yarn --offline build
    runHook postBuild
  '';

  postBuild = "npm prune --omit=dev";

  doDist = false;
}

the problem I'm trying to solve is pruning devDependencies

just use yarn install --offline --frozen-lockfile --ignore-engines rather than trying to yarn build and then using npm
16:06:03
@lily:lily.flowersLily Foster
In reply to @tensor5:matrix.org

Can someone help with this

mkYarnPackage {
  src = fetchFromGitHub {
    owner = "salesforcecli";
    repo = "cli";
    rev = "2.17.14";
    hash = "sha256-lliHmc/LJCEkZcxBdnSAqpYpnz7R/g6Q2Oi7hIB04B4=";
  };

  buildPhase = ''
    runHook preBuild
    yarn --offline build
    runHook postBuild
  '';

  postBuild = "npm prune --omit=dev";

  doDist = false;
}

the problem I'm trying to solve is pruning devDependencies

* just use yarn install --offline --frozen-lockfile --ignore-engines rather than trying to yarn build + npm prune
16:06:12
@tensor5:matrix.orgNicola Squartini
In reply to @lily:lily.flowers
just use yarn install --offline --frozen-lockfile --ignore-engines rather than trying to yarn build and then using npm

no luck

[] 0/1376error Can't make a request in offline mode ("https://registry.yarnpkg.com/got/-/got-11.8.6.tgz")
18:31:58
@lily:lily.flowersLily Foster
In reply to @tensor5:matrix.org

no luck

[] 0/1376error Can't make a request in offline mode ("https://registry.yarnpkg.com/got/-/got-11.8.6.tgz")
ugh yarn2nix makes me sad. i'll look at the yarn2nix code in a bit and get back to you
18:44:33
3 Dec 2023
@ThorHop:matrix.org@ThorHop:matrix.org changed their display name from hopland (valorent vicky) to hopland (meticulous montesquieu).14:08:31
5 Dec 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.00:38:02
8 Dec 2023
@fwam:karp.lolfwam left the room.06:53:36
10 Dec 2023
@emma:conduit.rory.gayEmma [it/its] ⚡️i wonder if theres a better way to do package nodejs apps...19:59:02
@emma:conduit.rory.gayEmma [it/its] ⚡️ https://github.com/spacebarchat/server/blob/dev/nix/flake.nix#L24-L57 19:59:31
@lily:lily.flowersLily Foster
In reply to @emma:conduit.rory.gay
https://github.com/spacebarchat/server/blob/dev/nix/flake.nix#L24-L57
they could have specified a good chunk of that in the package.json and let the default install behavior still run for buildNpmPackage. Then a postInstall hook would have been much shorter
20:01:27
@emma:conduit.rory.gayEmma [it/its] ⚡️i wrote that20:01:42
@emma:conduit.rory.gayEmma [it/its] ⚡️hence why im asking for what i could improve20:01:53
@emma:conduit.rory.gayEmma [it/its] ⚡️ https://github.com/spacebarchat/server/blob/dev/nix/package.json#L113 20:02:18
@lily:lily.flowersLily Fosterah! i'll give specifics then, apologies. one moment, i only just got my laptop out20:05:17
@emma:conduit.rory.gayEmma [it/its] ⚡️yeah, i'd love to ditch all of that mess and go back to normal nodejs behavior20:05:38
@lily:lily.flowersLily Foster quick question, is it critical to keep stuff not in the normal npm directory in $out? because this could be even shorter if so 20:06:15
@emma:conduit.rory.gayEmma [it/its] ⚡️not at all20:06:26
@lily:lily.flowersLily Foster (normal being $out/lib/node_modules/[package name]) 20:06:30
@emma:conduit.rory.gayEmma [it/its] ⚡️wait, how do you mean20:06:48
@lily:lily.flowersLily Foster like, the files here aren't getting install like npm install -g would do rn. which is fine, it would just involve moving things to the unexpected place in postInstall 20:07:25
@emma:conduit.rory.gayEmma [it/its] ⚡️i wrote all of that mess due to a bunch of imports cross-referencing projects20:08:22
@emma:conduit.rory.gayEmma [it/its] ⚡️ https://github.com/spacebarchat/server/blob/master/package.json 20:08:40
@emma:conduit.rory.gayEmma [it/its] ⚡️this is the non-nix package.json im using as base, by the way20:08:49
@lily:lily.flowersLily Foster
In reply to @emma:conduit.rory.gay
i wrote all of that mess due to a bunch of imports cross-referencing projects
yeah i'm seeing that
20:09:10
@emma:conduit.rory.gayEmma [it/its] ⚡️ Lily Foster i was browsing WebStorm settings... 20:36:47
@emma:conduit.rory.gayEmma [it/its] ⚡️ I wonder if Use paths relative to project, resource or sources roots is a good option to turn on? 20:37:02

Show newer messages


Back to Room ListRoom Version: 6