Skip to content

Commit

Permalink
fix(create-astro): TypeScript installation failure with yarn (#8939)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 30, 2023
1 parent 46d3043 commit 71455c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-avocados-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': patch
---

Fixes TypeScript installation issue with yarn
4 changes: 2 additions & 2 deletions packages/create-astro/src/actions/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ const FILES_TO_UPDATE = {
try {
// add required dependencies for astro check
if (options.ctx.install)
await shell(options.ctx.packageManager, ['install', '@astrojs/check', 'typescript'], {
await shell(options.ctx.packageManager, ['add', '@astrojs/check', 'typescript'], {
cwd: path.dirname(file),
stdio: 'ignore',
});

// inject addtional command to build script
// inject additional command to build script
const data = await readFile(file, { encoding: 'utf-8' });
const indent = /(^\s+)/m.exec(data)?.[1] ?? '\t';
const parsedPackageJson = JSON.parse(data);
Expand Down

0 comments on commit 71455c1

Please sign in to comment.