Guy Bedford
cb93c60e64
module: exports not exported for null resolutions
...
PR-URL: https://github.com/nodejs/node/pull/32838
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2020-04-28 13:15:04 +02:00
Myles Borins
e540d5cd9b
module: improve error for invalid package targets
...
For targets that are strings that do not start with `./` or `/` the
error will now have additional information about what the programming
error is.
Closes: https://github.com/nodejs/node/issues/32034
PR-URL: https://github.com/nodejs/node/pull/32052
Fixes: https://github.com/nodejs/node/issues/32034
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Signed-off-by: Myles Borins <myles.borins@gmail.com >
2020-04-28 13:15:04 +02:00
Jan Krems
537d2c1170
module: expose exports conditions to loaders
...
PR-URL: https://github.com/nodejs/node/pull/31303
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
2020-04-11 10:05:46 +02:00
Guy Bedford
bc7f819263
module: path-only CJS exports extension searching
...
PR-URL: https://github.com/nodejs/node/pull/32351
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2020-04-11 10:01:11 +02:00
Guy Bedford
bbb6cc733c
module: package "exports" error refinements
...
PR-URL: https://github.com/nodejs/node/pull/31625
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2020-02-27 09:28:48 -08:00
Guy Bedford
f62fb7603a
module: logical conditional exports ordering
...
PR-URL: https://github.com/nodejs/node/pull/31008
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2020-01-16 01:33:44 -05:00
Guy Bedford
bd047e8277
module: self resolve bug fix and esm ordering
...
PR-URL: https://github.com/nodejs/node/pull/31009
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2020-01-03 16:22:04 +01:00
Guy Bedford
e61f4ead93
module: conditional exports import condition
...
PR-URL: https://github.com/nodejs/node/pull/30799
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2019-12-13 10:50:40 -05:00
Rongjian Zhang
851f3135ab
module: add warnings for experimental flags
...
PR-URL: https://github.com/nodejs/node/pull/30617
Fixes: https://github.com/nodejs/node/issues/30600
Reviewed-By: Guy Bedford <guybedford@gmail.com >
2019-12-09 10:23:06 +01:00
Guy Bedford
e98d89cef9
module: conditional exports with flagged conditions
...
PR-URL: https://github.com/nodejs/node/pull/29978
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
2019-11-17 00:28:54 -08:00
Jan Krems
edfbee3727
module: resolve self-references
...
Adds the ability to `import` or `require` a package from within its
own source code. This allows tests and examples to be written using
the package name, making them easier to reuse by consumers of the
package.
Assuming the `name` field in `package.json` is set to `my-pkg`, its
test could use `require('my-pkg')` or `import 'my-pkg'` even if
there's no `node_modules/my-pkg` while testing the package itself.
An important difference between this and relative specifiers like
`require('../')` is that self-references use the public interface
of the package as defined in the `exports` field while relative
specifiers don't.
This behavior is guarded by a new experimental flag
(`--experimental-resolve-self`).
PR-URL: https://github.com/nodejs/node/pull/29327
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-10-28 07:08:02 +01:00
Guy Bedford
2103ae4835
module: pkg exports validations and fallbacks
...
PR-URL: https://github.com/nodejs/node/pull/28949
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2019-08-12 06:24:28 -04:00
Jan Krems
61f3a5c60a
module: unify package exports test for CJS and ESM
...
Refs: https://github.com/nodejs/modules/issues/358
PR-URL: https://github.com/nodejs/node/pull/28831
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2019-07-31 13:33:46 -07:00
Jan Krems
dcb6929183
module: implement "exports" proposal for CommonJS
...
Refs: https://github.com/jkrems/proposal-pkg-exports/issues/36
Refs: https://github.com/nodejs/node/pull/28568
PR-URL: https://github.com/nodejs/node/pull/28759
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
2019-07-23 16:11:20 -07:00
Guy Bedford
6df7b6a4f9
esm: implement "pkg-exports" proposal
...
Refs: https://github.com/jkrems/proposal-pkg-exports/issues/36
PR-URL: https://github.com/nodejs/node/pull/28568
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-07-18 14:54:16 -07:00
Ruben Bridgewater
1940114ac3
util: highlight stack frames
...
Using `util.inspect` on errors is going to highlight userland and
node_module stack frames from now on. This is done by marking Node.js
core frames grey and frames that contain `node_modules` in their path
yellow.
That way it's easy to grasp what frames belong to what code.
PR-URL: https://github.com/nodejs/node/pull/27052
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-04-15 17:30:50 +02:00
James M Snell
98e54b0bd4
meta: restore original copyright header
...
A prior io.js era commit inappropriately removed the
original copyright statements from the source. This
restores those in any files still remaining from that
edit.
Ref: https://github.com/nodejs/TSC/issues/174
Ref: https://github.com/nodejs/node/pull/10599
PR-URL: https://github.com/nodejs/node/pull/10155
Note: This PR was required, reviewed-by and approved
by the Node.js Foundation Legal Committee and the TSC.
There is no `Approved-By:` meta data.
2017-03-10 11:23:48 -08:00
Gibson Fahnestock
3d2aef3979
test: s/assert.equal/assert.strictEqual/
...
Use assert.strictEqual instead of assert.equal in tests, manually
convert types where necessary.
PR-URL: https://github.com/nodejs/node/pull/10698
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
2017-01-11 14:19:26 +00:00
cjihrig
ff1efa6087
test: use const for all require() calls
...
PR-URL: https://github.com/nodejs/node/pull/10550
Reviewed-By: Rich Trott <rtrott@gmail.com >
2017-01-02 18:28:18 -05:00
Evan Lucas
e248f7f9e7
repl: allow autocompletion for scoped packages
...
Previously, autocompletion of scoped packages was not supported by the
repl due to not including the `@` character in the regular expression.
PR-URL: https://github.com/nodejs/node/pull/10296
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-12-22 22:03:39 -08:00
Ben Noordhuis
213ede6cee
repl: fix require('3rdparty') regression
...
Fix module loading of third-party modules in the REPL by inheriting
module.paths from the REPL's parent module.
Commit ee72ee7 ("module,repl: remove repl require() hack") introduced
a regression where require() of modules in node_modules directories
no longer worked in the REPL (and fortunately only in the REPL.)
It turns out we didn't have test coverage for that but we do now.
Fixes: https://github.com/nodejs/node/issues/4208
PR-URL: https://github.com/nodejs/node/pull/4215
Reviewed-By: Roman Reiss <me@silverwind.io >
2015-12-09 23:30:02 +01:00
isaacs
3e1b1dd4a9
Remove excessive copyright/license boilerplate
...
The copyright and license notice is already in the LICENSE file. There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Colton Baker
87286cc737
Fixed a lot of jslint errors.
...
Fixes #1831
2011-10-05 18:51:06 -07:00
Mathias Buus
39246f65df
Closes #1177 remove one node_modules optimization
...
to better support certain project structures.
2011-06-14 15:32:41 -07:00
Ryan Dahl
55048cdf79
Update copyright headers
2011-03-14 17:37:05 -07:00
isaacs
81b4d45354
Better assert in the node_modules tests
2011-02-09 14:35:08 -08:00
isaacs
46513483cd
node_modules module lookup, +docs and test.
2011-02-09 14:24:22 -08:00