The naming scheme for create npm packages varies depending on whether
they are scoped or not. We only supported unscoped packages prior to
this PR. This PR adds support for all the following cases which npm
supports:
- `foo` -> `create-foo`
- `@foo/bar` -> `@foo/create-bar`
- `@foo` -> `@foo/create`
- `@foo@2.0.0` -> `@foo/create@2.0.0`
- `@foo/bar@2.0.0` -> `@foo/create-bar@2.0.0`
See https://docs.npmjs.com/cli/v8/commands/npm-init#description
Fixes https://github.com/denoland/deno/issues/27127
Fixes https://github.com/denoland/deno/issues/26721
Previously, we were applying only the import map, which would result in
`@scope/foo` expanding to (e.g.) `jsr:@scope/foo@1.0.0`. Since that
didn't exist it would error and fail to resolve.
We didn't respect casing when checking if a HTTP header is present in
Node's `ServerResponse.hasHeader()`. This lead to us returning incorrect
results when the header was present. Koa assumed that the `Content-Type`
header wasn't present when it actually was and defaulted to a different
`Content-Type` value.
Fixes https://github.com/denoland/deno/issues/27101
This resurrects the `--unstable-detect-cjs` flag (which became stable),
and repurposes it to attempt loading .js/.jsx/.ts/.tsx files as CJS in
the following additional scenarios:
1. There is no package.json
1. There is a package.json without a "type" field
Also cleans up the implementation of this in the LSP a lot by hanging
`resolution_mode()` off `Document` (didn't think about doing that until
now).
We didn't validate the `path` argument that's passed to `fs.stat()` and
`fs.statSync()` which lead to wrong errors being thrown. The
`@rollup/plugin-node-resolve` code calls it with `undefined` quite a lot
which lead to `nitro` and `nuxt` failing.
Fixes https://github.com/denoland/deno/issues/26700
---------
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Fixes https://github.com/denoland/deno/issues/26904
If using `nodeModulesDir: "auto"`, it's possible for the lifecycle
script subprocess to try to set up the node_modules dir (despite the
fact that we're already doing that). If it does that, it hangs trying to
acquire the file lock on the node_modules dir.
As a fix, don't try to set up node_modules if we're running as part of a
lifecycle script.
Ideally we'd have better control over when we do and don't set up
node_modules automatically (that's the underlying problem behind #25782
as well)
Ensures a dynamic import in a CJS file will consider the referrer as an import for node resolution.
Also adds fixes (adds) support for `"resolution-mode"` in TypeScript.
Enhances the deno compile workflow for denort development by
automatically checking for a denort binary in the same directory as the
deno binary, provided both are located within a target/ directory. If
found, this denort binary will be used.
Key points:
- The DENORT_BIN environment variable remains supported for explicitly
specifying a custom denort binary path.
- Includes additional logic to verify if the deno binary is a symlink
pointing to an executable in the target/ directory.
---------
Signed-off-by: Ian Bull <irbull@gmail.com>
* fix: drop auth headers, cookies on redirect to different origin
* refactor: destructure StringPrototypeEndsWith
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Fix related to #26906.
Currently, if a file is removed, no event is emitted because the file
path no longer exists. As a result, [this
check](12b377247b/runtime/ops/fs_events.rs (L149))
returns false.
With this PR, an additional check is introduced to verify if the file
exists. If the file does not exist, a custom "remove" event is emitted.
This change is necessary because, based on tests conducted on macOS and
Linux (Ubuntu 24.04.1 LTS), Linux emits a "rename" event instead of a
"remove" event when a file is deleted. Introducing a dedicated "remove"
event ensures consistent and clearer behavior across platforms.
This PR updates the node_compat setup script. Now the copied version in
each test file is corrected. Also `TODO.md` links to the correct files
in Node.js repo.
Similar with https://github.com/denoland/deno/pull/25848, we need to
make `format_sql` to return `None` so we do not flag well formatted sql
files as being wrong.
Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com>