Skip to content

Commit 23a6564

Browse files
authored
docs: use sh instead of bash in source blocks (#14059)
1 parent 1164ffa commit 23a6564

File tree

15 files changed

+33
-33
lines changed

15 files changed

+33
-33
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
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:
66

7-
```bash
7+
```sh
88
npm i -g pnpm
99
```
1010

1111
`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:
1212

13-
```bash
13+
```sh
1414
git clone [email protected]:sveltejs/kit.git
1515
cd kit
1616
pnpm install
@@ -124,7 +124,7 @@ There are a few guidelines we follow:
124124

125125
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:
126126

127-
```bash
127+
```sh
128128
git config core.hookspath .githooks
129129
```
130130

@@ -142,6 +142,6 @@ The [Changesets GitHub action](https://github.com/changesets/action#with-publish
142142

143143
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:
144144

145-
```bash
145+
```sh
146146
npm publish --access=public
147147
```

documentation/docs/10-getting-started/20-creating-a-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Creating a project
44

55
The easiest way to start building a SvelteKit app is to run `npx sv create`:
66

7-
```bash
7+
```sh
88
npx sv create my-app
99
cd my-app
1010
npm install

documentation/docs/20-core-concepts/40-page-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Since these routes cannot be dynamically server-rendered, this will cause errors
8888

8989
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...
9090

91-
```bash
91+
```sh
9292
/ # non-dynamic
9393
/blog # non-dynamic
9494
/blog/[slug] # dynamic, because of `[slug]`

documentation/docs/25-build-and-deploy/40-adapter-node.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ First, build your app with `npm run build`. This will create the production serv
2626

2727
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:
2828

29-
```bash
29+
```sh
3030
node build
3131
```
3232

@@ -44,41 +44,41 @@ In `dev` and `preview`, SvelteKit will read environment variables from your `.en
4444

4545
In production, `.env` files are _not_ automatically loaded. To do so, install `dotenv` in your project...
4646

47-
```bash
47+
```sh
4848
npm install dotenv
4949
```
5050

5151
...and invoke it before running the built app:
5252

53-
```bash
53+
```sh
5454
node +++-r dotenv/config+++ build
5555
```
5656

5757
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:
5858

59-
```bash
59+
```sh
6060
node +++--env-file=.env+++ build
6161
```
6262

6363
### `PORT`, `HOST` and `SOCKET_PATH`
6464

6565
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:
6666

67-
```bash
67+
```sh
6868
HOST=127.0.0.1 PORT=4000 node build
6969
```
7070

7171
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.
7272

73-
```bash
73+
```sh
7474
SOCKET_PATH=/tmp/socket node build
7575
```
7676

7777
### `ORIGIN`, `PROTOCOL_HEADER`, `HOST_HEADER`, and `PORT_HEADER`
7878

7979
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:
8080

81-
```bash
81+
```sh
8282
ORIGIN=https://my.site node build
8383

8484
# or e.g. for local previewing and testing
@@ -87,7 +87,7 @@ ORIGIN=http://localhost:3000 node build
8787

8888
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:
8989

90-
```bash
90+
```sh
9191
PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host node build
9292
```
9393

@@ -103,7 +103,7 @@ If `adapter-node` can't correctly determine the URL of your deployment, you may
103103

104104
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:
105105

106-
```bash
106+
```sh
107107
ADDRESS_HEADER=True-Client-IP node build
108108
```
109109

@@ -174,7 +174,7 @@ If you need to change the name of the environment variables used to configure th
174174
envPrefix: 'MY_CUSTOM_';
175175
```
176176

177-
```bash
177+
```sh
178178
MY_CUSTOM_HOST=127.0.0.1 \
179179
MY_CUSTOM_PORT=4000 \
180180
MY_CUSTOM_ORIGIN=https://my.site \

documentation/docs/25-build-and-deploy/70-adapter-cloudflare-workers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ https://dash.cloudflare.com/<your-account-id>/home
6464
6565
You will need to install [Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/) and log in, if you haven't already:
6666

67-
```bash
67+
```sh
6868
npm i -D wrangler
6969
wrangler login
7070
```
7171

7272
Then, you can build your app and deploy it:
7373

74-
```bash
74+
```sh
7575
wrangler deploy
7676
```
7777

documentation/docs/25-build-and-deploy/90-adapter-vercel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Set this string as an environment variable on Vercel by logging in and going to
131131

132132
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:
133133

134-
```bash
134+
```sh
135135
vercel env pull .env.development.local
136136
```
137137

documentation/docs/30-advanced/10-advanced-routing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: Advanced routing
66

77
If the number of route segments is unknown, you can use rest syntax — for example you might implement GitHub's file viewer like so...
88

9-
```bash
9+
```sh
1010
/[org]/[repo]/tree/[branch]/[...file]
1111
```
1212

@@ -101,7 +101,7 @@ Each module in the `params` directory corresponds to a matcher, with the excepti
101101

102102
It's possible for multiple routes to match a given path. For example each of these routes would match `/foo-abc`:
103103

104-
```bash
104+
```sh
105105
src/routes/[...catchall]/+page.svelte
106106
src/routes/[[a=x]]/+page.svelte
107107
src/routes/[b]/+page.svelte
@@ -118,7 +118,7 @@ SvelteKit needs to know which route is being requested. To do so, it sorts them
118118

119119
...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:
120120

121-
```bash
121+
```sh
122122
src/routes/foo-abc/+page.svelte
123123
src/routes/foo-[c]/+page.svelte
124124
src/routes/[[a=x]]/+page.svelte

documentation/docs/30-advanced/70-packaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ You can create so-called declaration maps (`d.ts.map` files) by setting `"declar
249249

250250
To publish the generated package:
251251

252-
```bash
252+
```sh
253253
npm publish
254254
```
255255

documentation/docs/40-best-practices/07-images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Doing this manually is tedious. There are a variety of techniques you can use, d
3232

3333
Install:
3434

35-
```bash
35+
```sh
3636
npm install --save-dev @sveltejs/enhanced-img
3737
```
3838

documentation/docs/60-appendix/10-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ Currently ESM Support within the latest Yarn (version 3) is considered [experime
195195

196196
The below seems to work although your results may vary. First create a new application:
197197

198-
```bash
198+
```sh
199199
yarn create svelte myapp
200200
cd myapp
201201
```
202202

203203
And enable Yarn Berry:
204204

205-
```bash
205+
```sh
206206
yarn set version berry
207207
yarn install
208208
```

0 commit comments

Comments
 (0)