Skip to content

Commit

Permalink
chore(create-webstone-app): use pnpm in the template to simplify comm…
Browse files Browse the repository at this point in the history
…ands
  • Loading branch information
Mike Nikles authored and mikenikles committed Aug 1, 2021
1 parent 58cbcba commit 7b194c0
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-bees-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-webstone-app": patch
---

Use pnpm in the template to simplify commands.
41 changes: 18 additions & 23 deletions packages/create-webstone-app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ const installWebApp = async (appDir) => {
console.log(`Installing web app in ${webAppDir}...`);

try {
// An empty directory means `npm init svelte@next` is not asking to overwrite it
// An empty directory means `pnpm init svelte@next` is not asking to overwrite it
fs.removeSync(`${webAppDir}/.keep`);

await execa("npm", ["init", "svelte@next", "."], {
await execa("pnpm", ["init", "svelte@next", "."], {
cwd: webAppDir,
shell: true,
stdio: "inherit",
Expand All @@ -78,7 +78,7 @@ const installWebApp = async (appDir) => {
const installDependencies = async (appDir) => {
console.log(`Installing dependencies...`);
try {
await execa("npm", ["install"], {
await execa("pnpm", ["install"], {
cwd: appDir,
stdio: "inherit",
});
Expand All @@ -91,26 +91,21 @@ const installDependencies = async (appDir) => {

const displayNextSteps = (appDir) =>
new Promise((resolve) => {
console.log();
console.log();
console.log("===================================================");
console.log("Congratulations 🎉! Your Webstone project is ready.");
console.log();
console.log("To contribute: https://github.com/WebstoneHQ/webstone");
console.log("To chat & get in touch: https://discord.gg/NJRm6eRs");
console.log();
console.log();
console.log(
"Thank you for your interest in Webstone, I'd love to hear your feedback. 🙏"
);
console.log();
console.log();
console.log(
`Next steps: For now, 'cd ${appDir
.split("/")
.pop()}/services/web' and 'npm run dev' starts the web interface. This will change once the Webstone CLI is ready.`
);
console.log();
console.log(`
===================================================
Congratulations 🎉! Your Webstone project is ready.
To contribute: https://github.com/WebstoneHQ/webstone
To chat & get in touch: https://discord.gg/NJRm6eRs
Thank you for your interest in Webstone, I'd love to hear your feedback 🙏.
Next steps:
- cd ${appDir.split("/").pop()}
- pnpm dev
`);
resolve();
});

Expand Down
3 changes: 3 additions & 0 deletions packages/create-webstone-app/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"workspaces": [
"services/*"
],
"scripts": {
"dev": "pnpm --recursive --parallel dev"
},
"devDependencies": {
"@webstone/core": "latest"
}
Expand Down
2 changes: 2 additions & 0 deletions packages/create-webstone-app/template/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- "services/**"
6 changes: 0 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
packages:
- "packages/**"
- "packages/**"
- "!packages/create-webstone-app/template"

0 comments on commit 7b194c0

Please sign in to comment.