# # spec file for package basedpyright # %define pkg_name basedpyright Name: nodejs-basedpyright Version: 1.37.4 Release: 1%{?dist} Summary: Pyright fork with various type checking improvements and pylance features License: MIT AND BSD-3-Clause AND ISC Url: https://github.com/DetachHead/basedpyright # Pre-built npm package from registry # Generated with: nodejs-packaging-bundler basedpyright # # Note: We use the pre-built npm package instead of building from source. # Building from source would require esbuild binaries for all platforms and # creating a vendored tarball with all build dependencies (npm ci). # # No bundled node_modules - the npm package contains pre-built webpack bundles # (dist/*.js) that are self-contained. Webpack generates LICENSE.txt files # (dist/*.LICENSE.txt) documenting all bundled third-party licenses, which we # include via %%license instead of a separate bundled-licenses.txt. Source0: %{pkg_name}-%{version}.tgz BuildRequires: /usr/bin/node BuildRequires: nodejs-devel BuildRequires: nodejs-packaging ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch %{?nodejs_default_filter} %description Basedpyright is a fork of pyright with various type checking improvements, pylance features and more. It is a fast type checker meant for large Python source bases. It can run in a "watch" mode and performs fast incremental updates when files are modified. %prep %setup -q -n package # Fix shebang sed -i 's#!/usr/bin/env node#!/usr/bin/node#' index.js sed -i 's#!/usr/bin/env node#!/usr/bin/node#' langserver.index.js %build # Nothing to build - using pre-built npm package %install install -d -m 0755 %{buildroot}%{nodejs_sitelib}/%{pkg_name}/ cp -pr dist index.js langserver.index.js package.json \ %{buildroot}%{nodejs_sitelib}/%{pkg_name}/ install -d -m 0755 %{buildroot}%{_bindir} ln -s %{nodejs_sitelib}/%{pkg_name}/index.js %{buildroot}%{_bindir}/%{pkg_name} ln -s %{nodejs_sitelib}/%{pkg_name}/langserver.index.js %{buildroot}%{_bindir}/%{pkg_name}-langserver %check %{__nodejs} index.js --version %files %license LICENSE.txt dist/pyright.js.LICENSE.txt dist/pyright-langserver.js.LICENSE.txt %doc README.md %{_bindir}/%{pkg_name} %{_bindir}/%{pkg_name}-langserver %dir %{nodejs_sitelib} %{nodejs_sitelib}/%{pkg_name}/ %changelog