Skip to content

Commit 834d0af

Browse files
committed
avoid pkg/ project name collisions
1 parent b382bdc commit 834d0af

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

dist/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,13 @@ function transform_files(
16681668
const readme = docs.content.find(({ name }) => name === "README.md");
16691669
const pkg = docs.content.find(({ name }) => name === "package.json");
16701670

1671-
if (!readme || !pkg || JSON.parse(pkg.content ).name === project)
1671+
if (
1672+
!readme ||
1673+
!pkg ||
1674+
JSON.parse(pkg.content ).name === project ||
1675+
JSON.parse(pkg.content ).name.replace("@sveltejs/", "") ===
1676+
project
1677+
)
16721678
return;
16731679

16741680
pkgs.push([

src/fs/get_content.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ export function transform_files(
120120
const readme = docs.content.find(({ name }) => name === "README.md");
121121
const pkg = docs.content.find(({ name }) => name === "package.json");
122122

123-
if (!readme || !pkg || JSON.parse(pkg.content as string).name === project)
123+
if (
124+
!readme ||
125+
!pkg ||
126+
JSON.parse(pkg.content as string).name === project ||
127+
JSON.parse(pkg.content as string).name.replace("@sveltejs/", "") ===
128+
project
129+
)
124130
return;
125131

126132
pkgs.push([

0 commit comments

Comments
 (0)