Skip to content

Commit 66246c3

Browse files
committed
Migrate to SolidBase's package helpers
1 parent dd580f9 commit 66246c3

File tree

23 files changed

+126
-837
lines changed

23 files changed

+126
-837
lines changed

app.config.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,55 @@ export default defineConfig(
8080
toc: {
8181
minDepth: 2,
8282
},
83+
packageManagers: {
84+
presets: {
85+
npm: {
86+
install: "npm i :content",
87+
"install-dev": "npm i :content -D",
88+
"install-global": "npm i :content -g",
89+
"install-local": "npm i",
90+
run: "npm run :content",
91+
exec: "npx :content",
92+
create: "npm init :content",
93+
},
94+
pnpm: {
95+
install: "pnpm i :content",
96+
"install-dev": "pnpm i :content -D",
97+
"install-global": "pnpm i :content -g",
98+
"install-local": "pnpm i",
99+
run: "pnpm :content",
100+
exec: "pnpx :content",
101+
create: "pnpm init :content",
102+
},
103+
yarn: {
104+
install: "yarn add :content",
105+
"install-dev": "yarn add :content -D",
106+
"install-global": "yarn add :content -g",
107+
"install-local": "yarn i",
108+
run: "yarn :content",
109+
exec: "yarn dlx :content",
110+
create: "yarn create :content",
111+
},
112+
bun: {
113+
install: "bun i :content",
114+
"install-dev": "bun i :content -d",
115+
"install-global": "bun i :content -g",
116+
"install-local": "bun i",
117+
run: "bun :content",
118+
exec: "bunx :content",
119+
create: "bun create :content",
120+
},
121+
deno: {
122+
install: "deno add npm::content",
123+
"install-dev": "deno add npm::content -D",
124+
"install-global": "deno add npm::content -g",
125+
"install-local": "deno i",
126+
run: "deno run :content",
127+
"exec": "dpx :content",
128+
create: "deno run -A npm::content",
129+
},
130+
},
131+
},
83132
},
84133
}
85134
)

src/routes/concepts/context.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,12 @@ Read more about default values in the [`createContext`](/reference/component-api
262262
:::
263263
264264
Because of this, if an initial value was not passed to `createContext`, the TS type signature of `useContext` will indicate that
265-
the value returned might be `undefined` (as mentioned above).
266-
This can be quite annoying when you want to use the context inside a component, and particularly when immediately destructuring the context.
265+
the value returned might be `undefined` (as mentioned above).
266+
This can be quite annoying when you want to use the context inside a component, and particularly when immediately destructuring the context.
267267
Additionally, if you use `useContext` and it returns `undefined` (which is often, but not always, the result of a bug), the error message thrown at runtime can be confusing.
268268
269-
The most common solution for it is to wrap all uses of `useContext` in a function that will explicitly throw a helpful error if the context is `undefined`.
270-
This also serves to narrow the type returned, so TS doesn't complain.
269+
The most common solution for it is to wrap all uses of `useContext` in a function that will explicitly throw a helpful error if the context is `undefined`.
270+
This also serves to narrow the type returned, so TS doesn't complain.
271271
As an example:
272272
273273
```ts title="/context/counter-component.tsx"
@@ -279,4 +279,3 @@ function useCounterContext() {
279279
return context
280280
}
281281
```
282-

src/routes/guides/deployment-options/aws-via-sst.mdx

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,17 @@ order: 1
44
mainNavExclude: true
55
---
66

7-
[SST](https://sst.dev/) is a framework for deploying applications to any cloud provider. It has a built-in way to deploy SolidStart apps to AWS Lambda. For additional details, you can [visit their docs](https://sst.dev/docs/).
7+
[SST](https://sst.dev/) is a framework for deploying applications to any cloud provider. It has a built-in way to deploy SolidStart apps to AWS Lambda. For additional details, you can [visit their docs](https://sst.dev/docs/).
88

99
## Quick start
1010

1111
1. [Create a SolidStart app](/solid-start/getting-started).
1212

1313
2. In your project, init SST.
1414

15-
<TabsCodeBlocks>
16-
<div id="npm">
17-
```bash frame="none"
18-
npx sst@latest init
15+
```package-exec
16+
sst@latest init
1917
```
20-
</div>
21-
<div id="yarn">
22-
```bash frame="none"
23-
yarn dlx sst@latest init
24-
```
25-
</div>
26-
<div id="pnpm">
27-
```bash frame="none"
28-
pnpm dlx sst@latest init
29-
```
30-
</div>
31-
<div id="bun">
32-
```bash frame="none"
33-
bunx sst@latest init
34-
```
35-
</div>
36-
</TabsCodeBlocks>
3718

3819
3. This will detect your SolidStart app and ask you to update your `app.config.ts`.
3920

@@ -45,28 +26,9 @@ server: {
4526

4627
4. When you are ready, you can deploy your app using:
4728

48-
<TabsCodeBlocks>
49-
<div id="npm">
50-
```bash frame="none"
51-
npx sst@latest deploy --stage production
52-
```
53-
</div>
54-
<div id="yarn">
55-
```bash frame="none"
56-
yarn dlx sst@latest deploy --stage production
57-
```
58-
</div>
59-
<div id="pnpm">
60-
```bash frame="none"
61-
pnpm dlx sst@latest deploy --stage production
62-
```
63-
</div>
64-
<div id="bun">
65-
```bash frame="none"
66-
bunx sst@latest deploy --stage production
29+
```package-exec
30+
sst@latest deploy --stage production
6731
```
68-
</div>
69-
</TabsCodeBlocks>
7032

7133
You can [read the full tutorial on the SST docs](https://sst.dev/docs/start/aws/solid).
7234

src/routes/guides/deployment-options/cloudflare.mdx

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -56,69 +56,27 @@ Here are the steps to deploy your Solid project using Wrangler.
5656

5757
1. Use your package manager of choice to install the Wrangler command-line tool:
5858

59-
<TabsCodeBlocks>
60-
<div id="npm">
61-
```bash frame="none"
62-
npm i -g wrangler
63-
```
64-
</div>
65-
66-
<div id="yarn">
67-
```bash frame="none"
68-
yarn global add wrangler
69-
```
70-
</div>
71-
72-
<div id="pnpm">
73-
```bash frame="none"
74-
pnpm add -g wrangler
59+
```package-install-global
60+
wrangler
7561
```
76-
</div>
77-
78-
<div id="bun">
79-
```bash frame="none"
80-
bun add -g wrangler
81-
```
82-
</div>
83-
</TabsCodeBlocks>
8462

8563
2. Open your terminal and run the following command to log in:
8664

8765
```bash frame="none"
8866
wrangler login
8967
```
9068

91-
3. Execute the following commands to build your project and deploy it using Wrangler:
69+
3. Build your project using the following command:
9270

93-
<TabsCodeBlocks>
94-
<div id="npm">
95-
```bash frame="none"
96-
npm run build
97-
wrangler pages publish dist
71+
```package-run
72+
build
9873
```
99-
</div>
10074

101-
<div id="yarn">
102-
```bash frame="none"
103-
yarn build
104-
wrangler pages publish dist
105-
```
106-
</div>
75+
4. Deploy using Wrangler:
10776

108-
<div id="pnpm">
109-
```bash frame="none"
110-
pnpm build
111-
wrangler pages publish dist
112-
```
113-
</div>
114-
115-
<div id="bun">
116-
```bash frame="none"
117-
bun build
77+
```bash
11878
wrangler pages publish dist
11979
```
120-
</div>
121-
</TabsCodeBlocks>
12280

12381
After running these commands, your project should be live.
12482
While the terminal may provide a link, it's more reliable to check your Cloudflare Pages dashboard for the deployed URL, which usually follows the format `project-name.pages.dev`.

src/routes/guides/deployment-options/firebase.mdx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,9 @@ If you haven't, you can follow [Firebase's official guide](https://firebase.goog
1414

1515
1. Use your preferred package manager to install the Firebase command-line tool with one of the following commands:
1616

17-
<TabsCodeBlocks>
18-
<div id="npm">
19-
```bash frame="none"
20-
npm i -g firebase-tools
21-
```
22-
</div>
23-
24-
<div id="yarn">
25-
``` bash frame="none"
26-
yarn global add firebase-tools
27-
```
28-
</div>
29-
30-
<div id="pnpm">
31-
```bash frame="none"
32-
pnpm add -g firebase-tools
33-
```
34-
</div>
35-
36-
<div id="bun">
37-
```bash frame="none"
38-
bun add -g firebase-tools
17+
```package-install-global
18+
firebase-tools
3919
```
40-
</div>
41-
</TabsCodeBlocks>
4220

4321
2. Execute the `firebase login` command to ensure that you're logged into the Firebase account associated with your project.
4422

src/routes/guides/deployment-options/netlify.mdx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,9 @@ For detailed guidance on build procedures, deployment options, and the range of
3838

3939
1. Install the Netlify CLI using your preferred package manager:
4040

41-
<TabsCodeBlocks>
42-
<div id="npm">
43-
```bash frame="none"
44-
npm i -g netlify-cli
41+
```package-install-global
42+
netlify-cli
4543
```
46-
</div>
47-
48-
<div id="yarn">
49-
```bash frame="none"
50-
yarn global add netlify-cli
51-
```
52-
</div>
53-
54-
<div id="pnpm">
55-
```bash frame="none"
56-
pnpm add -g netlify-cli
57-
```
58-
</div>
59-
60-
<div id="bun">
61-
```bash frame="none"
62-
bun add -g netlify-cli
63-
```
64-
</div>
65-
</TabsCodeBlocks>
6644

6745
**Note:**
6846
Before proceeding, ensure that your Netlify account and team are fully set up.

src/routes/guides/deployment-options/railway.mdx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,9 @@ Once a domain has been generated, your Solid project should be live.
6969

7070
1. Using your preferred package manager and install the Railway CLI:
7171

72-
<TabsCodeBlocks>
73-
<div id="npm">
74-
```bash frame="none"
75-
npm i -g @railway/cli
76-
```
77-
</div>
78-
79-
<div id="yarn">
80-
```bash frame="none"
81-
yarn global add @railway/cli
82-
```
83-
</div>
84-
85-
<div id="pnpm">
86-
```bash frame="none"
87-
pnpm add -g @railway/cli
88-
```
89-
</div>
90-
91-
<div id="bun">
92-
```bash frame="none"
93-
bun add -g @railway/cli
72+
```package-install-global
73+
@railway/cli
9474
```
95-
</div>
96-
</TabsCodeBlocks>
9775

9876
2. Open your terminal and run the following command to log in:
9977

src/routes/guides/deployment-options/vercel.mdx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,9 @@ For detailed information regarding build and deployment instructions, as well as
4949

5050
1. Install the Vercel CLI using your preferred package manager.
5151

52-
<TabsCodeBlocks>
53-
<div id="npm">
54-
```bash frame="none"
55-
npm i -g vercel
56-
```
57-
</div>
58-
59-
<div id="yarn">
60-
```bash frame="none"
61-
yarn global add vercel
62-
```
63-
</div>
64-
65-
<div id="pnpm">
66-
```bash frame="none"
67-
pnpm add -g vercel
68-
```
69-
</div>
70-
71-
<div id="bun">
72-
```bash frame="none"
73-
bun add -g vercel
52+
```package-install-global
53+
vercel
7454
```
75-
</div>
76-
</TabsCodeBlocks>
7755

7856
2. Open your terminal, navigate to your project directory, and run the following command to log in:
7957

src/routes/guides/deployment-options/zerops.mdx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,10 @@ irm https://zerops.io/zcli/install.ps1 | iex
137137
```
138138

139139
Npm
140-
<TabsCodeBlocks>
141-
<div id="npm">
142-
```bash frame="none"
143-
npm i -g @zerops/zcli
144-
```
145-
</div>
146-
<div id="pnpm">
147-
```bash frame="none"
148-
pnpm add -g @zerops/zcli
149-
```
150-
</div>
151-
<div id="yarn">
152-
```bash frame="none"
153-
yarn global add @zerops/zcli
140+
141+
```package-install-global
142+
@zerops/zcli
154143
```
155-
</div>
156-
</TabsCodeBlocks>
157144

158145
2. Open Settings > [Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.
159146
3. Log in using your access token with the following command:

0 commit comments

Comments
 (0)