1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
Commit graph

334 commits

Author SHA1 Message Date
Mohammad Sulaiman
eb8ee95f08
chore: deprecate node compat itests (#25573) 2024-09-16 09:53:20 +01:00
Asher Gomez
e4ea9be874
chore: cleanup remaining internals.future code (#25624) 2024-09-16 09:28:35 +10:00
Marvin Hagemeister
597f2d8d4d
feat: print Listening on messages on stderr instead of stdout (#25491)
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>
2024-09-14 23:30:06 +02:00
David Sherret
af2d992ecd
feat: TypeScript 5.6 and npm:@types/node@22 (#25614) 2024-09-14 11:58:47 +01:00
Asher Gomez
8476bbff9a
feat: stabilize Deno.createHttpClient() (#25569)
Closes #25518
2024-09-12 10:46:48 +10:00
HasanAlrimawi
1463a4ad58
chore: deprecate task itests (#25558)
This PR is part of #22907
2024-09-11 17:39:47 +02:00
Nayeem Rahman
ad30703e8e
fix(lsp): encode url parts before parsing as uri (#25509) 2024-09-11 11:11:39 +01:00
Nayeem Rahman
f959297dcd
feat(lsp): unstable setting as list (#25552) 2024-09-11 00:20:03 +01:00
Kenta Moriuchi
e522f4b65a
BREAKING(temporal/unstable): Remove obsoleted Temporal APIs part 2 (#25505)
Mainly I removed `Temporal.Calendar` and `Temporal.TimeZone` and
replaced them to APIs that handle calendar and timezone as strings.
https://github.com/tc39/proposal-temporal/pull/2925

Related #24836
2024-09-10 21:36:43 +00:00
snek
f9007d3386
feat: require(esm) (#25501)
implement require(esm) using `op_import_sync` from deno_core.

possible future changes:
- cts and mts
- replace Deno.core.evalContext to optimize esm syntax detection

Fixes: https://github.com/denoland/deno/issues/25487
2024-09-10 20:12:36 +00:00
Luca Casonato
7bfcb4dd10
feat(cli): use NotCapable error for permission errors (#25431)
Closes #7394

---------

Co-authored-by: snek <snek@deno.com>
2024-09-10 11:12:24 -07:00
Leo Kettmeir
c2f97494f7
refactor: move WebGPU, FFI and FS typings from unstable to stable (#25488)
Closes #25377
2024-09-10 05:04:59 -07:00
Bartek Iwańczuk
9a169e3cf1
test: remove usage of --unstable flag (#25549)
This commit removes all occurrences of `--unstable` flag
from all the tests that are run in CI.

Turns out none of the tests actually required that flag
anymore.
2024-09-10 11:28:59 +00:00
Asher Gomez
a445ebd74f
BREAKING(fs): remove Deno.fsync[Sync]() (#25448)
Towards #22079

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-09 22:39:56 +00:00
Bartek Iwańczuk
064a73f7a0
BREAKING: Remove --unstable flag (#25522)
This commit effectively removes the --unstable flag.

It's still being parsed, but it only prints a warning that a granular
flag should be used instead and doesn't actually enable any
unstable feature.

Closes https://github.com/denoland/deno/issues/25485
Closes https://github.com/denoland/deno/issues/23237
2024-09-09 23:44:29 +02:00
David Sherret
560ad0331b
fix(node/byonm): do not accidentally resolve bare node built-ins (#25543)
This was accidentally enabled in byonm, but it requires the
`--unstable-bare-node-builtins` flag.

Closes #25358
2024-09-09 21:35:41 +00:00
Bartek Iwańczuk
04a9cc95ac
feat: Add better error messages for unstable APIs (#25519)
This commit improves error messages for unstable APIs:
- `--unstable-broadcast-channel`
- `--unstable-cron`
- `--unstable-http`
- `--unstable-kv`
- `--unstable-temporal`

By providing information and hints what went wrong and how the
error can be fixed. It reuses the same infra that was added in 
https://github.com/denoland/deno/pull/21764.
2024-09-09 22:51:55 +02:00
David Sherret
1e0ac609b5
BREAKING: remove deprecated files config (#25535)
The long form "files" config has been flattened into the parent.

Old:

```json
{
  "test": {
    "files": {
      "include": ["**/*.ts"],
      "exclude": ["ignore.ts"]
    }
  }
}
```

New:

```json
{
  "test": {
    "include": ["**/*.ts"],
    "exclude": ["ignore.ts"]
  }
}
```

This was deprecated some time ago, but we're removing it now in Deno
2.0.

Closes #25415
2024-09-09 16:33:09 +00:00
Mohammad Sulaiman
582be0adc2
chore: Deprecate worker itests (#25514) 2024-09-09 11:07:41 -04:00
Asher Gomez
d8f3123c36
BREAKING(buffer): remove Deno.Buffer (#25441)
Towards #22079

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-06 18:28:05 +10:00
David Sherret
c678550a17
BREAKING: remove "emit" and "map" from deno info output (#25468)
The map field has been empty for years now and we don't want the emit
file to be exposed so it allows us to iterate on making the cache
faster. Additionally, it's racy/unreliable to rely on this information.
Instead, people should emit the TS files themselves using tools like
deno_emit, typescript, esbuild, etc.

Closes https://github.com/denoland/deno/issues/17703
2024-09-05 14:22:13 +00:00
Bartek Iwańczuk
5319b85f14
feat(uninstall): alias to 'deno remove' if -g flag missing (#25461)
Close https://github.com/denoland/deno/issues/25457
2024-09-05 13:51:37 +02:00
Mohammad Sulaiman
49340b96f6
chore: deprecate doc itests (#25452) 2024-09-05 08:09:09 +00:00
Bartek Iwańczuk
dfc5eec43c
feat: Allow importing .cjs files (#25426)
This commit adds support for executing top-level `.cjs` files, 
as well as import `.cjs` files from within npm packages.

This works only for `.cjs` files, the contents of sibling `package.json`
are not consulted for the `"type"` field.

Closes https://github.com/denoland/deno/issues/25384

---------

Signed-off-by: David Sherret <dsherret@users.noreply.github.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-09-05 07:59:12 +00:00
Bartek Iwańczuk
acd01eb2b4
feat: Add a hint on error about 'Relative import path ... not prefixed with ...' (#25430)
Running a file like:
```
import "@std/dotenv/load";
```
Without a mapping in `imports` field of `deno.json` or `dependencies` of
`package.json`
will now error out with a hint:
```
error: Relative import path "@std/dotenv/load" not prefixed with / or ./ or ../
  hint: Try running `deno add @std/dotenv/load`
    at [WILDCARD]bare_specifier_without_import/main.ts:1:8

```

Closes https://github.com/denoland/deno/issues/24699

---------

Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-09-05 08:25:56 +02:00
David Sherret
07ad47da53
BREAKING(config): make supported compilerOptions an allow list (#25432)
Deno has been using a deny list, which doesn't make sense because a lot
of these options don't even work.

Closes #25363
2024-09-04 17:39:30 +02:00
David Sherret
c6d1b0a1cc
fix(byonm): resolve npm deps of jsr deps (#25399)
This allows using npm deps of jsr deps without having to add them to the
root package.json.

Works by taking the package requirement and scanning the
`node_modules/.deno` directory for the best matching package, so it
relies on deno's node_modules structure.

Additionally to make the transition from package.json to deno.json
easier, Deno now:

1. Installs npm deps in a deno.json at the same time as installing npm
deps from a package.json.
2. Uses the alias in the import map for `node_modules/<alias>` for
better package.json compatiblity.
2024-09-04 14:00:44 +00:00
David Sherret
74fc66da11
fix: lock down allow-run permissions more (#25370)
`--allow-run` even with an allow list has essentially been
`--allow-all`... this locks it down more.

1. Resolves allow list for `--allow-run=` on startup to an absolute
path, then uses these paths when evaluating if a command can execute.
Also, adds these paths to `--deny-write`
1. Resolves the environment (cwd and env vars) before evaluating
permissions and before executing a command. Then uses this environment
to evaluate the permissions and then evaluate the command.
2024-09-04 14:51:24 +02:00
Nayeem Rahman
84dc375b2d
fix(lsp): update diagnostics on npm install (#25352) 2024-09-04 13:22:30 +01:00
Bartek Iwańczuk
0e0a5c24ea
test: run js_unit_tests with --unstable-* flags (#25394) 2024-09-04 14:21:02 +02:00
HasanAlrimawi
1d04c84c8f
chore: deprecate eval itests (#25382)
This PR serves as a part of #22907 .

---------

Signed-off-by: David Sherret <dsherret@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-09-03 15:14:19 +00:00
Asher Gomez
03d8e474d7
BREAKING(io): remove Deno.copy() (#25345)
Towards #22079

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-03 10:46:13 +00:00
Luca Casonato
5cf97f539b
BREAKING(permissions): remove --allow-hrtime (#25367)
Remove `--allow-hrtime` and `--deny-hrtime`. We are doing this because
it is already possible to get access to high resolution timers through
workers and SharedArrayBuffer.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-03 11:24:25 +02:00
David Sherret
bf7571a6f9
fix: make some warnings more standard (#25324) 2024-09-03 10:45:01 +02:00
Asher Gomez
9bf10aa1e0
chore(fs): remove Deno.flock[Sync]() (#25350)
Towards #22079
2024-09-03 18:39:37 +10:00
Bartek Iwańczuk
1f51b5310f
feat: support DENO_LOG env var instead of RUST_LOG (#25356)
Instead of `RUST_LOG` env var, we now support `DENO_LOG` env var.
This is done to be able to set a setting specific to `deno` that
wouldn't impact
other binaries written in Rust.

Ref
https://github.com/denoland/deno/issues/10558#issuecomment-2324300211
2024-09-03 10:36:28 +02:00
Asher Gomez
259752537f
BREAKING: remove Deno.close() (#25347)
Towards #22079
2024-09-03 18:33:26 +10:00
Asher Gomez
5f08d634f7
BREAKING: remove deno vendor (#25343) 2024-09-03 17:00:57 +10:00
Coty
2533d68cab
fix(cli/tools): correct deno init --serve template behavior (#25318) 2024-09-02 23:01:36 +00:00
Nayeem Rahman
e804175a0a
feat(lsp): html/css/yaml file formatting (#25353) 2024-09-02 18:27:25 +01:00
Asher Gomez
c62829fc03
BREAKING: remove --trace-ops (#25344)
Towards #22079
2024-09-02 18:26:05 +02:00
Asher Gomez
bc51eca700
BREAKING: remove deno bundle (#25339)
`deno bundle` now produces:
```
error: ⚠️ `deno bundle` was removed in Deno 2.

See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations
```

`deno bundle --help` now produces:
```
⚠️ `deno bundle` was removed in Deno 2.

See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations

Usage: deno bundle [OPTIONS]

Options:
  -q, --quiet     Suppress diagnostic output
      --unstable  Enable all unstable features and APIs. Instead of using this flag, consider enabling individual unstable features
                    To view the list of individual unstable feature flags, run this command again with --help=unstable
```
2024-09-02 17:27:37 +02:00
Asher Gomez
4c35668d90
BREAKING: remove --jobs flag (#25336) 2024-09-02 17:26:42 +02:00
Bartek Iwańczuk
42cf762cf4
chore: cleanup code for unstable tests (#25330)
Towards https://github.com/denoland/deno/issues/25241

Removes code for tests of unstable APIs that were stabilized with Deno
2.0.0-rc.0.
2024-08-31 23:38:21 +02:00
Bartek Iwańczuk
c29e5b9d1e
fix(upgrade): more informative information on invalid version (#25319)
Before:
```
$ deno upgrade v1.xx
error: Invalid version passed
```

After:
```
$ deno upgrade v1.xx
error: Invalid version passed (v1.xx)

Example usage:
  deno upgrade | deno upgrade 1.46 | deno upgrade canary
```

Also updates help text to use "shorthand version" without flags, but a
positional arg.
2024-08-31 00:22:20 +00:00
David Sherret
f891e73bbf
refactor: remove DENO_FUTURE (#25314) 2024-08-30 21:58:24 +00:00
Bartek Iwańczuk
b1c6142f74
BREAKING: DENO_FUTURE=1 by default, or welcome to Deno 2.0 (#25213)
This commit effectively turns Deno into Deno 2.0.

This is done by forcing `DENO_FUTURE=1` env var, that was available in
the past few months to try Deno 2 changes.

This commit contains several breaking changes scheduled for Deno 2:
- all deprecated JavaScript APIs are not available any more, mostly
`Deno.*` APIs
- `window` global is removed
- FFI, WebGPU and FS APIs are now stable and don't require
`--unstable-*` flags
- import assertions are no longer supported
- "bring your own node modules" is enabled by default

This is the first commit in a series that are scheduled before the Deno
2 release.

Follow up work is tracked in
https://github.com/denoland/deno/issues/25241.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-08-30 13:58:58 -04:00
David Sherret
c6793f52b9
fix(permissions): disallow any LD_ or DYLD_ prefixed env var without full --allow-run permissions (#25271)
Follow up to https://github.com/denoland/deno/pull/25221

I looked into what the list was and it was quite extensive, so I think
as suggested in
https://github.com/denoland/deno/issues/11964#issuecomment-2314585135 we
should disallow this for any `LD_` prefixed env var.
2024-08-28 21:11:37 -04:00
Bartek Iwańczuk
52fb6582e7
test: run node_unit_tests with DENO_FUTURE=1 (#25285)
This is blocking https://github.com/denoland/deno/pull/25213.

Turns out a bunch of FS APIs are completely broken because they
use RIDs (resource IDs) instead of FDs (file descriptors).
2024-08-29 00:09:06 +00:00
Bartek Iwańczuk
231bdc0aa0
test: Don't run unit tests with and without DENO_FUTURE=1 (#25273)
This is still flaky and won't be needed anyway once
https://github.com/denoland/deno/pull/25213 lands.
2024-08-28 19:37:54 +00:00