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

feat: lockfile v4 by default (#25165)

This won't be fully stabilized until 2.0 is released.
This commit is contained in:
David Sherret 2024-08-26 19:01:50 -04:00 committed by GitHub
parent ba58628601
commit e13230226f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 441 additions and 555 deletions

12
Cargo.lock generated
View file

@ -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",

View file

@ -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" }

View file

@ -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

View file

@ -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())
}),

View file

@ -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();

View file

@ -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";

View file

@ -1215,205 +1215,181 @@ 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": {
"version": "4",
"specifiers": {
"npm:cowsay@1.5.0": "npm:cowsay@1.5.0"
},
"npm": {
"ansi-regex@3.0.1": {
"integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
"dependencies": {}
"integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw=="
},
"ansi-regex@5.0.1": {
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dependencies": {}
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
},
"ansi-styles@4.3.0": {
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "color-convert@2.0.1"
}
"dependencies": [
"color-convert"
]
},
"camelcase@5.3.1": {
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dependencies": {}
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
},
"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"
}
"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"
}
"dependencies": [
"color-name"
]
},
"color-name@1.1.4": {
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dependencies": {}
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"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"
}
"dependencies": [
"get-stdin",
"string-width@2.1.1",
"strip-final-newline",
"yargs"
]
},
"decamelize@1.2.0": {
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
"dependencies": {}
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA=="
},
"emoji-regex@8.0.0": {
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dependencies": {}
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"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"
}
"dependencies": [
"locate-path",
"path-exists"
]
},
"get-caller-file@2.0.5": {
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dependencies": {}
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
},
"get-stdin@8.0.0": {
"integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==",
"dependencies": {}
"integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg=="
},
"is-fullwidth-code-point@2.0.0": {
"integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==",
"dependencies": {}
"integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w=="
},
"is-fullwidth-code-point@3.0.0": {
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dependencies": {}
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"locate-path@5.0.0": {
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dependencies": {
"p-locate": "p-locate@4.1.0"
}
"dependencies": [
"p-locate"
]
},
"p-limit@2.3.0": {
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dependencies": {
"p-try": "p-try@2.2.0"
}
"dependencies": [
"p-try"
]
},
"p-locate@4.1.0": {
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dependencies": {
"p-limit": "p-limit@2.3.0"
}
"dependencies": [
"p-limit"
]
},
"p-try@2.2.0": {
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dependencies": {}
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
},
"path-exists@4.0.0": {
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dependencies": {}
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
},
"require-directory@2.1.1": {
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"dependencies": {}
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="
},
"require-main-filename@2.0.0": {
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"dependencies": {}
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
},
"set-blocking@2.0.0": {
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
"dependencies": {}
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
},
"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"
}
"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": "emoji-regex@8.0.0",
"is-fullwidth-code-point": "is-fullwidth-code-point@3.0.0",
"strip-ansi": "strip-ansi@6.0.1"
}
"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": "ansi-regex@3.0.1"
}
"dependencies": [
"ansi-regex@3.0.1"
]
},
"strip-ansi@6.0.1": {
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "ansi-regex@5.0.1"
}
"dependencies": [
"ansi-regex@5.0.1"
]
},
"strip-final-newline@2.0.0": {
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dependencies": {}
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="
},
"which-module@2.0.0": {
"integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==",
"dependencies": {}
"integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q=="
},
"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"
}
"dependencies": [
"ansi-styles",
"string-width@4.2.3",
"strip-ansi@6.0.1"
]
},
"y18n@4.0.3": {
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dependencies": {}
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="
},
"yargs-parser@18.1.3": {
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"dependencies": {
"camelcase": "camelcase@5.3.1",
"decamelize": "decamelize@1.2.0"
}
"dependencies": [
"camelcase",
"decamelize"
]
},
"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"
"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" },
"version": "4",
"specifiers": {
"npm:@denotest/bin": "npm:@denotest/bin@1.0.0"
},
"npm": {
"@denotest/bin@1.0.0": {
"integrity": "sha512-foobar",
"dependencies": {}
"integrity": "sha512-foobar"
}
}
},
"remote": {}
}"#;
temp_dir.write("deno.lock", lock_file_content);

View file

@ -852,21 +852,6 @@ itest!(lock_v2_check_ok2 {
http_server: true,
});
#[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()
@ -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": {
"version": "4",
"specifiers": {
"npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0"
},
"npm": {
"@denotest/esm-basic@1.0.0": {
"integrity": "sha512-[WILDCARD]",
"dependencies": {}
}
"integrity": "sha512-[WILDCARD]"
}
},
"redirects": {
@ -990,8 +972,7 @@ 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": {
"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"
@ -1003,12 +984,9 @@ fn lock_deno_json_package_json_deps() {
},
"npm": {
"@denotest/esm-basic@1.0.0": {
"integrity": esm_basic_integrity,
"dependencies": {}
}
"integrity": esm_basic_integrity
}
},
"remote": {},
"workspace": {
"dependencies": [
"jsr:@denotest/module-graph@1.4",
@ -1042,8 +1020,7 @@ fn lock_deno_json_package_json_deps() {
.run()
.skip_output_check();
lockfile.assert_matches_json(json!({
"version": "3",
"packages": {
"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"
@ -1055,12 +1032,9 @@ fn lock_deno_json_package_json_deps() {
},
"npm": {
"@denotest/esm-basic@1.0.0": {
"integrity": esm_basic_integrity,
"dependencies": {}
}
"integrity": esm_basic_integrity
}
},
"remote": {},
"workspace": {
"dependencies": [
"jsr:@denotest/module-graph@1.4"
@ -1083,8 +1057,7 @@ fn lock_deno_json_package_json_deps() {
.run()
.skip_output_check();
lockfile.assert_matches_json(json!({
"version": "3",
"packages": {
"version": "4",
"specifiers": {
"jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0",
},
@ -1092,9 +1065,7 @@ fn lock_deno_json_package_json_deps() {
"@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": {
"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,
"dependencies": {}
"integrity": cjs_default_export_integrity
},
"@denotest/esm-basic@1.0.0": {
"integrity": esm_basic_integrity,
"dependencies": {}
}
"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": {
"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,
"dependencies": {}
"integrity": cjs_default_export_integrity
},
"@denotest/esm-basic@1.0.0": {
"integrity": esm_basic_integrity,
"dependencies": {}
}
"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)

View file

@ -1,6 +1,5 @@
{
"version": "3",
"packages": {
"version": "4",
"specifiers": {
"jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0"
},
@ -8,9 +7,7 @@
"@denotest/add@1.0.0": {
"integrity": "[WILDLINE]"
}
}
},
"remote": {},
"workspace": {
"dependencies": [
"jsr:@denotest/add@1",

View file

@ -1,6 +1,5 @@
{
"version": "3",
"packages": {
"version": "4",
"specifiers": {
"jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0",
"jsr:@denotest/subtract@1": "jsr:@denotest/subtract@1.0.0"
@ -12,9 +11,7 @@
"@denotest/subtract@1.0.0": {
"integrity": "[WILDLINE]"
}
}
},
"remote": {},
"workspace": {
"dependencies": [
"jsr:@denotest/add@1",

View file

@ -1,6 +1,5 @@
{
"version": "3",
"packages": {
"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"
@ -12,12 +11,10 @@
"@denotest/different-deps-per-export@1.0.0": {
"integrity": "[WILDLINE]",
"dependencies": [
"jsr:@denotest/add@1"
"jsr:@denotest/add"
]
}
}
},
"remote": {},
"workspace": {
"dependencies": [
"jsr:@denotest/different-deps-per-export@1"

View file

@ -1,6 +1,5 @@
{
"version": "3",
"packages": {
"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",
@ -13,16 +12,14 @@
"@denotest/different-deps-per-export@1.0.0": {
"integrity": "[WILDLINE]",
"dependencies": [
"jsr:@denotest/add@1",
"jsr:@denotest/subtract@1"
"jsr:@denotest/add",
"jsr:@denotest/subtract"
]
},
"@denotest/subtract@1.0.0": {
"integrity": "[WILDLINE]"
}
}
},
"remote": {},
"workspace": {
"dependencies": [
"jsr:@denotest/different-deps-per-export@1"

View file

@ -1,17 +1,13 @@
{
"version": "3",
"packages": {
"version": "4",
"specifiers": {
"npm:@denotest/add@1": "npm:@denotest/add@1.0.0"
},
"npm": {
"@denotest/add@1.0.0": {
"integrity": "[WILDLINE]",
"dependencies": {}
}
"integrity": "[WILDLINE]"
}
},
"remote": {},
"workspace": {
"dependencies": [
"npm:@denotest/add@1",

View file

@ -1,22 +1,17 @@
{
"version": "3",
"packages": {
"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]",
"dependencies": {}
"integrity": "[WILDLINE]"
},
"@denotest/subtract@1.0.0": {
"integrity": "[WILDLINE]",
"dependencies": {}
}
"integrity": "[WILDLINE]"
}
},
"remote": {},
"workspace": {
"dependencies": [
"npm:@denotest/add@1",

View file

@ -1,5 +1,5 @@
{
"version": "3",
"version": "4",
"remote": {
"http://localhost:4545/welcome.ts": "7353d5fcbc36c45d26bcbca478cf973092523b07c45999f41319820092b4de31"
}

View file

@ -1,5 +1,5 @@
{
"version": "3",
"version": "4",
"redirects": {
"http://localhost:4546/welcome.ts": "http://localhost:4545/welcome.ts"
},

View file

@ -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 | + }

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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 | + },

View file

@ -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 | + },

View file

@ -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 | + }

View file

@ -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": {}
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 | + }
13 | + },
14 | + "remote": {}
15 | +}
16 | +
12 | +

View file

@ -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"
}]
}

View file

@ -1,5 +1,5 @@
{
"version": "3",
"version": "4",
"remote": {
"http://localhost:4545/lockfile/no_dts/mod.js": "3f576f37a301d298c3032eb1835240bd83f3762db26fc1d358c5d67088d6ffc8"
}

View file

@ -1,14 +1,11 @@
{
"version": "3",
"packages": {
"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": [

View file

@ -1,20 +1,15 @@
{
"version": "3",
"packages": {
"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]",
"dependencies": {}
"integrity": "[WILDLINE]"
},
"@denotest/subtract@1.0.0": {
"integrity": "[WILDLINE]",
"dependencies": {}
"integrity": "[WILDLINE]"
}
}
},
"remote": {}
}

View file

@ -1,6 +1,5 @@
{
"version": "3",
"packages": {
"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"
@ -12,9 +11,7 @@
"@std/http@1.0.0": {
"integrity": "[WILDLINE]"
}
}
},
"remote": {},
"workspace": {
"dependencies": [
"jsr:@std/assert@^1.0.0",

View file

@ -1,4 +1,3 @@
{
"version": "3",
"remote": {}
"version": "4"
}

View file

@ -1,6 +1,5 @@
{
"version": "3",
"packages": {
"version": "4",
"specifiers": {
"jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0"
},
@ -8,9 +7,7 @@
"@denotest/add@1.0.0": {
"integrity": "3b2e675c1ad7fba2a45bc251992e01aff08a3c974ac09079b11e6a5b95d4bfcb"
}
}
},
"remote": {},
"workspace": {
"members": {
"pkg": {

View file

@ -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",