Jo Franchetti
9534112073
docs: adding jsdocs info for console interface ( #27666 )
...
Signed-off-by: Jo Franchetti <jofranchetti@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-01-16 23:32:13 +01:00
Phil Hawksworth
48f2587954
docs: JSDocs examples for prompt, confirm, and alert ( #27695 )
...
Adds examples
2025-01-16 23:32:13 +01:00
Phil Hawksworth
59ca3c6c57
docs:Adds examples in JSDocs for localStorage and sessionStorage ( #27668 )
...
Improves docs for:
- http://docs.deno.com/api/web/~/localStorage
- http://docs.deno.com/api/web/~/sessionStorage
2025-01-16 23:32:13 +01:00
Nathan Whitaker
d2a3319939
fix(check/lsp): correctly resolve compilerOptions.types ( #27686 )
...
Fixes https://github.com/denoland/deno/issues/27062
In the LSP we were passing `npm` specifiers to TSC as roots, but TSC
needs fully resolved specifiers (like the actual file path).
In `deno check` we were often excluding the specifiers entirely from the
roots.
In both cases, we need to resolve the specifiers fully and then pass
them to tsc
2025-01-16 23:32:12 +01:00
David Sherret
7e495dde58
refactor: create deno_lib crate ( #27673 )
...
Shifts just some code down for now. I'll do the rest of the refactor in
the next pr, but didn't want to drop a huge refactor.
2025-01-16 23:32:12 +01:00
Bartek Iwańczuk
e763b374ef
refactor: add 'deno_os' crate ( #27655 )
...
This commit creates "deno_os" extension crate and moves
numerous ops from "runtime/" crate to the new crate.
2025-01-16 23:32:11 +01:00
David Sherret
1bd66b09cc
refactor: move CliNpmResolver
to deno_resolver::npm::NpmResolver
( #27659 )
...
As title. After this PR all npm resolution will be out of the CLI crate.
2025-01-16 23:32:11 +01:00
Marvin Hagemeister
526c66dd4e
feat(unstable): refactor js lint plugin AST ( #27615 )
...
This PR changes the underlying buffer backed AST format we use for
JavaScript-based linting plugins. It adds support for various new types,
makes traversal code a lot easier and is more polished compared to
previous iterations.
Here is a quick summary (in no particular order):
- Node prop data is separate from traversal, which makes traversal code
so much easier to reason about. Previously, it was interleaved with node
prop data
- spans are in a separate table as well, as they are rarely needed.
- schema is separate from SWC conversion logic, which makes
- supports recursive plain objects
- supports numbers
- supports bigint
- supports regex
- adds all SWC nodes
Apologies, this is kinda a big PR, but it's worth it imo.
_Marking as draft because I need to update some tests tomorrow._
2025-01-16 23:32:11 +01:00
David Sherret
f6820dec52
refactor: deno_config 0.45 ( #27660 )
2025-01-16 23:32:11 +01:00
David Sherret
72124bb854
fix(compile/windows): better handling of deno_dir on different drive letter than code ( #27654 )
...
Closes https://github.com/denoland/deno/issues/27651
2025-01-16 23:32:10 +01:00
David Sherret
8b5b6cd561
refactor: create NpmInstaller
( #27626 )
...
This separates npm resolution code from npm installation (more work
towards moving resolution code out of the CLI and cleaning up this
code).
2025-01-16 23:32:10 +01:00
David Sherret
d5d1353084
fix(compile): store embedded fs case sensitivity ( #27653 )
2025-01-16 23:32:10 +01:00
Benjamin Swerdlow
428456681f
refactor(node_resolver): make conditions_from_resolution_mode configurable ( #27596 )
2025-01-16 23:32:09 +01:00
Nayeem Rahman
6fc6f5ebee
fix(lsp): handle pathless untitled URIs ( #27637 )
2025-01-16 23:32:09 +01:00
Nathan Whitaker
53d7f039ef
fix(lsp/check): don't resolve unknown media types to a .js
extension ( #27631 )
...
Fixes https://github.com/denoland/deno/issues/25762 . Note that some of
the things in that issue are not resolved (vite/client types not working
properly which has other root causes), but the wildcard module
augmentation specifically is fixed by this.
We were telling TSC that files with unknown media types had an extension
of `.js`, so the ambient module declarations weren't applying. Instead,
just don't resolve them, so the ambient declaration applies.
2025-01-16 23:32:09 +01:00
David Sherret
95c130baa1
fix(regression): show bare-node-builtin hint when using an import map ( #27632 )
2025-01-16 23:32:09 +01:00
David Sherret
62cf8fca69
refactor: remove CliNpmReqResolver
trait in deno_resolver ( #27616 )
2025-01-16 23:32:09 +01:00
David Sherret
42bf54914d
refactor: implement NpmPackageFolderResolver
in deno_resolver ( #27614 )
2025-01-16 23:32:08 +01:00
David Sherret
a9da90a44d
refactor(npm): move SloppyImportsCachedFs
to deno_resolver ( #27610 )
2025-01-16 23:32:08 +01:00
denobot
e842e5a59f
2.1.5 ( #27611 )
...
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2025-01-09 15:27:39 -05:00
Ryan Dahl
c624497b48
docs: added jsdoc for window.close() ( #27608 )
2025-01-09 15:19:21 -05:00
David Sherret
0e42884a4c
refactor(npm): move InNpmPackageChecker
code to deno_resolver ( #27609 )
...
As title. Will allow consumers to create this struct and use our
behaviour.
Closes #27409
2025-01-09 15:19:21 -05:00
Nayeem Rahman
2a508da4d4
fix(lsp): use verbatim specifier for URL auto-imports ( #27605 )
2025-01-09 15:19:21 -05:00
David Sherret
f3e851927c
refactor(npm): extract out some npm fs resolution code from the cli ( #27607 )
...
Moves the npm fs resolvers into the deno_resolution crate.
This does not entirely move things out, but is a step in that direction.
2025-01-09 15:19:21 -05:00
David Sherret
7c1d8736d8
refactor(npm): split some resolution from installation ( #27595 )
...
This splits away some npm resolution code from installation. It will
allow for more easily extracting out resolution code in the future.
2025-01-09 15:19:21 -05:00
Leo Kettmeir
5064e9051b
refactor: update deno_core for error refactor ( #26867 )
...
Closes #26171
---------
Co-authored-by: David Sherret <dsherret@gmail.com>
2025-01-09 15:19:21 -05:00
David Sherret
4279c2d78a
fix(jsr): Wasm imports fail to load ( #27594 )
...
* https://github.com/denoland/deno_graph/pull/562
Closes https://github.com/denoland/deno/issues/27593
2025-01-09 15:19:20 -05:00
Marvin Hagemeister
6b9f627d73
fix(lint): fix single char selectors being ignored ( #27576 )
...
The selector splitting code that's used for JS linting plugins didn't
properly account for selectors being a single character. This can happen
in the case of `*`.
Instead of comparing against the length, we'll now check if the
remaining string portion is not empty, which is more robust. It also
allows us to detect trailing whitespace, which we didn't before.
2025-01-09 15:19:20 -05:00
David Sherret
b93f118428
fix(no-slow-types): handle rest param with internal assignments ( #27581 )
...
Closes #27575
2025-01-09 15:19:20 -05:00
Nayeem Rahman
94796063f7
fix(lsp): don't skip dirs with enabled subdirs ( #27580 )
2025-01-09 15:19:20 -05:00
Bartek Iwańczuk
153b6f0365
refactor: make IncrementalCache
accept a CacheDBHash
( #27570 )
2025-01-09 15:19:19 -05:00
Luca Casonato
00719ecef7
feat(unstable): no config npm:@opentelemetry/api integration ( #27541 )
...
After this PR, one does not need to import `jsr:@deno/otel` anymore.
2025-01-09 15:19:19 -05:00
Luca Casonato
2a54c08182
feat(unstable): replace SpanExporter with TracerProvider ( #27473 )
2025-01-09 15:19:18 -05:00
Kitson Kelly
2c001851fe
fix(kv): improve backoff error message and inline documentation ( #27537 )
...
Ref: #27536
2025-01-09 15:19:18 -05:00
David Sherret
bb233b1ab1
fix(check): move module not found errors to typescript diagnostics ( #27533 )
...
Instead of hard erroring, we now surface module not found errors as
TypeScript diagnostics (we have yet to show the source code of the
error, but something we can improve over time).
2025-01-09 15:19:18 -05:00
Nayeem Rahman
4640a34453
fix(check): line-break between diagnostic message chain entries ( #27543 )
2025-01-09 15:19:18 -05:00
David Sherret
e99d3ad74d
fix(permissions): implicit --allow-import
when using --cached-only
( #27530 )
...
`--cached-only` cannot communicate with a remote server
Closes https://github.com/denoland/deno/issues/27498
2025-01-09 15:19:18 -05:00
David Sherret
888f40983e
refactor: update some fs_util functions to use sys_traits ( #27515 )
...
This is in preparation for extracting out these functions from the CLI
crate.
A side benefit is these functions will now work in Wasm.
2025-01-09 15:19:17 -05:00
David Sherret
1b6d7910cd
refactor(node/npm): separate out permission check from npm resolvers ( #27511 )
...
Decouples permissions from the npm resolvers (towards moving the
resolvers out of the cli crate)
2025-01-09 15:19:17 -05:00
Nayeem Rahman
adaa1f52e3
fix(lsp): css preprocessor formatting ( #27526 )
2025-01-09 15:19:17 -05:00
David Sherret
0718771a8a
fix(npm): deterministically output tags to initialized file ( #27514 )
...
The tags were being sorted in a random order due to the package_reqs
hashmap
2025-01-09 15:19:17 -05:00
Kenta Moriuchi
a39c83170f
chore: Happy New Year 2025 ( #27509 )
2025-01-09 15:19:16 -05:00
David Sherret
0bbb302318
chore: cargo fmt - turn on group_imports=StdExternalCrate ( #26646 )
2025-01-09 15:19:15 -05:00
David Sherret
118fd69988
refactor: do not use deno_fs::FileSystem
everywhere ( #27508 )
...
This changes the cli to mostly use `std::fs` via `sys_traits` instead of
the implemention of `deno_fs::FileSystem`.
2025-01-09 15:19:15 -05:00
Je Xia
1dd49e2875
fix(node): Add missing inspector/promises
( #27491 )
...
Add missing `inspector/promises` in node builtin module list, that
causes types checking error.
2025-01-09 15:19:14 -05:00
Marvin Hagemeister
4d95005c0d
chore(lint): remove manual AST field counter ( #27449 )
...
Addresses the review feedback in
https://github.com/denoland/deno/pull/27416 .
- Hoist the buffer max size variable to make it less confusing
- Remove manual AST field counter in favour of an explicit "commit
schema" step which writes the actual field count.
2025-01-09 15:19:14 -05:00
David Sherret
68287ab9b1
refactor: use sys_traits ( #27480 )
2025-01-09 15:19:14 -05:00
Marvin Hagemeister
3b02d9b603
fix(unstable): don't error on non-existing attrs or type attr ( #27456 )
...
When running selectors for JS linting plugins we would error when
encountering an unknown attribute name:
```js
// selector
Foo[non-existant]
// error
Error: Missing string id: <number>
```
This was caused by using `0` as the invalid marker, but also overloading
`0` with an actual node type. So the fix is to reserve `0` as the
invalid marker and move the property type to the next index.
2025-01-09 15:19:14 -05:00
Luca Casonato
7ad45db55f
feat(unstable): add OTEL MeterProvider ( #27240 )
...
This commit replaces `Deno.telemetry.MetricsExporter` with
`Deno.telemetry.MeterProvider`.
Signed-off-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: snek <snek@deno.com>
2025-01-09 15:19:13 -05:00
Marvin Hagemeister
9bea68b51a
feat(unstable): support selectors in JS lint plugins ( #27452 )
...
This PR adds support for using selectors in the JS linting plugin API.
Supported at the moment are:
- `Foo Bar` (descendant)
- `Foo > Bar` (child combinator)
- `Foo + Foo` (next sibling)
- `Foo ~ Foo` (subsequent sibling)
- `[attr]`, `[attr=value]` (attribute selectors, supported operators:
`=`, `!=`, `<`, `>`, `<=`, `>=`)
- `:first-child`
- `:last-child`
- `:nth-child(2)`, `:nth-child(2n + 1)`
2025-01-09 15:19:13 -05:00