Age | Commit message (Collapse) | Author |
|
Co-authored-by: Bedis Nbiba <bedisnbiba@gmail.com>
|
|
Closes https://github.com/denoland/deno/issues/11836
Ref https://github.com/denoland/deno/issues/25162
|
|
|
|
|
|
|
|
This commit stabilizes the `fetch` function declaration for use with
`Deno.HttpClient` and moves it from `lib.deno.unstable.d.ts` to
`lib.deno.shared_globals.d.ts`.
`Deno.HttpClient` was stabilized in #25569, but the associated override
declaration for `fetch` is still marked as experimental. This should
also be stabilized now and moved to a different d.ts file.
|
|
This commit lets `deno test --doc` command actually evaluate code snippets in
JSDoc and markdown files.
## How it works
1. Extract code snippets from JSDoc or code fences
2. Convert them into pseudo files by wrapping them in `Deno.test(...)`
3. Register the pseudo files as in-memory files
4. Run type-check and evaluation
We apply some magic at the step 2 - let's say we have the following file named
`mod.ts` as an input:
````ts
/**
* ```ts
* import { assertEquals } from "jsr:@std/assert/equals";
*
* assertEquals(add(1, 2), 3);
* ```
*/
export function add(a: number, b: number) {
return a + b;
}
````
This is virtually transformed into:
```ts
import { assertEquals } from "jsr:@std/assert/equals";
import { add } from "files:///path/to/mod.ts";
Deno.test("mod.ts$2-7.ts", async () => {
assertEquals(add(1, 2), 3);
});
```
Note that a new import statement is inserted here to make `add` function
available. In a nutshell, all items exported from `mod.ts` become available in
the generated pseudo file with this automatic import insertion.
The intention behind this design is that, from library user's standpoint, it
should be very obvious that this `add` function is what this example code is
attached to. Also, if there is an explicit import statement like
`import { add } from "./mod.ts"`, this import path `./mod.ts` is not helpful for
doc readers because they will need to import it in a different way.
The automatic import insertion has some edge cases, in particular where there is
a local variable in a snippet with the same name as one of the exported items.
This case is addressed by employing swc's scope analysis (see test cases for
more details).
## "type-checking only" mode stays around
This change will likely impact a lot of existing doc tests in the ecosystem
because some doc tests rely on the fact that they are not evaluated - some cause
side effects if executed, some throw errors at runtime although they do pass the
type check, etc. To help those tests gradually transition to the ones runnable
with the new `deno test --doc`, we will keep providing the ability to run
type-checking only via `deno check --doc`. Additionally there is a `--doc-only`
option added to the `check` subcommand too, which is useful when you want to
type-check on code snippets in markdown files, as normal `deno check` command
doesn't accept markdown.
## Demo
https://github.com/user-attachments/assets/47e9af73-d16e-472d-b09e-1853b9e8f5ce
---
Closes #4716
|
|
|
|
Ref https://github.com/denoland/deno/pull/25215#discussion_r1762064605
|
|
Aligns the error messages in the ext/websocket folder to be in-line with
the Deno style guide.
https://github.com/denoland/deno/issues/25269
|
|
|
|
|
|
Ref https://github.com/denoland/deno_core/pull/906
|
|
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
|
|
Closes #22583
|
|
|
|
Closes https://github.com/denoland/deno/issues/25464
Only uploads canary git hash if the one in the bucket is present
in the current action Git history.
|
|
No functional changes, just removes dead code.
|
|
|
|
|
|
Fixes CI
https://github.com/denoland/deno/actions/runs/10892648144/job/30225971485
|
|
|
|
* https://github.com/denoland/deno_npm/pull/68
|
|
Closes https://github.com/denoland/deno/issues/7315.
|
|
This makes the permission system more versatile.
|
|
This PR is part of #22907
---------
Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
|
|
|
|
|
|
* https://github.com/denoland/deno_lockfile/pull/39
Closes https://github.com/denoland/deno/issues/25649
|
|
Ref https://github.com/denoland/deno/issues/25241
Rewritten these tests:
- check::package_json_basic
- check::package_json_fail_check
- check::package_json_with_deno_json
- info::package_json_basic
- test::package_json_basic
- run::package_json_auto_discovered_for_npm_binary
- run::package_json_with_deno_json
|
|
Instead of two overloads for `Deno.connectTls` and
`Deno.createHttpClient`, there is now just one.
|
|
This fixes the fast path for `readableStreamCollectIntoUint8Array` to
only trigger if the readable stream has not yet been disturbed -
because otherwise we may not be able to close it if the
read errors.
|
|
untyped `Deno.PointerObject` parameter (#25577)
|
|
Fixes #25646
|
|
|
|
|
|
Fixes https://github.com/denoland/deno/issues/25632
Exit code 1 indiciates some sort of failure but `deno task` (without
arguments) is used to list available commands.
---------
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
|
|
|
|
|
|
|
|
Fixes https://github.com/denoland/deno/issues/25114
---------
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
|
|
|
|
`kBindStreamsLazy` should be called with `process` during init, but it
never was.
|
|
Toward #24236
|
|
Extracted out of https://github.com/denoland/deno/pull/25614
It's better for these to be non-minified because then diffs are better
when adding new versions.
|
|
This is required to do when loading because TypeScript handles and
resolves `/// <reference path="..." />` internally.
|
|
closes https://github.com/denoland/deno/issues/11547
|
|
Towards #25241
|
|
Aligns the error messages in the runtime folder to be in-line with the
Deno style guide.
https://github.com/denoland/deno/issues/25269
|