Skip to content

Commit 4535ad4

Browse files
committed
fix(vite): use pnpm for vite
1 parent ea37cec commit 4535ad4

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

src/api/pro.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ ${dirRoot}
300300
~~~
301301
`.trim()
302302
),
303-
command: `npm create vite "${dir}" && ${clearCommand} && cd "${dir}" && npm i && exit`,
303+
command: `pnpm create vite "${dir}" && ${clearCommand} && cd "${dir}" && pnpm i && exit`,
304304
cwd: viteRoot,
305305
shortcuts: [
306306
{

src/setup/clone-examples.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ if (await isDir(examplesDir)) {
3434
}
3535
} else if (await isBin('git')) {
3636
try {
37-
await exec(
38-
'git clone --depth 1 --verbose --progress https://github.com/johnlindquist/kit-examples-ts.git examples',
39-
{
40-
cwd: kenvPath('kenvs')
41-
}
42-
)
37+
await exec('git clone --depth 1 --verbose --progress git://github.com/johnlindquist/kit-examples-ts.git examples', {
38+
cwd: kenvPath('kenvs')
39+
})
4340
} catch (error) {
4441
await downloadAndSetupExamples()
4542
}
@@ -48,13 +45,11 @@ if (await isDir(examplesDir)) {
4845
}
4946

5047
try {
51-
await exec('npm i', {
48+
await exec('pnpm i', {
5249
cwd: kenvPath('kenvs', 'examples'),
5350
env: {
5451
...global.env,
5552
PATH: KIT_FIRST_PATH
5653
}
5754
})
5855
} catch (error) {}
59-
60-
export {}

src/setup/update-examples.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { KIT_FIRST_PATH } from "../core/utils.js"
1+
import { KIT_FIRST_PATH } from '../core/utils.js'
22

3-
let examplesDir = kenvPath("kenvs", "examples")
3+
let examplesDir = kenvPath('kenvs', 'examples')
44
if (await isDir(examplesDir)) {
55
await exec(`git stash`, {
6-
cwd: examplesDir,
6+
cwd: examplesDir
77
})
88
let { stdout } = await exec(`git pull`, {
9-
cwd: examplesDir,
9+
cwd: examplesDir
1010
})
1111

12-
if (!stdout.includes("Already up to date.")) {
12+
if (!stdout.includes('Already up to date.')) {
1313
try {
14-
await exec(`npm i`, {
15-
cwd: kenvPath("kenvs", "examples"),
14+
await exec(`pnpm i`, {
15+
cwd: kenvPath('kenvs', 'examples'),
1616
env: {
1717
...global.env,
18-
PATH: KIT_FIRST_PATH,
19-
},
18+
PATH: KIT_FIRST_PATH
19+
}
2020
})
2121
} catch (error) {}
2222
}

test-sdk/main.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ava.serial('app-prompt.js', async (t) => {
6161
channel: Channel.VALUE_SUBMITTED,
6262
value
6363
},
64-
(error) => {}
64+
(error) => { }
6565
);
6666
});
6767
});
@@ -353,7 +353,7 @@ console.log(value)
353353
t.log(pkgJson);
354354

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

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

0 commit comments

Comments
 (0)