Skip to content

Commit

Permalink
fix(vite): use pnpm for vite
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlindquist committed Dec 18, 2024
1 parent ea37cec commit 4535ad4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/api/pro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ ${dirRoot}
~~~
`.trim()
),
command: `npm create vite "${dir}" && ${clearCommand} && cd "${dir}" && npm i && exit`,
command: `pnpm create vite "${dir}" && ${clearCommand} && cd "${dir}" && pnpm i && exit`,
cwd: viteRoot,
shortcuts: [
{
Expand Down
13 changes: 4 additions & 9 deletions src/setup/clone-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ if (await isDir(examplesDir)) {
}
} else if (await isBin('git')) {
try {
await exec(
'git clone --depth 1 --verbose --progress https://github.com/johnlindquist/kit-examples-ts.git examples',
{
cwd: kenvPath('kenvs')
}
)
await exec('git clone --depth 1 --verbose --progress git://github.com/johnlindquist/kit-examples-ts.git examples', {
cwd: kenvPath('kenvs')
})
} catch (error) {
await downloadAndSetupExamples()
}
Expand All @@ -48,13 +45,11 @@ if (await isDir(examplesDir)) {
}

try {
await exec('npm i', {
await exec('pnpm i', {
cwd: kenvPath('kenvs', 'examples'),
env: {
...global.env,
PATH: KIT_FIRST_PATH
}
})
} catch (error) {}

export {}
18 changes: 9 additions & 9 deletions src/setup/update-examples.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { KIT_FIRST_PATH } from "../core/utils.js"
import { KIT_FIRST_PATH } from '../core/utils.js'

let examplesDir = kenvPath("kenvs", "examples")
let examplesDir = kenvPath('kenvs', 'examples')
if (await isDir(examplesDir)) {
await exec(`git stash`, {
cwd: examplesDir,
cwd: examplesDir
})
let { stdout } = await exec(`git pull`, {
cwd: examplesDir,
cwd: examplesDir
})

if (!stdout.includes("Already up to date.")) {
if (!stdout.includes('Already up to date.')) {
try {
await exec(`npm i`, {
cwd: kenvPath("kenvs", "examples"),
await exec(`pnpm i`, {
cwd: kenvPath('kenvs', 'examples'),
env: {
...global.env,
PATH: KIT_FIRST_PATH,
},
PATH: KIT_FIRST_PATH
}
})
} catch (error) {}
}
Expand Down
4 changes: 2 additions & 2 deletions test-sdk/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ava.serial('app-prompt.js', async (t) => {
channel: Channel.VALUE_SUBMITTED,
value
},
(error) => {}
(error) => { }
);
});
});
Expand Down Expand Up @@ -353,7 +353,7 @@ console.log(value)
t.log(pkgJson);

cd(kenvPath());
let { stdout, stderr } = await exec(`npm run ${npmScript}`);
let { stdout, stderr } = await exec(`pnpm run ${npmScript}`);

t.is(stderr, '');
t.regex(stdout, new RegExp(`${message}`));
Expand Down

0 comments on commit 4535ad4

Please sign in to comment.