Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular-language-server: init at 18.2.0 #343326

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bornedj
Copy link

@bornedj bornedj commented Sep 20, 2024

Description of changes

Adds the angular language server for neovim, emacs, and eclipse users managing their own lsps via extraPackages.

homepage: https://github.com/angular/vscode-ng-language-service#readme

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@lelgenio
Copy link
Contributor

Thanks for your first contribution!

It's a general consensus on nixpkgs to no longer add packages to nodePackages, and instead prefer to add them as standalone packages: #229475
I thinks this should be better communicated....

angular/language-server is packaged with yarn, I assume you could use the newly added yarn-specific hooks to package it: https://nixos.org/manual/nixpkgs/unstable/#javascript-yarn

@bornedj
Copy link
Author

bornedj commented Sep 27, 2024

  1. My bad I wasn't aware of that decision and was following the documentation here. Would it be useful to open a documentation PR to add a reference to issue Repackage node2nix generated packages using buildNpmPackage #229475 within the language-frameworks javascript section?

  2. I would be happy to package it via yarn. Would you prefer that I do that on another branch and PR and make reference to this one, or would it be better to revert my commit and continuing working on the same branch/PR?

@SuperSandro2000
Copy link
Member

2. Would you prefer that I do that on another branch and PR and make reference to this one

that would be fine

or would it be better to revert my commit and continuing working on the same branch/PR?

You can continue this PR but it must be force pushed. We want a cleanish history.

@lelgenio
Copy link
Contributor

  1. My bad I wasn't aware of that decision and was following the documentation here. Would it be useful to open a documentation PR to add a reference to issue

Ref: #319341

@bornedj bornedj closed this Sep 28, 2024
@bornedj bornedj changed the title nodePackages.@angular/language-server: init at 18.2.0 angular-language-server: init at 18.2.0 Sep 28, 2024
@bornedj
Copy link
Author

bornedj commented Sep 28, 2024

Reopening PR as it's been packaged as a derivation with mkYarnPackage.

Comment on lines +43 to +42
buildPhase = ''
runHook preBuild

tsc -b && yarn bazel build :npm

runHook postBuild
'';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
buildPhase = ''
runHook preBuild
tsc -b && yarn bazel build :npm
runHook postBuild
'';
yarnBuildScript = "compile";

https://github.com/angular/vscode-ng-language-service/blob/1e4c92c156c0f1cdd2c9510000a6f41f070dd123/package.json#L224C6-L224C13

Assuming this would work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oddly, using the yarnBuildHook and package.json script directly results in yarn attempting to install bazel on my machine. Explicitly doing the command instead of the equivalent script does not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because bazel isn't even run:

/nix/store/91d27rjqlhkzx7mhzxrir1jcr40nyc7p-stdenv-linux/setup: line 1709: tsc: command not found

Comment on lines +34 to +29
yarnConfigHook
yarnInstallHook
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
yarnConfigHook
yarnInstallHook
yarnConfigHook
yarnBuildHook
yarnInstallHook

pkgs/by-name/an/angular-language-server/package.nix Outdated Show resolved Hide resolved
'';

meta = {
description = "Lsp for angular completions, AOT diagnostic, quick info and go to definitions";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "Lsp for angular completions, AOT diagnostic, quick info and go to definitions";
description = "LSP for angular completions, AOT diagnostic, quick info and go to definitions";

Comment on lines +43 to +42
buildPhase = ''
runHook preBuild

tsc -b && yarn bazel build :npm

runHook postBuild
'';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because bazel isn't even run:

/nix/store/91d27rjqlhkzx7mhzxrir1jcr40nyc7p-stdenv-linux/setup: line 1709: tsc: command not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants