From 2148a4bd21b15d0be963da6e4d129e8f580ccc8e Mon Sep 17 00:00:00 2001 From: Filip Kobierski Date: Sat, 26 Jul 2025 20:56:08 +0200 Subject: [PATCH] use sh instead of bash in source blocks no bash-specific features were used --- CONTRIBUTING.md | 8 ++++---- .../20-creating-a-project.md | 2 +- .../docs/20-core-concepts/40-page-options.md | 2 +- .../25-build-and-deploy/40-adapter-node.md | 20 +++++++++---------- .../70-adapter-cloudflare-workers.md | 4 ++-- .../25-build-and-deploy/90-adapter-vercel.md | 2 +- .../docs/30-advanced/10-advanced-routing.md | 6 +++--- .../docs/30-advanced/70-packaging.md | 2 +- .../docs/40-best-practices/07-images.md | 2 +- documentation/docs/60-appendix/10-faq.md | 4 ++-- .../adapter-static/test/apps/spa/README.md | 6 +++--- packages/create-svelte/README.md | 2 +- packages/kit/README.md | 2 +- .../types/synthetic/$env+static+private.md | 2 +- packages/package/README.md | 2 +- 15 files changed, 33 insertions(+), 33 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ed8d429f743..555dee0e3e29 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,13 +4,13 @@ This is a monorepo, meaning the repo holds multiple packages. It requires the use of [pnpm](https://pnpm.io/). You can [install pnpm](https://pnpm.io/installation) with: -```bash +```sh npm i -g pnpm ``` `pnpm` commands run in the project's root directory will run on all sub-projects. You can checkout the code and install the dependencies with: -```bash +```sh git clone git@github.com:sveltejs/kit.git cd kit pnpm install @@ -124,7 +124,7 @@ There are a few guidelines we follow: To use the git hooks in the repo, which will save you from waiting for CI to tell you that you forgot to lint, run this: -```bash +```sh git config core.hookspath .githooks ``` @@ -142,6 +142,6 @@ The [Changesets GitHub action](https://github.com/changesets/action#with-publish New packages will need to be published manually the first time if they are scoped to the `@sveltejs` organisation, by running this from the package directory: -```bash +```sh npm publish --access=public ``` diff --git a/documentation/docs/10-getting-started/20-creating-a-project.md b/documentation/docs/10-getting-started/20-creating-a-project.md index 4219449d1f1a..856818974c9d 100644 --- a/documentation/docs/10-getting-started/20-creating-a-project.md +++ b/documentation/docs/10-getting-started/20-creating-a-project.md @@ -4,7 +4,7 @@ title: Creating a project The easiest way to start building a SvelteKit app is to run `npx sv create`: -```bash +```sh npx sv create my-app cd my-app npm install diff --git a/documentation/docs/20-core-concepts/40-page-options.md b/documentation/docs/20-core-concepts/40-page-options.md index aa4068b7a8b5..727274c80911 100644 --- a/documentation/docs/20-core-concepts/40-page-options.md +++ b/documentation/docs/20-core-concepts/40-page-options.md @@ -88,7 +88,7 @@ Since these routes cannot be dynamically server-rendered, this will cause errors SvelteKit will discover pages to prerender automatically, by starting at _entry points_ and crawling them. By default, all your non-dynamic routes are considered entry points — for example, if you have these routes... -```bash +```sh / # non-dynamic /blog # non-dynamic /blog/[slug] # dynamic, because of `[slug]` diff --git a/documentation/docs/25-build-and-deploy/40-adapter-node.md b/documentation/docs/25-build-and-deploy/40-adapter-node.md index c67db0714efa..3f14662a4159 100644 --- a/documentation/docs/25-build-and-deploy/40-adapter-node.md +++ b/documentation/docs/25-build-and-deploy/40-adapter-node.md @@ -26,7 +26,7 @@ First, build your app with `npm run build`. This will create the production serv You will need the output directory, the project's `package.json`, and the production dependencies in `node_modules` to run the application. Production dependencies can be generated by copying the `package.json` and `package-lock.json` and then running `npm ci --omit dev` (you can skip this step if your app doesn't have any dependencies). You can then start your app with this command: -```bash +```sh node build ``` @@ -44,19 +44,19 @@ In `dev` and `preview`, SvelteKit will read environment variables from your `.en In production, `.env` files are _not_ automatically loaded. To do so, install `dotenv` in your project... -```bash +```sh npm install dotenv ``` ...and invoke it before running the built app: -```bash +```sh node +++-r dotenv/config+++ build ``` If you use Node.js v20.6+, you can use the [`--env-file`](https://nodejs.org/en/learn/command-line/how-to-read-environment-variables-from-nodejs) flag instead: -```bash +```sh node +++--env-file=.env+++ build ``` @@ -64,13 +64,13 @@ node +++--env-file=.env+++ build By default, the server will accept connections on `0.0.0.0` using port 3000. These can be customised with the `PORT` and `HOST` environment variables: -```bash +```sh HOST=127.0.0.1 PORT=4000 node build ``` Alternatively, the server can be configured to accept connections on a specified socket path. When this is done using the `SOCKET_PATH` environment variable, the `HOST` and `PORT` environment variables will be disregarded. -```bash +```sh SOCKET_PATH=/tmp/socket node build ``` @@ -78,7 +78,7 @@ SOCKET_PATH=/tmp/socket node build HTTP doesn't give SvelteKit a reliable way to know the URL that is currently being requested. The simplest way to tell SvelteKit where the app is being served is to set the `ORIGIN` environment variable: -```bash +```sh ORIGIN=https://my.site node build # or e.g. for local previewing and testing @@ -87,7 +87,7 @@ ORIGIN=http://localhost:3000 node build With this, a request for the `/stuff` pathname will correctly resolve to `https://my.site/stuff`. Alternatively, you can specify headers that tell SvelteKit about the request protocol and host, from which it can construct the origin URL: -```bash +```sh PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host node build ``` @@ -103,7 +103,7 @@ If `adapter-node` can't correctly determine the URL of your deployment, you may The [`RequestEvent`](@sveltejs-kit#RequestEvent) object passed to hooks and endpoints includes an `event.getClientAddress()` function that returns the client's IP address. By default this is the connecting `remoteAddress`. If your server is behind one or more proxies (such as a load balancer), this value will contain the innermost proxy's IP address rather than the client's, so we need to specify an `ADDRESS_HEADER` to read the address from: -```bash +```sh ADDRESS_HEADER=True-Client-IP node build ``` @@ -174,7 +174,7 @@ If you need to change the name of the environment variables used to configure th envPrefix: 'MY_CUSTOM_'; ``` -```bash +```sh MY_CUSTOM_HOST=127.0.0.1 \ MY_CUSTOM_PORT=4000 \ MY_CUSTOM_ORIGIN=https://my.site \ diff --git a/documentation/docs/25-build-and-deploy/70-adapter-cloudflare-workers.md b/documentation/docs/25-build-and-deploy/70-adapter-cloudflare-workers.md index 73a771459543..12042800d5e5 100644 --- a/documentation/docs/25-build-and-deploy/70-adapter-cloudflare-workers.md +++ b/documentation/docs/25-build-and-deploy/70-adapter-cloudflare-workers.md @@ -64,14 +64,14 @@ https://dash.cloudflare.com//home You will need to install [Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/) and log in, if you haven't already: -```bash +```sh npm i -D wrangler wrangler login ``` Then, you can build your app and deploy it: -```bash +```sh wrangler deploy ``` diff --git a/documentation/docs/25-build-and-deploy/90-adapter-vercel.md b/documentation/docs/25-build-and-deploy/90-adapter-vercel.md index d15ae0f3aca3..58e8079cda27 100644 --- a/documentation/docs/25-build-and-deploy/90-adapter-vercel.md +++ b/documentation/docs/25-build-and-deploy/90-adapter-vercel.md @@ -131,7 +131,7 @@ Set this string as an environment variable on Vercel by logging in and going to To get this key known about for local development, you can use the [Vercel CLI](https://vercel.com/docs/cli/env) by running the `vercel env pull` command locally like so: -```bash +```sh vercel env pull .env.development.local ``` diff --git a/documentation/docs/30-advanced/10-advanced-routing.md b/documentation/docs/30-advanced/10-advanced-routing.md index 06122648f170..dd1f5b7b5420 100644 --- a/documentation/docs/30-advanced/10-advanced-routing.md +++ b/documentation/docs/30-advanced/10-advanced-routing.md @@ -6,7 +6,7 @@ title: Advanced routing If the number of route segments is unknown, you can use rest syntax — for example you might implement GitHub's file viewer like so... -```bash +```sh /[org]/[repo]/tree/[branch]/[...file] ``` @@ -101,7 +101,7 @@ Each module in the `params` directory corresponds to a matcher, with the excepti It's possible for multiple routes to match a given path. For example each of these routes would match `/foo-abc`: -```bash +```sh src/routes/[...catchall]/+page.svelte src/routes/[[a=x]]/+page.svelte src/routes/[b]/+page.svelte @@ -118,7 +118,7 @@ SvelteKit needs to know which route is being requested. To do so, it sorts them ...resulting in this ordering, meaning that `/foo-abc` will invoke `src/routes/foo-abc/+page.svelte`, and `/foo-def` will invoke `src/routes/foo-[c]/+page.svelte` rather than less specific routes: -```bash +```sh src/routes/foo-abc/+page.svelte src/routes/foo-[c]/+page.svelte src/routes/[[a=x]]/+page.svelte diff --git a/documentation/docs/30-advanced/70-packaging.md b/documentation/docs/30-advanced/70-packaging.md index 285094390c94..93294e3f2616 100644 --- a/documentation/docs/30-advanced/70-packaging.md +++ b/documentation/docs/30-advanced/70-packaging.md @@ -249,7 +249,7 @@ You can create so-called declaration maps (`d.ts.map` files) by setting `"declar To publish the generated package: -```bash +```sh npm publish ``` diff --git a/documentation/docs/40-best-practices/07-images.md b/documentation/docs/40-best-practices/07-images.md index c0cc54f2724a..4edfa68a63bc 100644 --- a/documentation/docs/40-best-practices/07-images.md +++ b/documentation/docs/40-best-practices/07-images.md @@ -32,7 +32,7 @@ Doing this manually is tedious. There are a variety of techniques you can use, d Install: -```bash +```sh npm install --save-dev @sveltejs/enhanced-img ``` diff --git a/documentation/docs/60-appendix/10-faq.md b/documentation/docs/60-appendix/10-faq.md index 94ebe4950cec..5caa0f5b7b9f 100644 --- a/documentation/docs/60-appendix/10-faq.md +++ b/documentation/docs/60-appendix/10-faq.md @@ -195,14 +195,14 @@ Currently ESM Support within the latest Yarn (version 3) is considered [experime The below seems to work although your results may vary. First create a new application: -```bash +```sh yarn create svelte myapp cd myapp ``` And enable Yarn Berry: -```bash +```sh yarn set version berry yarn install ``` diff --git a/packages/adapter-static/test/apps/spa/README.md b/packages/adapter-static/test/apps/spa/README.md index 16c7d1981629..3623c0c7e3f3 100644 --- a/packages/adapter-static/test/apps/spa/README.md +++ b/packages/adapter-static/test/apps/spa/README.md @@ -6,7 +6,7 @@ Everything you need to build a Svelte project, powered by [`create-svelte`](http If you're seeing this, you've probably already done this step. Congrats! -```bash +```sh # create a new project in the current directory npm init svelte @@ -18,7 +18,7 @@ npm init svelte my-app Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: -```bash +```sh npm run dev # or start the server and open the app in a new browser tab @@ -29,7 +29,7 @@ npm run dev -- --open Before creating a production version of your app, install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. Then: -```bash +```sh npm run build ``` diff --git a/packages/create-svelte/README.md b/packages/create-svelte/README.md index 74cacad79bde..a671bc6405ba 100644 --- a/packages/create-svelte/README.md +++ b/packages/create-svelte/README.md @@ -2,7 +2,7 @@ This package has been deprecated. Please see [`sv`](https://npmjs.com/package/sv) instead: -```bash +```sh npx sv create ``` diff --git a/packages/kit/README.md b/packages/kit/README.md index f5592f982a6d..372a92e71fa7 100644 --- a/packages/kit/README.md +++ b/packages/kit/README.md @@ -4,7 +4,7 @@ This is the [SvelteKit](https://svelte.dev/docs/kit) framework and CLI. The quickest way to get started is via the [sv](https://npmjs.com/package/sv) package: -```bash +```sh npx sv create my-app cd my-app npm install diff --git a/packages/kit/src/types/synthetic/$env+static+private.md b/packages/kit/src/types/synthetic/$env+static+private.md index e36ef4efdd7f..bf3599977eb3 100644 --- a/packages/kit/src/types/synthetic/$env+static+private.md +++ b/packages/kit/src/types/synthetic/$env+static+private.md @@ -14,6 +14,6 @@ MY_FEATURE_FLAG="" You can override `.env` values from the command line like so: -```bash +```sh MY_FEATURE_FLAG="enabled" npm run dev ``` diff --git a/packages/package/README.md b/packages/package/README.md index df0a8935c7e3..a2d431eb4265 100644 --- a/packages/package/README.md +++ b/packages/package/README.md @@ -4,7 +4,7 @@ The quickest way to get started is via the [sv](https://npmjs.com/package/sv) package: -```bash +```sh npx sv create my-app cd my-app npm install