Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-04fix: replace deprecated String.prototype.substr() (#4667)CommanderRoot
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2021-12-02feat: streaming debug logfileLuke Karrys
This decouples the log file writing from the terminal logging. We now open an append only file at the start of the process and stream logs to it. We still only display the log file message in timing mode or if there is an error, but the file is still written regardless. All logging now goes through `proc-log` and this is the first step to removing `npmlog`. For now `npmlog` is still used for the terminal logging but with a shim in front of it to make it easier to test and use in conjunction with `proc-log`. Ref: npm/statusboard#366 This also refactors many of the tests to always use an explicit `t.testdir` for their cache since the file is opened on each `new Npm()`. Tests are also refactored to use more of `MockNpm` with behavior to add config items and load `npm` if necessary. A new fixture `mockGlobals` was also added to make much of this more ergonomic. Ref: npm/statusboard#410 Closes npm/statusboard#411 Closes npm/statusboard#367 PR-URL: https://github.com/npm/cli/pull/4062 Credit: @lukekarrys Close: #4062 Reviewed-by: @wraithgar
2021-11-05chore: update to latest eslint and linting rulesGar
This brings us in line with the rest of the linting rules we are wanting to use on the npm cli repos. There were several hundred over-length lines and instead of editing them all by hand I piped the failing file through `prettier` and back through `eslint` just to save some time and energy. This means there may be some quirks in the linting those files have, but we can fix those if we see them and they bother us. Other than that there were about 50 lines that are legitimately over-length, all are now explicitly overridden. Many are tests that could be snapshots. PR-URL: https://github.com/npm/cli/pull/3995 Credit: @wraithgar Close: #3995 Reviewed-by: @lukekarrys
2021-09-28fix: use Intl.Collator for string sorting when availableisaacs/string-locale-compareisaacs
The npm/cli form of https://github.com/npm/arborist/pull/324 Required adding options support to package used for this. PR-URL: https://github.com/npm/cli/pull/3809 Credit: @isaacs Close: #3809 Reviewed-by: @wraithgar
2021-08-11deps: remove byte-sizeGar
In its latest release, byte-size dropped support for node versions lower than 14. The cli currently supports node 10 and up. The actual functionality we needed and was using was extremely limited in scope, and didn't warrant an external module. It's just pretty printing a file size, and the files we are dealing with are limited in size so we don't need to support so many suffixes. PR-URL: https://github.com/npm/cli/pull/3569 Credit: @wraithgar Close: #3569 Reviewed-by: @isaacs
2021-05-10fix(packages): locale-agnostic string sortingisaacs
This adds the 'en' locale to all instances of String.localeCompare within the CLI codebase. Tests added for the cases where we're sorting arbitrary user-generated data. The tests rely on the fact that 'ch' sorts after 'd' in the `'sk'` locale, but ahead of `'d'` in the `'en'` locale. To ensure that this is the default behavior if no locale is specified, `LC_ALL=sk` is set in the test environment. Other instances of `localeCompare` sort data that the cli controls, so no tests were added. Re: https://github.com/npm/cli/issues/2829 PR-URL: https://github.com/npm/cli/pull/3203 Credit: @isaacs Close: #3203 Reviewed-by: @ruyadorno
2020-10-27pack: do not show individual files of bundled depsisaacs
We show a list of bundled dependencies, there's no need to ALSO show the individual files in each one. PR-URL: https://github.com/npm/cli/pull/2050 Credit: @isaacs Close: #2050 Reviewed-by: @nlf
2020-10-23update lint rules to match @npmcli/arboristisaacs
2020-07-27test: add utils/tar.js testsclaudiahdz
2020-05-08feat: publish only from local directoryclaudiahdz
2017-08-23tar: Remove use of old tarisaacs
Credit: @isaacs Reviewed-By: @iarna PR-URL: https://github.com/npm/npm/pull/16804
2017-07-11install: fix max callstack exceeded loops with linksRebecca Turner
PR-URL: https://github.com/npm/npm/pull/17652 Credit: @iarna Reviewed-By: @zkat
2017-05-26lifecycle: added prepack and postpack (#16725)Kat Marchán
2017-05-26filespecs: Implement new file: specifier behaviorRebecca Turner
PR-URL: https://github.com/npm/npm/pull/15900 Credit: @iarna actions: Allow actions to return promises extract: Eliminate extra callback finalize: Rewrite finalize as promises update-linked: Remove update-linked action install: Remove obsolete invalid action filtering fetch-package-metadata: Error on installing windows paths on non-windows systems fetch-package-metadata: Read in modules installed inside of new links finalize: Act on realpaths because we may be installing inside a link prior to the symlink being made finalize: Create symlinks of directory deps deps: Resolve ambiguity for file specifiers in the traditional way deps: Set link and realpath properties for directory deps inflate-bundled: Distinguish published bundles from lined modules node: Add new fromLink attribute to track sourced-to-symlinks deps diff-trees: Don't try to install deps that are already inside a link fetch-package-metadata: Improve error messages for link failures install: Run preinstall lifecycle after finalize finalize: Start reading package.json files here decompose-actions: Don't fetch or extract links deps: Determine if a link matches spec based on where it points deps: Compute correct save specifier for file spec deps: Set the isInLink property on new children deps: When finding the install location, don't walk up out of a symlink unless PRESERVE_SYMLINKS is on diff-trees: Stop setting isInLink, this is now a first class property diff-trees: Only exclude children of links from adding if they were already there behind the symlink inflate-bundled: We are using isInLink now not fromLink inflate-bundled: realpaths should be built on realpaths node: Eliminate fromLink as a thing node: Fill in values for inLink, isInLink & fromBundle save: When updating a lock/shrinkwrap don't read the damn tree again shrinkwrap: Fill in version per the new shrinkwrap spec install: Make _inBundle purely a debugging artifact inflate-shrinkwrap: Fix how bundle deps are inflated save: Detect dependency type when saving recalculateMetadata: Rewrite as simpler and synchronous prune: Work off computed metadata refreshPackageJson: Copy all of the in memory version over the on-disk version except empty items install: Reduce normalize tree function to minimum realize-package-specifier: Bring into closer alignment with spec read-shrinkwrap: Use child.isTop not !child.parent copy-tree: Don't crash of requires or requiredBy are missing copy-tree: Initialize copied nodes dedupe: use getRequested instead of child.package._requested install: recompute the pkg relationships after finalize Neccessary to align behavior with shrinkwraps where relationship information isn't available until we read the module off disk. install: Prune the tree after building it install: Only save deps if we made changes inflate-shrinkwrap: Better metadata while inflating
2017-05-26feat(lockfile): add package-lock.json supportKat Marchán
This implements https://github.com/npm/npm/pull/16441 as well as the auto-save behavior it needs in order to be kept up to date.
2017-05-26feat(install): use pacote for package downloadsKat Marchán
2017-03-16pack: Bundle dependencies inside bundled scope depsRebecca Turner
Credit: @iarna PR-URL: https://github.com/npm/npm/pull/16040 Reviewed-By: @zkat
2016-09-09tar: ignore *.orig filesChristopher Hiller
Credit: @boneskull PR-URL: https://github.com/npm/npm/pull/13708 Reviewed-By: @zkat
2016-08-02tar: include scoped packages in bundledDepsJordan Klassen
PR-URL: https://github.com/npm/npm/pull/13438 Fixes: https://github.com/npm/npm/issues/8614 Credit: @forivall Reviewed-By: @iarna Reviewed-By: @zkat
2016-06-18tar: restore our version of applyIgnoresRebecca Turner
This reverts some of #11995. Without this, bundled dependencies don't include transitive dependencies. Fixes: #13088 Credit: @iarna Reviewed-By: @othiym23 PR-URL: https://github.com/npm/npm/pull/13089
2016-06-18tar: revert 4e52cef3d4170c8abab98149666ec599Forrest L Norvell
If #5082 is really fixed, a warning is no longer necessary. Credit: @othiym23 Reviewed-By: @iarna PR-URL: https://github.com/npm/npm/pull/13092
2016-06-17tar: warn when using Node 6+Forrest L Norvell
Credit: @othiym23 PR-URL: https://github.com/npm/npm/pull/13077
2016-06-16tar: Better progress indicatorsRebecca Turner
PR-URL: https://github.com/npm/npm/pull/13075 Credit: @iarna
2016-06-16tar: Rewrite to use requiredBy instead of _requiredByRebecca Turner
Credit: @iarna PR-URL: https://github.com/npm/npm/pull/12775
2016-05-27tar: fix prograssbar section nameRebecca Turner
Without this you get `pack:[object Object]`. Reviewed-By: @zkat Credit: @iarna PR-URL: https://github.com/npm/npm/pull/12845
2016-04-08tar: Improve handling of special cases for files included in packagesGlen Mailer
Most notably, the package 'history' will not longer be included in the packages of anything which depends on it. Likewise with packages named changelog or license. This was fixed in fstream-npm@1.0.6 from via d82ff81403, but for some reason the internal tar code duplicated this logic. Removing the duplication passes all the tests, so seems prudent. While fixing this bug, it was noticed that the `files-and-ignores` tests were giving false positives because they use `npm install` instead of only `npm pack`, the tests have been modified to avoid this. See also #9642, #10445, #11995 Credit: @glenjamin Reviewed-By: @zkat PR-URL: https://github.com/npm/npm/pull/11995
2015-10-22src: Update formatting to be compatible with standard@5Sebastiaan Deckers
PR-URL: https://github.com/npm/npm/pull/9954
2015-10-09package-id: Use getPackageId more consistently in diagnosticsRebecca Turner
PR-URL: //github.com/npm/npm/pull/9890 Fixes: #9766
2015-10-09module-name: Factor out module name readingRebecca Turner
Bring consistent guarding against null/undefined and consistent business logic. PR-URL: //github.com/npm/npm/pull/9890 Fixes: #9766
2015-09-25pack: Don't bother reading the tree if nothing is bundledRebecca Turner
PR-URL: https://github.com/npm/npm/pull/9667
2015-09-25pack: Pass in our tree object via closures instead of propertiesRebecca Turner
PR-URL: https://github.com/npm/npm/pull/9667
2015-06-26pack: fix infinite loop when packing w/ node_modules w/ dep cyclesRebecca Turner
2015-06-26publish: Throw an error if the bundled deps package.json entry is invalidRebecca Turner
2015-06-26Add multi-stage installerRebecca Turner
2015-06-26Move modules to new standard formatting in preparation for rewritesRebecca Turner
2014-12-25pack tarballs to their final locations atomicallyForrest L Norvell
2014-12-12tar detection looks for magic number (fixes #6868)David Volm
2014-09-28logging cleanupForrest L Norvell
2014-09-27remove locking code around packing and unpackingForrest L Norvell
2014-09-20Raise error when tar.unpack encounters a 0-byte tgzisaacs
2014-09-19use writeFileAtomic instead of fs.writeFile fixes #6163Filip Weiss
2014-08-13tar.js: Comment should describe why not whatisaacs
2014-08-13rename .gitignore when unpacking foreign tarballsisaacs
Fix #5658 Note that this doesn't actually *ignore* the files specified by the .gitignore and/or .npmignore files. That would likely require removing them after the fact, as well as all the same logic that exists in fstream-npm, since tar does not give us a directory listing, and tarballs may have their files in any random order.
2014-08-13Detect non-gzipped tar files more reliablyisaacs
In addition to starting with the string `package/`, they may also start with a `pax_global_header`, and this is almost certainly an indication that we are dealing with a tar file. For example, git adds a global header with the commit sha when producing archive files.
2014-05-08split out cache locking into separate fileForrest L Norvell
2014-02-15Forbid deleting important npm dirsisaacs
Re #4691
2013-06-08Separate tar and cache lockfile usageisaacs
Folders were getting double-locked, resulting in an unnecessary 1000ms hang for everything added to cache. Since we tar things multiple times (stupidly) this led to about a 5-10s increase in latency for lots of operations. Fix that by adding 'tar://' to the start of all the locks created in lib/utils/tar.js
2013-02-06tar.js: Lock the tarballs as well as target foldersisaacs
2013-02-06tar.js: Don't unlock locks we didn't lockisaacs
2013-01-15styleisaacs