diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-08-26 19:01:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 23:01:50 +0000 |
commit | e13230226fe91498b3a5f28a8de6edbe4f164944 (patch) | |
tree | 680687d66cb0725601008bed14fa7c2c8be2054c | |
parent | ba58628601057c6f996cbad287fcfbe353872368 (diff) |
feat: lockfile v4 by default (#25165)
This won't be fully stabilized until 2.0 is released.
34 files changed, 439 insertions, 553 deletions
diff --git a/Cargo.lock b/Cargo.lock index 055c32320..4226e7eb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1734,9 +1734,9 @@ dependencies = [ [[package]] name = "deno_lockfile" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04beb67705d894d688e818870a701829223f6f485ef3ce0b8b2a7adac98d9583" +checksum = "92d4e132d2930cf5fbbec8323f4ac98952ca3d1c4ff74d770bbdd7c2588b1783" dependencies = [ "serde", "serde_json", @@ -1882,9 +1882,9 @@ dependencies = [ [[package]] name = "deno_npm" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d72068f4292455d48ac3b90c644ebf3150fb78c26a480cfb235a9642afe95c" +checksum = "cafaa830cea11b37ad838ed9508c9cc00ac0235fdd42b3b31aa74d5cd6fe3d92" dependencies = [ "anyhow", "async-trait", @@ -2814,9 +2814,9 @@ dependencies = [ [[package]] name = "eszip" -version = "0.75.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ab3253e0e6a99b79ffc6d7a6243ad541f54543768cecd2198b64476a5971f8" +checksum = "7b3a54eb4f58493897fc2627e76e6714c9b52c84213c923ab1601a5daf722b00" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 6e250bc92..3176d4e27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ deno_ast = { version = "=0.41.2", features = ["transpiling"] } deno_core = { version = "0.306.0" } deno_bench_util = { version = "0.160.0", path = "./bench_util" } -deno_lockfile = "0.21.2" +deno_lockfile = "=0.22.0" deno_media_type = { version = "0.1.4", features = ["module_specifier"] } deno_permissions = { version = "0.26.0", path = "./runtime/permissions" } deno_runtime = { version = "0.175.0", path = "./runtime" } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 8eeef8cb3..33a169458 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -72,13 +72,13 @@ deno_emit = "=0.44.0" deno_graph = { version = "=0.81.3" } deno_lint = { version = "=0.63.1", features = ["docs"] } deno_lockfile.workspace = true -deno_npm = "=0.23.1" +deno_npm = "=0.24.0" deno_package_json.workspace = true deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver = "=0.5.10" deno_task_shell = "=0.17.0" deno_terminal.workspace = true -eszip = "=0.75.0" +eszip = "=0.76.0" libsui = "0.3.0" napi_sym.workspace = true node_resolver.workspace = true diff --git a/cli/args/lockfile.rs b/cli/args/lockfile.rs index 00d1f929d..30db49b7a 100644 --- a/cli/args/lockfile.rs +++ b/cli/args/lockfile.rs @@ -225,26 +225,12 @@ impl CliLockfile { file_path, content: &text, overwrite: false, - is_deno_future: *super::DENO_FUTURE, })?, frozen, )), - Err(err) if err.kind() == std::io::ErrorKind::NotFound => { - Ok(CliLockfile::new( - if *super::DENO_FUTURE { - // force version 4 for deno future - Lockfile::new(deno_lockfile::NewLockfileOptions { - file_path, - content: r#"{"version":"4"}"#, - overwrite: false, - is_deno_future: true, - })? - } else { - Lockfile::new_empty(file_path, false) - }, - frozen, - )) - } + Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok( + CliLockfile::new(Lockfile::new_empty(file_path, false), frozen), + ), Err(err) => Err(err).with_context(|| { format!("Failed reading lockfile '{}'", file_path.display()) }), diff --git a/tests/integration/check_tests.rs b/tests/integration/check_tests.rs index 57c38522f..f0e3dfb5a 100644 --- a/tests/integration/check_tests.rs +++ b/tests/integration/check_tests.rs @@ -367,7 +367,6 @@ fn npm_module_check_then_error() { file_path: lockfile_path.to_path_buf(), content: &lockfile_path.read_to_string(), overwrite: false, - is_deno_future: false, }) .unwrap(); diff --git a/tests/integration/jsr_tests.rs b/tests/integration/jsr_tests.rs index ef074987e..e72eab1fa 100644 --- a/tests/integration/jsr_tests.rs +++ b/tests/integration/jsr_tests.rs @@ -146,7 +146,6 @@ console.log(version);"#, file_path: lockfile_path.to_path_buf(), content: &lockfile_path.read_to_string(), overwrite: false, - is_deno_future: false, }) .unwrap(); *lockfile @@ -262,7 +261,6 @@ console.log(version);"#, file_path: lockfile_path.to_path_buf(), content: &lockfile_path.read_to_string(), overwrite: false, - is_deno_future: false, }) .unwrap(); let pkg_name = "@denotest/no-module-graph@0.1.1"; diff --git a/tests/integration/npm_tests.rs b/tests/integration/npm_tests.rs index 9e4eb7efe..d75b87689 100644 --- a/tests/integration/npm_tests.rs +++ b/tests/integration/npm_tests.rs @@ -1215,204 +1215,180 @@ fn lock_file_lock_write() { let deno_dir = util::new_deno_dir(); let temp_dir = util::TempDir::new(); - // write empty config file temp_dir.write("deno.json", "{}"); - - // write a lock file with borked integrity let lock_file_content = r#"{ - "version": "3", - "packages": { - "specifiers": { - "npm:cowsay@1.5.0": "npm:cowsay@1.5.0" + "version": "4", + "specifiers": { + "npm:cowsay@1.5.0": "npm:cowsay@1.5.0" + }, + "npm": { + "ansi-regex@3.0.1": { + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==" }, - "npm": { - "ansi-regex@3.0.1": { - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dependencies": {} - }, - "ansi-regex@5.0.1": { - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dependencies": {} - }, - "ansi-styles@4.3.0": { - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "color-convert@2.0.1" - } - }, - "camelcase@5.3.1": { - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dependencies": {} - }, - "cliui@6.0.0": { - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dependencies": { - "string-width": "string-width@4.2.3", - "strip-ansi": "strip-ansi@6.0.1", - "wrap-ansi": "wrap-ansi@6.2.0" - } - }, - "color-convert@2.0.1": { - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "color-name@1.1.4" - } - }, - "color-name@1.1.4": { - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dependencies": {} - }, - "cowsay@1.5.0": { - "integrity": "sha512-8Ipzr54Z8zROr/62C8f0PdhQcDusS05gKTS87xxdji8VbWefWly0k8BwGK7+VqamOrkv3eGsCkPtvlHzrhWsCA==", - "dependencies": { - "get-stdin": "get-stdin@8.0.0", - "string-width": "string-width@2.1.1", - "strip-final-newline": "strip-final-newline@2.0.0", - "yargs": "yargs@15.4.1" - } - }, - "decamelize@1.2.0": { - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dependencies": {} - }, - "emoji-regex@8.0.0": { - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dependencies": {} - }, - "find-up@4.1.0": { - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "locate-path@5.0.0", - "path-exists": "path-exists@4.0.0" - } - }, - "get-caller-file@2.0.5": { - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dependencies": {} - }, - "get-stdin@8.0.0": { - "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", - "dependencies": {} - }, - "is-fullwidth-code-point@2.0.0": { - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dependencies": {} - }, - "is-fullwidth-code-point@3.0.0": { - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dependencies": {} - }, - "locate-path@5.0.0": { - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "p-locate@4.1.0" - } - }, - "p-limit@2.3.0": { - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "p-try@2.2.0" - } - }, - "p-locate@4.1.0": { - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "p-limit@2.3.0" - } - }, - "p-try@2.2.0": { - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dependencies": {} - }, - "path-exists@4.0.0": { - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dependencies": {} - }, - "require-directory@2.1.1": { - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dependencies": {} - }, - "require-main-filename@2.0.0": { - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dependencies": {} - }, - "set-blocking@2.0.0": { - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dependencies": {} - }, - "string-width@2.1.1": { - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dependencies": { - "is-fullwidth-code-point": "is-fullwidth-code-point@2.0.0", - "strip-ansi": "strip-ansi@4.0.0" - } - }, - "string-width@4.2.3": { - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "emoji-regex@8.0.0", - "is-fullwidth-code-point": "is-fullwidth-code-point@3.0.0", - "strip-ansi": "strip-ansi@6.0.1" - } - }, - "strip-ansi@4.0.0": { - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dependencies": { - "ansi-regex": "ansi-regex@3.0.1" - } - }, - "strip-ansi@6.0.1": { - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "ansi-regex@5.0.1" - } - }, - "strip-final-newline@2.0.0": { - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dependencies": {} - }, - "which-module@2.0.0": { - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dependencies": {} - }, - "wrap-ansi@6.2.0": { - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dependencies": { - "ansi-styles": "ansi-styles@4.3.0", - "string-width": "string-width@4.2.3", - "strip-ansi": "strip-ansi@6.0.1" - } - }, - "y18n@4.0.3": { - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dependencies": {} - }, - "yargs-parser@18.1.3": { - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dependencies": { - "camelcase": "camelcase@5.3.1", - "decamelize": "decamelize@1.2.0" - } - }, - "yargs@15.4.1": { - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dependencies": { - "cliui": "cliui@6.0.0", - "decamelize": "decamelize@1.2.0", - "find-up": "find-up@4.1.0", - "get-caller-file": "get-caller-file@2.0.5", - "require-directory": "require-directory@2.1.1", - "require-main-filename": "require-main-filename@2.0.0", - "set-blocking": "set-blocking@2.0.0", - "string-width": "string-width@4.2.3", - "which-module": "which-module@2.0.0", - "y18n": "y18n@4.0.3", - "yargs-parser": "yargs-parser@18.1.3" - } - } + "ansi-regex@5.0.1": { + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles@4.3.0": { + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": [ + "color-convert" + ] + }, + "camelcase@5.3.1": { + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "cliui@6.0.0": { + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": [ + "string-width@4.2.3", + "strip-ansi@6.0.1", + "wrap-ansi" + ] + }, + "color-convert@2.0.1": { + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": [ + "color-name" + ] + }, + "color-name@1.1.4": { + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "cowsay@1.5.0": { + "integrity": "sha512-8Ipzr54Z8zROr/62C8f0PdhQcDusS05gKTS87xxdji8VbWefWly0k8BwGK7+VqamOrkv3eGsCkPtvlHzrhWsCA==", + "dependencies": [ + "get-stdin", + "string-width@2.1.1", + "strip-final-newline", + "yargs" + ] + }, + "decamelize@1.2.0": { + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, + "emoji-regex@8.0.0": { + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "find-up@4.1.0": { + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": [ + "locate-path", + "path-exists" + ] + }, + "get-caller-file@2.0.5": { + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-stdin@8.0.0": { + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==" + }, + "is-fullwidth-code-point@2.0.0": { + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==" + }, + "is-fullwidth-code-point@3.0.0": { + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path@5.0.0": { + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": [ + "p-locate" + ] + }, + "p-limit@2.3.0": { + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": [ + "p-try" + ] + }, + "p-locate@4.1.0": { + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": [ + "p-limit" + ] + }, + "p-try@2.2.0": { + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists@4.0.0": { + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "require-directory@2.1.1": { + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-main-filename@2.0.0": { + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "set-blocking@2.0.0": { + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "string-width@2.1.1": { + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dependencies": [ + "is-fullwidth-code-point@2.0.0", + "strip-ansi@4.0.0" + ] + }, + "string-width@4.2.3": { + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": [ + "emoji-regex", + "is-fullwidth-code-point@3.0.0", + "strip-ansi@6.0.1" + ] + }, + "strip-ansi@4.0.0": { + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dependencies": [ + "ansi-regex@3.0.1" + ] + }, + "strip-ansi@6.0.1": { + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": [ + "ansi-regex@5.0.1" + ] + }, + "strip-final-newline@2.0.0": { + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "which-module@2.0.0": { + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==" + }, + "wrap-ansi@6.2.0": { + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": [ + "ansi-styles", + "string-width@4.2.3", + "strip-ansi@6.0.1" + ] + }, + "y18n@4.0.3": { + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs-parser@18.1.3": { + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": [ + "camelcase", + "decamelize" + ] + }, + "yargs@15.4.1": { + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": [ + "cliui", + "decamelize", + "find-up", + "get-caller-file", + "require-directory", + "require-main-filename", + "set-blocking", + "string-width@4.2.3", + "which-module", + "y18n", + "yargs-parser" + ] } - }, - "remote": {} + } } "#; temp_dir.write("deno.lock", lock_file_content); @@ -1436,8 +1412,8 @@ fn lock_file_lock_write() { let stderr = String::from_utf8(output.stderr).unwrap(); assert!(stderr.is_empty()); assert_eq!( + std::fs::read_to_string(temp_dir.path().join("deno.lock")).unwrap(), lock_file_content, - std::fs::read_to_string(temp_dir.path().join("deno.lock")).unwrap() ); } @@ -1452,17 +1428,15 @@ fn auto_discover_lock_file() { // write a lock file with borked integrity let lock_file_content = r#"{ - "version": "3", - "packages": { - "specifiers": { "npm:@denotest/bin": "npm:@denotest/bin@1.0.0" }, - "npm": { - "@denotest/bin@1.0.0": { - "integrity": "sha512-foobar", - "dependencies": {} - } - } + "version": "4", + "specifiers": { + "npm:@denotest/bin": "npm:@denotest/bin@1.0.0" }, - "remote": {} + "npm": { + "@denotest/bin@1.0.0": { + "integrity": "sha512-foobar" + } + } }"#; temp_dir.write("deno.lock", lock_file_content); diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index c6637e005..deec3d1d4 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -853,21 +853,6 @@ itest!(lock_v2_check_ok2 { }); #[test] -fn lock_no_declaration_files() { - let context = TestContextBuilder::new() - .use_temp_cwd() - .use_http_server() - .build(); - let output = context - .new_command() - .args("cache --lock --lock-write $TESTDATA/lockfile/no_dts/main.ts") - .run(); - output.assert_matches_file("lockfile/no_dts/main.cache.out"); - let lockfile = context.temp_dir().path().join("deno.lock"); - lockfile.assert_matches_file("lockfile/no_dts/deno.lock.out"); -} - -#[test] fn lock_redirects() { let context = TestContextBuilder::new() .use_temp_cwd() @@ -886,7 +871,7 @@ fn lock_redirects() { .run() .skip_output_check(); let initial_lockfile_text = r#"{ - "version": "3", + "version": "4", "redirects": { "http://localhost:4546/run/001_hello.js": "http://localhost:4545/run/001_hello.js" }, @@ -905,7 +890,7 @@ fn lock_redirects() { // now try changing where the redirect occurs in the lockfile temp_dir.write("deno.lock", r#"{ - "version": "3", + "version": "4", "redirects": { "http://localhost:4546/run/001_hello.js": "http://localhost:4545/echo.ts" }, @@ -936,16 +921,13 @@ fn lock_redirects() { util::assertions::assert_wildcard_match( &temp_dir.read_to_string("deno.lock"), r#"{ - "version": "3", - "packages": { - "specifiers": { - "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" - }, - "npm": { - "@denotest/esm-basic@1.0.0": { - "integrity": "sha512-[WILDCARD]", - "dependencies": {} - } + "version": "4", + "specifiers": { + "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + }, + "npm": { + "@denotest/esm-basic@1.0.0": { + "integrity": "sha512-[WILDCARD]" } }, "redirects": { @@ -990,25 +972,21 @@ fn lock_deno_json_package_json_deps() { let esm_basic_integrity = get_lockfile_npm_package_integrity(&lockfile, "@denotest/esm-basic@1.0.0"); lockfile.assert_matches_json(json!({ - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", - "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" - }, - "jsr": { - "@denotest/module-graph@1.4.0": { - "integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d" - } - }, - "npm": { - "@denotest/esm-basic@1.0.0": { - "integrity": esm_basic_integrity, - "dependencies": {} - } + "version": "4", + "specifiers": { + "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", + "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + }, + "jsr": { + "@denotest/module-graph@1.4.0": { + "integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d" + } + }, + "npm": { + "@denotest/esm-basic@1.0.0": { + "integrity": esm_basic_integrity } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@denotest/module-graph@1.4", @@ -1042,25 +1020,21 @@ fn lock_deno_json_package_json_deps() { .run() .skip_output_check(); lockfile.assert_matches_json(json!({ - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", - "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" - }, - "jsr": { - "@denotest/module-graph@1.4.0": { - "integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d" - } - }, - "npm": { - "@denotest/esm-basic@1.0.0": { - "integrity": esm_basic_integrity, - "dependencies": {} - } + "version": "4", + "specifiers": { + "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", + "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + }, + "jsr": { + "@denotest/module-graph@1.4.0": { + "integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d" + } + }, + "npm": { + "@denotest/esm-basic@1.0.0": { + "integrity": esm_basic_integrity } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@denotest/module-graph@1.4" @@ -1083,18 +1057,15 @@ fn lock_deno_json_package_json_deps() { .run() .skip_output_check(); lockfile.assert_matches_json(json!({ - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", - }, - "jsr": { - "@denotest/module-graph@1.4.0": { - "integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d" - } + "version": "4", + "specifiers": { + "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", + }, + "jsr": { + "@denotest/module-graph@1.4.0": { + "integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d" } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@denotest/module-graph@1.4" @@ -1112,8 +1083,7 @@ fn lock_deno_json_package_json_deps() { .skip_output_check(); lockfile.assert_matches_json(json!({ - "version": "3", - "remote": {} + "version": "4" })); } @@ -1171,24 +1141,19 @@ fn lock_deno_json_package_json_deps_workspace() { ); lockfile.assert_matches_json(json!({ - "version": "3", - "packages": { - "specifiers": { - "npm:@denotest/cjs-default-export@1": "npm:@denotest/cjs-default-export@1.0.0", - "npm:@denotest/esm-basic@1": "npm:@denotest/esm-basic@1.0.0" + "version": "4", + "specifiers": { + "npm:@denotest/cjs-default-export@1": "npm:@denotest/cjs-default-export@1.0.0", + "npm:@denotest/esm-basic@1": "npm:@denotest/esm-basic@1.0.0" + }, + "npm": { + "@denotest/cjs-default-export@1.0.0": { + "integrity": cjs_default_export_integrity }, - "npm": { - "@denotest/cjs-default-export@1.0.0": { - "integrity": cjs_default_export_integrity, - "dependencies": {} - }, - "@denotest/esm-basic@1.0.0": { - "integrity": esm_basic_integrity, - "dependencies": {} - } + "@denotest/esm-basic@1.0.0": { + "integrity": esm_basic_integrity } }, - "remote": {}, "workspace": { "packageJson": { "dependencies": [ @@ -1219,24 +1184,19 @@ fn lock_deno_json_package_json_deps_workspace() { "@denotest/cjs-default-export@1.0.0", ); let expected_lockfile = json!({ - "version": "3", - "packages": { - "specifiers": { - "npm:@denotest/cjs-default-export@1": "npm:@denotest/cjs-default-export@1.0.0", - "npm:@denotest/esm-basic@1": "npm:@denotest/esm-basic@1.0.0" + "version": "4", + "specifiers": { + "npm:@denotest/cjs-default-export@1": "npm:@denotest/cjs-default-export@1.0.0", + "npm:@denotest/esm-basic@1": "npm:@denotest/esm-basic@1.0.0" + }, + "npm": { + "@denotest/cjs-default-export@1.0.0": { + "integrity": cjs_default_export_integrity }, - "npm": { - "@denotest/cjs-default-export@1.0.0": { - "integrity": cjs_default_export_integrity, - "dependencies": {} - }, - "@denotest/esm-basic@1.0.0": { - "integrity": esm_basic_integrity, - "dependencies": {} - } + "@denotest/esm-basic@1.0.0": { + "integrity": esm_basic_integrity } }, - "remote": {}, "workspace": { "packageJson": { "dependencies": [ @@ -1275,8 +1235,6 @@ fn get_lockfile_npm_package_integrity( // different hashes depending on what operating system it's running on lockfile .read_json_value() - .get("packages") - .unwrap() .get("npm") .unwrap() .get(package_name) diff --git a/tests/specs/lockfile/adding_jsr_dep/lock01.out b/tests/specs/lockfile/adding_jsr_dep/lock01.out index 0ac007526..fcdb22ae1 100644 --- a/tests/specs/lockfile/adding_jsr_dep/lock01.out +++ b/tests/specs/lockfile/adding_jsr_dep/lock01.out @@ -1,16 +1,13 @@ { - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" - }, - "jsr": { - "@denotest/add@1.0.0": { - "integrity": "[WILDLINE]" - } + "version": "4", + "specifiers": { + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "[WILDLINE]" } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@denotest/add@1", diff --git a/tests/specs/lockfile/adding_jsr_dep/lock02.out b/tests/specs/lockfile/adding_jsr_dep/lock02.out index 4293c7dfe..f069c5a2f 100644 --- a/tests/specs/lockfile/adding_jsr_dep/lock02.out +++ b/tests/specs/lockfile/adding_jsr_dep/lock02.out @@ -1,20 +1,17 @@ { - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", - "jsr:@denotest/subtract@1": "jsr:@denotest/subtract@1.0.0" + "version": "4", + "specifiers": { + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", + "jsr:@denotest/subtract@1": "jsr:@denotest/subtract@1.0.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "[WILDLINE]" }, - "jsr": { - "@denotest/add@1.0.0": { - "integrity": "[WILDLINE]" - }, - "@denotest/subtract@1.0.0": { - "integrity": "[WILDLINE]" - } + "@denotest/subtract@1.0.0": { + "integrity": "[WILDLINE]" } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@denotest/add@1", diff --git a/tests/specs/lockfile/adding_jsr_export_new_dep/lock01.out b/tests/specs/lockfile/adding_jsr_export_new_dep/lock01.out index e78ea355a..a2ce254a3 100644 --- a/tests/specs/lockfile/adding_jsr_export_new_dep/lock01.out +++ b/tests/specs/lockfile/adding_jsr_export_new_dep/lock01.out @@ -1,23 +1,20 @@ { - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", - "jsr:@denotest/different-deps-per-export@1": "jsr:@denotest/different-deps-per-export@1.0.0" + "version": "4", + "specifiers": { + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", + "jsr:@denotest/different-deps-per-export@1": "jsr:@denotest/different-deps-per-export@1.0.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "[WILDLINE]" }, - "jsr": { - "@denotest/add@1.0.0": { - "integrity": "[WILDLINE]" - }, - "@denotest/different-deps-per-export@1.0.0": { - "integrity": "[WILDLINE]", - "dependencies": [ - "jsr:@denotest/add@1" - ] - } + "@denotest/different-deps-per-export@1.0.0": { + "integrity": "[WILDLINE]", + "dependencies": [ + "jsr:@denotest/add" + ] } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@denotest/different-deps-per-export@1" diff --git a/tests/specs/lockfile/adding_jsr_export_new_dep/lock02.out b/tests/specs/lockfile/adding_jsr_export_new_dep/lock02.out index 0f4a388c6..d4825c32d 100644 --- a/tests/specs/lockfile/adding_jsr_export_new_dep/lock02.out +++ b/tests/specs/lockfile/adding_jsr_export_new_dep/lock02.out @@ -1,28 +1,25 @@ { - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", - "jsr:@denotest/different-deps-per-export@1": "jsr:@denotest/different-deps-per-export@1.0.0", - "jsr:@denotest/subtract@1": "jsr:@denotest/subtract@1.0.0" + "version": "4", + "specifiers": { + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", + "jsr:@denotest/different-deps-per-export@1": "jsr:@denotest/different-deps-per-export@1.0.0", + "jsr:@denotest/subtract@1": "jsr:@denotest/subtract@1.0.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "[WILDLINE]" + }, + "@denotest/different-deps-per-export@1.0.0": { + "integrity": "[WILDLINE]", + "dependencies": [ + "jsr:@denotest/add", + "jsr:@denotest/subtract" + ] }, - "jsr": { - "@denotest/add@1.0.0": { - "integrity": "[WILDLINE]" - }, - "@denotest/different-deps-per-export@1.0.0": { - "integrity": "[WILDLINE]", - "dependencies": [ - "jsr:@denotest/add@1", - "jsr:@denotest/subtract@1" - ] - }, - "@denotest/subtract@1.0.0": { - "integrity": "[WILDLINE]" - } + "@denotest/subtract@1.0.0": { + "integrity": "[WILDLINE]" } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@denotest/different-deps-per-export@1" diff --git a/tests/specs/lockfile/adding_npm_dep/lock01.out b/tests/specs/lockfile/adding_npm_dep/lock01.out index 5d5567dc0..0ed6aa8c7 100644 --- a/tests/specs/lockfile/adding_npm_dep/lock01.out +++ b/tests/specs/lockfile/adding_npm_dep/lock01.out @@ -1,17 +1,13 @@ { - "version": "3", - "packages": { - "specifiers": { - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" - }, - "npm": { - "@denotest/add@1.0.0": { - "integrity": "[WILDLINE]", - "dependencies": {} - } + "version": "4", + "specifiers": { + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" + }, + "npm": { + "@denotest/add@1.0.0": { + "integrity": "[WILDLINE]" } }, - "remote": {}, "workspace": { "dependencies": [ "npm:@denotest/add@1", diff --git a/tests/specs/lockfile/adding_npm_dep/lock02.out b/tests/specs/lockfile/adding_npm_dep/lock02.out index 6042b1cb9..7a9da8d29 100644 --- a/tests/specs/lockfile/adding_npm_dep/lock02.out +++ b/tests/specs/lockfile/adding_npm_dep/lock02.out @@ -1,22 +1,17 @@ { - "version": "3", - "packages": { - "specifiers": { - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", - "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" + "version": "4", + "specifiers": { + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", + "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" + }, + "npm": { + "@denotest/add@1.0.0": { + "integrity": "[WILDLINE]" }, - "npm": { - "@denotest/add@1.0.0": { - "integrity": "[WILDLINE]", - "dependencies": {} - }, - "@denotest/subtract@1.0.0": { - "integrity": "[WILDLINE]", - "dependencies": {} - } + "@denotest/subtract@1.0.0": { + "integrity": "[WILDLINE]" } }, - "remote": {}, "workspace": { "dependencies": [ "npm:@denotest/add@1", diff --git a/tests/specs/lockfile/adding_redirect/lock01.out b/tests/specs/lockfile/adding_redirect/lock01.out index f00cefa6a..b7b217cd6 100644 --- a/tests/specs/lockfile/adding_redirect/lock01.out +++ b/tests/specs/lockfile/adding_redirect/lock01.out @@ -1,5 +1,5 @@ { - "version": "3", + "version": "4", "remote": { "http://localhost:4545/welcome.ts": "7353d5fcbc36c45d26bcbca478cf973092523b07c45999f41319820092b4de31" } diff --git a/tests/specs/lockfile/adding_redirect/lock02.out b/tests/specs/lockfile/adding_redirect/lock02.out index 70c38c966..1c0227cb9 100644 --- a/tests/specs/lockfile/adding_redirect/lock02.out +++ b/tests/specs/lockfile/adding_redirect/lock02.out @@ -1,5 +1,5 @@ { - "version": "3", + "version": "4", "redirects": { "http://localhost:4546/welcome.ts": "http://localhost:4545/welcome.ts" }, diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_cache.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_cache.out index bf6c03367..a66e090a2 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_cache.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_cache.out @@ -1,11 +1,10 @@ error: The lockfile is out of date. Run `deno cache --frozen=false` or rerun with `--frozen=false` to update it. changes: - 5 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" - 5 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", - 6 | + "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" -11 | - } -12 | + }, -13 | + "@denotest/subtract@1.0.0": { -14 | + "integrity": "[WILDCARD]", -15 | + "dependencies": {} -16 | + } + 4 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" + 4 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", + 5 | + "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" + 9 | - } +10 | + }, +11 | + "@denotest/subtract@1.0.0": { +12 | + "integrity": "[WILDCARD]" +13 | + } diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_http.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_http.out index 99c884e9c..3ec45581a 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_http.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_http.out @@ -1,10 +1,11 @@ Download http://localhost:4545/welcome.ts error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno cache --frozen=false` or rerun with `--frozen=false` to update it. changes: -14 | - "remote": {} -14 | + "remote": { -15 | + "http://localhost:4545/welcome.ts": "[WILDCARD]" -16 | + } +10 | - } +10 | + }, +11 | + "remote": { +12 | + "http://localhost:4545/welcome.ts": "[WILDCARD]" +13 | + } const _ = await import(scheme + "localhost:4545/welcome.ts"); ^ at [WILDCARD]
\ No newline at end of file diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_jsr.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_jsr.out index e77853ab2..7051ecbfa 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_jsr.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_jsr.out @@ -3,14 +3,14 @@ Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno cache --frozen=false` or rerun with `--frozen=false` to update it. changes: - 5 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" - 5 | + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", - 6 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" - 7 | + }, - 8 | + "jsr": { - 9 | + "@denotest/add@1.0.0": { -10 | + "integrity": "[WILDCARD]" -11 | + } + 4 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" + 4 | + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0", + 5 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" + 6 | + }, + 7 | + "jsr": { + 8 | + "@denotest/add@1.0.0": { + 9 | + "integrity": "[WILDCARD]" +10 | + } const { add } = await import(scheme + "@denotest/add@1"); ^ at [WILDCARD]
\ No newline at end of file diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out index 9b2efa462..749c69587 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out @@ -1,15 +1,14 @@ Download http://localhost:4260/@denotest/subtract error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno cache --frozen=false` or rerun with `--frozen=false` to update it. changes: - 5 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" - 5 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", - 6 | + "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" -11 | - } -12 | + }, -13 | + "@denotest/subtract@1.0.0": { -14 | + "integrity": "[WILDCARD]", -15 | + "dependencies": {} -16 | + } + 4 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" + 4 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", + 5 | + "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" + 9 | - } +10 | + }, +11 | + "@denotest/subtract@1.0.0": { +12 | + "integrity": "[WILDCARD]" +13 | + } const { subtract } = await import(scheme + "@denotest/subtract@1"); ^ at [WILDCARD] diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_cache.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_cache.out index bb523deff..9e77bce85 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_cache.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_cache.out @@ -1,12 +1,12 @@ error: The lockfile is out of date. Run `deno cache --frozen=false` or rerun with `--frozen=false` to update it. changes: - 5 | - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" - 6 | - }, - 7 | - "jsr": { - 5 | + "jsr:@denotest/add@0.2.0": "jsr:@denotest/add@0.2.0", - 6 | + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" - 7 | + }, - 8 | + "jsr": { - 9 | + "@denotest/add@0.2.0": { -10 | + "integrity": "[WILDCARD]" -11 | + }, + 4 | - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" + 5 | - }, + 6 | - "jsr": { + 4 | + "jsr:@denotest/add@0.2.0": "jsr:@denotest/add@0.2.0", + 5 | + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" + 6 | + }, + 7 | + "jsr": { + 8 | + "@denotest/add@0.2.0": { + 9 | + "integrity": "[WILDCARD]" +10 | + }, diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_run.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_run.out index 3a0d51678..0222ca355 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_run.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_jsr_run.out @@ -2,13 +2,13 @@ Download http://127.0.0.1:4250/@denotest/add/0.2.0_meta.json Download http://127.0.0.1:4250/@denotest/add/0.2.0/mod.ts error: The lockfile is out of date. Run `deno cache --frozen=false` or rerun with `--frozen=false` to update it. changes: - 5 | - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" - 6 | - }, - 7 | - "jsr": { - 5 | + "jsr:@denotest/add@0.2.0": "jsr:@denotest/add@0.2.0", - 6 | + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" - 7 | + }, - 8 | + "jsr": { - 9 | + "@denotest/add@0.2.0": { -10 | + "integrity": "[WILDCARD]" -11 | + }, + 4 | - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" + 5 | - }, + 6 | - "jsr": { + 4 | + "jsr:@denotest/add@0.2.0": "jsr:@denotest/add@0.2.0", + 5 | + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" + 6 | + }, + 7 | + "jsr": { + 8 | + "@denotest/add@0.2.0": { + 9 | + "integrity": "[WILDCARD]" +10 | + }, diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out index 6dad6f6f4..d8ab302b7 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out @@ -1,12 +1,11 @@ Download http://localhost:4260/@denotest/subtract error: The lockfile is out of date. Run `deno cache --frozen=false` or rerun with `--frozen=false` to update it. changes: - 5 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" - 5 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", - 6 | + "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" -11 | - } -12 | + }, -13 | + "@denotest/subtract@1.0.0": { -14 | + "integrity": "[WILDCARD]", -15 | + "dependencies": {} -16 | + } + 4 | - "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" + 4 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0", + 5 | + "npm:@denotest/subtract@1": "npm:@denotest/subtract@1.0.0" + 9 | - } +10 | + }, +11 | + "@denotest/subtract@1.0.0": { +12 | + "integrity": "[WILDCARD]" +13 | + } diff --git a/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out b/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out index 2ae84b110..e482c469f 100644 --- a/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out +++ b/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out @@ -3,18 +3,14 @@ error: The lockfile is out of date. Run `deno cache --frozen=false` or rerun wit changes: 1 | - 1 | +{ - 2 | + "version": "3", - 3 | + "packages": { - 4 | + "specifiers": { - 5 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" - 6 | + }, - 7 | + "npm": { - 8 | + "@denotest/add@1.0.0": { - 9 | + "integrity": "[WILDCARD]", -10 | + "dependencies": {} -11 | + } -12 | + } -13 | + }, -14 | + "remote": {} -15 | +} -16 | + + 2 | + "version": "4", + 3 | + "specifiers": { + 4 | + "npm:@denotest/add@1": "npm:@denotest/add@1.0.0" + 5 | + }, + 6 | + "npm": { + 7 | + "@denotest/add@1.0.0": { + 8 | + "integrity": "[WILDCARD]" + 9 | + } +10 | + } +11 | +} +12 | + diff --git a/tests/specs/lockfile/no_declaration_files/__test__.jsonc b/tests/specs/lockfile/no_declaration_files/__test__.jsonc new file mode 100644 index 000000000..8bbb55825 --- /dev/null +++ b/tests/specs/lockfile/no_declaration_files/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tempDir": true, + "steps": [{ + "args": "cache --lock --lock-write main.ts", + "output": "main.cache.out" + }, { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('deno.lock').trim())" + ], + "output": "deno.lock.out" + }] +} diff --git a/tests/testdata/lockfile/no_dts/deno.lock.out b/tests/specs/lockfile/no_declaration_files/deno.lock.out index 6aa547e28..3066e9b15 100644 --- a/tests/testdata/lockfile/no_dts/deno.lock.out +++ b/tests/specs/lockfile/no_declaration_files/deno.lock.out @@ -1,5 +1,5 @@ { - "version": "3", + "version": "4", "remote": { "http://localhost:4545/lockfile/no_dts/mod.js": "3f576f37a301d298c3032eb1835240bd83f3762db26fc1d358c5d67088d6ffc8" } diff --git a/tests/testdata/lockfile/no_dts/main.cache.out b/tests/specs/lockfile/no_declaration_files/main.cache.out index 84e728d66..84e728d66 100644 --- a/tests/testdata/lockfile/no_dts/main.cache.out +++ b/tests/specs/lockfile/no_declaration_files/main.cache.out diff --git a/tests/testdata/lockfile/no_dts/main.ts b/tests/specs/lockfile/no_declaration_files/main.ts index 7596e1e1a..7596e1e1a 100644 --- a/tests/testdata/lockfile/no_dts/main.ts +++ b/tests/specs/lockfile/no_declaration_files/main.ts diff --git a/tests/specs/lockfile/only_package_json/deno.lock.out b/tests/specs/lockfile/only_package_json/deno.lock.out index b30232996..395190a66 100644 --- a/tests/specs/lockfile/only_package_json/deno.lock.out +++ b/tests/specs/lockfile/only_package_json/deno.lock.out @@ -1,14 +1,11 @@ { - "version": "3", - "packages": { - "specifiers": { - "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" - }, - "npm": { - "@denotest/esm-basic@1.0.0": [WILDCARD] - } + "version": "4", + "specifiers": { + "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + }, + "npm": { + "@denotest/esm-basic@1.0.0": [WILDCARD] }, - "remote": {}, "workspace": { "packageJson": { "dependencies": [ diff --git a/tests/specs/npm/adding_npm_dep_in_dynamic_import/lock.out b/tests/specs/npm/adding_npm_dep_in_dynamic_import/lock.out index c67be75c9..c8caafc07 100644 --- a/tests/specs/npm/adding_npm_dep_in_dynamic_import/lock.out +++ b/tests/specs/npm/adding_npm_dep_in_dynamic_import/lock.out @@ -1,20 +1,15 @@ { - "version": "3", - "packages": { - "specifiers": { - "npm:@denotest/add": "npm:@denotest/add@1.0.0", - "npm:@denotest/subtract": "npm:@denotest/subtract@1.0.0" + "version": "4", + "specifiers": { + "npm:@denotest/add": "npm:@denotest/add@1.0.0", + "npm:@denotest/subtract": "npm:@denotest/subtract@1.0.0" + }, + "npm": { + "@denotest/add@1.0.0": { + "integrity": "[WILDLINE]" }, - "npm": { - "@denotest/add@1.0.0": { - "integrity": "[WILDLINE]", - "dependencies": {} - }, - "@denotest/subtract@1.0.0": { - "integrity": "[WILDLINE]", - "dependencies": {} - } + "@denotest/subtract@1.0.0": { + "integrity": "[WILDLINE]" } - }, - "remote": {} + } } diff --git a/tests/specs/remove/basic/add_lock.out b/tests/specs/remove/basic/add_lock.out index cda0fc34a..99127b95d 100644 --- a/tests/specs/remove/basic/add_lock.out +++ b/tests/specs/remove/basic/add_lock.out @@ -1,20 +1,17 @@ { - "version": "3", - "packages": { - "specifiers": { - "jsr:@std/assert@^1.0.0": "jsr:@std/assert@1.0.0", - "jsr:@std/http@^1.0.0": "jsr:@std/http@1.0.0" + "version": "4", + "specifiers": { + "jsr:@std/assert@^1.0.0": "jsr:@std/assert@1.0.0", + "jsr:@std/http@^1.0.0": "jsr:@std/http@1.0.0" + }, + "jsr": { + "@std/assert@1.0.0": { + "integrity": "[WILDLINE]" }, - "jsr": { - "@std/assert@1.0.0": { - "integrity": "[WILDLINE]" - }, - "@std/http@1.0.0": { - "integrity": "[WILDLINE]" - } + "@std/http@1.0.0": { + "integrity": "[WILDLINE]" } }, - "remote": {}, "workspace": { "dependencies": [ "jsr:@std/assert@^1.0.0", diff --git a/tests/specs/remove/basic/remove_lock.out b/tests/specs/remove/basic/remove_lock.out index 37f10ce95..a39b837e9 100644 --- a/tests/specs/remove/basic/remove_lock.out +++ b/tests/specs/remove/basic/remove_lock.out @@ -1,4 +1,3 @@ { - "version": "3", - "remote": {} + "version": "4" } diff --git a/tests/specs/workspaces/lockfile/expected-lock.out b/tests/specs/workspaces/lockfile/expected-lock.out index dcc479a20..fc387c760 100644 --- a/tests/specs/workspaces/lockfile/expected-lock.out +++ b/tests/specs/workspaces/lockfile/expected-lock.out @@ -1,16 +1,13 @@ { - "version": "3", - "packages": { - "specifiers": { - "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" - }, - "jsr": { - "@denotest/add@1.0.0": { - "integrity": "3b2e675c1ad7fba2a45bc251992e01aff08a3c974ac09079b11e6a5b95d4bfcb" - } + "version": "4", + "specifiers": { + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "3b2e675c1ad7fba2a45bc251992e01aff08a3c974ac09079b11e6a5b95d4bfcb" } }, - "remote": {}, "workspace": { "members": { "pkg": { diff --git a/tests/testdata/run/lock_check_ok2.json b/tests/testdata/run/lock_check_ok2.json index 14d8b7117..55a6f9892 100644 --- a/tests/testdata/run/lock_check_ok2.json +++ b/tests/testdata/run/lock_check_ok2.json @@ -1,5 +1,5 @@ { - "version": "3", + "version": "4", "remote": { "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", |