Skip to content

Commit f6417dd

Browse files
authored
fix: Fix starter publish and scripts (#28260)
* Fix starter publish script * Don't use yarn import because @arcanis says it's a bad idea #28238 (comment)
1 parent bd0a7f4 commit f6417dd

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

packages/create-gatsby/src/init-starter.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,7 @@ const install = async (
9292
}
9393
}
9494
if (getPackageManager() === `yarn` && checkForYarn()) {
95-
if (await fs.pathExists(`package-lock.json`)) {
96-
if (!(await fs.pathExists(`yarn.lock`))) {
97-
await execa(`yarnpkg`, [`import`])
98-
}
99-
await fs.remove(`package-lock.json`)
100-
}
101-
95+
await fs.remove(`package-lock.json`)
10296
const args = packages.length ? [`add`, silent, ...packages] : [silent]
10397
await execa(`yarnpkg`, args)
10498
} else {

packages/gatsby-cli/src/init-starter.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,7 @@ const install = async (rootPath: string): Promise<void> => {
111111
}
112112
}
113113
if (getPackageManager() === `yarn` && checkForYarn()) {
114-
if (await fs.pathExists(`package-lock.json`)) {
115-
if (!(await fs.pathExists(`yarn.lock`))) {
116-
await spawn(`yarnpkg import`)
117-
}
118-
await fs.remove(`package-lock.json`)
119-
}
114+
await fs.remove(`package-lock.json`)
120115
await spawn(`yarnpkg`)
121116
} else {
122117
await fs.remove(`yarn.lock`)

scripts/publish-starters.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ for folder in $GLOB; do
2929

3030
if [ "$IS_WORKSPACE" = null ]; then
3131
rm -f yarn.lock
32-
if ["$MINIMAL_STARTER" != "$NAME"]; then # ignore minimal starter because we don't want any lock files for create-gatsby
32+
if [ "$MINIMAL_STARTER" != "$NAME" ]; then # ignore minimal starter because we don't want any lock files for create-gatsby
3333
yarn import # generate a new yarn.lock file based on package-lock.json, gatsby new does this is new CLI versions but will ignore if file exists
3434
fi
3535
fi

0 commit comments

Comments
 (0)