Skip to content

Commit 64ae994

Browse files
committed
fix: skip name checks for private packages
1 parent dbf8239 commit 64ae994

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

packages/app/e2e.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ describe.sequential.each([
153153
expect(process.stderr).toContain("pkg-pr-new:");
154154
expect(process.stderr).toContain("playground-a:");
155155
expect(process.stderr).toContain("playground-b:");
156+
expect(process.stderr).toContain(
157+
"private-playground/ because the package is private",
158+
);
156159
}, 20_000);
157160

158161
it(`serves and installs playground-a for ${mode}`, async () => {

packages/cli/index.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,13 @@ const main = defineCommand({
274274
const pJsonPath = path.resolve(p, "package.json");
275275
const pJson = await readPackageJson(pJsonPath);
276276

277-
if (!pJson) {
277+
if (!pJson || pJson.private) {
278278
continue;
279279
}
280280

281281
if (!pJson.name) {
282282
throw new Error(`"name" field in ${pJsonPath} should be defined`);
283283
}
284-
if (pJson.private) {
285-
continue;
286-
}
287284

288285
const packageName = pJson.name;
289286
packageInfos.push({ packageName, pJson });
@@ -471,15 +468,15 @@ const main = defineCommand({
471468
}
472469

473470
try {
471+
if (pJson.private) {
472+
console.warn(`skipping ${p} because the package is private`);
473+
continue;
474+
}
474475
if (!pJson.name) {
475476
throw new Error(
476477
`"name" field in ${pJsonPath} should be defined`,
477478
);
478479
}
479-
if (pJson.private) {
480-
console.warn(`skipping ${p} because the package is private`);
481-
continue;
482-
}
483480

484481
const { filename, shasum } = await resolveTarball(
485482
packMethod,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"private": true
3+
}

pnpm-lock.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)