diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 76db9d0007ce..80d61816acb4 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -375,8 +375,74 @@ Assuming the following directory structure, we can define `sourceRoot` and `pnpm pnpmRoot = "frontend"; ``` +### Yarn {#javascript-yarn} + +Yarn based projects use a `yarn.lock` file instead of a `package-lock.json` to pin dependencies. Nixpkgs provides the Nix function `fetchYarnDeps` which fetches an offline cache suitable for running `yarn install` before building the project. In addition, Nixpkgs provides the hooks: + +- `yarnConfigHook`: Fetches the dependencies from the offline cache and installs them into `node_modules`. +- `yarnBuildHook`: Runs `yarn build` or a specified `yarn` command that builds the project. + +An example usage of the above attributes is: + +```nix +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + nodejs, + npmHooks, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "..."; + version = "..."; + + src = fetchFromGitHub { + owner = "..."; + repo = "..."; + rev = "v${finalAttrs.version}"; + hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; + }; + + yarnOfflineCache = fetchYarnDeps { + yarnLock = finalAttrs.src + "/yarn.lock"; + hash = "sha256-mo8urQaWIHu33+r0Y7mL9mJ/aSe/5CihuIetTeDHEUQ="; + }; + + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + # Needed for executing package.json scripts + nodejs + npmHooks.npmInstallHook + ]; + + meta = { + # ... + }; +}) +``` + +Note that there is no setup hook for installing yarn based packages - `npmHooks.npmInstallHook` should fit most cases, but sometimes you may need to override the `installPhase` completely. + +#### `yarnConfigHook` arguments {#javascript-yarnconfighook} + +By default, `yarnConfigHook` relies upon the attribute `${yarnOfflineCache}` (or `${offlineCache}` if the former is not set) to find the location of the offline cache produced by `fetchYarnDeps`. To disable this phase, you can set `dontYarnInstallDeps = true` or override the `configurePhase`. + +#### `yarnBuildHook` arguments {#javascript-yarnbuildhook} + +This script by default runs `yarn --offline build`, and it relies upon the project's dependencies installed at `node_modules`. Below is a list of additional `mkDerivation` arguments read by this hook: + +- `yarnBuildScript`: Sets a different `yarn --offline` subcommand (defaults to `build`). +- `yarnBuildFlags`: Single string list of additional flags to pass the above command, or a Nix list of such additional flags. + ### yarn2nix {#javascript-yarn2nix} +WARNING: The `yarn2nix` functions have been deprecated in favor of the new `yarnConfigHook` and `yarnBuildHook`. Documentation for them still appears here for the sake of the packages that still use them. See also a tracking issue [#324246](https://github.com/NixOS/nixpkgs/issues/324246). + #### Preparation {#javascript-yarn2nix-preparation} You will need at least a `yarn.lock` file. If upstream does not have one you need to generate it and reference it in your package definition. diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index a28ae62468c0..b518761a6991 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -218,6 +218,8 @@ - `security.pam.u2f` now follows RFC42. All module options are now settable through the freeform `.settings`. +- The hooks `yarnConfigHook` and `yarnBuildHook` were added. These should replace `yarn2nix.mkYarnPackage` and other `yarn2nix` related tools. The motivation to get rid of `yarn2nix` tools is the fact that they are too complex and hard to maintain, and they rely upon too much Nix evaluation which is problematic if import-from-derivation is not allowed (see more details at [#296856](https://github.com/NixOS/nixpkgs/issues/296856). The transition from `mkYarnPackage` to `yarn{Config,Build}Hook` is tracked at [#324246](https://github.com/NixOS/nixpkgs/issues/324246). + - Cinnamon has been updated to 6.2. - Following Mint 22 defaults, the Cinnamon module no longer ships geary and hexchat by default. - Nemo is now built with gtk-layer-shell support, note that for now it will be expected to see nemo-desktop diff --git a/pkgs/applications/file-managers/xplorer/default.nix b/pkgs/applications/file-managers/xplorer/default.nix index 027c051fef79..9c3a04e8dde3 100644 --- a/pkgs/applications/file-managers/xplorer/default.nix +++ b/pkgs/applications/file-managers/xplorer/default.nix @@ -6,7 +6,10 @@ , freetype , gtk3 , libsoup -, mkYarnPackage +, stdenvNoCC +, yarnConfigHook +, yarnBuildHook +, nodejs , openssl , pkg-config , rustPlatform @@ -25,7 +28,7 @@ let sha256 = "sha256-VFRdkSfe2mERaYYtZlg9dvH1loGWVBGwiTRj4AoNEAo="; }; - frontend-build = mkYarnPackage { + frontend-build = stdenvNoCC.mkDerivation (finalAttrs: { inherit version src; pname = "xplorer-ui"; @@ -33,19 +36,16 @@ let yarnLock = src + "/yarn.lock"; sha256 = "sha256-H37vD0GTSsWV5UH7C6UANDWnExTGh8yqajLn3y7P2T8="; }; - - packageJSON = ./package.json; - - buildPhase = '' - export HOME=$(mktemp -d) - yarn --offline run prebuild - - cp -r deps/xplorer/out $out + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + ]; + yarnBuildScript = "prebuild"; + installPhase = '' + cp -r out $out ''; - - distPhase = "true"; - dontInstall = true; - }; + }); in rustPlatform.buildRustPackage { diff --git a/pkgs/applications/file-managers/xplorer/package.json b/pkgs/applications/file-managers/xplorer/package.json deleted file mode 100644 index fd381eb347d9..000000000000 --- a/pkgs/applications/file-managers/xplorer/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "xplorer", - "description": "Xplorer, a customizable, modern file manager", - "version": "0.3.1", - "author": "Justin Maximillian Kimlim ", - "icon": "build/icon.icns", - "private": true, - "homepage": "https://xplorer.space", - "repository": { - "type": "git", - "url": "https://github.com/kimlimjustin/xplorer.git" - }, - "os": ["darwin", "win32", "linux"], - "scripts": { - "start": "yarn dev", - "web": "concurrently \"cd api/web && cargo run\" \"live-server ./out/src --no-browser\"", - "dev": "yarn compile && concurrently --kill-others \"yarn compile:watch\" \"yarn sass:watch\" \"yarn web\" \"tauri dev\"", - "clean": "rimraf out", - "sass": "sass src/Public/style.scss out/src/Public/style.css", - "sass:watch": "node scripts/sass-watcher.js", - "docs": "yarn --cwd ./docs start", - "pretest": "yarn compile", - "test": "jest", - "copyfiles": "node scripts/copyfiles", - "compile": "webpack && yarn sass && yarn copyfiles", - "compile:watch": "webpack --watch", - "crowdin": "crowdin", - "crowdin:pull": "crowdin pull", - "postcrowdin:pull": "node scripts/post_crowdin_pull.js", - "crowdin:sync": "yarn --cwd ./docs write-translations && crowdin upload && crowdin download", - "lint": "eslint -c .eslintrc.yml --ext .ts ./src", - "prettier": "prettier --write src", - "grunt": "grunt", - "css:minify": "cleancss --batch --batch-suffix \"\" out/**/*.css ", - "prebuild": "yarn compile && yarn grunt && yarn css:minify", - "build": "tauri build", - "postinstall": "husky install", - "fakefiles": "python scripts/generate-fake-files.py 1000" - }, - "workspaces": ["packages/*"], - "keywords": [ - "Xplorer", - "File explorer", - "File", - "File manager", - "Folders", - "Directory" - ], - "license": "Apache-2.0", - "devDependencies": { - "@crowdin/cli": "^3.6.5", - "@tauri-apps/cli": "^1.1.1", - "@types/jest": "^27.0.2", - "@types/marked": "^4.0.1", - "@typescript-eslint/eslint-plugin": "^5.4.0", - "@typescript-eslint/parser": "^5.4.0", - "buffer": "^6.0.3", - "clean-css-cli": "^5.3.3", - "concurrently": "^6.2.1", - "cpy": "^8.1.2", - "eslint": "^8.2.0", - "grunt": "^1.4.1", - "grunt-cli": "^1.4.3", - "grunt-contrib-uglify": "^5.0.1", - "grunt-contrib-watch": "^1.1.0", - "husky": "^7.0.2", - "jest": "^27.1.0", - "live-server": "^1.2.1", - "node-watch": "^0.7.1", - "postinstall-postinstall": "^2.1.0", - "prettier": "2.5.1", - "rimraf": "^3.0.2", - "sass": "1.45.2", - "ts-jest": "^27.0.7", - "ts-loader": "^9.2.6", - "typescript": "^4.4.2", - "webpack": "^5.58.2", - "webpack-cli": "^4.9.0" - }, - "dependencies": { - "@tauri-apps/api": "^1.1.0", - "highlight.js": "^11.2.0", - "mammoth": "^1.4.18", - "marked": "^4.0.15", - "xlsx": "^0.17.1" - }, - "optionalDependencies": {} -} diff --git a/pkgs/applications/misc/kuro/default.nix b/pkgs/applications/misc/kuro/default.nix index 55a2e04c9326..02911f312122 100644 --- a/pkgs/applications/misc/kuro/default.nix +++ b/pkgs/applications/misc/kuro/default.nix @@ -1,17 +1,20 @@ { lib +, stdenv , fetchFromGitHub , fetchYarnDeps +, yarnConfigHook +, yarnBuildHook +, nodejs , makeWrapper , makeDesktopItem , copyDesktopItems -, mkYarnPackage , electron_29 }: let electron = electron_29; in -mkYarnPackage rec { +stdenv.mkDerivation rec { pname = "kuro"; version = "9.0.0"; @@ -22,8 +25,6 @@ mkYarnPackage rec { hash = "sha256-9Z/r5T5ZI5aBghHmwiJcft/x/wTRzDlbIupujN2RFfU="; }; - packageJSON = ./package.json; - offlineCache = fetchYarnDeps { yarnLock = "${src}/yarn.lock"; hash = "sha256-GTiNv7u1QK/wjQgpka7REuoLn2wjZG59kYJQaZZPycI="; @@ -32,30 +33,29 @@ mkYarnPackage rec { env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs makeWrapper copyDesktopItems ]; - postBuild = '' - pushd deps/kuro - - yarn --offline run electron-builder \ - --dir \ - -c.electronDist=${electron}/libexec/electron \ - -c.electronVersion=${electron.version} - - popd - ''; + yarnBuildScript = "electron-builder"; + yarnBuildFlags = [ + "--dir" + "-c.electronDist=${electron}/libexec/electron" + "-c.electronVersion=${electron.version}" + ]; installPhase = '' runHook preInstall # resources mkdir -p "$out/share/lib/kuro" - cp -r ./deps/kuro/dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/kuro" + cp -r ./dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/kuro" # icons - install -Dm644 ./deps/kuro/static/Icon.png $out/share/icons/hicolor/1024x1024/apps/kuro.png + install -Dm644 ./static/Icon.png $out/share/icons/hicolor/1024x1024/apps/kuro.png # executable wrapper makeWrapper '${electron}/bin/electron' "$out/bin/kuro" \ @@ -65,9 +65,6 @@ mkYarnPackage rec { runHook postInstall ''; - # Do not attempt generating a tarball for contents again. - # note: `doDist = false;` does not work. - distPhase = "true"; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/applications/misc/kuro/package.json b/pkgs/applications/misc/kuro/package.json deleted file mode 100644 index 0ae2f22c08db..000000000000 --- a/pkgs/applications/misc/kuro/package.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "name": "kuro", - "productName": "Kuro", - "version": "9.0.0", - "description": "Elegant Microsoft To-Do desktop app (Ao fork)", - "license": "MIT", - "repository": "davidsmorais/kuro", - "author": { - "name": "davidsmorais", - "email": "david@dsmorais.com", - "url": "https://github.com/davidsmorais" - }, - "maintainers": [ - { - "name": "davidsmorais", - "email": "david@dsmorais.com", - "url": "https://github.com/davidsmorais" - } - ], - "scripts": { - "postinstall": "electron-builder install-app-deps", - "icons": "electron-icon-maker --input=./static/Icon.png --output=./build/", - "test": "xo && stylelint 'src/style/*.css'", - "release": "yarn version && rm -rf dist build && yarn icons && electron-builder --publish never", - "build-snap": "electron-builder --linux snap", - "build-win": "electron-builder --win", - "start": "electron ." - }, - "dependencies": { - "auto-launch": "^5.0.1", - "electron-context-menu": "^3.6.1", - "electron-debug": "^1.4.0", - "electron-dl": "^2.0.0", - "electron-store": "^8.1.0", - "lodash": "^4.17.21" - }, - "devDependencies": { - "electron": "^22.1.0", - "electron-builder": "^23.6.0", - "electron-icon-maker": "^0.0.5", - "stylelint": "^14.9.1", - "xo": "^0.53.1" - }, - "xo": { - "envs": [ - "browser", - "node" - ], - "rules": { - "n/prefer-global/process": 0, - "unicorn/prefer-module": 0, - "unicorn/no-for-loop": 0, - "unicorn/no-array-for-each": 0, - "import/extensions": 0, - "object-curly-spacing": 0, - "quote-props": 0, - "unicorn/prefer-query-selector": 0, - "quotes": [ - "error", - "double" - ] - }, - "space": 2 - }, - "stylelint": { - "rules": { - "block-closing-brace-empty-line-before": "never", - "block-closing-brace-newline-after": "always", - "block-no-empty": true, - "block-opening-brace-space-before": "always", - "color-hex-case": "upper", - "color-hex-length": "long", - "color-no-invalid-hex": true, - "comment-no-empty": true, - "declaration-block-semicolon-space-before": "never", - "indentation": 2, - "max-empty-lines": 0, - "no-duplicate-selectors": true - } - }, - "build": { - "appId": "com.davidsmorais.kuro", - "snap": { - "title": "Kuro" - }, - "files": [ - "**/*", - "!media${/*}", - "!docs${/*}" - ], - "win": { - "target": [ - { - "target": "nsis", - "arch": [ - "x64" - ] - } - ], - "icon": "icons/win/icon.ico", - "publish": { - "provider": "github", - "releaseType": "release" - } - }, - "linux": { - "category": "Office", - "icon": "icons/png", - "description": "Kuro is an unofficial, featureful, open source, community-driven, free Microsoft To-Do app, used by people in more than 120 countries. (Ao fork)", - "synopsis": "Elegant Microsoft To-Do desktop app (Ao fork)", - "publish": { - "provider": "github", - "releaseType": "release" - }, - "target": [ - { - "target": "AppImage", - "arch": [ - "x64" - ] - }, - { - "target": "deb", - "arch": [ - "x64" - ] - }, - { - "target": "pacman", - "arch": [ - "x64" - ] - }, - { - "target": "rpm", - "arch": [ - "x64" - ] - }, - { - "target": "snap", - "arch": [ - "x64" - ] - } - ] - } - } -} diff --git a/pkgs/applications/networking/powerdns-admin/default.nix b/pkgs/applications/networking/powerdns-admin/default.nix index 6028f0e1a1ae..7029dd054165 100644 --- a/pkgs/applications/networking/powerdns-admin/default.nix +++ b/pkgs/applications/networking/powerdns-admin/default.nix @@ -1,6 +1,7 @@ -{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, mkYarnPackage, nixosTests, writeText, python3 }: +{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarnConfigHook, nixosTests, writeText, python3 }: let + pname = "powerdns-admin"; version = "0.4.2"; src = fetchFromGitHub { owner = "PowerDNS-Admin"; @@ -23,44 +24,32 @@ let ./0001-Fix-flask-2.3-issue.patch ]; - assets = mkYarnPackage { - inherit src version; - packageJSON = ./package.json; + assets = stdenv.mkDerivation { + pname = "${pname}-assets"; + inherit version src; offlineCache = fetchYarnDeps { yarnLock = "${src}/yarn.lock"; hash = "sha256-rXIts+dgOuZQGyiSke1NIG7b4lFlR/Gfu3J6T3wP3aY="; }; - # Copied from package.json, see also - # https://github.com/NixOS/nixpkgs/pull/214952 - packageResolutions = { - "@fortawesome/fontawesome-free" = "6.3.0"; - }; - - nativeBuildInputs = pythonDeps; + nativeBuildInputs = [ + yarnConfigHook + ] ++ pythonDeps; patches = all_patches ++ [ ./0002-Remove-cssrewrite-filter.patch ]; buildPhase = '' - # The build process expects the directory to be writable - # with node_modules at a specific path - # https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/.yarnrc - - approot=deps/powerdns-admin-assets - - ln -s $node_modules $approot/powerdnsadmin/static/node_modules - SESSION_TYPE=filesystem FLASK_APP=$approot/powerdnsadmin/__init__.py flask assets build + SESSION_TYPE=filesystem FLASK_APP=./powerdnsadmin/__init__.py flask assets build ''; installPhase = '' # https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/54b257768f600c5548a1c7e50eac49c40df49f92/docker/Dockerfile#L43 mkdir $out - cp -r $approot/powerdnsadmin/static/{generated,assets,img} $out - find $node_modules -name webfonts -exec cp -r {} $out \; - find $node_modules -name fonts -exec cp -r {} $out \; - find $node_modules/icheck/skins/square -name '*.png' -exec cp {} $out/generated \; + cp -r powerdnsadmin/static/{generated,assets,img} $out + find powerdnsadmin/static/node_modules -name webfonts -exec cp -r {} $out \; -printf "Copying %P\n" + find powerdnsadmin/static/node_modules -name fonts -exec cp -r {} $out \; -printf "Copying %P\n" + find powerdnsadmin/static/node_modules/icheck/skins/square -name '*.png' -exec cp {} $out/generated \; ''; - distPhase = "true"; }; assetsPy = writeText "assets.py" '' @@ -73,9 +62,7 @@ let assets.register('css_main', 'generated/main.css') ''; in stdenv.mkDerivation { - pname = "powerdns-admin"; - - inherit src version; + inherit pname version src; nativeBuildInputs = [ python.pkgs.wrapPython ]; diff --git a/pkgs/applications/networking/powerdns-admin/package.json b/pkgs/applications/networking/powerdns-admin/package.json deleted file mode 100644 index 0fb58f9c544c..000000000000 --- a/pkgs/applications/networking/powerdns-admin/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "dependencies": { - "@fortawesome/fontawesome-free": "6.3.0", - "admin-lte": "3.2.0", - "bootstrap": "4.6.2", - "bootstrap-datepicker": "^1.9.0", - "bootstrap-validator": "^0.11.9", - "datatables.net-plugins": "^1.13.1", - "icheck": "^1.0.2", - "jquery-slimscroll": "^1.3.8", - "jquery-sparkline": "^2.4.0", - "jquery-ui-dist": "^1.13.2", - "jquery.quicksearch": "^2.4.0", - "jquery-validation": "^1.19.5", - "jtimeout": "^3.2.0", - "knockout": "^3.5.1", - "multiselect": "^0.9.12" - }, - "resolutions": { - "admin-lte/@fortawesome/fontawesome-free": "6.3.0" - }, - "name": "powerdns-admin-assets", - "version": "0.4.1" -} diff --git a/pkgs/applications/office/micropad/default.nix b/pkgs/applications/office/micropad/default.nix index c50e14015f3b..46c318ffbd11 100644 --- a/pkgs/applications/office/micropad/default.nix +++ b/pkgs/applications/office/micropad/default.nix @@ -2,100 +2,88 @@ , stdenv , fetchFromGitHub , fetchYarnDeps +, yarnBuildHook , fetchzip , makeWrapper , makeDesktopItem -, mkYarnPackage , electron , desktopToDarwinBundle , copyDesktopItems }: -let - executableName = "micropad"; -in - mkYarnPackage rec { - pname = "micropad"; - version = "4.5.1"; - src = fetchFromGitHub { - owner = "MicroPad"; - repo = "Micropad-Electron"; - rev = "v${version}"; - hash = "sha256-z+g+FwmoX4Qqf+v4BVLCtfrXwGiAUFlPLQQhp2CMhLU="; - }; +stdenv.mkDerivation (finalAttrs: { + pname = "micropad"; + version = "4.5.1"; - micropad-core = fetchzip { - url = "https://github.com/MicroPad/MicroPad-Core/releases/download/v${version}/micropad.tar.xz"; - hash = "sha256-y13PVA/AKKsc5q7NDwZFasb7fOo+56IW8qbTbsm2WWc="; - }; + src = fetchFromGitHub { + owner = "MicroPad"; + repo = "Micropad-Electron"; + rev = "v${finalAttrs.version}"; + hash = "sha256-z+g+FwmoX4Qqf+v4BVLCtfrXwGiAUFlPLQQhp2CMhLU="; + }; - packageJSON = ./package.json; + # This project can't be built from source currently, because Nixpkgs lacks + # ecosystem for https://bun.sh + micropad-core = fetchzip { + url = "https://github.com/MicroPad/MicroPad-Core/releases/download/v${finalAttrs.version}/micropad.tar.xz"; + hash = "sha256-y13PVA/AKKsc5q7NDwZFasb7fOo+56IW8qbTbsm2WWc="; + }; - offlineCache = fetchYarnDeps { - yarnLock = "${src}/yarn.lock"; - hash = "sha256-ESYSHuHLNsn3EYKIe2p0kg142jyC0USB+Ef//oGeF08="; - }; + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-ESYSHuHLNsn3EYKIe2p0kg142jyC0USB+Ef//oGeF08="; + }; - nativeBuildInputs = [ copyDesktopItems makeWrapper ] - ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ]; + nativeBuildInputs = [ yarnBuildHook copyDesktopItems makeWrapper ] + ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ]; - buildPhase = '' - runHook preBuild - pushd deps/micropad/ - yarn --offline build - popd - runHook postBuild - ''; + installPhase = '' + runHook preInstall - installPhase = '' - runHook preInstall + # resources + mkdir -p "$out/share/" + cp -r './deps/micropad' "$out/share/micropad" + ln -s '${finalAttrs.micropad-core}' "$out/share/micropad/core" + rm "$out/share/micropad/node_modules" + cp -r './node_modules' "$out/share/micropad" - # resources - mkdir -p "$out/share/" - cp -r './deps/micropad' "$out/share/micropad" - ln -s '${micropad-core}' "$out/share/micropad/core" - rm "$out/share/micropad/node_modules" - cp -r './node_modules' "$out/share/micropad" + # icons + for icon in $out/share/micropad/build/icons/*.png; do + mkdir -p "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps" + ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps/micropad.png" + done - # icons - for icon in $out/share/micropad/build/icons/*.png; do - mkdir -p "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps" - ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps/micropad.png" - done + # executable wrapper + makeWrapper '${electron}/bin/electron' "$out/bin/micropad" \ + --add-flags "$out/share/micropad" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" - # executable wrapper - makeWrapper '${electron}/bin/electron' "$out/bin/${executableName}" \ - --add-flags "$out/share/micropad" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" + runHook postInstall + ''; - runHook postInstall - ''; + # Do not attempt generating a tarball for micropad again. + doDist = false; - # Do not attempt generating a tarball for micropad again. - doDist = false; + # The desktop item properties should be kept in sync with data from upstream: + # https://github.com/MicroPad/MicroPad-Electron/blob/master/package.json + desktopItems = [ + (makeDesktopItem { + name = "micropad"; + exec = "micropad %u"; + icon = "micropad"; + desktopName = "µPad"; + startupWMClass = "µPad"; + comment = finalAttrs.meta.description; + categories = ["Office"]; + }) + ]; - # The desktop item properties should be kept in sync with data from upstream: - # https://github.com/MicroPad/MicroPad-Electron/blob/master/package.json - desktopItems = [ - (makeDesktopItem { - name = "micropad"; - exec = "${executableName} %u"; - icon = "micropad"; - desktopName = "µPad"; - startupWMClass = "µPad"; - comment = meta.description; - categories = ["Office"]; - }) - ]; - - passthru.updateScript = ./update.sh; - - meta = with lib; { - description = "A powerful note-taking app that helps you organise + take notes without restrictions"; - homepage = "https://getmicropad.com/"; - license = licenses.mpl20; - maintainers = with maintainers; [rhysmdnz]; - inherit (electron.meta) platforms; - mainProgram = "micropad"; - }; - } + meta = { + description = "A powerful note-taking app that helps you organise + take notes without restrictions"; + homepage = "https://getmicropad.com/"; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [rhysmdnz]; + inherit (electron.meta) platforms; + mainProgram = "micropad"; + }; +}) diff --git a/pkgs/applications/office/micropad/package.json b/pkgs/applications/office/micropad/package.json deleted file mode 100644 index 8e1ca96a0519..000000000000 --- a/pkgs/applications/office/micropad/package.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "name": "micropad", - "version": "4.5.1", - "description": "A powerful note-taking app that helps you organise + take notes without restrictions.", - "main": "main.js", - "scripts": { - "start": "yarn build && yarn electron . --is-dev --no-sandbox", - "build": "yarn tsc -p tsconfig.json", - "update-core": "rm -rf core && rm -rf tmp && mkdir tmp && wget https://github.com/MicroPad/MicroPad-Core/releases/download/v${npm_package_version}/micropad.tar.xz -P ./tmp && cd tmp && tar -xf micropad.tar.xz && rm build/dist/*.map && cp -r build ../core && cd .. && rm -rf tmp", - "pack": "yarn build && yarn electron-builder --dir", - "dist": "yarn build && yarn electron-builder", - "windows:version": "echo %npm_package_version%" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/MicroPad/Electron.git" - }, - "author": { - "name": "Nick Webster", - "email": "nick@nick.geek.nz" - }, - "license": "MPL-2.0", - "bugs": { - "url": "https://github.com/MicroPad/Electron/issues" - }, - "homepage": "https://getmicropad.com", - "devDependencies": { - "@types/mime": "^3.0.1", - "@types/node": "^18.7.18", - "@types/typo-js": "^1.2.1", - "electron": "^28.1.0", - "electron-builder": "^24.9.1", - "typescript": "~5.2.2" - }, - "dependencies": { - "dictionary-en": "^3.0.0", - "dictionary-en-au": "^2.1.1", - "electron-context-menu": "^3.1.2", - "electron-window-state": "^5.0.3", - "localforage": "^1.10.0", - "mime": "^3.0.0", - "typo-js": "^1.2.3" - }, - "build": { - "appId": "com.getmicropad.micropad", - "productName": "µPad", - "publish": { - "provider": "github", - "releaseType": "release" - }, - "asarUnpack": [ - "preload.js" - ], - "linux": { - "target": [ - { - "target": "tar.gz", - "arch": [ - "x64", - "armv7l", - "arm64" - ] - }, - { - "target": "AppImage", - "arch": [ - "x64", - "armv7l", - "arm64" - ] - }, - "snap", - "deb", - "rpm", - "pacman" - ], - "executableName": "micropad", - "category": "Office", - "icon": "build/icons" - }, - "pacman": { - "depends": [ - "gtk3" - ] - }, - "snap": { - "publish": { - "provider": "github", - "releaseType": "release" - } - }, - "mac": { - "target": { - "target": "dmg", - "arch": "universal" - }, - "category": "public.app-category.productivity", - "identity": null - }, - "win": { - "target": [ - { - "target": "nsis", - "arch": [ - "x64", - "arm64" - ] - }, - "portable" - ] - }, - "nsis": { - "allowToChangeInstallationDirectory": true, - "oneClick": false - } - } -} diff --git a/pkgs/applications/office/micropad/update.sh b/pkgs/applications/office/micropad/update.sh deleted file mode 100755 index e2265af4ee72..000000000000 --- a/pkgs/applications/office/micropad/update.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl common-updater-scripts jq nix nodePackages.prettier prefetch-yarn-deps - -set -eu -o pipefail - -latest_version=$(curl -s https://api.github.com/repos/MicroPad/Micropad-Electron/releases/latest | jq --raw-output '.tag_name[1:]') -old_core_hash=$(nix-instantiate --eval --strict -A "micropad.micropad-core.drvAttrs.outputHash" | tr -d '"' | sed -re 's|[+]|\\&|g') -new_core_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --unpack "https://github.com/MicroPad/MicroPad-Core/releases/download/v$latest_version/micropad.tar.xz")) - -nixFile=$(nix-instantiate --eval --strict -A "micropad.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/') -nixFolder=$(dirname "$nixFile") - -sed -i "$nixFile" -re "s|\"$old_core_hash\"|\"$new_core_hash\"|" - -curl -o "$nixFolder/package.json" -s "https://raw.githubusercontent.com/MicroPad/MicroPad-Electron/v$latest_version/package.json" -curl -o "$nixFolder/yarn.lock" -s "https://raw.githubusercontent.com/MicroPad/MicroPad-Electron/v$latest_version/yarn.lock" - -prettier --write "$nixFolder/package.json" -old_yarn_hash=$(nix-instantiate --eval --strict -A "micropad.offlineCache.outputHash" | tr -d '"' | sed -re 's|[+]|\\&|g') -new_yarn_hash=$(nix hash to-sri --type sha256 $(prefetch-yarn-deps "$nixFolder/yarn.lock")) -sed -i "$nixFile" -re "s|\"$old_yarn_hash\"|\"$new_yarn_hash\"|" -rm "$nixFolder/yarn.lock" - -update-source-version micropad "$latest_version" diff --git a/pkgs/build-support/node/fetch-yarn-deps/default.nix b/pkgs/build-support/node/fetch-yarn-deps/default.nix index 4ef74c0cab88..d0caa42dade1 100644 --- a/pkgs/build-support/node/fetch-yarn-deps/default.nix +++ b/pkgs/build-support/node/fetch-yarn-deps/default.nix @@ -1,4 +1,19 @@ -{ stdenv, lib, makeWrapper, coreutils, nix-prefetch-git, fetchurl, nodejs-slim, prefetch-yarn-deps, cacert, callPackage, nix }: +{ + stdenv, + lib, + makeWrapper, + coreutils, + nix-prefetch-git, + fetchurl, + nodejs-slim, + prefetch-yarn-deps, + fixup-yarn-lock, + yarn, + makeSetupHook, + cacert, + callPackage, + nix, +}: let yarnpkg-lockfile-tar = fetchurl { @@ -6,9 +21,9 @@ let hash = "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ=="; }; - tests = callPackage ./tests {}; - -in { + tests = callPackage ./tests { }; +in +{ prefetch-yarn-deps = stdenv.mkDerivation { name = "prefetch-yarn-deps"; @@ -30,12 +45,20 @@ in { patchShebangs $out/libexec makeWrapper $out/libexec/index.js $out/bin/prefetch-yarn-deps \ - --prefix PATH : ${lib.makeBinPath [ coreutils nix-prefetch-git nix ]} + --prefix PATH : ${ + lib.makeBinPath [ + coreutils + nix-prefetch-git + nix + ] + } runHook postInstall ''; - passthru = { inherit tests; }; + passthru = { + inherit tests; + }; }; fixup-yarn-lock = stdenv.mkDerivation { @@ -63,45 +86,93 @@ in { runHook postInstall ''; - passthru = { inherit tests; }; + passthru = { + inherit tests; + }; }; - fetchYarnDeps = let - f = { - name ? "offline", - src ? null, - hash ? "", - sha256 ? "", - ... - }@args: let - hash_ = - if hash != "" then { outputHashAlgo = null; outputHash = hash; } - else if sha256 != "" then { outputHashAlgo = "sha256"; outputHash = sha256; } - else { outputHashAlgo = "sha256"; outputHash = lib.fakeSha256; }; - in stdenv.mkDerivation ({ - inherit name; + fetchYarnDeps = + let + f = + { + name ? "offline", + src ? null, + hash ? "", + sha256 ? "", + ... + }@args: + let + hash_ = + if hash != "" then + { + outputHashAlgo = null; + outputHash = hash; + } + else if sha256 != "" then + { + outputHashAlgo = "sha256"; + outputHash = sha256; + } + else + { + outputHashAlgo = "sha256"; + outputHash = lib.fakeSha256; + }; + in + stdenv.mkDerivation ( + { + inherit name; - dontUnpack = src == null; - dontInstall = true; + dontUnpack = src == null; + dontInstall = true; - nativeBuildInputs = [ prefetch-yarn-deps cacert ]; - GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - NODE_EXTRA_CA_CERTS = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + nativeBuildInputs = [ + prefetch-yarn-deps + cacert + ]; + GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + NODE_EXTRA_CA_CERTS = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - buildPhase = '' - runHook preBuild + buildPhase = '' + runHook preBuild - yarnLock=''${yarnLock:=$PWD/yarn.lock} - mkdir -p $out - (cd $out; prefetch-yarn-deps --verbose --builder $yarnLock) + yarnLock=''${yarnLock:=$PWD/yarn.lock} + mkdir -p $out + (cd $out; prefetch-yarn-deps --verbose --builder $yarnLock) - runHook postBuild - ''; + runHook postBuild + ''; - outputHashMode = "recursive"; - } // hash_ // (removeAttrs args (["name" "hash" "sha256"] ++ (lib.optional (src == null) "src")))); + outputHashMode = "recursive"; + } + // hash_ + // (removeAttrs args ( + [ + "name" + "hash" + "sha256" + ] + ++ (lib.optional (src == null) "src") + )) + ); + in + lib.setFunctionArgs f (lib.functionArgs f) // { inherit tests; }; - in lib.setFunctionArgs f (lib.functionArgs f) // { - inherit tests; - }; + yarnConfigHook = makeSetupHook { + name = "yarn-config-hook"; + propagatedBuildInputs = [ + yarn + fixup-yarn-lock + ]; + meta = { + description = "Install nodejs dependencies from an offline yarn cache produced by fetchYarnDeps"; + }; + } ./yarn-config-hook.sh; + + yarnBuildHook = makeSetupHook { + name = "yarn-build-hook"; + meta = { + description = "Run yarn build in buildPhase"; + }; + } ./yarn-build-hook.sh; } diff --git a/pkgs/build-support/node/fetch-yarn-deps/fixup.js b/pkgs/build-support/node/fetch-yarn-deps/fixup.js index 732e569aba7b..a359cd58a916 100755 --- a/pkgs/build-support/node/fetch-yarn-deps/fixup.js +++ b/pkgs/build-support/node/fetch-yarn-deps/fixup.js @@ -12,6 +12,15 @@ const fixupYarnLock = async (lockContents, verbose) => { const fixedData = Object.fromEntries( Object.entries(lockData.object) .map(([dep, pkg]) => { + if (pkg.resolved === undefined) { + console.warn(`no resolved URL for package ${dep}`) + var maybeFile = dep.split("@", 2)[1] + if (maybeFile.startsWith("file:")) { + console.log(`Rewriting URL for local file dependency ${dep}`) + pkg.resolved = maybeFile + } + return [dep, pkg] + } const [ url, hash ] = pkg.resolved.split("#", 2) if (hash || url.startsWith("https://codeload.github.com")) { diff --git a/pkgs/build-support/node/fetch-yarn-deps/yarn-build-hook.sh b/pkgs/build-support/node/fetch-yarn-deps/yarn-build-hook.sh new file mode 100644 index 000000000000..947aa1736b6f --- /dev/null +++ b/pkgs/build-support/node/fetch-yarn-deps/yarn-build-hook.sh @@ -0,0 +1,24 @@ +yarnBuildHook() { + runHook preBuild + echo "Executing yarnBuildHook" + + if [ -z "${yarnBuildScript-}" ]; then + yarnBuildScript="build" + fi + + if ! type node > /dev/null 2>&1 ; then + echo yarnConfigHook WARNING: a node interpreter was not added to the \ + build, and is probably required to run \'yarn $yarnBuildHook\'. \ + A common symptom of this is getting \'command not found\' errors \ + for Nodejs related tools. + fi + + yarn --offline "$yarnBuildScript" $yarnBuildFlags + + echo "finished yarnBuildHook" + runHook postBuild +} + +if [[ -z "${dontYarnBuild-}" && -z "${buildPhase-}" ]]; then + buildPhase=yarnBuildHook +fi diff --git a/pkgs/build-support/node/fetch-yarn-deps/yarn-config-hook.sh b/pkgs/build-support/node/fetch-yarn-deps/yarn-config-hook.sh new file mode 100644 index 000000000000..d11229aafc71 --- /dev/null +++ b/pkgs/build-support/node/fetch-yarn-deps/yarn-config-hook.sh @@ -0,0 +1,37 @@ +yarnConfigHook(){ + runHook preConfigure + echo "Executing yarnConfigHook" + + # Use a constant HOME directory + mkdir -p /tmp/home + export HOME=/tmp/home + if [[ -n "$yarnOfflineCache" ]]; then + offlineCache="$yarnOfflineCache" + fi + if [[ -z "$offlineCache" ]]; then + echo yarnConfigHook: No yarnOfflineCache or offlineCache were defined\! >&2 + exit 2 + fi + yarn config --offline set yarn-offline-mirror "$offlineCache" + fixup-yarn-lock yarn.lock + yarn install \ + --frozen-lockfile \ + --force \ + --production=false \ + --ignore-engines \ + --ignore-platform \ + --ignore-scripts \ + --no-progress \ + --non-interactive \ + --offline + + # TODO: Check if this is really needed + patchShebangs node_modules + + echo "finished yarnConfigHook" + runHook postConfigure +} + +if [[ -z "${dontYarnInstallDeps-}" && -z "${configurePhase-}" ]]; then + configurePhase=yarnConfigHook +fi diff --git a/pkgs/by-name/co/codefresh/package.json b/pkgs/by-name/co/codefresh/package.json deleted file mode 100644 index e0e82b3bcdd4..000000000000 --- a/pkgs/by-name/co/codefresh/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "name": "codefresh", - "version": "0.87.3", - "description": "Codefresh command line utility", - "main": "index.js", - "preferGlobal": true, - "scripts": { - "generate-completion": "node ./lib/interface/cli/completion/generate", - "test": "jest .spec.js --coverage", - "e2e": "bash e2e/e2e.spec.sh", - "eslint": "eslint --fix lib/logic/**", - "pkg": "pkg . -t node16-alpine-x64,node16-macos-x64,node16-linux-x64,node16-win-x64,node16-linux-arm64 --out-path ./dist", - "serve-docs": "yarn build-local-docs && cd temp && hugo server -D", - "serve-docs-beta": "ALLOW_BETA_COMMANDS=true yarn build-local-docs && cd temp && hugo server -D", - "build-local-docs": "node ./docs/index.js", - "build-public-docs": "node ./docs/index.js && cd temp && hugo", - "postinstall": "node run-check-version.js" - }, - "bin": { - "codefresh": "lib/interface/cli/codefresh" - }, - "repository": "git+https://github.com/codefresh-io/cli.git", - "keywords": [ - "command line" - ], - "pkg": { - "scripts": [ - "lib/**/*.js", - "node_modules/codefresh-sdk/lib/**/*.js", - "node_modules/kubernetes-client/**/*.js" - ], - "assets": "lib/**/*.hbs" - }, - "resolutions": { - "websocket-extensions": "^0.1.4", - "lodash": "^4.17.21", - "json-schema": "^0.4.0", - "ajv": "^6.12.6", - "normalize-url": "^4.5.1", - "ansi-regex": "^5.0.1", - "y18n": "^4.0.1", - "shelljs": "^0.8.5", - "codefresh-sdk/swagger-client/qs": "6.9.7", - "kubernetes-client/qs": "6.9.7", - "**/request/qs": "6.5.3" - }, - "dependencies": { - "@codefresh-io/docker-reference": "^0.0.5", - "adm-zip": "^0.5.5", - "ajv": "^6.12.6", - "bluebird": "^3.5.1", - "cf-errors": "^0.1.16", - "chalk": "^4.1.0", - "cli-progress": "3.10.0", - "codefresh-sdk": "^1.12.0", - "colors": "1.4.0", - "columnify": "^1.6.0", - "compare-versions": "^3.4.0", - "copy-dir": "^0.3.0", - "debug": "^3.1.0", - "diff": "^3.5.0", - "dockerode": "^2.5.7", - "draftlog": "^1.0.12", - "figlet": "^1.4.0", - "filesize": "^3.5.11", - "firebase": "git+https://github.com/codefresh-io/firebase.git#80b2ed883ff281cd67b53bd0f6a0bbd6f330fed5", - "flat": "^4.1.1", - "inquirer": "^7.1.0", - "js-yaml": "^3.10.0", - "kefir": "^3.8.1", - "kubernetes-client": "^9.0.0", - "lodash": "^4.17.21", - "mkdirp": "^0.5.1", - "moment": "^2.29.4", - "mongodb": "^4.17.2", - "node-forge": "^1.3.0", - "ora": "^5.4.1", - "prettyjson": "^1.2.5", - "promise-retry": "^2.0.1", - "recursive-readdir": "^2.2.3", - "request": "^2.88.0", - "request-promise": "^4.2.2", - "requestretry": "^7.0.2", - "rimraf": "^2.6.2", - "semver": "^7.5.4", - "tar-stream": "^2.2.0", - "uuid": "^3.1.0", - "yaml": "^1.10.0", - "yargs": "^15.4.1", - "yargs-parser": "^13.0.0", - "zip": "^1.2.0" - }, - "devDependencies": { - "@types/node-forge": "^1.0.1", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-plugin-import": "^2.25.4", - "eslint-plugin-jest": "^27.6.3", - "hugo-cli": "^0.5.4", - "jest": "^29.7.0", - "pkg": "5.5.2" - }, - "bugs": { - "url": "https://github.com/codefresh-io/cli/issues" - }, - "homepage": "https://github.com/codefresh-io/cli#readme", - "author": "Codefresh", - "license": "ISC", - "engines": { - "node": ">=14.0.0" - }, - "jest": { - "testEnvironment": "node", - "setupFiles": [ - "./test-setup.js" - ] - } -} diff --git a/pkgs/by-name/co/codefresh/package.nix b/pkgs/by-name/co/codefresh/package.nix index 604ca4a83e95..36792f48dfaa 100644 --- a/pkgs/by-name/co/codefresh/package.nix +++ b/pkgs/by-name/co/codefresh/package.nix @@ -1,36 +1,40 @@ -{ lib, mkYarnPackage, fetchFromGitHub, fetchYarnDeps, testers, codefresh }: +{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarnConfigHook, npmHooks, nodejs, testers }: -mkYarnPackage rec { +stdenv.mkDerivation (finalAttrs: { pname = "codefresh"; version = "0.87.3"; src = fetchFromGitHub { owner = "codefresh-io"; repo = "cli"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-SUwt0oWls823EeLxT4CW+LDdsjAtSxxxKkllhMJXCtM="; }; offlineCache = fetchYarnDeps { - yarnLock = "${src}/yarn.lock"; + yarnLock = "${finalAttrs.src}/yarn.lock"; hash = "sha256-tzsHbvoQ59MwE4TYdPweLaAv9r4V8oyTQyvdeyPCsHY="; }; - packageJSON = ./package.json; - - doDist = false; + nativeBuildInputs = [ + yarnConfigHook + npmHooks.npmInstallHook + nodejs + ]; + # Tries to fetch stuff from the internet + dontNpmPrune = true; passthru.tests.version = testers.testVersion { - package = codefresh; + package = finalAttrs.finalPackage; # codefresh needs to read a config file, this is faked out with a subshell command = "codefresh --cfconfig <(echo 'contexts:') version"; }; meta = { - changelog = "https://github.com/codefresh-io/cli/releases/tag/v${version}"; + changelog = "https://github.com/codefresh-io/cli/releases/tag/v${finalAttrs.version}"; description = "Codefresh CLI tool to interact with Codefresh services"; homepage = "https://github.com/codefresh-io/cli"; license = lib.licenses.mit; mainProgram = "codefresh"; maintainers = [ lib.maintainers.takac ]; }; -} +}) diff --git a/pkgs/by-name/el/element-call/package.json b/pkgs/by-name/el/element-call/package.json deleted file mode 100644 index 173927845525..000000000000 --- a/pkgs/by-name/el/element-call/package.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "name": "element-call", - "version": "0.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "NODE_OPTIONS=--max-old-space-size=16384 vite build", - "serve": "vite preview", - "prettier:check": "prettier -c .", - "prettier:format": "prettier -w .", - "lint": "yarn lint:types && yarn lint:eslint", - "lint:eslint": "eslint --max-warnings 0 src", - "lint:eslint-fix": "eslint --max-warnings 0 src --fix", - "lint:types": "tsc", - "i18n": "node_modules/i18next-parser/bin/cli.js", - "i18n:check": "node_modules/i18next-parser/bin/cli.js --fail-on-warnings --fail-on-update", - "test": "vitest", - "test:coverage": "vitest run --coverage", - "backend": "docker-compose -f backend-docker-compose.yml up" - }, - "dependencies": { - "@juggle/resize-observer": "^3.3.1", - "@livekit/components-core": "^0.10.0", - "@livekit/components-react": "^2.0.0", - "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz", - "@opentelemetry/api": "^1.4.0", - "@opentelemetry/context-zone": "^1.9.1", - "@opentelemetry/exporter-jaeger": "^1.9.1", - "@opentelemetry/exporter-trace-otlp-http": "^0.48.0", - "@opentelemetry/instrumentation-document-load": "^0.36.0", - "@opentelemetry/instrumentation-user-interaction": "^0.36.0", - "@opentelemetry/sdk-trace-web": "^1.9.1", - "@radix-ui/react-dialog": "^1.0.4", - "@radix-ui/react-slider": "^1.1.2", - "@radix-ui/react-visually-hidden": "^1.0.3", - "@react-aria/button": "^3.3.4", - "@react-aria/focus": "^3.5.0", - "@react-aria/menu": "^3.3.0", - "@react-aria/overlays": "^3.7.3", - "@react-aria/select": "^3.6.0", - "@react-aria/tabs": "^3.1.0", - "@react-aria/tooltip": "^3.1.3", - "@react-aria/utils": "^3.10.0", - "@react-rxjs/core": "^0.10.7", - "@react-spring/web": "^9.4.4", - "@react-stately/collections": "^3.3.4", - "@react-stately/select": "^3.1.3", - "@react-stately/tooltip": "^3.0.5", - "@react-stately/tree": "^3.2.0", - "@sentry/react": "^7.0.0", - "@sentry/tracing": "^7.0.0", - "@types/lodash": "^4.14.199", - "@use-gesture/react": "^10.2.11", - "@vector-im/compound-design-tokens": "^1.0.0", - "@vector-im/compound-web": "^3.0.0", - "@vitejs/plugin-basic-ssl": "^1.0.1", - "@vitejs/plugin-react": "^4.0.1", - "buffer": "^6.0.3", - "classnames": "^2.3.1", - "events": "^3.3.0", - "i18next": "^23.0.0", - "i18next-browser-languagedetector": "^7.0.0", - "i18next-http-backend": "^2.0.0", - "livekit-client": "^2.0.2", - "lodash": "^4.17.21", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#d55c6a36df539f6adacc335efe5b9be27c9cee4a", - "matrix-widget-api": "^1.3.1", - "normalize.css": "^8.0.1", - "pako": "^2.0.4", - "postcss-preset-env": "^9.0.0", - "posthog-js": "^1.29.0", - "react": "18", - "react-dom": "18", - "react-i18next": "^14.0.0", - "react-router-dom": "^5.2.0", - "react-use-clipboard": "^1.0.7", - "react-use-measure": "^2.1.1", - "rxjs": "^7.8.1", - "sdp-transform": "^2.14.1", - "tinyqueue": "^2.0.3", - "unique-names-generator": "^4.6.0", - "uuid": "9", - "vaul": "^0.9.0" - }, - "devDependencies": { - "@babel/core": "^7.16.5", - "@babel/preset-env": "^7.22.20", - "@babel/preset-react": "^7.22.15", - "@babel/preset-typescript": "^7.23.0", - "@react-spring/rafz": "^9.7.3", - "@react-types/dialog": "^3.5.5", - "@sentry/vite-plugin": "^2.0.0", - "@testing-library/react": "^14.0.0", - "@testing-library/user-event": "^14.5.1", - "@types/content-type": "^1.1.5", - "@types/dom-screen-wake-lock": "^1.0.1", - "@types/dompurify": "^3.0.2", - "@types/grecaptcha": "^3.0.4", - "@types/node": "^20.0.0", - "@types/react-router-dom": "^5.3.3", - "@types/request": "^2.48.8", - "@types/sdp-transform": "^2.4.5", - "@types/uuid": "9", - "@typescript-eslint/eslint-plugin": "^7.0.0", - "@typescript-eslint/parser": "^7.0.0", - "babel-loader": "^9.0.0", - "babel-plugin-transform-vite-meta-env": "^1.0.3", - "eslint": "^8.14.0", - "eslint-config-google": "^0.14.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-deprecate": "^0.8.2", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-matrix-org": "^1.2.1", - "eslint-plugin-react": "^7.29.4", - "eslint-plugin-react-hooks": "^4.5.0", - "eslint-plugin-unicorn": "^51.0.0", - "i18next-parser": "^8.0.0", - "jsdom": "^24.0.0", - "prettier": "^3.0.0", - "sass": "^1.42.1", - "typescript": "^5.1.6", - "typescript-eslint-language-service": "^5.0.5", - "vite": "^5.0.0", - "vite-plugin-html-template": "^1.1.0", - "vite-plugin-svgr": "^4.0.0", - "vitest": "^1.2.2" - } -} diff --git a/pkgs/by-name/el/element-call/package.nix b/pkgs/by-name/el/element-call/package.nix index da7f41222c16..835329fef295 100644 --- a/pkgs/by-name/el/element-call/package.nix +++ b/pkgs/by-name/el/element-call/package.nix @@ -1,8 +1,11 @@ { lib , stdenv -, mkYarnPackage , fetchFromGitHub , fetchYarnDeps +, yarnConfigHook +, yarnBuildHook +, nodejs +, npmHooks }: let @@ -15,38 +18,33 @@ let aarch64-darwin = "sha256-G4doEnZORJqcl3bWaKZPuQmBeXNXud06nLO12Afr9kM="; }.${system} or throwSystem; in -mkYarnPackage rec { +stdenv.mkDerivation (finalAttrs: { pname = "element-call"; version = "0.5.16"; src = fetchFromGitHub { owner = "element-hq"; repo = "element-call"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-GTHM27i716RZk+kDELMg/lYy355/SZoQLXGPQ90M4xg="; }; - packageJSON = ./package.json; - patches = [ ./name.patch ]; offlineCache = fetchYarnDeps { - yarnLock = "${src}/yarn.lock"; + yarnLock = "${finalAttrs.src}/yarn.lock"; hash = offlineCacheHash; }; - buildPhase = '' - runHook preBuild - yarn --offline run build - runHook postBuild - ''; - - preInstall = '' - mkdir $out - cp -R ./deps/element-call/dist $out - ''; - - doDist = false; + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + npmHooks.npmInstallHook + ]; + # From some reason causes the build to fail due to dependencies not available + # offline + dontNpmPrune = true; meta = with lib; { homepage = "https://github.com/element-hq/element-call"; @@ -55,4 +53,4 @@ mkYarnPackage rec { maintainers = with maintainers; [ kilimnik ]; mainProgram = "element-call"; }; -} +}) diff --git a/pkgs/by-name/ko/koodo-reader/package.json b/pkgs/by-name/ko/koodo-reader/package.json deleted file mode 100644 index 5c8f5140d1ba..000000000000 --- a/pkgs/by-name/ko/koodo-reader/package.json +++ /dev/null @@ -1,312 +0,0 @@ -{ - "name": "koodo-reader", - "main": "main.js", - "version": "1.6.6", - "description": "A cross-platform ebook reader", - "author": { - "name": "App by Troye", - "email": "support@960960.xyz" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=6.0.0" - }, - "repository": "https://github.com/koodo-reader/koodo-reader", - "private": false, - "resolutions": { - "//": "See https://github.com/facebook/create-react-app/issues/11773", - "react-error-overlay": "6.0.9" - }, - "dependencies": { - "@aws-sdk/client-s3": "^3.485.0", - "adm-zip": "^0.5.2", - "axios": "^0.19.2", - "buffer": "^6.0.3", - "copy-text-to-clipboard": "^2.2.0", - "dompurify": "^3.0.1", - "electron-is-dev": "^1.1.0", - "electron-store": "^8.0.1", - "font-list": "^1.4.5", - "fs-extra": "^9.1.0", - "ftp": "^0.3.10", - "howler": "^2.2.3", - "iconv-lite": "^0.6.3", - "qs": "^6.11.2", - "react-hot-toast": "^2.1.1", - "react-tooltip": "^5.26.3", - "ssh2-sftp-client": "^9.1.0", - "webdav": "^3.6.2", - "wink-lemmatizer": "^3.0.4", - "ws": "^8.13.0", - "zip-a-folder": "^0.0.12" - }, - "devDependencies": { - "@types/i18next": "^13.0.0", - "@types/iconv-lite": "^0.0.1", - "@types/node": "^13.13.2", - "@types/react": "17.0.2", - "@types/react-dom": "17.0.2", - "@types/react-i18next": "^8.1.0", - "@types/react-lottie": "^1.2.5", - "@types/react-redux": "^7.1.7", - "@types/react-router-dom": "^5.1.6", - "@types/spark-md5": "^3.0.2", - "@types/ws": "^8.5.5", - "classnames": "^2.2.6", - "concurrently": "^5.0.1", - "cross-env": "^6.0.3", - "electron": "14.1.1", - "electron-builder": "^23.6.0", - "hard-source-webpack-plugin": "^0.13.1", - "html-react-parser": "^0.13.0", - "i18next": "^20.2.4", - "node-sass": "^9.0.0", - "nodemon": "^2.0.6", - "rc-color-picker": "^1.2.6", - "react": "^17.0.2", - "react-device-detect": "^1.12.1", - "react-dom": "^17.0.2", - "react-dropzone": "^11.3.0", - "react-i18next": "^13.2.2", - "react-lottie": "^1.2.3", - "react-redux": "^7.2.0", - "react-router-dom": "^5.2.0", - "react-scripts": "^5.0.1", - "redux": "^4.0.5", - "redux-thunk": "^2.3.0", - "sass-loader": "^13.3.2", - "source-map-explorer": "^2.5.2", - "spark-md5": "^3.0.1", - "typescript": "3.8.3", - "wait-on": "^7.0.1" - }, - "scripts": { - "analyze": "source-map-explorer 'build/static/js/*.js'", - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "ele": "electron .", - "dev": "concurrently \"cross-env BROWSER=none npm start\" \"wait-on http://127.0.0.1:3000/ && nodemon --watch main.js --exec electron .\"", - "release": "electron-builder", - "prerelease": "react-scripts build" - }, - "homepage": "./", - "build": { - "appId": "xyz.960960.koodo", - "productName": "Koodo Reader", - "copyright": "Copyright (c) 2021-2022 ${author}", - "files": [ - "build/**/*", - "node_modules/**/*", - "package.json", - "main.js", - "edge-tts.js" - ], - "directories": { - "buildResources": "assets" - }, - "publish": { - "provider": "github", - "repo": "koodo-reader", - "owner": "koodo-reader" - }, - "buildDependenciesFromSource": false, - "nodeGypRebuild": false, - "fileAssociations": [ - { - "ext": "epub", - "icon": "assets/icons/epub", - "role": "Viewer", - "mimeType": "application/epub+zip" - }, - { - "ext": "pdf", - "icon": "assets/icons/pdf", - "role": "Viewer", - "mimeType": "application/pdf" - }, - { - "ext": "mobi", - "icon": "assets/icons/mobi", - "role": "Viewer", - "mimeType": "application/x-mobipocket-ebook" - }, - { - "ext": "azw3", - "icon": "assets/icons/azw3", - "role": "Viewer", - "mimeType": "application/vnd.amazon.ebook" - }, - { - "ext": "azw", - "icon": "assets/icons/azw3", - "role": "Viewer", - "mimeType": "application/vnd.amazon.ebook" - }, - { - "ext": "cbz", - "icon": "assets/icons/comic", - "role": "Viewer", - "mimeType": "application/x-cbz" - }, - { - "ext": "cbr", - "icon": "assets/icons/comic", - "role": "Viewer", - "mimeType": "application/x-cbr" - }, - { - "ext": "cbt", - "icon": "assets/icons/comic", - "role": "Viewer", - "mimeType": "application/x-cbt" - }, - { - "ext": "cb7", - "icon": "assets/icons/comic", - "role": "Viewer", - "mimeType": "application/x-cb7" - }, - { - "ext": "fb2", - "icon": "assets/icons/fb2", - "role": "Viewer", - "mimeType": "application/x-fictionbook+xml" - } - ], - "extends": null, - "dmg": { - "contents": [ - { - "x": 410, - "y": 150, - "type": "link", - "path": "/Applications" - }, - { - "x": 130, - "y": 150, - "type": "file" - } - ] - }, - "mac": { - "target": [ - { - "target": "dmg", - "arch": [ - "x64", - "arm64" - ] - } - ], - "icon": "assets/icons/icon.icns", - "category": "public.app-category.productivity", - "artifactName": "${productName}-${version}-${arch}.${ext}" - }, - "win": { - "target": [ - { - "target": "nsis", - "arch": [ - "x64" - ] - }, - { - "target": "zip", - "arch": [ - "x64", - "ia32", - "arm64" - ] - }, - { - "target": "portable", - "arch": [ - "x64" - ] - } - ], - "icon": "assets/icons/icon.ico", - "artifactName": "${productName}-${version}-${arch}-Win.${ext}", - "publisherName": "App by Troye" - }, - "linux": { - "icon": "assets/icons", - "category": "Office", - "target": [ - { - "target": "snap", - "arch": [ - "x64" - ] - }, - { - "target": "deb", - "arch": [ - "arm64", - "ia32", - "x64" - ] - }, - { - "target": "rpm", - "arch": [ - "x64" - ] - }, - { - "target": "AppImage", - "arch": [ - "arm64", - "ia32", - "x64" - ] - } - ], - "artifactName": "${productName}-${version}-${arch}.${ext}" - }, - "portable": { - "artifactName": "${productName}-${version}-Portable.${ext}" - }, - "nsis": { - "artifactName": "${productName}-${version}.${ext}", - "oneClick": false, - "allowToChangeInstallationDirectory": true, - "include": "assets/windows/installer.nsh" - }, - "snap": { - "publish": [ - { - "provider": "github" - } - ] - } - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "babel": { - "presets": [ - "react-app" - ], - "plugins": [ - [ - "react-hot-loader/babel" - ] - ] - } -} diff --git a/pkgs/by-name/ko/koodo-reader/package.nix b/pkgs/by-name/ko/koodo-reader/package.nix index 5a53af807eea..9fa8ce626b9a 100644 --- a/pkgs/by-name/ko/koodo-reader/package.nix +++ b/pkgs/by-name/ko/koodo-reader/package.nix @@ -1,10 +1,11 @@ { lib, stdenv, - mkYarnPackage, fetchFromGitHub, - applyPatches, fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + nodejs, makeDesktopItem, copyDesktopItems, makeWrapper, @@ -15,31 +16,28 @@ let electronDist = electron + (if stdenv.isDarwin then "/Applications" else "/libexec/electron"); in -mkYarnPackage rec { +stdenv.mkDerivation (finalAttrs: { pname = "koodo-reader"; - version = "1.6.6"; + version = "1.6.7"; - src = applyPatches { - src = fetchFromGitHub { - owner = "troyeguo"; - repo = "koodo-reader"; - rev = "v${version}"; - hash = "sha256-g2bVm8LFeEIPaWlaxzMI0SrpM+79zQFzJ7Vs5CbWBT4="; - }; - patches = [ ./update-react-i18next.patch ]; # Could be upstreamed + src = fetchFromGitHub { + owner = "troyeguo"; + repo = "koodo-reader"; + rev = "v${finalAttrs.version}"; + hash = "sha256-ZHRU8dJjKQFLIB1t2VK/COy6a3nShUeWR8iAM9YJdto="; }; - # should be copied from `koodo-reader.src` - packageJSON = ./package.json; - offlineCache = fetchYarnDeps { - yarnLock = "${src}/yarn.lock"; - hash = "sha256-VvYkotVb74zR9+/IWiQwOX/6RJf+xukpi7okRovfVzc="; + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-58mxYt2wD6SGzhvo9c44CPmdX+/tLnbJCMPafo4txbY="; }; nativeBuildInputs = [ makeWrapper + yarnConfigHook + yarnBuildHook + nodejs ] ++ lib.optionals (!stdenv.isDarwin) [ copyDesktopItems @@ -53,28 +51,12 @@ mkYarnPackage rec { # disable code signing on Darwin env.CSC_IDENTITY_AUTO_DISCOVERY = "false"; - configurePhase = '' - runHook preConfigure - - cp -r $node_modules node_modules - chmod +w node_modules - - runHook postConfigure - ''; - - buildPhase = '' - runHook preBuild - - export HOME=$(mktemp -d) - yarn --offline build - + postBuild = '' cp -r ${electronDist} electron-dist chmod -R u+w electron-dist yarn --offline run electron-builder --dir \ -c.electronDist=electron-dist \ -c.electronVersion=${electron.version} - - runHook postBuild ''; installPhase = '' @@ -107,15 +89,13 @@ mkYarnPackage rec { --inherit-argv0 ''; - doDist = false; - desktopItems = [ (makeDesktopItem { name = "koodo-reader"; desktopName = "Koodo Reader"; exec = "koodo-reader %U"; icon = "koodo-reader"; - comment = meta.description; + comment = finalAttrs.meta.description; categories = [ "Office" ]; mimeTypes = [ "application/epub+zip" @@ -136,7 +116,7 @@ mkYarnPackage rec { ]; meta = { - changelog = "https://github.com/troyeguo/koodo-reader/releases/tag/v${version}"; + changelog = "https://github.com/troyeguo/koodo-reader/releases/tag/v${finalAttrs.version}"; description = "A cross-platform ebook reader"; longDescription = '' A modern ebook manager and reader with sync and backup capacities @@ -148,4 +128,4 @@ mkYarnPackage rec { maintainers = with lib.maintainers; [ tomasajt ]; platforms = electron.meta.platforms; }; -} +}) diff --git a/pkgs/by-name/ko/koodo-reader/update-react-i18next.patch b/pkgs/by-name/ko/koodo-reader/update-react-i18next.patch deleted file mode 100644 index 6d71460ee38d..000000000000 --- a/pkgs/by-name/ko/koodo-reader/update-react-i18next.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/package.json b/package.json -index c71b04a1..a4b4b3ef 100644 ---- a/package.json -+++ b/package.json -@@ -67,7 +67,7 @@ - "react-device-detect": "^1.12.1", - "react-dom": "^17.0.2", - "react-dropzone": "^11.3.0", -- "react-i18next": "^11.8.15", -+ "react-i18next": "^13.2.2", - "react-lottie": "^1.2.3", - "react-redux": "^7.2.0", - "react-router-dom": "^5.2.0", -diff --git a/yarn.lock b/yarn.lock -index 881db5b2..2df4d362 100644 ---- a/yarn.lock -+++ b/yarn.lock -@@ -1828,7 +1828,7 @@ - resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" - integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== - --"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.20.6", "@babel/runtime@^7.20.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": -+"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.20.6", "@babel/runtime@^7.20.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" - integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== -@@ -1842,6 +1842,13 @@ - dependencies: - regenerator-runtime "^0.14.0" - -+"@babel/runtime@^7.22.5": -+ version "7.23.1" -+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" -+ integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== -+ dependencies: -+ regenerator-runtime "^0.14.0" -+ - "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" -@@ -10951,12 +10958,12 @@ react-i18next@*: - "@babel/runtime" "^7.20.6" - html-parse-stringify "^3.0.1" - --react-i18next@^11.8.15: -- version "11.18.6" -- resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.18.6.tgz#e159c2960c718c1314f1e8fcaa282d1c8b167887" -- integrity sha512-yHb2F9BiT0lqoQDt8loZ5gWP331GwctHz9tYQ8A2EIEUu+CcEdjBLQWli1USG3RdWQt3W+jqQLg/d4rrQR96LA== -+react-i18next@^13.2.2: -+ version "13.2.2" -+ resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.2.2.tgz#b1e78ed66a54f4bc819616f68b98221e1b1a1936" -+ integrity sha512-+nFUkbRByFwnrfDcYqvzBuaeZb+nACHx+fAWN/pZMddWOCJH5hoc21+Sa/N/Lqi6ne6/9wC/qRGOoQhJa6IkEQ== - dependencies: -- "@babel/runtime" "^7.14.5" -+ "@babel/runtime" "^7.22.5" - html-parse-stringify "^3.0.1" - - react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: diff --git a/pkgs/by-name/li/listmonk/frontend.nix b/pkgs/by-name/li/listmonk/frontend.nix index 928092038c12..1584526d4b23 100644 --- a/pkgs/by-name/li/listmonk/frontend.nix +++ b/pkgs/by-name/li/listmonk/frontend.nix @@ -1,37 +1,34 @@ -{ mkYarnPackage +{ stdenv , fetchYarnDeps +, yarnConfigHook +, yarnBuildHook +, nodejs , meta , version , src }: -mkYarnPackage { +stdenv.mkDerivation (finalAttrs: { pname = "listmonk-frontend"; inherit version; src = "${src}/frontend"; - packageJSON = ./package.json; offlineCache = fetchYarnDeps { yarnLock = "${src}/frontend/yarn.lock"; hash = "sha256-TdrglyRtb2Q8SFtoiCoDj/zBV2+7DwzIm/Fzlt0ZvSo="; }; - configurePhase = '' - ln -s $node_modules node_modules - ''; - - buildPhase = '' - yarn --offline build - ''; + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + ]; installPhase = '' mkdir $out cp -R dist/* $out ''; - doDist = false; - - inherit meta; -} +}) diff --git a/pkgs/by-name/li/listmonk/package.json b/pkgs/by-name/li/listmonk/package.json deleted file mode 100644 index 25018ef265dd..000000000000 --- a/pkgs/by-name/li/listmonk/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "listmonk", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "vite", - "build": "vite build", - "serve": "vite preview", - "lint": "eslint --ext .js,.vue --ignore-path .gitignore src", - "prebuild": "eslint --ext .js,.vue --ignore-path .gitignore src" - }, - "dependencies": { - "@tinymce/tinymce-vue": "^3", - "axios": "^1.6.2", - "buefy": "^0.9.25", - "bulma": "^0.9.4", - "chart.js": "^4.4.1", - "codeflask": "^1.4.1", - "dayjs": "^1.11.10", - "indent.js": "^0.3.5", - "qs": "^6.10.1", - "textversionjs": "^1.1.3", - "tinymce": "^5.10.9", - "turndown": "^7.1.2", - "vue": "^2.7.14", - "vue-chartjs": "^5.3.0", - "vue-i18n": "^8.28.2", - "vue-router": "^3.2.0", - "vuex": "^3.6.2" - }, - "devDependencies": { - "@vitejs/plugin-vue2": "^2.3.1", - "@vue/eslint-config-airbnb": "^7.0.1", - "cypress": "13.6.1", - "cypress-file-upload": "^5.0.2", - "eslint": "^8.56.0", - "eslint-define-config": "^2.0.0", - "eslint-plugin-import": "^2.23.3", - "eslint-plugin-vue": "^9.19.2", - "sass": "^1.34.0", - "vite": "^5.0.12", - "vue-eslint-parser": "^9.3.2", - "vue-template-compiler": "^2.6.12" - } -} diff --git a/pkgs/by-name/po/postlight-parser/package.json b/pkgs/by-name/po/postlight-parser/package.json deleted file mode 100644 index 11b49c9e686e..000000000000 --- a/pkgs/by-name/po/postlight-parser/package.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "name": "@postlight/parser", - "version": "2.2.3", - "description": "Postlight Parser transforms web pages into clean text. Publishers and programmers use it to make the web make sense, and readers use it to read any web article comfortably.", - "author": "Postlight ", - "homepage": "https://reader.postlight.com", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/postlight/parser.git" - }, - "bugs": { - "url": "https://github.com/postlight/parser/issues" - }, - "keywords": [ - "mercury", - "parser", - "reader", - "web", - "content" - ], - "files": [ - "dist", - "cli.js", - "src/shims/" - ], - "main": "./dist/mercury.js", - "bin": { - "mercury-parser": "./cli.js", - "postlight-parser": "./cli.js" - }, - "scripts": { - "lint": "eslint . --fix", - "lint:ci": "remark . && eslint .", - "lint-fix-quiet": "eslint --fix --quiet", - "build": "yarn lint && rollup -c && yarn test:build", - "build:ci": "rollup -c && yarn test:build", - "build:web": "yarn lint && rollup -c rollup.config.web.js && yarn test:build:web", - "build:esm": "yarn lint && rollup -c rollup.config.esm.js && yarn test:build:esm", - "build:esm:ci": "rollup -c rollup.config.esm.js && yarn test:build:esm", - "build:web:ci": "rollup -c rollup.config.web.js && yarn test:build:web", - "release": "yarn build && yarn build:web", - "build:generator": "rollup -c scripts/rollup.config.js", - "test_build": "rollup -c", - "test": "yarn test:node && yarn test:web", - "test:node": "jest --json --outputFile test-output.json", - "test:web": "node ./node_modules/karma/bin/karma start karma.conf.js --auto-watch", - "test:build": "cd ./scripts && jest check-build.test.js", - "test:build:web": "node ./scripts/proxy-browser-test.js", - "test:build:esm": "node ./scripts/proxy-browser-test.js", - "watch:test": "jest --watch", - "generate-parser": "node ./dist/generate-custom-parser.js" - }, - "engines": { - "node": ">=10" - }, - "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/plugin-transform-runtime": "^7.0.0", - "@babel/polyfill": "^7.0.0", - "@babel/preset-env": "^7.0.0", - "@babel/runtime": "^7.0.0", - "@jesses/circle-github-bot": "^2.1.0", - "@octokit/rest": "^16.9.0", - "babel-core": "^7.0.0-bridge.0", - "babel-eslint": "^10.0.1", - "babel-jest": "^23.4.2", - "babel-plugin-module-alias": "^1.6.0", - "babel-plugin-module-resolver": "^3.1.2", - "babelify": "^10.0.0", - "babelrc-rollup": "^3.0.0", - "brfs": "^2.0.1", - "brfs-babel": "^2.0.0", - "browserify": "^16.2.3", - "changelog-maker": "^2.3.0", - "eslint": "^5.12.0", - "eslint-config-airbnb": "^17.1.0", - "eslint-config-prettier": "^6.1.0", - "eslint-import-resolver-babel-module": "^2.2.1", - "eslint-plugin-babel": "^5.3.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-react": "^7.12.3", - "express": "^4.16.4", - "husky": "^3.0.0", - "inquirer": "^7.0.0", - "jasmine-core": "^2.5.2", - "jest": "^23.6.0", - "jest-cli": "^23.6.0", - "karma": "^6.3.16", - "karma-browserify": "8.1.0", - "karma-chrome-launcher": "^3.0.0", - "karma-cli": "^2.0.0", - "karma-jasmine": "^1.0.2", - "karma-mocha": "^1.3.0", - "karma-requirejs": "^1.1.0", - "lint-staged": "^8.1.0", - "mocha": "^6.0.0", - "nock": "^10.0.6", - "ora": "^4.0.0", - "prettier": "^1.15.3", - "remark-cli": "^7.0.0", - "remark-lint": "^6.0.4", - "remark-preset-lint-recommended": "^3.0.2", - "request": "^2.88.2", - "requirejs": "^2.3.6", - "rollup": "^1.1.0", - "rollup-plugin-babel": "^4.0.1", - "rollup-plugin-commonjs": "^9.2.0", - "rollup-plugin-node-globals": "^1.4.0", - "rollup-plugin-node-resolve": "^2.0.0", - "rollup-plugin-terser": "^6.1.0", - "rollup-plugin-uglify": "^6.0.1", - "watchify": "^3.11.1" - }, - "dependencies": { - "@babel/runtime-corejs2": "^7.2.0", - "@postlight/ci-failed-test-reporter": "^1.0", - "browser-request": "github:postlight/browser-request#feat-add-headers-to-response", - "cheerio": "^0.22.0", - "difflib": "github:postlight/difflib.js", - "ellipsize": "0.1.0", - "iconv-lite": "0.5.0", - "jquery": "^3.5.0", - "moment": "^2.23.0", - "moment-parseformat": "3.0.0", - "moment-timezone": "0.5.37", - "postman-request": "^2.88.1-postman.31", - "string-direction": "^0.1.2", - "turndown": "^7.1.1", - "valid-url": "^1.0.9", - "wuzzy": "^0.1.4", - "yargs-parser": "^15.0.1" - }, - "bundleDependencies": [ - "jquery", - "moment-timezone", - "browser-request" - ], - "browser": { - "main": "./dist/mercury.web.js", - "cheerio": "./src/shims/cheerio-query", - "jquery": "./node_modules/jquery/dist/jquery.min.js", - "postman-request": "browser-request", - "iconv-lite": "./src/shims/iconv-lite", - "moment-timezone": "./node_modules/moment-timezone/builds/moment-timezone-with-data-2012-2022.min.js" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "*.js": [ - "eslint --fix", - "prettier --write", - "git add" - ], - "*.{json,css,md}": [ - "remark .", - "prettier --write", - "git add" - ] - } -} diff --git a/pkgs/by-name/po/postlight-parser/package.nix b/pkgs/by-name/po/postlight-parser/package.nix index c00028b9a401..fd0617ede1f2 100644 --- a/pkgs/by-name/po/postlight-parser/package.nix +++ b/pkgs/by-name/po/postlight-parser/package.nix @@ -1,36 +1,53 @@ { lib , stdenv -, mkYarnPackage , fetchFromGitHub , fetchYarnDeps +, yarnConfigHook +, yarnBuildHook +, nodejs +, npmHooks }: -mkYarnPackage rec { +stdenv.mkDerivation (finalAttrs: { pname = "postlight-parser"; version = "2.2.3"; src = fetchFromGitHub { owner = "postlight"; repo = "parser"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-k6m95FHeJ+iiWSeY++1zds/bo1RtNXbnv2spaY/M+L0="; }; - packageJSON = ./package.json; - - doDist = false; - offlineCache = fetchYarnDeps { - yarnLock = "${src}/yarn.lock"; + yarnLock = "${finalAttrs.src}/yarn.lock"; hash = "sha256-Vs8bfkhEbPv33ew//HBeDnpQcyWveByHi1gUsdl2CNI="; }; - meta = with lib; { - changelog = "https://github.com/postlight/parser/blob/${src.rev}/CHANGELOG.md"; + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + npmHooks.npmInstallHook + ]; + # Upstream doesn't include a script in package.json that only builds without + # testing, and tests fail because they need to access online websites. Hence + # we use the builtin interface of yarnBuildHook to lint, and in `postBuild` + # we run the rest of commands needed to create the js files eventually + # distributed and wrapped by npmHooks.npmInstallHook + yarnBuildScript = "lint"; + postBuild = '' + yarn --offline run rollup -c + ''; + # Tries to download stuff from the internet in this phase. + dontNpmPrune = true; + + meta = { + changelog = "https://github.com/postlight/parser/blob/${finalAttrs.src.rev}/CHANGELOG.md"; homepage = "https://reader.postlight.com"; description = "Extracts the bits that humans care about from any URL you give it"; - license = licenses.mit; - maintainers = with maintainers; [ viraptor ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ viraptor ]; mainProgram = "postlight-parser"; }; -} +}) diff --git a/pkgs/by-name/sp/spectral-language-server/package.json b/pkgs/by-name/sp/spectral-language-server/package.json deleted file mode 100644 index 1f3651349c62..000000000000 --- a/pkgs/by-name/sp/spectral-language-server/package.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "activationEvents": [ - "onStartupFinished" - ], - "author": "Stoplight ", - "bugs": { - "url": "https://github.com/stoplightio/vscode-spectral/issues" - }, - "categories": [ - "Linters" - ], - "contributes": { - "configuration": { - "properties": { - "spectral.enable": { - "default": true, - "description": "Controls whether or not Spectral is enabled.", - "scope": "resource", - "type": "boolean" - }, - "spectral.rulesetFile": { - "description": "Location of the ruleset file to use when validating. If omitted, the default is a .spectral.yml/.spectral.json in the same folder as the document being validated. Paths are relative to the workspace. This can also be a remote HTTP url.", - "scope": "resource", - "type": "string" - }, - "spectral.run": { - "default": "onType", - "description": "Run the linter on save (onSave) or as you type (onType).", - "enum": [ - "onSave", - "onType" - ], - "scope": "resource", - "type": "string" - }, - "spectral.trace.server": { - "default": "off", - "description": "Traces the communication between VS Code and the language server.", - "enum": [ - "off", - "messages", - "verbose" - ], - "scope": "window", - "type": "string" - }, - "spectral.validateFiles": { - "description": "An array of file globs (e.g., `**/*.yaml`) in minimatch glob format which should be validated by Spectral. If language identifiers are also specified, the file must match both in order to be validated. You can also use negative file globs (e.g., `!**/package.json`) here to exclude files.", - "items": { - "type": "string" - }, - "scope": "resource", - "type": "array" - }, - "spectral.validateLanguages": { - "default": [ - "json", - "yaml" - ], - "description": "An array of language IDs which should be validated by Spectral. If file globs are also specified, the file must match both in order to be validated.", - "items": { - "type": "string" - }, - "scope": "resource", - "type": "array" - } - }, - "title": "Spectral", - "type": "object" - }, - "commands": [ - { - "title": "Show Output Channel", - "category": "Spectral", - "command": "spectral.showOutputChannel" - } - ] - }, - "description": "JSON/YAML linter with OpenAPI and custom ruleset support.", - "devDependencies": { - "@types/chai": "^4.3.1", - "@types/chai-jest-snapshot": "^1.3.6", - "@types/glob": "^7.2.0", - "@types/mocha": "^9.1.0", - "@types/node": "^18.11.18", - "@types/vscode": "^1.48.0", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.1.0", - "chai": "^4.2.0", - "chai-jest-snapshot": "^2.0.0", - "copyfiles": "^2.4.1", - "cross-env": "^7.0.3", - "eslint": "^7.8.1", - "eslint-config-google": "^0.14.0", - "glob": "^8.0.3", - "http-test-servers": "^2.0.0", - "merge-options": "^3.0.0", - "mocha": "^8.1.3", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "shelljs": "^0.8.5", - "ts-loader": "^9.2.8", - "ts-node": "^8.10.2", - "typescript": "beta", - "vsce": "^1.103.1", - "vscode-test": "^1.5.0", - "webpack": "^5.72.0", - "webpack-cli": "^4.9.2" - }, - "displayName": "Spectral", - "engines": { - "vscode": "^1.48.0", - "node": "^12.20 || >= 14.13" - }, - "homepage": "https://github.com/stoplightio/vscode-spectral", - "icon": "icon.png", - "keywords": [ - "linter", - "validator", - "OpenAPI", - "Swagger", - "API", - "style guide", - "API description", - "API specification", - "OAS", - "OAS2", - "OAS3", - "AsyncAPI", - "json", - "yaml" - ], - "license": "Apache-2.0", - "main": "./client/index.js", - "name": "spectral", - "private": true, - "publisher": "stoplight", - "repository": { - "type": "git", - "url": "https://github.com/stoplightio/vscode-spectral" - }, - "scripts": { - "clean": "rimraf dist && rimraf \"{server,client}/dist\"", - "lint": "eslint --ext .ts,.js .", - "test": "mocha -r ts-node/register \"./+(client|server)/__tests__/unit/**/*.test.ts\"", - "test:e2e": "cross-env CI=true CHAI_JEST_SNAPSHOT_UPDATE_ALL=false ts-node ./client/src/__tests__/e2e/index.ts" - }, - "version": "1.1.2", - "workspaces": { - "packages": [ - "client", - "server" - ], - "nohoist": [ - "client/**", - "server/**" - ] - } -} diff --git a/pkgs/by-name/sp/spectral-language-server/package.nix b/pkgs/by-name/sp/spectral-language-server/package.nix index 8193ff3acebd..9c895e171f7a 100644 --- a/pkgs/by-name/sp/spectral-language-server/package.nix +++ b/pkgs/by-name/sp/spectral-language-server/package.nix @@ -1,7 +1,10 @@ { lib , buildNpmPackage -, mkYarnPackage +, stdenv , fetchYarnDeps +, yarnConfigHook +, yarnBuildHook +, nodejs , fetchFromGitHub , typescript , jq @@ -10,33 +13,29 @@ let # Instead of the build script that spectral-language-server provides (ref: https://github.com/luizcorreia/spectral-language-server/blob/master/script/vscode-spectral-build.sh), we build vscode-spectral manually. # This is because the script must go through the network and will not work under the Nix sandbox environment. - vscodeSpectral = mkYarnPackage rec { + vscodeSpectral = stdenv.mkDerivation (finalAttrs: { pname = "vscode-spectral"; version = "1.1.2"; src = fetchFromGitHub { owner = "stoplightio"; repo = "vscode-spectral"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-TWy+bC6qhTKDY874ORTBbvCIH8ycpmBiU8GLYxBIiAs="; }; - packageJSON = ./package.json; - offlineCache = fetchYarnDeps { - yarnLock = src + "/yarn.lock"; + yarnLock = finalAttrs.src + "/yarn.lock"; hash = "sha256-am27A9VyFoXuOlgG9mnvNqV3Q7Bi7GJzDqqVFGDVWIA="; }; - nativeBuildInputs = [ typescript jq ]; + nativeBuildInputs = [ typescript jq yarnConfigHook ]; postPatch = '' cp server/tsconfig.json server/tsconfig.json.bak jq '.compilerOptions += {"module": "NodeNext", "moduleResolution": "NodeNext"}' server/tsconfig.json.bak > server/tsconfig.json ''; - dontConfigure = true; - buildPhase = '' runHook preBuild # FIXME: vscode-spactral depends on @rollup/pluginutils, but it may have a bug that doesn't provide the type definitions for NodeNext module resolution. (ref: https://github.com/rollup/plugins/issues/1192) @@ -53,14 +52,12 @@ let runHook postInstall ''; - doDist = false; - meta = with lib; { homepage = "https://github.com/stoplightio/vscode-spectral"; description = "VS Code extension bringing the awesome Spectral JSON/YAML linter with OpenAPI/AsyncAPI support"; license = licenses.asl20; }; - }; + }); in buildNpmPackage rec { pname = "spectral-language-server"; diff --git a/pkgs/by-name/tr/treedome/package.json b/pkgs/by-name/tr/treedome/package.json deleted file mode 100644 index bc56e53d0266..000000000000 --- a/pkgs/by-name/tr/treedome/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "treedome", - "private": true, - "version": "0.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc && vite build", - "preview": "vite preview", - "tauri": "tauri", - "clean": "rm -rf node_modules", - "prettier-format": "prettier --config .prettierrc 'src/**/*.ts*' --write" - }, - "dependencies": { - "@column-resizer/react": "^1.3.0", - "@emotion/react": "^11.11.1", - "@emotion/styled": "^11.11.0", - "@fontsource/noto-sans": "^5.0.8", - "@fontsource/noto-sans-mono": "^5.0.8", - "@leeoniya/ufuzzy": "^1.0.8", - "@mantine/core": "^7.5.0", - "@mantine/form": "^7.5.0", - "@mantine/hooks": "^7.5.0", - "@mantine/modals": "^7.5.0", - "@mantine/notifications": "^7.5.0", - "@mantine/spotlight": "^7.5.0", - "@mantine/tiptap": "^7.5.0", - "@minoru/react-dnd-treeview": "^3.4.4", - "@mui/icons-material": "^5.14.0", - "@mui/material": "^5.14.0", - "@tabler/icons-react": "^2.28.0", - "@tauri-apps/api": "^1.4.0", - "@tiptap/extension-code-block-lowlight": "^2.0.4", - "@tiptap/extension-highlight": "^2.0.4", - "@tiptap/extension-image": "^2.0.4", - "@tiptap/extension-link": "^2.0.4", - "@tiptap/extension-placeholder": "^2.0.4", - "@tiptap/extension-subscript": "^2.0.4", - "@tiptap/extension-superscript": "^2.0.4", - "@tiptap/extension-text-align": "^2.0.4", - "@tiptap/extension-typography": "^2.2.3", - "@tiptap/extension-underline": "^2.0.4", - "@tiptap/pm": "^2.0.4", - "@tiptap/react": "^2.0.4", - "@tiptap/starter-kit": "^2.0.4", - "@types/lodash": "^4.14.195", - "fuse.js": "^7.0.0", - "jotai": "^2.2.2", - "lodash": "^4.17.21", - "lowlight": "^2.9.0", - "rc-tree": "^5.7.8", - "react": "^18.2.0", - "react-dnd": "^16.0.1", - "react-dom": "^18.2.0", - "react-idle-timer": "^5.7.2", - "wouter": "^2.11.0" - }, - "devDependencies": { - "@tauri-apps/cli": "^1.4.0", - "@types/node": "^20.4.4", - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.19", - "@vitejs/plugin-react": "^4.0.3", - "prettier": "^3.0.0", - "typescript": "^5.1.6", - "vite": "^4.4.6" - } -} diff --git a/pkgs/by-name/tr/treedome/package.nix b/pkgs/by-name/tr/treedome/package.nix index ca92f33ed5dd..de0236d0a930 100644 --- a/pkgs/by-name/tr/treedome/package.nix +++ b/pkgs/by-name/tr/treedome/package.nix @@ -8,7 +8,10 @@ , gsettings-desktop-schemas , gtk3 , libsoup -, mkYarnPackage +, stdenv +, yarnConfigHook +, yarnBuildHook +, nodejs , openssl , pkg-config , rustPlatform @@ -28,31 +31,20 @@ let fetchLFS = true; }; - frontend-build = mkYarnPackage { - inherit version src; + frontend-build = stdenv.mkDerivation (finalAttrs: { pname = "treedome-ui"; + inherit version src; offlineCache = fetchYarnDeps { yarnLock = "${src}/yarn.lock"; hash = "sha256-CrD/n8z5fJKkBKEcvpRHJaqXBt1gbON7VsuLb2JGu1A="; }; - packageJSON = ./package.json; - - configurePhase = '' - runHook preConfigure - ln -s $node_modules node_modules - runHook postConfigure - ''; - - buildPhase = '' - runHook preBuild - - export HOME=$(mktemp -d) - yarn --offline run build - - runHook postBuild - ''; + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + ]; installPhase = '' runHook preInstall @@ -62,9 +54,7 @@ let runHook postInstall ''; - - doDist = false; - }; + }); in rustPlatform.buildRustPackage { inherit version pname src; diff --git a/pkgs/by-name/vi/vim-language-server/package.json b/pkgs/by-name/vi/vim-language-server/package.json deleted file mode 100644 index bbc996c8302a..000000000000 --- a/pkgs/by-name/vi/vim-language-server/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "vim-language-server", - "version": "2.3.1", - "description": "vim language server", - "keywords": [ - "viml", - "vim", - "lsp", - "language", - "server", - "autocomplete" - ], - "main": "./out/index.js", - "repository": "https://github.com/iamcco/vim-language-server", - "author": "iamcco ", - "license": "MIT", - "scripts": { - "build-docs": "rm ./src/docs/builtin-docs.json && ./bin/build-docs.js", - "build": "rm -rf ./out && webpack", - "watch": "webpack -w", - "test": "mocha test/src/**/*.ts --require ts-node/register", - "lint": "tslint -c tslint.json --format verbose {.,test}/src/**/*.ts src/index.ts", - "fix": "tslint -c tslint.json --fix {.,test}/src/**/*.ts src/index.ts" - }, - "bin": { - "vim-language-server": "./bin/index.js" - }, - "devDependencies": { - "@types/mocha": "^7.0.2", - "@types/node": "^11.13.6", - "chai": "^4.2.0", - "chai-as-promised": "^7.1.1", - "fast-glob": "^3.2.4", - "findup": "^0.1.5", - "mocha": "^7.1.2", - "rxjs": "^6.6.7", - "rxjs-operators": "^1.1.3", - "shvl": "^2.0.0", - "ts-loader": "^8.1.0", - "ts-node": "^9.1.1", - "tslint": "^6.1.3", - "typescript": "^4.2.3", - "vscode-languageserver": "^7.0.0", - "vscode-languageserver-textdocument": "^1.0.1", - "vscode-uri": "^3.0.2", - "webpack": "^5.30.0", - "webpack-cli": "^4.6.0" - } -} diff --git a/pkgs/by-name/vi/vim-language-server/package.nix b/pkgs/by-name/vi/vim-language-server/package.nix index 5e085d0f6d71..3d60dd1ca5fb 100644 --- a/pkgs/by-name/vi/vim-language-server/package.nix +++ b/pkgs/by-name/vi/vim-language-server/package.nix @@ -1,38 +1,41 @@ { lib -, mkYarnPackage +, stdenv , fetchFromGitHub , fetchYarnDeps +, yarnConfigHook +, yarnBuildHook +, nodejs +, npmHooks }: -mkYarnPackage rec { +stdenv.mkDerivation (finalAttrs: { pname = "vim-language-server"; version = "2.3.1"; src = fetchFromGitHub { owner = "iamcco"; repo = "vim-language-server"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-NfBKNCTvCMIJrSiTlCG+LtVoMBMdCc3rzpDb9Vp2CGM="; }; - packageJSON = ./package.json; offlineCache = fetchYarnDeps { - yarnLock = src + "/yarn.lock"; + yarnLock = finalAttrs.src + "/yarn.lock"; hash = "sha256-mo8urQaWIHu33+r0Y7mL9mJ/aSe/5CihuIetTeDHEUQ="; }; - buildPhase = '' - runHook preBuild - - export HOME=$(mktemp -d) - # https://stackoverflow.com/a/69699772/4935114 - env NODE_OPTIONS=--openssl-legacy-provider yarn --offline build - - runHook postBuild + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + # Needed for executing package.json scripts + nodejs + npmHooks.npmInstallHook + ]; + # https://stackoverflow.com/a/69699772/4935114 + preBuild = '' + export NODE_OPTIONS=--openssl-legacy-provider ''; - doDist = false; - meta = with lib; { description = "VImScript language server, LSP for vim script"; homepage = "https://github.com/iamcco/vim-language-server"; @@ -40,4 +43,4 @@ mkYarnPackage rec { maintainers = with maintainers; [ doronbehar ]; mainProgram = "vim-language-server"; }; -} +}) diff --git a/pkgs/by-name/yo/your_spotify/client.nix b/pkgs/by-name/yo/your_spotify/client.nix index 420498821bf9..4453d3988621 100644 --- a/pkgs/by-name/yo/your_spotify/client.nix +++ b/pkgs/by-name/yo/your_spotify/client.nix @@ -1,49 +1,36 @@ { - apiEndpoint ? "http://localhost:3000", - fetchYarnDeps, - your_spotify, - mkYarnPackage, - fixup-yarn-lock, + stdenv, src, version, - yarn, + meta, + offlineCache, + apiEndpoint ? "http://localhost:3000", + yarnConfigHook, + yarnBuildHook, + nodejs }: -mkYarnPackage rec { - inherit version src; + +stdenv.mkDerivation (finalAttrs: { pname = "your_spotify_client"; - name = "your_spotify_client-${version}"; - packageJSON = ./package.json; - offlineCache = fetchYarnDeps { - yarnLock = src + "/yarn.lock"; - hash = "sha256-5SgknaRVzgO2Dzc8MhAaM8UERWMv+PrItzevoWHbWnA="; - }; - configurePhase = '' - runHook preConfigure + inherit version src offlineCache; - export HOME=$(mktemp -d) - yarn config --offline set yarn-offline-mirror $offlineCache - fixup-yarn-lock yarn.lock - yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive - patchShebangs node_modules/ + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + ]; - runHook postConfigure - ''; - buildPhase = '' - runHook preBuild + API_ENDPOINT="${apiEndpoint}"; + preBuild = '' pushd ./apps/client/ - yarn --offline run build - export API_ENDPOINT="${apiEndpoint}" + ''; + postBuild = '' substituteInPlace scripts/run/variables.sh --replace-quiet '/app/apps/client/' "./" - chmod +x ./scripts/run/variables.sh patchShebangs --build ./scripts/run/variables.sh - ./scripts/run/variables.sh - popd - runHook postBuild ''; - nativeBuildInputs = [yarn fixup-yarn-lock]; installPhase = '' runHook preInstall @@ -51,8 +38,6 @@ mkYarnPackage rec { cp -r ./apps/client/build/* $out runHook postInstall ''; - doDist = false; - meta = { - inherit (your_spotify.meta) homepage changelog description license maintainers; - }; -} + + inherit meta; +}) diff --git a/pkgs/by-name/yo/your_spotify/package.json b/pkgs/by-name/yo/your_spotify/package.json deleted file mode 100644 index 8c10988ffb6d..000000000000 --- a/pkgs/by-name/yo/your_spotify/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@your_spotify/root", - "version": "1.10.1", - "repository": "git@github.com:Yooooomi/your_spotify.git", - "author": "Timothee ", - "private": true, - "workspaces": [ - "apps/*" - ] -} diff --git a/pkgs/by-name/yo/your_spotify/package.nix b/pkgs/by-name/yo/your_spotify/package.nix index 0296b9d22c02..738d1aefa248 100644 --- a/pkgs/by-name/yo/your_spotify/package.nix +++ b/pkgs/by-name/yo/your_spotify/package.nix @@ -1,85 +1,76 @@ { - callPackage, + lib, + stdenv, fetchFromGitHub, fetchYarnDeps, - lib, - makeWrapper, - mkYarnPackage, + yarnConfigHook, + yarnBuildHook, nodejs, - fixup-yarn-lock, - yarn, -}: let + makeWrapper, + callPackage, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "your_spotify_server"; version = "1.10.1"; + src = fetchFromGitHub { owner = "Yooooomi"; repo = "your_spotify"; - rev = "refs/tags/${version}"; + rev = "refs/tags/${finalAttrs.version}"; hash = "sha256-e82j2blGxQLWAlBNuAnFvlD9vwMk4/mRI0Vf7vuaPA0="; }; - client = callPackage ./client.nix {inherit src version;}; -in - mkYarnPackage rec { - inherit version src; - pname = "your_spotify_server"; - name = "your_spotify_server-${version}"; - packageJSON = ./package.json; - offlineCache = fetchYarnDeps { - yarnLock = src + "/yarn.lock"; - hash = "sha256-5SgknaRVzgO2Dzc8MhAaM8UERWMv+PrItzevoWHbWnA="; + + offlineCache = fetchYarnDeps { + yarnLock = finalAttrs.src + "/yarn.lock"; + hash = "sha256-5SgknaRVzgO2Dzc8MhAaM8UERWMv+PrItzevoWHbWnA="; + }; + + nativeBuildInputs = [ + makeWrapper + yarnConfigHook + yarnBuildHook + nodejs + ]; + + preBuild = '' + pushd ./apps/server/ + ''; + postBuild = '' + popd + rm -r node_modules + export NODE_ENV="production" + yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive + patchShebangs node_modules/ + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/your_spotify + cp -r node_modules $out/share/your_spotify/node_modules + cp -r ./apps/server/{lib,package.json} $out + mkdir -p $out/bin + makeWrapper ${lib.escapeShellArg (lib.getExe nodejs)} "$out/bin/your_spotify_migrate" \ + --add-flags "$out/lib/migrations.js" --set NODE_PATH "$out/share/your_spotify/node_modules" + makeWrapper ${lib.escapeShellArg (lib.getExe nodejs)} "$out/bin/your_spotify_server" \ + --add-flags "$out/lib/index.js" --set NODE_PATH "$out/share/your_spotify/node_modules" + + runHook postInstall + ''; + + passthru = { + client = callPackage ./client.nix { + inherit (finalAttrs) src version offlineCache meta; }; + }; - configurePhase = '' - runHook preConfigure - - export HOME=$(mktemp -d) - yarn config --offline set yarn-offline-mirror $offlineCache - fixup-yarn-lock yarn.lock - - runHook postConfigure - ''; - - buildPhase = '' - runHook preBuild - - yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive - patchShebangs node_modules/ - - pushd ./apps/server/ - yarn --offline run build - popd - - rm -r node_modules - export NODE_ENV="production" - yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive - patchShebangs node_modules/ - - runHook postBuild - ''; - nativeBuildInputs = [makeWrapper yarn fixup-yarn-lock]; - installPhase = '' - runHook preInstall - - mkdir -p $out/share/your_spotify - cp -r node_modules $out/share/your_spotify/node_modules - cp -r ./apps/server/{lib,package.json} $out - mkdir -p $out/bin - makeWrapper ${lib.escapeShellArg (lib.getExe nodejs)} "$out/bin/your_spotify_migrate" \ - --add-flags "$out/lib/migrations.js" --set NODE_PATH "$out/share/your_spotify/node_modules" - makeWrapper ${lib.escapeShellArg (lib.getExe nodejs)} "$out/bin/your_spotify_server" \ - --add-flags "$out/lib/index.js" --set NODE_PATH "$out/share/your_spotify/node_modules" - - runHook postInstall - ''; - doDist = false; - passthru = { - inherit client; - }; - meta = with lib; { - homepage = "https://github.com/Yooooomi/your_spotify"; - changelog = "https://github.com/Yooooomi/your_spotify/releases/tag/${version}"; - description = "Self-hosted application that tracks what you listen and offers you a dashboard to explore statistics about it"; - license = licenses.gpl3Only; - maintainers = with maintainers; [patrickdag]; - mainProgram = "your_spotify_server"; - }; - } + meta = { + homepage = "https://github.com/Yooooomi/your_spotify"; + changelog = "https://github.com/Yooooomi/your_spotify/releases/tag/${finalAttrs.version}"; + description = "Self-hosted application that tracks what you listen and offers you a dashboard to explore statistics about it"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ patrickdag ]; + mainProgram = "your_spotify_server"; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f8aad00fc1e7..b5281a29245c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -981,6 +981,8 @@ with pkgs; inherit (callPackages ../build-support/node/fetch-yarn-deps { }) fixup-yarn-lock prefetch-yarn-deps + yarnConfigHook + yarnBuildHook fetchYarnDeps; find-cursor = callPackage ../tools/X11/find-cursor { };