1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-18 13:22:55 -05:00
Commit graph

504 commits

Author SHA1 Message Date
Bartek Iwańczuk
14e4064986
fix(task): properly handle task name wildcards with --recursive (#27396)
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
2024-12-18 03:32:37 +01:00
Nathan Whitaker
9d7174e434
fix(outdated): ensure "Latest" version is greater than "Update" version (#27390)
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
```
2024-12-17 23:56:03 +00:00
David Sherret
95928c46eb
refactor: extract out FileFetcher to deno_cache_dir (#27263) 2024-12-16 23:39:40 +00:00
David Sherret
75945cbb86
fix(compile): display embedded file sizes and total (#27360)
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).
2024-12-16 09:37:39 -05:00
Nathan Whitaker
9d315f27ed
fix(outdated): support updating dependencies in external import maps (#27339)
Fixes #27331.

The support for it was already in `outdated`, but forgot to wire up the
updating part

Needs #27337
2024-12-13 12:25:05 -08:00
Nathan Whitaker
3946956b8c
fix(lockfile): include dependencies listed in external import map in lockfile (#27337) 2024-12-13 10:19:37 -08:00
David Sherret
f4f64cbe2d
fix(npm): search node_modules folder for package matching npm specifier (#27345) 2024-12-12 23:58:14 +00:00
David Sherret
4cfa34052d
fix(compile): analyze modules in directory specified in --include (#27296)
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.
2024-12-12 18:07:35 +00:00
snek
5f8be055db
refactor(unstable): otel configuration (#27333)
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
2024-12-12 09:17:26 +01:00
David Sherret
c6fa62896d
fix(compile): output contents of embedded file system (#27302) 2024-12-11 09:40:50 -05:00
Nathan Whitaker
6f506208f6
feat(unstable): support caching npm dependencies only as they're needed (#27300)
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>
2024-12-10 18:24:23 -08:00
Bartek Iwańczuk
7c8b55b584
fix(outdated): error when there are no config files (#27306)
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>
2024-12-10 23:25:29 +00:00
ingalless
fe1be715d8
chore(tests): Deprecate remaining usages of itest in check tests (#26962)
This PR progresses #22907 by deprecating the usage of `itest` in
`tests/integration/check_tests.rs`
2024-12-10 23:41:24 +01:00
Bartek Iwańczuk
7bab83d6c0
fix(outdated): respect --quiet flag for hints (#27317) 2024-12-10 18:22:42 +00:00
Bartek Iwańczuk
c3af09821a
fix(outdated): show a suggestion for updating (#27304)
Show command to update dependencies based on the output
of "deno outdated" command.

Closes https://github.com/denoland/deno/issues/27256
2024-12-10 14:41:16 +01:00
David Sherret
da3a676d1c
fix: do not error when subpath has an @ symbol (#27290)
Closes https://github.com/denoland/deno/issues/27243
2024-12-09 13:19:08 -08:00
Nathan Whitaker
ffac282805
fix(install): use locked version of jsr package when fetching exports (#27237)
Fixes #27193.
2024-12-05 18:55:35 +00:00
Marvin Hagemeister
f098dd02f7
fix(task): --recursive option not working (#27183)
We didn't handle the `--recursive` option properly in `deno task`. This
PR addresses that.

Fixes https://github.com/denoland/deno/issues/27174
2024-12-05 19:00:35 +01:00
ud2
25aed5071f
fix(unstable/temporal): respect locale in Duration.prototype.toLocaleString (#27000)
Adds a temporary polyfill for `Duration.prototype.toLocaleString()`
that will be removed once native support in V8 lands.
2024-12-05 13:55:50 +00:00
David Sherret
f0586238fc
fix(task): kill descendants when killing task process on Windows (#27163) 2024-12-04 12:19:06 -05:00
snek
5c17bb4287
fix(unstable): otel context with multiple keys (#27230)
`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.
2024-12-04 13:14:37 +00:00
Marvin Hagemeister
120b3811eb
fix(task): don't panic with filter on missing task argument (#27180)
We were panicing when running `deno task --filter foo` without a task
argument.

Fixes https://github.com/denoland/deno/issues/27177
2024-12-04 13:06:09 +01:00
David Sherret
8cd257de3d
refactor: remove CliNpmRegistryApi (#27222)
Extracts more code out of the CLI.
2024-12-03 19:44:56 -05:00
Marvin Hagemeister
d5b63bb642
fix(task): only pass args to root task (#27213)
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
2024-12-03 16:35:46 +01:00
Ian Bull
b78c851a94
refactor(ext/web): align error messages (#25871)
Aligns the error messages in the ext/web folder to be in-line with the
Deno style guide.
2024-12-03 03:30:39 +00:00
David Sherret
70d69a8828
chore: fix cjs_with_deps test to use a temp dir (#27199)
It was creating a node_modules directory.
2024-12-03 02:37:40 +01:00
Bartek Iwańczuk
53936eda11
fix(fmt): stable formatting of HTML files with JS (#27164)
Closes https://github.com/denoland/deno/issues/26407
Closes https://github.com/denoland/deno/issues/26763
Closes https://github.com/denoland/deno/issues/26560
Closes https://github.com/denoland/deno/issues/26744
Closes https://github.com/denoland/deno/issues/27030
2024-12-03 02:04:55 +01:00
snek
7c036772df
feat(unstable): add metrics to otel (#27143)
Refs: https://github.com/denoland/deno/issues/26852

Initial support for exporting metrics.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-12-02 20:45:41 +01:00
Bartek Iwańczuk
1d49b3cb0f
fix: support workspace:^ and workspace:~ version constraints (#27096)
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>
2024-11-30 00:54:26 +01:00
David Sherret
f6248601f4
fix(task): forward signals to spawned sub-processes on unix (#27141)
Closes https://github.com/denoland/deno/issues/18445
2024-11-29 17:36:43 -05:00
Marvin Hagemeister
3553aa9132
fix(publish): error on missing name field (#27131)
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
2024-11-28 18:11:36 +01:00
Luca Casonato
32e260d55a
fix: support bun specifiers in JSR publish (#24588)
Fixes https://github.com/denoland/deno/issues/26989

---------

Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-11-28 14:51:24 +01:00
Nathan Whitaker
76daa03aa9
fix(info): resolve bare specifier pointing to workspace member (#27020)
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.
2024-11-27 13:54:26 -08:00
David Sherret
2bbfef137c
feat(unstable): repurpose --unstable-detect-cjs to attempt loading more modules as cjs (#27094)
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).
2024-11-27 09:50:38 -05:00
Leo Kettmeir
7400181ecb
fix(tools/doc): HTML resolve main entrypoint from config file (#27103)
Fixes #26901
2024-11-27 02:15:15 -08:00
Leo Kettmeir
42b71d82db
chore(lint): add .out file reference checker (#27078)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-26 20:53:20 -08:00
Bartek Iwańczuk
4700f12ddc
fix(task): handle carriage return in task description (#27099)
Ref https://github.com/denoland/deno/pull/27069#discussion_r1857702814
2024-11-27 01:12:47 +00:00
David Sherret
e2f7e031b3
chore: fix flaky specs::publish::npm_workspace_jsr_pkg_with_npm_dep::dep_and_workspace_dep (#27098)
Closes https://github.com/denoland/deno/issues/27097
2024-11-26 19:32:30 -05:00
Kenta Moriuchi
4330ef553f
fix(streams): reject string in ReadableStream.from type (#25116)
WebIDL `async iterable<T>` type rejects `string`

Ref https://github.com/whatwg/webidl/pull/1397, #24623
2024-11-26 19:42:54 +00:00
David Sherret
115a306656
fix(node): correct resolution of dynamic import of esm from cjs (#27071)
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.
2024-11-26 14:38:24 -05:00
Bartek Iwańczuk
d4fe3311a6
fix(task): handle multiline descriptions properly (#27069)
Closes https://github.com/denoland/deno/issues/27049
2024-11-25 22:02:39 -05:00
David Sherret
2b26444584
fix(check): support jsdoc @import tag (#26991)
* https://github.com/denoland/deno_graph/pull/544

Closes https://github.com/denoland/deno/issues/25516
2024-11-25 18:57:05 -05:00
David Sherret
02b480b171
fix(compile): do not error embedding same symlink via multiple methods (#27015)
Closes https://github.com/denoland/deno/issues/27012
2024-11-25 17:08:06 -05:00
snek
d59bd5e8c9
feat(unstable): Instrument fetch (#27057)
Add basic tracing to `fetch`. Also fix span kinds so that we can
differentiate fetch and serve.
2024-11-25 16:38:07 +01:00
David Sherret
4365f8d999
fix(compile): handle TypeScript file included as asset (#27032)
Closes #27024
2024-11-25 09:37:48 -05:00
snek
8ea95c34b5
feat: Instrument Deno.serve (#26964)
Add basic trace to Deno.serve. Also updates a bit of the testing infra
to make it easier to deal with.
2024-11-25 10:45:06 +01:00
João Baptista
9eee2a0e9e
fix(fmt): return None if sql fmt result is the same (#27014)
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>
2024-11-22 22:57:33 +00:00
David Sherret
4ded7519e9
fix(compile): correct buffered reading of assets and files (#27008)
Closes #27006
2024-11-22 19:26:38 +00:00
David Sherret
9c0e6369b2
chore(check): add test for Wasm memory and table (#26996) 2024-11-22 10:59:19 -05:00
Bartek Iwańczuk
5ca47ee97a
fix: support non-function exports in Wasm modules (#26992)
Closes https://github.com/denoland/deno/issues/26986
2024-11-22 00:46:23 +00:00