Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cli/tools/pack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,12 @@ fn collect_asset_files(
excluded.insert(p);
}
}
// The source config file is replaced by the generated package.json.
// The source config file and any existing package.json are replaced by the
// generated package.json.
if let Ok(p) = package.config_file.specifier.to_file_path() {
excluded.insert(p);
}
excluded.insert(package_dir.join("package.json"));
// README/LICENSE are added by `collect_readme_license_files`.
for file in readme_license_files {
excluded.insert(package_dir.join(&file.relative_path));
Expand Down
4 changes: 2 additions & 2 deletions tests/specs/pack/package_json_content/__test__.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"pack_package_json_content": {
"steps": [{
"args": "pack",
"output": "[WILDCARD]✓[WILDCARD]test-pkg-json-1.0.0.tgz[WILDCARD]"
"output": "[WILDCARD]0 assets collected[WILDCARD]✓[WILDCARD]test-pkg-json-1.0.0.tgz[WILDCARD]"
}, {
"if": "unix",
"commandName": "bash",
"args": [
"-c",
"tar -xzf test-pkg-json-1.0.0.tgz && cat package/package.json && echo"
"test \"$(tar -tzf test-pkg-json-1.0.0.tgz | grep -c '^package/package.json$')\" -eq 1 && tar -xzf test-pkg-json-1.0.0.tgz && cat package/package.json && echo"
],
"output": "package_json.out"
}]
Expand Down
4 changes: 4 additions & 0 deletions tests/specs/pack/package_json_content/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "source-package-json",
"private": true
}
Loading