-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove empty properties in blockPackageJson (#1801)
## PR Checklist - [x] Addresses an existing open issue: fixes #1802 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Uses the convenient [`remove-undefined-objects`](https://www.npmjs.com/package/remove-undefined-objects). 💖
- Loading branch information
1 parent
3b082a9
commit 6e43554
Showing
6 changed files
with
102 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ describe("blockPackageJson", () => { | |
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"scripts":{},"dependencies":{},"devDependencies":{}}", | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}", | ||
}, | ||
"scripts": [ | ||
{ | ||
|
@@ -36,7 +36,7 @@ describe("blockPackageJson", () => { | |
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"scripts":{},"dependencies":{},"devDependencies":{}}", | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}", | ||
}, | ||
"scripts": [ | ||
{ | ||
|
@@ -62,7 +62,7 @@ describe("blockPackageJson", () => { | |
cleanupCommands: ["pnpm dedupe"], | ||
properties: { | ||
dependencies: { | ||
"is-odd": "3.0.1", | ||
"is-odd": "1.2.3", | ||
}, | ||
other: true, | ||
}, | ||
|
@@ -73,7 +73,42 @@ describe("blockPackageJson", () => { | |
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"scripts":{},"dependencies":{"is-odd":"3.0.1"},"devDependencies":{},"other":true}", | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"other":true}", | ||
}, | ||
"scripts": [ | ||
{ | ||
"commands": [ | ||
"pnpm install", | ||
"pnpm dedupe", | ||
], | ||
"phase": 1, | ||
}, | ||
], | ||
} | ||
`); | ||
}); | ||
|
||
test("with addons adding devDependencies", () => { | ||
const creation = testBlock(blockPackageJson, { | ||
addons: { | ||
cleanupCommands: ["pnpm dedupe"], | ||
properties: { | ||
dependencies: { | ||
"is-odd": "1.2.3", | ||
}, | ||
devDependencies: { | ||
"is-even": "4.5.6", | ||
}, | ||
other: true, | ||
}, | ||
}, | ||
options: optionsBase, | ||
}); | ||
|
||
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"devDependencies":{"is-even":"4.5.6"},"other":true}", | ||
}, | ||
"scripts": [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters