Skip to content

Commit 9dabb83

Browse files
committed
feat(project-type): prevent detecting project as a package when marked as private
1 parent 5f501f7 commit 9dabb83

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/project-type/package/tester.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export default async function ({packageDetails: {exports, publishConfig, bin}}) {
2-
return !!exports || (!!publishConfig && !bin);
1+
export default async function ({packageDetails: {exports, publishConfig, bin, private: projectMarkedPrivate}}) {
2+
return !projectMarkedPrivate && (!!exports || (!!publishConfig && !bin));
33
}

src/project-type/package/tester.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ describe('package project-type tester', () => {
2121
it('should return `false` when there are no indicators that the project is a package type', async () => {
2222
expect(await test({packageDetails: any.simpleObject()})).toBe(false);
2323
});
24+
25+
it('should return `false` when `private` is set to `true`', async () => {
26+
expect(await test({packageDetails: {...any.simpleObject(), private: true, exports: any.word()}})).toBe(false);
27+
});
2428
});

0 commit comments

Comments
 (0)