all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: swedebugia <swedebugia@riseup.net>
To: Julien Lepiller <julien@lepiller.eu>, guix-devel@gnu.org
Subject: Improved NPM importer with blacklist (Was: Re: NPM importer)
Date: Fri, 30 Nov 2018 17:13:44 +0100	[thread overview]
Message-ID: <12fdf913-eb03-b898-f9ff-8dd455935975@riseup.net> (raw)
In-Reply-To: <70F182DB-C157-4763-A4C6-89985545661C@lepiller.eu>

[-- Attachment #1: Type: text/plain, Size: 2505 bytes --]

Hi :)

On 2018-11-11 16:37, Julien Lepiller wrote:
> I improved a bit over jlicht's work here, but there still a few tgings we want co work on: https://framagit.org/tyreunom/guix/tree/npm
> 
> There is an importer and a build system as well as a few packages. One of tge issue is that the importer is not recursive, so it doesn't get the specified version, and the packages aren't tested because the tests depend on cylic dependencies (and sometimes very big circles).

There is a stub of a recursive importer, but it does not seem to work.

--

I improved on Julliens work and added a blacklister. After much sweat it 
now works and the blacklist is populated with a lot of unneeded 
development dependencies and complex packages.

I added the version to all imported npm-packages and to the inputs as it 
does not make sense to reference the packages without a version given 
all the cyclic dependencies.

Thanks for all the help!

TODO:
* make npm-recursive-import work by not fetching blacklisted packages

* implement keyword blacklisting based on the descriptions

* match not just the whole string of blacklisted packages:
   e.g. match also "rollup-plugin" when "rollup" is in the blacklist.

* get the tarballs from npm-registry instead as they are never missing
   (githubs sometimes are) and likely reproducible.

* Output a (define-public <guixname> (inherit <guixname>-<version>)) for
   all imported npm-packages.

* Make it possible to specify a specific version to import (and perhaps
   the latest of all minor versions of a package :D).
(For async that would be "0.1.22", "0.2.10", "0.3.0", etc all the way up 
to "2.6.1" which is the current beast. This would mean that we in total 
import about 477.000 packages times the number of minor releases (mean 
~10?) that equals 4,7 mio. npm-packages :p) Then we will definitely need 
to speed up guile. My guess is that we will have to import at least 1,5 
versions for every npm package to mitigate cyclic dependencies (this 
means 477.000*1,5 = 715.500 npm-package-versions).

* Make it easy to analyze a given npm-package to see when deps/devdeps 
were added. In the case async, propose we import 0.9.0 first which is 
the last version without lodash as devdep. From 1.0.0 more devdeps were 
added. (source: https://registry.npmjs.org/async)

Perhaps some kind of tree output for these complex packages with 
versions as branches and dependencies as subbranches would be nice?
--

See the files I changed attached.

-- 
Cheers
Swedebugia

[-- Attachment #2: npm.scm.bz2 --]
[-- Type: application/x-bzip, Size: 5882 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: npm-blacklist.scm --]
[-- Type: text/x-scheme; name="npm-blacklist.scm", Size: 6251 bytes --]

;;; Copyright © 2018 swedebugia <swedebugia@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guix import npm-blacklist)
  #:export (blacklist
            keyword-blacklist))

;; Many of these are already in debian.

(define blacklist-benchmark
  '(
    "matcha"
    "benchmark"
    ))
  
(define blacklist-complex
  ;; Complex packages we should not begin with
  '(
    ;; From debian wiki /Javascript:
    ;; Packages used to transform code written for nodejs to run in
    ;; the browser:
    "babel"
    "@babel"
    "babel-core"
    "webpack"
    "rollup"
    "rollup-plugin-node-resolve"
    "browserify"			;This can be replaced by one
					;of the above.
    ;; jquery dependant
    "async"
    "ember" ;A JavaScript framework for creating ambitious web applications
    "broccoli"                          ;Browser compilation library
    "nsp"                               ;security related
    ;; Other complex packages not yet in debian:
    "electron"
    "statsd"
    "vega"
    "grunt-release"
    "lineman"
    "lineman-angular"
    "lerna"
    "openlayers"
    "openpgp"
    "yarnpkg"
    "wekan"
    "etherpad-lite"
    "meteor"
    ))

(define blacklist-deprecated
  '(
   ;; From debian wiki:
    "keybase"
    ))

(define blacklist-doc
  '(
    ;; From underscore:
    "docco"
    ;; From mocha:
    "jsdoc"
    "markdown-toc"))

(define blacklist-lint
  '(
    ;; From underscore:
    "eslint"
    ;; From mocha:
    "eslint-config-prettier"
    "eslint-config-semistandard"
    "eslint-config-standard"
    "eslint-plugin-import"
    "eslint-plugin-node"
    "eslint-plugin-prettier"
    "eslint-plugin-promise"
    "eslint-plugin-standard"
    "lint-staged"
    "markdownlint-cli"
    "prettier-eslint-cli"
    ;;From yargs
    "standard"				;linter & automatic code fixer
    "standard-version"	 ;Automate versioning and CHANGELOG generation
    ;;From tap
    "jscs"		 ;JavaScript Code Style checker
    ;; From nsp
    "eslint-config-nodesecurity"
    ;; From
    "@ljharb/eslint-config"
    ;; From eslint-config
    "editorconfig-tools"		;A tool to verify
    ;; From requirejs
    "jshint"
    ;; from path-is-absolute
    "xo"
    ;; from glob
    "tick"
    ;; video.js
    "tsml"
    ;; callsites
    "tsd-check"
    ;; promptly
    "@commitlint/config-conventional"
    "eslint-config-moxy"
    "@commitlint/cli"
    ;; async
    "jshint-stylish"
    ;; fs-extra
    "standard-markdown"
    ;; is
    "safe-publish-latest"
    ))

(define blacklist-grunt
  '(
    ;; From tap:
    "grunt"				;The JavaScript Task Runner - is in
					;debian
    "grunt-contrib-concat"
    "grunt-contrib-uglify"
    ;; From jquery
    "grunt-compare-size"
    
    ))

(define blacklist-management
  '(
    ;; From parser5:
    "lerna"
    ;; CI
    "vows"))

(define blacklist-other
  '(
    ;; From mocha:
    "husky"
    "nps"
    "rimraf"                            ;complex also
    ;;async
    "colors"                            ;cli
    "cli-table"
    
    ))

(define blacklist-test-assertion
  '(
    ;; mocha
   "chai"				;Chai is an assertion library.
   "unexpected"
    ))

(define blacklist-test-browser
  '(
    ;; mocha
    "karma"
    "karma-qunit"
    "karma-sauce-launcher"
    ;; async
    "karma-browserify"
    ))

(define blacklist-test-coverage
  '(
    ;; mocha
    "coveralls"				;is in debian
    "covert"				;code coverage command
    "nyc"
    ))

(define blacklist-test-general
  ;; sinon and tape are the most common
  '(
   ;; From underscore:
   "qunit-cli"
   "qunit"
   ;; From yargs
   "mocha"				;is in debian
   "yargs-test-extends"
   ;; From commander
   "sinon"				;Test spies, stubs and mocks
   ;; From nsp
   "code"				;assertion, fork of chai
   ;; From minimist
   "tape"				;tap-producing test harness
   ;; universalify
   "colortape"
   "airtap"
   "tap"				;Test-Anything-Protocol
					;library
   ;; klaw
   "tap-spec"
   "lab"				;Node.js test framework
   ;; From nsp
   "mock-fs"
   ;; From many :)
   "nyc"				;istanbul coverage, testing
   ;; from is-wsl
   "proxyquire"
   ;; mocha
   "coffe-script"
   "cross-swawn"
   ;; secure-random
   "terst"
   ;; through2
   "stream-spigot"
   ;; is
   "make-generator-function"
   ;; From github search "test" javascript, sort by stars
   "forking-tap"
   "bogota"
   "faucet"
   "gremlins"
   "jest"
   "redux-mock-store"
   "webdriverio"
   "ava"
   "enzyme"
   "testem"
   "protractor"
   "testcafe"
   "test262"
   "storybook"
   "jasmine"
   "volkswagen"
   "nightwatch"
   "supertest"
   "istanbul"
   "sizzy"
   "zombie"
   "PhantomCSS"
   ))

(define blacklist
  ;; Combine blacklists into one.
  (append
   blacklist-benchmark
   blacklist-complex
   blacklist-deprecated
   blacklist-doc
   blacklist-lint
   blacklist-grunt
   blacklist-management
   blacklist-other
   blacklist-test-assertion
   blacklist-test-browser
   blacklist-test-coverage
   blacklist-test-general
   ))

(define keyword-blacklist
  ;; Blacklist based on description or keywords
  '("assert"
    "assertion"
    "check"
    "test"
    "testing"
    "mock"
    "coverage"
    "lint"
    "linter"
    "security")) 

;; Debugging
;; (format (current-error-port) "Blacklisted: ~a \n" blacklist)
;; (force-output)
;; (format (current-error-port) "Total: ~a packages blacklisted \n" (length blacklist))

  parent reply	other threads:[~2018-11-30 16:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 10:41 NPM importer swedebugia
2018-11-11 15:37 ` Julien Lepiller
2018-11-19 23:29   ` swedebugia
2018-11-20  7:50     ` Julien Lepiller
2018-11-20 19:58       ` swedebugia
2018-11-20 21:12         ` swedebugia
2018-11-20 22:35           ` Julien Lepiller
2018-11-21 15:36             ` swedebugia
2018-11-21  1:41           ` Mike Gerwitz
2018-11-21 22:01             ` Brett Gilio
2018-11-21 23:22               ` swedebugia
2018-11-22  1:02                 ` swedebugia
2018-11-22  5:43                   ` Brett Gilio
2018-11-22 11:27                     ` import libjs-*.deb from Debian? (was Re: NPM importer) Giovanni Biscuolo
2018-11-30  3:23                       ` Ricardo Wurmus
2018-11-22  8:36                   ` NPM importer Julien Lepiller
2018-11-24 13:47                     ` swedebugia
2018-11-23 19:50                   ` swedebugia
2018-11-30  3:17                     ` Ricardo Wurmus
2018-11-30 14:17                   ` Packaging async and underscore (Was: Re: NPM importer) swedebugia
2018-11-30 16:08                     ` Packaging async and underscore Julien Lepiller
2018-11-30 16:44                       ` swedebugia
2018-11-24 13:42       ` NPM importer swedebugia
2018-11-30 16:13   ` swedebugia [this message]
2018-11-30 16:24     ` Improved NPM importer with blacklist Julien Lepiller
2018-11-30 17:20       ` swedebugia
2018-11-30 23:27     ` Improved NPM importer with blacklist (Was: Re: NPM importer) swedebugia
2018-11-11 17:10 ` NPM importer Ludovic Courtès
2018-11-21 16:37   ` Giovanni Biscuolo
2018-11-21 17:15     ` Julien Lepiller
2018-11-22  9:29       ` Giovanni Biscuolo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12fdf913-eb03-b898-f9ff-8dd455935975@riseup.net \
    --to=swedebugia@riseup.net \
    --cc=guix-devel@gnu.org \
    --cc=julien@lepiller.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.