diff --git a/.changeset/plenty-bees-deliver.md b/.changeset/plenty-bees-deliver.md new file mode 100644 index 00000000..2001fd63 --- /dev/null +++ b/.changeset/plenty-bees-deliver.md @@ -0,0 +1,5 @@ +--- +"create-webstone-app": patch +--- + +Use pnpm in the template to simplify commands. diff --git a/packages/create-webstone-app/src/index.js b/packages/create-webstone-app/src/index.js index d6871220..f0ce78ae 100644 --- a/packages/create-webstone-app/src/index.js +++ b/packages/create-webstone-app/src/index.js @@ -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", @@ -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", }); @@ -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(); }); diff --git a/packages/create-webstone-app/template/package.json b/packages/create-webstone-app/template/package.json index 50a04f8f..fb153131 100644 --- a/packages/create-webstone-app/template/package.json +++ b/packages/create-webstone-app/template/package.json @@ -5,6 +5,9 @@ "workspaces": [ "services/*" ], + "scripts": { + "dev": "pnpm --recursive --parallel dev" + }, "devDependencies": { "@webstone/core": "latest" } diff --git a/packages/create-webstone-app/template/pnpm-workspace.yaml b/packages/create-webstone-app/template/pnpm-workspace.yaml new file mode 100644 index 00000000..70dcb2a0 --- /dev/null +++ b/packages/create-webstone-app/template/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - "services/**" \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d9c03c0..519e6dad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,12 +42,6 @@ importers: fs-extra: 9.1.0 prompts: 2.4.0 - packages/create-webstone-app/template: - specifiers: - '@webstone/core': latest - devDependencies: - '@webstone/core': link:../../core - packages: /@babel/code-frame/7.12.13: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e32ff20f..f6603df3 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ packages: - - "packages/**" \ No newline at end of file + - "packages/**" + - "!packages/create-webstone-app/template" \ No newline at end of file