David Sherret
6960637b5c
fix(publish): warn about missing license file ( #24677 )
...
Part of https://github.com/denoland/deno/issues/24676 , but just a
warning for now.
2024-07-22 15:46:37 -04:00
David Sherret
afcae364be
refactor: update to deno_config 0.25 ( #24645 )
...
- Gets rid of WorkspaceMemberContext. It's now `Workspace` and
`WorkspaceDirectory`
- Uses the workspace cache in the lsp
* https://github.com/denoland/deno_config/pull/95
* https://github.com/denoland/deno_config/pull/96
2024-07-19 15:56:07 -04:00
David Sherret
ecd4f900c6
fix(publish): surface syntax errors when using --no-check ( #24620 )
2024-07-17 23:06:30 -04:00
Bartek Iwańczuk
7b33623b1d
Reland "refactor(fetch): reimplement fetch with hyper instead of reqwest" ( #24593 )
...
Originally landed in
f6fd6619e7
.
Reverted in https://github.com/denoland/deno/pull/24574 .
This reland contains a fix that sends "Accept: */*" header for calls made
from "FileFetcher". Absence of this header made downloading source code
from JSR broken. This is tested by ensuring this header is present in the
test server that servers JSR packages.
---------
Co-authored-by: Sean McArthur <sean@seanmonstar.com>
2024-07-18 01:37:31 +02:00
David Sherret
f4b9d85862
fix(workspace): support resolving bare specifiers to npm pkgs within a workspace ( #24611 )
...
This makes bare specifiers for npm packages work when inside a
workspace, which emulates the same behaviour as when there's a
node_modules directory. The bare specifier can be overwritten by
specifying an import map entry or package.json dependency entry.
* https://github.com/denoland/deno_config/pull/88
Closes #24605
2024-07-17 09:13:22 -04:00
Ryan Dahl
e0cfc9da39
Revert "refactor(fetch): reimplement fetch with hyper instead of reqwest ( #24237 )" ( #24574 )
...
This reverts commit f6fd6619e7
.
I'm seeing a difference between canary and 1.45.2. In
`deno-docs/reference_gen` I can't download dax when running `deno task
types`
```
~/src/deno-docs/reference_gen# deno upgrade --canary
Looking up latest canary version
Found latest version f6fd6619e7
Downloading https://dl.deno.land/canary/f6fd6619e708a515831f707438368d81b0c9aa56/deno-aarch64-apple-darwin.zip
Deno is upgrading to version f6fd6619e7
Archive: /var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/.tmpb5lDnq/deno.zip
inflating: deno
Upgraded successfully
~/src/deno-docs/reference_gen# deno -v
deno 1.45.2+f6fd661
~/src/deno-docs/reference_gen# rm -rf /Users/ry/Library/Caches/deno
~/src/deno-docs/reference_gen# deno task types
Task types deno task types:deno && deno task types:node
Task types:deno deno run --allow-read --allow-write --allow-run --allow-env --allow-sys deno-docs.ts
error: JSR package manifest for '@david/dax' failed to load. expected value at line 1 column 1
at file:///Users/ry/src/deno-docs/reference_gen/deno-docs.ts:2:15
~/src/deno-docs/reference_gen# deno upgrade --version 1.45.2
Downloading https://github.com/denoland/deno/releases/download/v1.45.2/deno-aarch64-apple-darwin.zip
Deno is upgrading to version 1.45.2
Archive: /var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/.tmp3R7uhF/deno.zip
inflating: deno
Upgraded successfully
~/src/deno-docs/reference_gen# rm -rf /Users/ry/Library/Caches/deno
~/src/deno-docs/reference_gen# deno task types
Task types deno task types:deno && deno task types:node
Task types:deno deno run --allow-read --allow-write --allow-run --allow-env --allow-sys deno-docs.ts
Task types:node deno run --allow-read --allow-write=. --allow-env --allow-sys node-docs.ts
```
2024-07-13 21:08:23 +00:00
Sean McArthur
f6fd6619e7
refactor(fetch): reimplement fetch with hyper instead of reqwest ( #24237 )
...
This commit re-implements `ext/fetch` and all dependent crates
using `hyper` and `hyper-util`, instead of `reqwest`.
The reasoning is that we want to have greater control and access
to low level `hyper` APIs when implementing `fetch` API as well
as `node:http` module.
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-13 00:51:37 +02:00
David Sherret
8243c85a47
fix(publish): show dirty files on dirty check failure ( #24541 )
2024-07-12 15:35:57 -04:00
David Sherret
80df9aec1d
refactor: move FileCollector
to deno_config ( #24433 )
2024-07-05 17:53:09 -04:00
David Sherret
f396b3d1c8
fix(publish): unfurling should always be done with the package json ( #24435 )
...
Closes https://github.com/denoland/deno/issues/24430
2024-07-05 00:41:01 +00:00
David Sherret
147411e64b
feat: npm workspace and better Deno workspace support ( #24334 )
...
Adds much better support for the unstable Deno workspaces as well as
support for npm workspaces. npm workspaces is still lacking in that we
only install packages into the root node_modules folder. We'll make it
smarter over time in order for it to figure out when to add node_modules
folders within packages.
This includes a breaking change in config file resolution where we stop
searching for config files on the first found package.json unless it's
in a workspace. For the previous behaviour, the root deno.json needs to
be updated to be a workspace by adding `"workspace":
["./path-to-pkg-json-folder-goes-here"]`. See details in
https://github.com/denoland/deno_config/pull/66
Closes #24340
Closes #24159
Closes #24161
Closes #22020
Closes #18546
Closes #16106
Closes #24160
2024-07-04 00:54:33 +00:00
David Sherret
0da01c0ca6
refactor: move PackageJson to deno_config ( #24348 )
2024-06-26 21:24:10 +00:00
Satya Rohith
0f48313565
chore: upgrade to rust 1.79 ( #24207 )
2024-06-14 17:10:57 +05:30
David Sherret
d74be0842a
FUTURE: support deno install <alias>@npm:<package>
( #24156 )
...
Closes #23144
2024-06-10 23:56:43 +00:00
David Sherret
7ed90a20d0
fix: better handling of npm resolution occurring on workers ( #24094 )
...
Closes https://github.com/denoland/deno/issues/24063
2024-06-05 17:04:16 +02:00
David Sherret
3341c50b6a
refactor: don't share reqwest::HttpClient
across tokio runtimes ( #24092 )
...
This also fixes several issues where we weren't properly creating http
clients with the user's settings.
2024-06-03 21:17:08 +00:00
David Sherret
448fe67b7a
feat(vendor): support modifying remote files in vendor folder without checksum errors ( #23979 )
...
Includes:
* https://github.com/denoland/deno_graph/pull/486
* https://github.com/denoland/deno_graph/pull/488
* https://github.com/denoland/deno_lockfile/pull/25
* https://github.com/denoland/deno_lockfile/pull/22
* https://github.com/denoland/deno_graph/pull/483
* https://github.com/denoland/deno_graph/pull/470
2024-05-28 14:58:43 -04:00
David Sherret
c4211e2ffc
fix(publish): raise diagnostics for triple-slash directives for --dry-run
instead of just publish
( #23811 )
2024-05-28 01:35:08 +00:00
David Sherret
c0e3b6ed9d
fix(publish): always include config file when publishing ( #23797 )
...
Closes https://github.com/denoland/deno/issues/23796
2024-05-14 18:15:43 +00:00
David Sherret
c6189e2070
fix(publish): error for missing version constraints on dry-publish instead of just publish ( #23798 )
...
Closes https://github.com/denoland/deno/issues/22835
2024-05-14 10:30:09 -04:00
David Sherret
47f7bed677
chore: enable clippy::print_stdout and clippy::print_stderr ( #23732 )
...
1. Generally we should prefer to use the `log` crate.
2. I very often accidentally commit `eprintln`s.
When we should use `println` or `eprintln`, it's not too bad to be a bit
more verbose and ignore the lint rule.
2024-05-08 22:45:06 -04:00
Bartek Iwańczuk
4e23a5b1fc
FUTURE: deno install
changes ( #23498 )
...
This PR implements the changes we plan to make to `deno install` in deno
2.0.
- `deno install` without arguments caches dependencies from
`package.json` / `deno.json` and sets up the `node_modules` folder
- `deno install <pkg>` adds the package to the config file (either
`package.json` or `deno.json`), i.e. it aliases `deno add`
- `deno add` can also add deps to `package.json` (this is gated behind
`DENO_FUTURE` due to uncertainty around handling projects with both
`deno.json` and `package.json`)
- `deno install -g <bin>` installs a package as a globally available
binary (the same as `deno install <bin>` in 1.0)
---------
Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-05-08 12:34:46 -07:00
David Sherret
ded6afccf2
fix(publish): --dry-publish should error for gitignored excluded files ( #23540 )
...
Files that were gitignored only were not included in the diagnostic.
2024-04-24 18:52:05 +00:00
nokazn
3d841acf48
fix(cli): avoid deno add
and deno vendor
errors when deno.json is empty ( #23439 )
2024-04-18 15:48:15 -04:00
David Sherret
98077e4b3c
fix(publish): do not warn about excluded external modules in node_modules directory ( #23173 )
2024-04-11 23:52:35 +00:00
David Sherret
ade0cd5e97
fix: upgrade deno_ast related crates ( #23187 )
...
Had to revert back swc due to
https://github.com/swc-project/swc/issues/8840
Fixes:
- https://github.com/denoland/deno_lint/pull/1262
- https://github.com/denoland/deno_doc/pull/538
- https://github.com/denoland/deno_doc/pull/537
- https://github.com/denoland/deno_graph/pull/430
- https://github.com/denoland/deno_graph/pull/425
- https://github.com/denoland/deno_graph/pull/432
2024-04-11 23:00:17 +00:00
David Sherret
b8af46e007
fix(check): ignore certain diagnostics in remote modules and when publishing ( #23119 )
...
Unused locals and parameters don't make sense to surface in remote
modules. Additionally, fast check can cause these kind of diagnostics
when publishing, so they should be ignored.
Closes #22959
2024-03-31 16:39:40 -04:00
Bartek Iwańczuk
6b95c53e48
feat(add): always produce multiline config file ( #23077 )
...
This commit changes `deno add` to always produce a multiline config
file.
In v1.41.3:
```
$ mkdir foo
$ cd foo
$ deno add @std/assert
Created deno.json configuration file.
Add @std/assert - jsr:@std/assert@^0.220.0
$ cat deno.json
{ "imports": { "@std/assert": "jsr:@std/assert@^0.220.0" } }
```
Now:
```
$ mkdir foo
$ cd foo
$ deno add @std/assert
Created deno.json configuration file.
Add @std/assert - jsr:@std/assert@^0.220.0
$ cat deno.json
{
"imports": {
"@std/assert": "jsr:@std/assert@^0.220.0"
}
}
```
2024-03-26 17:40:24 -04:00
Asher Gomez
2d59372e7a
feat(publish): check for uncommitted files in deno publish --dry-run
( #22981 )
...
Closes #22936
2024-03-22 12:41:33 -07:00
David Sherret
f96f167dc8
feat(unstable/publish): error when a package's module is excluded from publishing ( #22948 )
...
Closes #22657
2024-03-21 21:42:23 +00:00
David Sherret
c10d96cb21
fix(slow-types): improved exports tracing and infer type literals in as exprs ( #22849 )
...
Several fixes in deno_graph:
* https://github.com/denoland/deno_graph/pull/411
* https://github.com/denoland/deno_graph/pull/413
* https://github.com/denoland/deno_graph/pull/414
* https://github.com/denoland/deno_graph/pull/415
* https://github.com/denoland/deno_graph/pull/416
* https://github.com/denoland/deno_graph/pull/417
Also created https://github.com/denoland/publish_smoke_tests to help
prevent regressions in the future.
Closes https://github.com/denoland/deno/issues/22829
Closes https://github.com/denoland/deno/issues/22819
Closes https://github.com/denoland/deno/issues/22802
2024-03-12 17:45:38 +00:00
David Sherret
ad6b00a2bf
chore: enable clippy unused_async rule ( #22834 )
2024-03-11 23:48:00 -04:00
David Sherret
644ac0fe43
chore: hidden tool for overwriting files with fast check output ( #22822 )
...
Not sure if we should do this, but it's a nice hidden tool that
overwrites the working tree with the fast check output.
2024-03-11 11:42:12 -04:00
David Sherret
f8543a9fd8
fix(publish): regression - publishing with vendor folder ( #22830 )
...
In
https://github.com/denoland/deno/pull/22720/files#diff-d62d85de2a7ffb816cd2fdbaa47e588352f521c7c43d058b75649bbb255e0ae1R70
, I copy and pasted from another area of the code and didn't think about
removing how it ignores the vendor folder by default.
2024-03-09 20:40:53 -05:00
David Sherret
119744c285
fix(publish): suggest using --allow-dirty
on uncommitted changes ( #22810 )
2024-03-08 22:49:15 +00:00
David Sherret
2c6e9107b6
fix(publish): do not include .gitignore ( #22789 )
...
Regression from https://github.com/denoland/deno/pull/22720
2024-03-08 04:16:19 +00:00
David Sherret
2dfc0aca7c
fix(publish): make include and exclude work ( #22720 )
...
1. Stops `deno publish` using some custom include/exclude behaviour from
other sub commands
2. Takes ancestor directories into account when resolving gitignore
3. Backards compatible change that adds ability to unexclude an exclude
by using a negated glob at a more specific level for all sub commands
(see https://github.com/denoland/deno_config/pull/44 ).
2024-03-07 20:16:32 -05:00
Bartek Iwańczuk
914b7495a8
fix(publish): reland error if there are uncommitted changes ( #22613 ) ( #22632 )
...
Reverted in https://github.com/denoland/deno/pull/22625
2024-03-07 22:13:36 +01:00
Matt Mastracci
4791d16a8e
perf(cli): use faster_hex ( #22761 )
...
`cli::util::checksum` was showing up on flame graphs because it was
concatenating allocated strings. We can use `faster-hex` to improve it.
2024-03-07 10:00:43 -07:00
David Sherret
594d8397ad
fix(publish): properly display graph validation errors ( #22775 )
...
The graph validation errors were displaying cryptically during publish.
This fixes that.
2024-03-07 17:30:30 +01:00
Luca Casonato
87a08fc3b2
fix(tools/publish): correctly handle importing from self in unfurling ( #22774 )
...
We emitted `import "./` rather than `import "./$NAME"`. This is now
fixed.
Also makes a cosmetic change so that `../` imports are now just imported
as `../`, not `./../`.
2024-03-07 17:29:17 +01:00
Nayeem Rahman
01bc2f530e
feat(unstable/pm): support npm packages in 'deno add' ( #22715 )
2024-03-06 13:24:15 +00:00
Divy Srivastava
156950828e
fix(publish): permissionless dry-run in GHA ( #22679 )
...
Fixes https://github.com/denoland/deno/issues/22658
2024-03-06 18:26:20 +05:30
David Sherret
942dcbad84
refactor: move deno json functionality to args module ( #22710 )
2024-03-05 15:45:44 -05:00
Divy Srivastava
11db68ce96
feat(publish): add npm:
suggestion for esm.sh specifiers ( #22343 )
...
![image](https://github.com/denoland/deno/assets/34997667/f32642ed-c109-4519-84c5-6f78e9452703 )
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-03-04 09:55:28 +05:30
Nayeem Rahman
15f5f74eb7
feat(unstable/pm): support version contraints in 'deno add' ( #22646 )
2024-03-01 21:34:13 +00:00
David Sherret
878384aefa
fix(unstable/publish): repect --no-check
in no-slow-types ( #22653 )
2024-03-01 15:54:46 +00:00
Bartek Iwańczuk
ea3651a1ac
fix(publish): disable provenance if not in GHA ( #22638 )
...
The condition was wrong
2024-02-29 21:19:30 +00:00
Bartek Iwańczuk
fb31ae73e4
feat(unstable): deno add
subcommand ( #22520 )
...
This commit adds "deno add" subcommand that has a basic support for
adding "jsr:" packages to "deno.json" file.
This currently doesn't support "npm:" specifiers and specifying version
constraints.
2024-02-29 19:12:04 +00:00
David Sherret
8d9a54ca18
fix(publish): reduce warnings about dynamic imports ( #22636 )
2024-02-29 11:34:07 -05:00