This commit fixes `deno task` by checking if the provided
task name actually has a wildcard char ("*").
Previously, if the "--recursive" flag was passed, the task name
was treated as a regex, which lead to a situation where exact task
name resulted in a regex that matched all tasks with the specific
prefix.
This commit fixes it, by checking if the provided task name, is an exact
name, or is it a wildcard match.
Closes https://github.com/denoland/deno/issues/27370
Closes https://github.com/denoland/deno/issues/27401
Closes https://github.com/denoland/deno/issues/27408
Fixes #27038.
Previously, for NPM packages the latest version was the version with the
"latest" tag. For JSR packages, the latest version was the greatest
version that matched a `*` version requirement. Unfortunately, that
doesn't work well with pre-release versions.
This PR changes it so that the latest version is always > the currently
requested version.
For NPM: if "latest" tag > current then "latest" tag; otherwise the
greatest version that is >= current
For JSR: greatest version >= current
This is the most reasonable behavior I could come up with. For example,
```
versions:
2.0.0-beta.2
2.0.0-beta.1
1.0.0 => "latest" tag
with a version req `^2.0.0-beta.1`
previously:
"Update" column => 2.0.0-beta.2
"Latest" column => 1.0.0
now:
"Update" column => 2.0.0-beta.2
"Latest" column => 2.0.0-beta.2
```
Merging as a fix so that LTS gets this as it's a useful diagnostic tool.
The 1MB unique is because we deduplicate files that we store (ex. some
packages have the same file multiple times so we store that once).
I ended up changing the file system implementation to determine
its root directory as the last step of building it instead of being the
first step which makes it much more reliable.
split up otel config into user configurable and runtime configurable
parts. user configurable part is now set via env vars parsed according
to the otel spec. otel is now enabled via `OTEL_DENO=true`, and
`--unstable-otel` only acts as a guard.
Fixes: https://github.com/denoland/deno/issues/27273
Currently deno eagerly caches all npm packages in the workspace's npm
resolution. So, for instance, running a file `foo.ts` that imports
`npm:chalk` will also install all dependencies listed in `package.json`
and all `npm` dependencies listed in the lockfile.
This PR refactors things to give more control over when and what npm
packages are automatically cached while building the module graph.
After this PR, by default the current behavior is unchanged _except_ for
`deno install --entrypoint`, which will only cache npm packages used by
the given entrypoint. For the other subcommands, this behavior can be
enabled with `--unstable-npm-lazy-caching`
Fixes #25782.
---------
Signed-off-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit changes "deno outdated" subcommand to
error out if run in a directory that has no config file
(including parent directories). This matches
"pnpm" behavior.
Also added tests for filtering that yields no results,
to ensure that it exists cleanly, that also matches "pnpm"
behavior.
Closes https://github.com/denoland/deno/issues/27287
---------
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
`SafeMap` treats its argument as an object with a "length" and index
properties, rather than a generic iterator, so every time we cloned it,
it was dropping all the data.
When we run `deno task` with args like `deno task foo arg` the argument
should only be passed to the root task, not to its dependencies.
Fixes https://github.com/denoland/deno/issues/27206
This commit adds support for understanding "workpace:^"
and "workspace:~" version constraints in npm/pnpm workspaces.
This is done by upgrading various crates to their latest versions.
Closes https://github.com/denoland/deno/issues/26726
---------
Co-authored-by: David Sherret <dsherret@gmail.com>
This PR improves the error output on publish when the `name` filed is
missing:
```json
{
"exports": "./mod.ts",
"version": "0.0.1"
}
```
Before:
```sh
deno publish --dry-run
error: You did not specify an entrypoint in file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json. Add `exports` mapping in the configuration file, eg:
{
"name": "@scope/name",
"version": "0.0.0",
"exports": "<path_to_entrypoint>"
}
```
After:
```sh
deno publish --dry-run
error: Missing 'name' field in 'file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json'.
```
Fixes https://github.com/denoland/deno/issues/27116
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.
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).
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.
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>