1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

Merge branch 'main' into repl_restart

This commit is contained in:
Bartek Iwańczuk 2022-12-08 06:38:39 +01:00 committed by GitHub
commit f5e36f8bae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 268 additions and 134 deletions

View file

@ -43,9 +43,9 @@
"tools/wpt/manifest.json"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.78.0.wasm",
"https://plugins.dprint.dev/json-0.16.0.wasm",
"https://plugins.dprint.dev/markdown-0.14.2.wasm",
"https://plugins.dprint.dev/typescript-0.79.0.wasm",
"https://plugins.dprint.dev/json-0.17.0.wasm",
"https://plugins.dprint.dev/markdown-0.15.0.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm",
"https://plugins.dprint.dev/exec-0.3.2.json@8efbbb3fcfbdf84142c3c438fbdeaf1637152a020032127c837b2b14e23261c3"
]

209
Cargo.lock generated
View file

@ -108,9 +108,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.65"
version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602"
checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6"
[[package]]
name = "arrayvec"
@ -138,10 +138,10 @@ checksum = "cf94863c5fdfee166d0907c44e5fee970123b2b7307046d35d1e671aa93afbba"
dependencies = [
"darling",
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -174,9 +174,9 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -185,9 +185,9 @@ version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -208,9 +208,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4"
dependencies = [
"proc-macro-error",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -642,7 +642,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb"
dependencies = [
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -715,10 +715,10 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
dependencies = [
"fnv",
"ident_case",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"strsim",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -729,7 +729,7 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
dependencies = [
"darling_core",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -1163,10 +1163,10 @@ dependencies = [
"pmutil",
"prettyplease",
"proc-macro-crate",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"regex",
"syn 1.0.99",
"syn 1.0.105",
"testing_macros",
"trybuild",
]
@ -1340,10 +1340,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
"convert_case",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"rustc_version 0.4.0",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -1418,22 +1418,23 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "dprint-core"
version = "0.59.0"
version = "0.60.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84600c297cc99fc088a9a916286d71915c988fa3a6f1bbc994ad9b93dde80c03"
checksum = "2c762da282ebc7635f7918898e26d50e2b282378977dc7b3786364ac12065a71"
dependencies = [
"anyhow",
"bumpalo",
"indexmap",
"rustc-hash",
"serde",
"unicode-width",
]
[[package]]
name = "dprint-plugin-json"
version = "0.16.0"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "447c6f9ceae26cafa063a53b59710735576ade0c17dee4603a59ee18b5dbcdff"
checksum = "e6120aa5613816db2ef2ef539c229c24f4ee3dbba15317242bcf0de5f17a0060"
dependencies = [
"anyhow",
"dprint-core",
@ -1444,9 +1445,9 @@ dependencies = [
[[package]]
name = "dprint-plugin-markdown"
version = "0.14.3"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "999e8891976e3b15b519b920db4ac70c6a85f0c6f0e0ddb6ef3b247373e8984d"
checksum = "8a56f436938566b1f638411e1f3089257a59a68b344886d75fcad0f397e5acfb"
dependencies = [
"anyhow",
"dprint-core",
@ -1458,9 +1459,9 @@ dependencies = [
[[package]]
name = "dprint-plugin-typescript"
version = "0.78.0"
version = "0.79.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f864163f7cff21d4ff2385d36d441ff30af73d77530d87c6c90510e39a69a4f5"
checksum = "cf79285ae7a27047ab90162fefab77367478e08fffc42f8158143f8b33b69c22"
dependencies = [
"anyhow",
"deno_ast",
@ -1501,9 +1502,9 @@ dependencies = [
"byteorder",
"lazy_static",
"proc-macro-error",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -1585,9 +1586,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116"
dependencies = [
"heck",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -1597,9 +1598,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b940da354ae81ef0926c5eaa428207b8f4f091d3956c891dfbd124162bed99"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -1752,9 +1753,9 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479cde5eb168cf5a056dd98f311cbfab7494c216394e4fb9eba0336827a8db93"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -1815,9 +1816,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0981e470d2ab9f643df3921d54f1952ea100c39fdb6a3fdc820e20d2291df6c"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -1904,9 +1905,9 @@ version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -2313,9 +2314,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.9.1"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
dependencies = [
"autocfg",
"hashbrown",
@ -2410,9 +2411,9 @@ checksum = "1c068d4c6b922cd6284c609cfa6dec0e41615c9c5a1a4ba729a970d8daba05fb"
dependencies = [
"Inflector",
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -2846,11 +2847,11 @@ dependencies = [
name = "napi_sym"
version = "0.10.0"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"serde",
"serde_json",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -3216,9 +3217,9 @@ dependencies = [
"phf_generator",
"phf_shared",
"proc-macro-hack",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -3245,9 +3246,9 @@ version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -3295,9 +3296,9 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -3342,8 +3343,8 @@ version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51"
dependencies = [
"proc-macro2 1.0.43",
"syn 1.0.99",
"proc-macro2 1.0.47",
"syn 1.0.105",
]
[[package]]
@ -3364,9 +3365,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
"version_check",
]
@ -3376,7 +3377,7 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"version_check",
]
@ -3398,9 +3399,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.43"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
dependencies = [
"unicode-ident",
]
@ -3453,7 +3454,7 @@ version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
]
[[package]]
@ -3801,9 +3802,9 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "107c3d5d7f370ac09efa62a78375f94d94b8a33c61d8c278b96683fb4dbf2d8d"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -3913,9 +3914,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "serde"
version = "1.0.144"
version = "1.0.149"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860"
checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055"
dependencies = [
"serde_derive",
]
@ -3931,13 +3932,13 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.144"
version = "1.0.149"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00"
checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -3958,9 +3959,9 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4180,7 +4181,7 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
dependencies = [
"phf_generator",
"phf_shared",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
]
@ -4191,10 +4192,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "994453cd270ad0265796eb24abf5540091ed03e681c5f3c12bc33e4db33253e1"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4302,10 +4303,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb64bc03d90fd5c90d6ab917bb2b1d7fbd31957df39e31ea24a3f554b4372251"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4351,10 +4352,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0159c99f81f52e48fe692ef7af1b0990b45d3006b14c6629be0b1ffee1b23aea"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4445,10 +4446,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebf907935ec5492256b523ae7935a824d9fdc0368dcadc41375bad0dca91cd8b"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4575,9 +4576,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c20468634668c2bbab581947bb8c75c97158d5a6959f4ba33df20983b20b4f6"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4612,9 +4613,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4be988307882648d9bc7c71a6a73322b7520ef0211e920489a98f8391d8caa2"
dependencies = [
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4635,10 +4636,10 @@ checksum = "8fb1f3561674d84947694d41fb6d5737d19539222779baeac1b3a071a2b29428"
dependencies = [
"Inflector",
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"swc_macros_common",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4654,11 +4655,11 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.99"
version = "1.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"unicode-ident",
]
@ -4669,9 +4670,9 @@ version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
"unicode-xid 0.2.4",
]
@ -4778,11 +4779,11 @@ dependencies = [
"glob",
"once_cell",
"pmutil",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"regex",
"relative-path",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4821,9 +4822,9 @@ version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -4878,9 +4879,9 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -5005,9 +5006,9 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ebd99eec668d0a450c177acbc4d05e0d0d13b1f8d3db13cd706c52cbec4ac04"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -5034,9 +5035,9 @@ version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
]
[[package]]
@ -5467,9 +5468,9 @@ dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
"wasm-bindgen-shared",
]
@ -5501,9 +5502,9 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -5790,9 +5791,9 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17"
dependencies = [
"proc-macro2 1.0.43",
"proc-macro2 1.0.47",
"quote 1.0.21",
"syn 1.0.99",
"syn 1.0.105",
"synstructure",
]

View file

@ -103,7 +103,7 @@ rusqlite = { version = "=0.28.0", features = ["unlock_notify", "bundled"] }
rustls = "0.20.5"
rustls-pemfile = "1.0.0"
semver = "=1.0.14"
serde = { version = "=1.0.144", features = ["derive"] }
serde = { version = "=1.0.149", features = ["derive"] }
serde_bytes = "0.11"
serde_json = "=1.0.85"
serde_repr = "=0.1.9"

View file

@ -61,9 +61,9 @@ clap_complete = "=3.1.2"
clap_complete_fig = "=3.1.5"
data-url.workspace = true
dissimilar = "=1.0.4"
dprint-plugin-json = "=0.16.0"
dprint-plugin-markdown = "=0.14.3"
dprint-plugin-typescript = "=0.78.0"
dprint-plugin-json = "=0.17.0"
dprint-plugin-markdown = "=0.15.0"
dprint-plugin-typescript = "=0.79.0"
encoding_rs.workspace = true
env_logger = "=0.9.0"
eszip = "=0.31.0"
@ -71,7 +71,7 @@ fancy-regex = "=0.10.0"
flate2.workspace = true
http.workspace = true
import_map = "=0.13.0"
indexmap = "=1.9.1"
indexmap = "=1.9.2"
indicatif = "=0.17.1"
jsonc-parser = { version = "=0.21.0", features = ["serde"] }
libc.workspace = true

View file

@ -429,6 +429,13 @@ pub struct TestConfig {
pub files: FilesConfig,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(untagged)]
pub enum LockConfig {
Bool(bool),
PathBuf(PathBuf),
}
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConfigFileJson {
@ -438,6 +445,7 @@ pub struct ConfigFileJson {
pub fmt: Option<Value>,
pub tasks: Option<Value>,
pub test: Option<Value>,
pub lock: Option<Value>,
}
#[derive(Clone, Debug)]
@ -759,6 +767,16 @@ impl ConfigFile {
bail!("No tasks found in configuration file")
}
}
pub fn to_lock_config(&self) -> Result<Option<LockConfig>, AnyError> {
if let Some(config) = self.json.lock.clone() {
let lock_config: LockConfig = serde_json::from_value(config)
.context("Failed to parse \"lock\" configuration")?;
Ok(Some(lock_config))
} else {
Ok(None)
}
}
}
/// Represents the "default" type library that should be used when type

View file

@ -547,6 +547,7 @@ static ENV_VARIABLES_HELP: &str = r#"ENVIRONMENT VARIABLES:
(module downloads, fetch)
HTTPS_PROXY Proxy address for HTTPS requests
(module downloads, fetch)
NPM_CONFIG_REGISTRY URL to use for the npm registry.
NO_COLOR Set to disable color
NO_PROXY Comma-separated list of hosts which do not use a proxy
(module downloads, fetch)"#;

View file

@ -10,6 +10,7 @@ use std::collections::BTreeMap;
use std::io::Write;
use std::path::PathBuf;
use crate::args::config_file::LockConfig;
use crate::args::ConfigFile;
use crate::npm::NpmPackageId;
use crate::npm::NpmPackageReq;
@ -104,9 +105,23 @@ impl Lockfile {
None => match maybe_config_file {
Some(config_file) => {
if config_file.specifier.scheme() == "file" {
let mut path = config_file.specifier.to_file_path().unwrap();
path.set_file_name("deno.lock");
path
match config_file.clone().to_lock_config()? {
Some(LockConfig::Bool(lock)) if !lock => {
return Ok(None);
}
Some(LockConfig::PathBuf(lock)) => config_file
.specifier
.to_file_path()
.unwrap()
.parent()
.unwrap()
.join(lock),
_ => {
let mut path = config_file.specifier.to_file_path().unwrap();
path.set_file_name("deno.lock");
path
}
}
} else {
return Ok(None);
}

View file

@ -228,22 +228,37 @@ pub struct RealNpmRegistryApi(Arc<RealNpmRegistryApiInner>);
impl RealNpmRegistryApi {
pub fn default_url() -> Url {
let env_var_name = "DENO_NPM_REGISTRY";
if let Ok(registry_url) = std::env::var(env_var_name) {
// ensure there is a trailing slash for the directory
let registry_url = format!("{}/", registry_url.trim_end_matches('/'));
match Url::parse(&registry_url) {
Ok(url) => url,
Err(err) => {
eprintln!("{}: Invalid {} environment variable. Please provide a valid url.\n\n{:#}",
colors::red_bold("error"),
env_var_name, err);
std::process::exit(1);
// todo(dsherret): remove DENO_NPM_REGISTRY in the future (maybe May 2023)
let env_var_names = ["NPM_CONFIG_REGISTRY", "DENO_NPM_REGISTRY"];
for env_var_name in env_var_names {
if let Ok(registry_url) = std::env::var(env_var_name) {
// ensure there is a trailing slash for the directory
let registry_url = format!("{}/", registry_url.trim_end_matches('/'));
match Url::parse(&registry_url) {
Ok(url) => {
if env_var_name == "DENO_NPM_REGISTRY" {
log::warn!(
"{}",
colors::yellow(concat!(
"DENO_NPM_REGISTRY was intended for internal testing purposes only. ",
"Please update to NPM_CONFIG_REGISTRY instead.",
)),
);
}
return url;
}
Err(err) => {
log::debug!(
"Invalid {} environment variable: {:#}",
env_var_name,
err,
);
}
}
}
} else {
Url::parse("https://registry.npmjs.org").unwrap()
}
Url::parse("https://registry.npmjs.org").unwrap()
}
pub fn new(

View file

@ -355,6 +355,11 @@
}
}
}
},
"lock": {
"description": "Whether to use a lock file or the path to use for the lock file. Can be overridden by CLI arguments.",
"type": ["string", "boolean"],
"default": true
}
}
}

View file

@ -28,8 +28,11 @@ mod init {
assert_contains!(stderr, "Project initialized");
assert!(!stderr.contains("cd"));
assert_contains!(stderr, "deno run main.ts");
assert_contains!(stderr, "deno task dev");
assert_contains!(stderr, "deno test");
assert!(cwd.join("deno.json").exists());
let mut deno_cmd = util::deno_cmd_with_deno_dir(&deno_dir);
let output = deno_cmd
.current_dir(cwd)
@ -80,8 +83,11 @@ mod init {
assert_contains!(stderr, "Project initialized");
assert_contains!(stderr, "cd my_dir");
assert_contains!(stderr, "deno run main.ts");
assert_contains!(stderr, "deno task dev");
assert_contains!(stderr, "deno test");
assert!(cwd.join("my_dir/deno.json").exists());
let mut deno_cmd = util::deno_cmd_with_deno_dir(&deno_dir);
let output = deno_cmd
.current_dir(cwd)
@ -131,6 +137,7 @@ mod init {
assert!(output.status.success());
let stdout = String::from_utf8(output.stdout).unwrap();
assert_eq!(stdout, "");
assert!(cwd.join("deno.json").exists());
let mut deno_cmd = util::deno_cmd_with_deno_dir(&deno_dir);
let output = deno_cmd

View file

@ -656,6 +656,19 @@ mod run {
http_server: true,
});
itest!(config_file_lock_path {
args: "run --config=run/config_file_lock_path.json run/019_media_types.ts",
output: "run/config_file_lock_path.out",
exit_code: 10,
http_server: true,
});
itest!(lock_flag_overrides_config_file_lock_path {
args: "run --lock=run/lock_check_ok2.json --config=run/config_file_lock_path.json run/019_media_types.ts",
output: "run/019_media_types.ts.out",
http_server: true,
});
itest!(lock_v2_check_ok {
args:
"run --lock=run/lock_v2_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts",
@ -3662,6 +3675,20 @@ console.log("finish");
exit_code: 0,
});
itest!(config_file_lock_false {
args: "run --config=run/config_file_lock_boolean/false.json run/config_file_lock_boolean/main.ts",
output: "run/config_file_lock_boolean/false.main.out",
http_server: true,
exit_code: 0,
});
itest!(config_file_lock_true {
args: "run --config=run/config_file_lock_boolean/true.json run/config_file_lock_boolean/main.ts",
output: "run/config_file_lock_boolean/true.main.out",
http_server: true,
exit_code: 10,
});
// Check https://github.com/denoland/deno_std/issues/2882
itest!(flash_shutdown {
args: "run --unstable --allow-net run/flash_shutdown/main.ts",

View file

@ -0,0 +1,7 @@
{
"version": "2",
"remote": {
"http://localhost:4545/subdir/mod2.ts": "cae1d3e9f3c38cd415ff52dff854be8f3d17d35f8d7b3d285e813fb0f6393a2f",
"http://localhost:4545/subdir/print_hello.ts": "foobar"
}
}

View file

@ -0,0 +1,3 @@
{
"lock": false
}

View file

@ -0,0 +1,2 @@
Download http://localhost:4545/subdir/mod2.ts
Download http://localhost:4545/subdir/print_hello.ts

View file

@ -0,0 +1 @@
import "http://localhost:4545/subdir/mod2.ts";

View file

@ -0,0 +1,3 @@
{
"lock": true
}

View file

@ -0,0 +1,3 @@
[WILDCARD]The source code is invalid, as it does not match the expected hash in the lock file.
Specifier: http://localhost:4545/subdir/print_hello.ts
Lock file: [WILDCARD]deno.lock

View file

@ -0,0 +1,3 @@
{
"lock": "./lock_check_err2.json"
}

View file

@ -0,0 +1,3 @@
[WILDCARD]The source code is invalid, as it does not match the expected hash in the lock file.
Specifier: http://localhost:4545/subdir/mt_text_ecmascript.j3.js
Lock file: [WILDCARD]lock_check_err2.json

View file

@ -1,6 +1,7 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
use crate::args::InitFlags;
use crate::colors;
use crate::deno_std;
use deno_core::anyhow::Context;
use deno_core::error::AnyError;
@ -40,12 +41,26 @@ pub async fn init_project(init_flags: InitFlags) -> Result<(), AnyError> {
.replace("{CURRENT_STD_URL}", deno_std::CURRENT_STD_URL.as_str());
create_file(&dir, "main_test.ts", &main_test_ts)?;
info!("✅ Project initialized");
info!("Run these commands to get started");
create_file(&dir, "deno.json", include_str!("./templates/deno.json"))?;
info!("✅ {}", colors::green("Project initialized"));
info!("");
info!("{}", colors::gray("Run these commands to get started"));
info!("");
if let Some(dir) = init_flags.dir {
info!(" cd {}", dir);
info!("");
}
info!(" {}", colors::gray("// Run the program"));
info!(" deno run main.ts");
info!("");
info!(
" {}",
colors::gray("// Run the program and watch for file changes")
);
info!(" deno task dev");
info!("");
info!(" {}", colors::gray("// Run the tests"));
info!(" deno test");
Ok(())
}

View file

@ -0,0 +1,5 @@
{
"tasks": {
"dev": "deno run --watch main.ts"
}
}

View file

@ -18,4 +18,4 @@ deno_core.workspace = true
once_cell.workspace = true
path-clean = "=0.1.0"
regex.workspace = true
serde = "1.0.144"
serde = "1.0.149"

View file

@ -19,7 +19,7 @@ base64-simd = "0.7"
deno_core.workspace = true
encoding_rs.workspace = true
flate2.workspace = true
serde = "1.0.144"
serde = "1.0.149"
tokio.workspace = true
uuid = { workspace = true, features = ["serde"] }

View file

@ -97,7 +97,7 @@ lazy_static! {
pub fn env_vars_for_npm_tests_no_sync_download() -> Vec<(String, String)> {
vec![
("DENO_NODE_COMPAT_URL".to_string(), std_file_url()),
("DENO_NPM_REGISTRY".to_string(), npm_registry_url()),
("NPM_CONFIG_REGISTRY".to_string(), npm_registry_url()),
("NO_COLOR".to_string(), "1".to_string()),
]
}

View file

@ -234,7 +234,7 @@ impl LspClient {
command
.env("DENO_DIR", deno_dir.path())
.env("DENO_NODE_COMPAT_URL", std_file_url())
.env("DENO_NPM_REGISTRY", npm_registry_url())
.env("NPM_CONFIG_REGISTRY", npm_registry_url())
.arg("lsp")
.stdin(Stdio::piped())
.stdout(Stdio::piped());