1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

490 commits

Author SHA1 Message Date
David Sherret
b5b4887c4a
feat(fmt): make semi-colon option a boolean (#17527) 2023-01-25 15:06:00 -05:00
Leo Kettmeir
b71d224d11
fix(upgrade): don't display release information for canary (#17516) 2023-01-25 16:29:27 +01:00
Bartek Iwańczuk
e1c51f3c0d
feat(fmt): add ability to configure semicolons (#17292)
Allows to change behavior of `deno fmt` to use "ASI" setting for
semicolons instead of always prefering them, this is done
by "--options-semi=asi" flag or `"semi": "asi"` setting
in the config file.
2023-01-24 21:07:00 +01:00
Bartek Iwańczuk
fc2e00152b
feat: support node built-in module imports (#17264)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-01-24 09:05:54 -05:00
David Sherret
654e177c91
refactor(deno_graph): remove unused Resolved::Ok#kind usage (#17504)
See https://github.com/denoland/deno_graph/pull/205 for more details.
2023-01-24 08:23:19 -05:00
Asher Gomez
0d1471282b
feat(upgrade): link to release notes & blog post (#17073)
This change prints a link to the release notes to `deno upgrade` output
and its variations.

Release notes aren't printed for commands relating to canary versions.

Closes #16350.
2023-01-24 13:30:45 +01:00
Andreu Botella
69ec45eac7
refactor(cli): Integrate standalone mode cert handling into Flags (#17419)
The way the standalone mode handles the `--cert` flag is different to
all other modes. This is because `--cert` takes a path to the
certificate file, which is directly added to the root cert store; except
for compile mode, where its byte contents are stored in the standalone
metadata, and they are added to the root cert store after the
`ProcState` is created.

This change instead changes `Flags::ca_file` (an `Option<String>`) into
`Flags::ca_data`, which can represent a `String` file path or a
`Vec<u8>` with the certificate contents. That way, standalone mode can
create a `ProcState` whose root cert store alreay contains the
certificate.

This change also adds a tests for certificates in standalone mode, since
there weren't any before.

This refactor will help with implementing web workers in standalone mode
in the future.
2023-01-18 01:18:24 +01:00
Geert-Jan Zwiers
e023a6e3f0
refactor(cli): fewer clones (#17450) 2023-01-16 15:27:41 -05:00
David Sherret
9d3483d4eb
fix(repl): improve validator to mark more code as incomplete (#17443)
Closes #17442
2023-01-16 09:45:06 -05:00
Leo Kettmeir
df4d0c55c0
fix(cli/fmt): show filepath for InvalidData error (#17361) 2023-01-16 00:30:52 +00:00
Divy Srivastava
d5634164cb
chore: use rustfmt imports_granularity option (#17421)
Closes https://github.com/denoland/deno/issues/2699
Closes https://github.com/denoland/deno/issues/2347

Uses unstable rustfmt features. Since dprint invokes `rustfmt` we do not
need to switch the cargo toolchain to nightly. Do we care about
formatting stability of our codebase across Rust versions? (I don't)
2023-01-14 23:18:58 -05:00
David Sherret
01e02d3123
refactor: create enum for --builtin doc flag (#17423) 2023-01-14 12:39:56 -05:00
Geert-Jan Zwiers
6557642fc8
refactor(coverage): use FileFlags struct (#17388) 2023-01-13 16:56:29 -05:00
Geert-Jan Zwiers
052bcc62bb
refactor(cli/tools): reduce cloning (#17309) 2023-01-13 22:39:19 +01:00
Yiyu Lin
a00e432297
chore: add copyright_checker tool and add the missing copyright (#17285) 2023-01-13 16:51:32 +09:00
Leo Kettmeir
692f9af14a
fix: don't unwrap in test pipe handling logic (#17341)
Fixes #14746
2023-01-12 02:30:23 +01:00
Nayeem Rahman
71ea4ef274
fix(watch): preserve ProcState::file_fetcher between restarts (#15466)
This commit changes "ProcState" to store "file_fetcher" field in an "Arc",
allowing it to be preserved between restarts and thus keeping the state
alive between the restarts. File watchers for "deno test" and "deno bench"
now reset "ProcState" between restarts.
2023-01-10 16:28:10 +01:00
David Sherret
2be1282be4
fix(install): should always include --no-config in shim unless --config is specified (#17300)
Closes #17294
2023-01-08 09:03:55 -05:00
Geert-Jan Zwiers
84ef26ac9b
refactor(cli/tools): move flag and config logic to CliOptions (#17008)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-01-07 15:22:09 -05:00
Bartek Iwańczuk
fac6447815
refactor(permissions): add PermissionsContainer struct for internal mutability (#17134)
Turns out we were cloning permissions which after prompting were discarded,
so the state of permissions was never preserved. To handle that we need to store
all permissions behind "Arc<Mutex<>>" (because there are situations where we
need to send them to other thread).

Testing and benching code still uses "Permissions" in most places - it's undesirable
to share the same permission set between various test/bench files - otherwise
granting or revoking permissions in one file would influence behavior of other test
files.
2023-01-07 17:25:34 +01:00
Yiyu Lin
896dd56b7a
refactor(cli,core,ext,rt): remove some unnecessary clone or malloc (#17274) 2023-01-05 14:29:50 -05:00
David Sherret
0ee64ad847
fix: upgrade deno_ast to 0.23 (#17269)
Closes #17172
Closes #15669
Closes #8529
2023-01-04 18:54:54 -05:00
Yiyu Lin
319f607476
chore(cli,ext,rt): remove some unnecessary clone or malloc (#17261) 2023-01-04 13:20:36 +01:00
Fenix
501472f06b
fix(cli): bundle command support shebang file (#17113) 2023-01-03 16:19:28 +00:00
David Sherret
10e4b2e140
chore: update copyright year to 2023 (#17247)
Yearly tradition of creating extra noise in git.
2023-01-02 21:00:42 +00:00
Geert-Jan Zwiers
f729576b2d
refactor: cleanup redundant call (#17226) 2022-12-30 20:04:17 -08:00
Pig Fang
59dedf217f
fix(init): update comment style (#17074)
The output of `init` are commands, so this should be treated as a "Shell
script". In Shell script, comments must start with `#`, not `//`. (This
also makes the commands example easier to be copied to somewhere.)
2022-12-17 23:26:25 +01:00
linbingquan
f46df3e359
chore: update to Rust 1.66.0 (#17078) 2022-12-17 23:20:15 +01:00
David Sherret
f2c9cc500c
fix(lint): column number for pretty reporting was off by 1 (#17107)
Closes #17086
2022-12-17 16:00:33 -05:00
sigmaSd
c39550fe52
fix(repl): doing two history searches exiting with ctrl+c should not exit repl (#17079)
fix https://github.com/denoland/deno/issues/16147
2022-12-16 18:39:52 -05:00
Bartek Iwańczuk
efcb93f8b9
fix(npm): fix require resolution if using --node-modules-dir (#17087)
In our `require()` implementation we use a special logic to resolve
"base path" when looking for matching packages, however this logic
is in contradiction to what needs to happen if there's a local
"node_modules"
directory used. This commit changes require implementation to be aware
if we're running off of global node modules cache or a local one.
2022-12-16 23:41:51 +01:00
David Sherret
058610b458
fix(install): use a hidden file for the lockfile and config (#17084)
Closes #17083
2022-12-16 22:24:06 +01:00
Bartek Iwańczuk
a202e38316
refactor(core): allow to listen for notifications in LocalInspectorSession (#17040) 2022-12-16 20:12:06 +01:00
Bartek Iwańczuk
ff71ef8175
fix(repl): errors shouldn't terminate repl (#17082)
This commit changes REPL to never surface errors coming
from code execution, but instead print them as errors
to the REPL itself.
2022-12-16 17:11:10 +01:00
David Sherret
9f82abb4b4
fix(upgrade/windows): correct command in windows access denied message (#17049) 2022-12-14 16:21:43 -05:00
David Sherret
4a64ca8501
chore: fix recent regression with deno upgrade not handling redirects (#17045) 2022-12-14 08:47:18 -05:00
Bartek Iwańczuk
435948e470
feat(repl): support npm packages (#16770)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-12-13 13:53:32 +01:00
David Sherret
8972ebc9cc
fix: always derive http client from cli flags (#17029)
I'm not sure how to test this. It doesn't seem to have an existing test.

Closes #15921
2022-12-12 21:30:44 -05:00
Bartek Iwańczuk
8c026dab92
feat: improve download progress bar (#16984)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-12-12 20:52:10 -05:00
Geert-Jan Zwiers
890b065310
feat(cli): support deno bench in the config file (#16608)
This PR adds the ability to set `include/exclude` fields for `deno
bench` in the configuration file.
2022-12-10 02:30:47 +01:00
sigmaSd
4eb8e875fd
feat(init): Generate main_bench.ts by default (#16786)
This commit changes "deno init" to generate "main_bench.ts" file
which scaffold two example bench cases.
2022-12-10 00:34:08 +01:00
Bartek Iwańczuk
6794d9fe5d
feat(init): Use jsonc for configuration file (#17002)
Generate "deno.jsonc" instead of "deno.json" when running "deno init"
subcommand.
2022-12-09 23:55:03 +01:00
David Sherret
653aebfa1a
fix: respect the --quiet flag in more cases (#16998) 2022-12-09 10:54:24 -05:00
David Sherret
6541a0a9fd
refactor: cleanup main.rs (#16996)
1. Extracts out some code from main.rs
2. Inlines all the `x_command` functions in main.rs
2022-12-09 09:40:48 -05:00
Lino Le Van
a9d2154110
fix(cli/upgrade): properly cleanup after finished (#16930)
Co-authored-by: kidonng <kidonng@users.noreply.github.com>
2022-12-08 17:48:48 -05:00
David Sherret
91443bbc0b
fix(compile): ensure import map is used when specified in deno config file (#16990)
Closes #14246
2022-12-08 11:50:09 -05:00
Bartek Iwańczuk
a6b5d05311
feat(init): Generate deno.json by default (#16389)
Updates `deno init` subcommand to create a `deno.json` when initializing
a new project.

Slightly changes the output, to make it more readable.
2022-12-08 06:34:28 +01:00
Bartek Iwańczuk
1a472ad06b
feat(repl): run "deno repl" with no permissions (#16795)
This commit changes "deno repl" command to run with no permissions by
default and accept "--allow-*" flags. 

This change is dictated by the fact that currently there is no way to
run REPL with limited permissions. Technically it's a breaking 
change in the CLI command, but there's agreement in the team 
that it has merit and it's a good solution.

Running just "deno" command still starts the REPL with full permissions
allowed, but now a banner is printed to inform users about that:
2022-12-07 20:21:18 +01:00
David Sherret
9c1ab39e19
feat: ignore node_modules and .git folders when collecting files everywhere (#16862)
We currently only do this for fmt. This makes it so they're excluded by
default, but you can still opt into these directories by explicitly
specifying them.
2022-12-07 13:10:10 -05:00
David Sherret
c03e0f3853
refactor: remove deno_graph::Locker usage (#16877)
This is just a straight refactor and doesn't make any improvements to
the code that could now be made.

Closes #16493
2022-12-06 14:12:51 -05:00
David Sherret
2fab4583ef
fix(test): improve how --fail-fast shuts down when hitting limit (#16956)
Closes #15650
2022-12-05 16:17:49 -05:00
David Sherret
83bc8c473d
fix(upgrade/windows): show informative message on access denied error (#16887)
Closes #16886
2022-12-02 14:53:10 -05:00
David Sherret
05469fc382
fix(upgrade): respect the --quiet flag (#16888)
Also, use `ProgressBar` for upgrading.
2022-12-01 18:05:49 -05:00
David Sherret
fafb3eebaf
fix(vendor): properly handle bare specifiers that start with http (#16885) 2022-12-01 11:01:19 -05:00
Bartek Iwańczuk
d1962e07af
fix(repl): respect --quiet flag (#16875)
This commit changes REPL behavior to respect --quiet flag. Once 
this flag is present REPL will not print a banner at the start.
2022-11-30 23:25:20 +01:00
sigmaSd
2656af2544
fix(coverage): Error if the emit cache is invalid (#16850) 2022-11-29 18:43:54 +01:00
David Sherret
2d4c46c975
refactor: create util folder, move nap_sym to napi/sym, move http_cache to cache folder (#16857) 2022-11-28 17:28:54 -05:00
Bartek Iwańczuk
3a320db270
fix(inspector): send "isDefault" in aux data (#16836)
With trial and error I found that most debuggers expect "isDefault" to be sent
in "auxData" field of "executionContextCreated" notification. This stems from
the fact that Node.js sends this data and eg. VSCode requires it to close
connection to the debugger when the program finishes execution.
2022-11-26 23:09:48 +01:00
David Sherret
0c0af67f89
refactor: DenoDir - move to cache folder and make root_dir private (#16823) 2022-11-26 00:04:30 +00:00
David Sherret
6de3d7f184
refactor: move cdp.rs to tools/repl (#16821) 2022-11-25 18:38:08 -05:00
David Sherret
dcb4ffb93a
refactor: move dts files, diagnostics.rs, and tsc.rs to tsc folder (#16820) 2022-11-25 18:29:48 -05:00
Bartek Iwańczuk
433f38084b
fix(repl): more reliable history handling (#16797)
This commit changes history handling of the REPL.

There were some situations were history wasn't properly saved and flushed to a
file, making history very spotty. This commit changes it to save every line into
the history file and flush it to disk before being evaluated.

Thanks to this all lines, including "close()" will be stored in the history
file.

If for any reason we're not able to save history file, a single warning will be
printed to the REPL and it will continue to work, even if subsequent tries will
fail to save to disk.
2022-11-25 02:56:47 +01:00
David Sherret
4b07c7b159
fix(install): deno install -f should overwrite lockfile from previous installation (#16744) 2022-11-21 14:24:51 -05:00
Bartek Iwańczuk
d232746928
feat(core): Ability to create snapshots from existing snapshots (#16597)
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2022-11-21 14:36:26 +01:00
David Sherret
409e6c8402
fix(info): handle circular npm dependencies (#16692) 2022-11-17 21:22:28 -05:00
Aaron O'Mullan
238590aa9f
chore: use Rust 1.65.0 (#16688) 2022-11-18 02:59:10 +01:00
David Sherret
d6fd171394
fix(install): support npm specifiers (#16634)
Supports npm specifiers for `deno install`. This will by default always
use a lockfile (which is generated on first run) unless `--no-lock` is
specified.
2022-11-14 22:40:05 -05:00
Bartek Iwańczuk
5be8c96ae8
feat: Stabilize Deno.bench() and 'deno bench' subcommand (#16485) 2022-11-11 00:22:14 +01:00
David Sherret
cbb3f85433
feat(unstable/npm): support peer dependencies (#16561)
This adds support for peer dependencies in npm packages.

1. If not found higher in the tree (ancestor and ancestor siblings),
peer dependencies are resolved like a dependency similar to npm 7.
2. Optional peer dependencies are only resolved if found higher in the
tree.
3. This creates "copy packages" or duplicates of a package when a
package has different resolution due to peer dependency resolution—see
https://pnpm.io/how-peers-are-resolved. Unlike pnpm though, duplicates
of packages will have `_1`, `_2`, etc. added to the end of the package
version in the directory in order to minimize the chance of hitting the
max file path limit on Windows. This is done for both the local
"node_modules" directory and also the global npm cache. The files are
hard linked in this case to reduce hard drive space.

This is a first pass and the code is definitely more inefficient than it
could be.

Closes #15823
2022-11-08 14:17:24 -05:00
sigmaSd
384e53308a
fix(upgrade): don't prompt if current version has changed (#16542)
fix https://github.com/denoland/deno/issues/16539
fix https://github.com/denoland/deno/issues/16537
2022-11-05 19:06:58 -04:00
Bartek Iwańczuk
dae3940519
fix(lock): add --no-lock flag to disable auto discovery of lock file (#16526) 2022-11-03 16:42:56 +01:00
Bartek Iwańczuk
630abb58b0
refactor: Combine ImportMapResolver and JsxResolver (#16508)
These resolvers are used in `deno_graph` APIs. Combining them removes a
lot of code and
unblocks me on https://github.com/denoland/deno/pull/16157
2022-11-02 15:47:02 +01:00
David Sherret
cb08b4683f
feat(unstable/npm): deno info --json support for npm specifiers (#16472) 2022-10-31 10:25:46 -04:00
sigmaSd
b07a753756
fix(tools): show correct upgrade command for upgrading canary (#16486) 2022-10-31 11:48:28 +01:00
David Sherret
edaceecec7
feat: support npm specifiers in deno info for display text output only (#16470) 2022-10-28 16:19:55 -04:00
Bartek Iwańczuk
d1d42e6ba7
fix(upgrade): don't prompt if latest version is older than current binary (#16464) 2022-10-28 18:43:49 +02:00
David Sherret
56d5cb21b0
refactor: move deno info functionality from deno_graph to CLI (#16434)
Closes #16423
2022-10-28 11:03:33 -04:00
David Sherret
65f12f571b
fix(cli): do not log update checker when log level is quiet (#16433)
Co-authored-by: lucacasonato <hello@lcas.dev>
2022-10-26 21:20:41 +00:00
doi yuki
5d45d2a7e0
fix(upgrade): Added error message when using canary option with M1 (#16382)
before
```
Looking up latest version
Found latest version 8c9e6c5565
Checking https://dl.deno.land/canary/8c9e6c5565c1c00437d083de76cdd944e44b1d99/deno-aarch64-apple-darwin.zip
Download could not be found, aborting
```

after
```
Looking up latest canary version
Found latest version 8c9e6c5565
error: Canary builds are not available for M1
```

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-26 15:51:22 +02:00
David Sherret
e203bd9c5a
fix: upgrade swc_ecma_parser to 0.122.19 - deno_ast 0.20 (#16406) 2022-10-25 11:55:57 -04:00
Brenley Dueck
a189c5393e
feat(lint): add a report lint config setting (#16045)
Builds off this PR to add a "report" setting to deno.json which can be
"pretty", "compact", or "json".
2022-10-25 14:21:20 +02:00
David Sherret
15744e2a0c
refactor: testable update checker code (#16386) 2022-10-22 14:31:25 -04:00
sigmaSd
8c9e6c5565
feat(upgrade): check if user has write access to deno exe (#16378) 2022-10-21 15:50:03 -04:00
David Sherret
bcfe279fba
feat(unstable/npm): initial type checking of npm specifiers (#16332) 2022-10-21 15:20:18 +00:00
Bartek Iwańczuk
0e1a71fec6
fix(upgrade): put prompt date in the past when creating a file (#16380) 2022-10-21 17:07:17 +02:00
Bartek Iwańczuk
4b6168d5e3
feat(update): prompt for new version once per day (#16375)
<!--
Before submitting a PR, please read http://deno.land/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
-->
2022-10-21 01:50:55 +02:00
David Sherret
e825022c82
refactor(cli): update checker - use a single option instead of two (#16372) 2022-10-20 17:01:17 -04:00
Bert Belder
a48d05fac7
feat(cli): check for updates in background (#15974)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-10-20 16:15:21 +02:00
Bartek Iwańczuk
23bb0abc23
feat(task): remove warning about being unstable (#16281)
`deno task` has been in use for a few months now. It was very
well received and there are not many complaints. I feel like
this warning might be discouraging for some users and we don't
really plan to make drastic changes to it (besides adding support
for globs in unspecified future).
2022-10-18 14:39:04 +02:00
David Sherret
872dc9b1df
feat(unstable/task): add INIT_CWD env var (#16110) 2022-10-15 16:46:28 -04:00
Yusuke Tanaka
2c96f64fa7
fix(cli): skip removing the latter part if @ appears at the beginning (#16244)
This commit prevents panics that `deno compile` command ran into under certain
conditions from occurring. Such conditions are as follows.

- the target file name begins with `@`, OR
- the stem part of the target file name is equal to one of
["main", "index", "mod", "index"] && the parent directory name starts with `@`

Fixes #16243
2022-10-12 11:32:52 +09:00
Brenley Dueck
23125b275f
feat(lint): add --compact flag for terse output (#15926) 2022-09-28 18:47:48 +02:00
Yoshiya Hinosawa
fa9e7aab6d
feat: add --allow-sys permission flag (#16028) 2022-09-28 21:46:50 +09:00
Sylvain Cau
9bb3ccbab2
fix(cli/vendor): handle assert type json during vendoring (#16059) 2022-09-27 14:01:43 -04:00
Mathias Lafeldt
4b01ef5c23
chore: use Rust 1.64.0 (#16035) 2022-09-26 21:52:16 +02:00
David Sherret
0eda3fcd12
fix(compile): keep non-exe extension in output name on Windows (#15994) 2022-09-22 11:49:27 -04:00
David Sherret
716005a0d4
feat(npm): add flag for creating and resolving npm packages to a local node_modules folder (#15971) 2022-09-22 11:17:02 -04:00
Kayla Washburn
1ef96343a1
feat: allow exiting on two consecutive ctrl+c presses (#15981) 2022-09-22 04:42:09 -04:00
David Sherret
1464b756a4
refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
Ben Noordhuis
b1b418b81a
chore: fix clippy warnings (#15944)
Stop allowing clippy::derive-partial-eq-without-eq and fix warnings
about deriving PartialEq without also deriving Eq.

In one case I removed the PartialEq because it a) wasn't necessary,
and b) sketchy because it was comparing floating point numbers.

IMO, that's a good argument for enforcing the lint rule, because it
would most likely have been caught during review if it had been enabled.
2022-09-19 10:25:03 +02:00