Age | Commit message (Collapse) | Author |
|
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
|
|
|
|
|
|
Credit: @isaacs
Reviewed-By: @iarna
PR-URL: https://github.com/npm/npm/pull/16804
|
|
PR-URL: https://github.com/npm/npm/pull/17652
Credit: @iarna
Reviewed-By: @zkat
|
|
|
|
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
|
|
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.
|
|
|
|
Credit: @iarna
PR-URL: https://github.com/npm/npm/pull/16040
Reviewed-By: @zkat
|
|
Credit: @boneskull
PR-URL: https://github.com/npm/npm/pull/13708
Reviewed-By: @zkat
|
|
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
|
|
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
|
|
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
|
|
Credit: @othiym23
PR-URL: https://github.com/npm/npm/pull/13077
|
|
PR-URL: https://github.com/npm/npm/pull/13075
Credit: @iarna
|
|
Credit: @iarna
PR-URL: https://github.com/npm/npm/pull/12775
|
|
Without this you get `pack:[object Object]`.
Reviewed-By: @zkat
Credit: @iarna
PR-URL: https://github.com/npm/npm/pull/12845
|
|
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
|
|
PR-URL: https://github.com/npm/npm/pull/9954
|
|
PR-URL: //github.com/npm/npm/pull/9890
Fixes: #9766
|
|
Bring consistent guarding against null/undefined and consistent
business logic.
PR-URL: //github.com/npm/npm/pull/9890
Fixes: #9766
|
|
PR-URL: https://github.com/npm/npm/pull/9667
|
|
PR-URL: https://github.com/npm/npm/pull/9667
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
Re #4691
|
|
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
|
|
|
|
|
|
|