Skip to content

Commit 00546a3

Browse files
authored
Merge branch 'main' into request-event-locals
2 parents 632448d + faf1ccd commit 00546a3

File tree

174 files changed

+9340
-6653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+9340
-6653
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 33 deletions
This file was deleted.

.eslintrc.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"ignorePatterns": ["node_modules/", "dist/"],
3+
"env": {
4+
"browser": true,
5+
"es2021": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:solid/typescript"
11+
],
12+
"overrides": [
13+
{
14+
"env": {
15+
"node": true
16+
},
17+
"files": [".eslintrc.{js,cjs}"],
18+
"parserOptions": {
19+
"sourceType": "script"
20+
}
21+
}
22+
],
23+
"parser": "@typescript-eslint/parser",
24+
"parserOptions": {
25+
"ecmaVersion": "latest",
26+
"sourceType": "module"
27+
},
28+
"plugins": ["@typescript-eslint", "solid"],
29+
"rules": {
30+
"quotes": ["error", "double"],
31+
"semi": "warn",
32+
"@typescript-eslint/no-unused-vars": [
33+
"error",
34+
{
35+
"args": "all",
36+
"argsIgnorePattern": "^_",
37+
"caughtErrors": "all",
38+
"caughtErrorsIgnorePattern": "^_",
39+
"destructuredArrayIgnorePattern": "^_",
40+
"varsIgnorePattern": "^_",
41+
"ignoreRestSiblings": true
42+
}
43+
]
44+
}
45+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Thank you for taking the time to open this PR! We appreciate your contribution and effort in helping improve the project. -->
2+
3+
- [ ] I have read the [Contribution guide](https://github.com/solidjs/solid-docs/blob/main/CONTRIBUTING.md)
4+
- [ ] This PR references an issue (except for typos, broken links, or other minor problems)
5+
6+
### Description(required)
7+
<!-- Provide a detailed description of the changes in this PR. Why is it necessary, and what does it do? -->
8+
9+
### Related issues & labels
10+
11+
- Closes #<!-- Add the issue number this PR closes (if applicable). For multiple issues, separate them with commas. Example: #123, #456 -->
12+
- Suggested label(s) (optional): <!-- Suggest any labels that help categorize this PR, such as 'bug', 'enhancement', 'documentation', etc. -->

.github/workflows/orama_sync.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Sync Orama
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
@@ -11,20 +12,20 @@ jobs:
1112
build:
1213
runs-on: ubuntu-latest
1314
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v4
16-
- uses: pnpm/action-setup@v3
17-
with:
18-
version: 8
19-
- name: Setup Node.js
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: 20.x
23-
cache: pnpm
24-
- name: Install dependencies
25-
run: pnpm i
26-
- name: Sync Orama
27-
run: pnpm sync:orama
28-
env:
29-
ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }}
30-
ORAMA_PRIVATE_INDEX_ID: ${{ secrets.ORAMA_PRIVATE_INDEX_ID }}
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
- uses: pnpm/action-setup@v3
18+
with:
19+
version: 8
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20.x
24+
cache: pnpm
25+
- name: Install dependencies
26+
run: pnpm i
27+
- name: Sync Orama
28+
run: pnpm sync:orama
29+
env:
30+
ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }}
31+
ORAMA_PRIVATE_INDEX_ID: ${{ secrets.ORAMA_PRIVATE_INDEX_ID }}

.github/workflows/static_checks.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: 🔍 Lint / Type Checks
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
setup:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v4
15+
with:
16+
version: 9
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: "20"
20+
cache: "pnpm"
21+
- run: pnpm i
22+
- uses: actions/cache/save@v4
23+
with:
24+
path: |
25+
node_modules
26+
~/.pnpm-store
27+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
28+
29+
typecheck:
30+
needs: setup
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: pnpm/action-setup@v4
35+
with:
36+
version: 9
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version: "20"
40+
cache: "pnpm"
41+
- uses: actions/cache/restore@v4
42+
with:
43+
path: |
44+
node_modules
45+
~/.pnpm-store
46+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
- name: Generate virtual modules
48+
run: pnpm sync
49+
- name: TypeScript check
50+
run: pnpm check:types
51+
52+
lint:
53+
needs: setup
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: pnpm/action-setup@v4
58+
with:
59+
version: 9
60+
- uses: actions/setup-node@v4
61+
with:
62+
node-version: "20"
63+
cache: "pnpm"
64+
- uses: actions/cache/restore@v4
65+
with:
66+
path: |
67+
node_modules
68+
~/.pnpm-store
69+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
70+
- name: ESLint check
71+
run: pnpm check:lint

CONTRIBUTING.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,16 @@ Though it is not a hard requirement, we'd deeply appreciate if you could recomme
131131

132132
#### Adding support to a new language
133133

134-
1. Create a dictionary file in `src/i18n/dictionaries`. The name should follow our locale convention.
134+
1. Create a dictionary file in `src/i18n/dictionaries/{locale}/ui.ts`. The name should follow our locale convention.
135135

136-
- language (ISO 639-1 - set 1): https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
136+
- language (ISO 639-1 - set 1): https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
137+
- country code(optional) (ISO 3166-1 alpha-2): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
138+
- E.g.: Canadian French would be: `fr-ca`
137139

138-
- country code (ISO 3166-1 alpha-2): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
139-
140-
- E.g.: Canadian French would be: `fr-ca`
141-
142-
2. Add it to the barrel file: `src/i18n/dictionaries/index.ts`. So it will be identified by the routing system.
143-
144-
3. Add the important UI translations.
145-
146-
> [!TIP]
147-
> To save time, you can use chatGPT to translate the `default.ts` dictionary to the language and adjust based on context.
140+
2. Add the `import` and language information to the objects in the barrel file: `./src/i18n/dictionaries/index.ts`. So it will be identified by the routing system, and an entry its added to the language dropdown.
141+
3. Add the language to the `array` in `./scripts/collections/index.mjs` so internal files are created.
142+
4. Add the important UI translations to `./src/i18n/dictionaries/{locale}/ui.ts`
143+
5. Add at least the index page `./src/routes/{locale}/index.mdx`, so others and yourself could see things in action.
148144

149145
#### Adding translations to a supported language
150146

WRITING.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ But beyond just your written content, there are several other things to consider
2727
#### Tables
2828

2929
Though not used all that often, tables are an important tool for several reasons:
30+
3031
- They break up text.
3132
- They offer clear information to the reader.
3233
- They are easy to look through and understand.
3334

3435
Solid uses Markdown for tables, so here's how to make one.
36+
3537
1. Start with a vertical line, also called a pipe: `|`.
3638
2. Insert your first heading and end with another pipe.
3739
3. Write the next heading and end it with a pipe. Repeat until you have your column headings.
@@ -87,10 +89,10 @@ Start with three back ticks, ```, write your code, then close the block with thr
8789

8890
Here's an example in raw Markdown:
8991

90-
```
92+
````
9193
```bash
9294
npm install
93-
``````
95+
````
9496

9597
Code examples are vital to providing users with quick tips on how to use Solid.
9698
Knowing when to use inline code versus code blocks can further the understanding of the readers and users alike.
@@ -130,7 +132,7 @@ For each additional hash, you go down one heading level.
130132
Here's an example of a Heading 1 (H1) and a Heading 2 (H2) in raw Markdown.
131133

132134
```
133-
# SolidJS documentation
135+
# Solid documentation
134136
135137
## Introduction
136138
```
@@ -174,9 +176,9 @@ We would prefer you to keep page linking in mind while you're working on your co
174176
The following two points are what you should pay attention to:
175177

176178
1. Interlink when you refer to a topic that has its own page.
177-
This makes it possible for the user to easily seek additional information.
179+
This makes it possible for the user to easily seek additional information.
178180
2. Be descriptive with the linked text.
179-
Do not use "click here" or any variation therein, as this is not a best practice for accessibility.
181+
Do not use "click here" or any variation therein, as this is not a best practice for accessibility.
180182

181183
Links are written in Markdown.
182184
Here's an example of what that looks like:
@@ -229,7 +231,7 @@ When writing steps in a how-to section, please start sentences with a verb.
229231
### Accessible
230232

231233
Accessibility has taken a front seat in most aspects of technology in recent years, including documentation.
232-
Solid should be accessible to anyone who wishes to use it, meaning that your writing has to meet some basic standards.
234+
Solid should be accessible to anyone who wishes to use it, meaning that your writing has to meet some basic standards.
233235

234236
Some accessibility comes down to visual style, as we discussed.
235237
However, it goes hand-in-hand with inclusiveness (which we'll get to next), so there is some overlap between the two.
@@ -302,16 +304,16 @@ This is a list of Solid-specific words and what they mean. In the second column,
302304

303305
These are technical; use them with the default assumption that the reader doesn't know what they mean.
304306

305-
| Terms to use | Terms not to use | Definition |
306-
| --- | --- | --- |
307-
| Computation, reactive computation | *Not to be confused with*: computed | A scope that automatically reruns when its dependencies change (it doesn't necessarily _have_ dependencies). |
308-
| Core primitive | API function | A primitive provided by the Solid core library; this typically provides reactive behaviors but not necessarily ( `createContext` does not). |
309-
| Custom primitive | hook | A primitive created outside of the Solid core library; i.e., a function that provides a composable piece of functionality. |
310-
| Ownership, owns | | A one-to-many relationship between computations; if a computation "owns" one or more other computations, all its owned computations are cleaned up when it is cleaned up. |
311-
| Primitive | Hook | A function that serves as a building block of reactivity or behavior. usually begins with `create` or `use`. |
312-
| Reactive value | Signal (don't use to describe a general reactive value) | A value that can be tracked (includes signals, memos, properties of `props` and stores). |
313-
| Reactivity | | A system for writing expressions or behaviors that depend on certain values and execute when those values change. |
314-
| Root | | A computation that has no owner. created by `createRoot`. |
315-
| Scope | *Not to be confused with:* root, effect (specific kinds of scopes) | A body of a function (a chunk of code). |
316-
| Solid | SolidJS (unless outside the community/internal writings) | A JavaScript framework made up of a library (providing primitives and UI utilities) and a compiler (allowing you to write in JSX). Its differentiating feature is its reactivity system. |
317-
| Tracking scope | Tracking context, reactive context, reactive scope, reactive root | A scope that, when run, Solid automatically tracks all read signals |
307+
| Terms to use | Terms not to use | Definition |
308+
| --------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
309+
| Computation, reactive computation | _Not to be confused with_: computed | A scope that automatically reruns when its dependencies change (it doesn't necessarily _have_ dependencies). |
310+
| Core primitive | API function | A primitive provided by the Solid core library; this typically provides reactive behaviors but not necessarily ( `createContext` does not). |
311+
| Custom primitive | hook | A primitive created outside of the Solid core library; i.e., a function that provides a composable piece of functionality. |
312+
| Ownership, owns | | A one-to-many relationship between computations; if a computation "owns" one or more other computations, all its owned computations are cleaned up when it is cleaned up. |
313+
| Primitive | Hook | A function that serves as a building block of reactivity or behavior. usually begins with `create` or `use`. |
314+
| Reactive value | Signal (don't use to describe a general reactive value) | A value that can be tracked (includes signals, memos, properties of `props` and stores). |
315+
| Reactivity | | A system for writing expressions or behaviors that depend on certain values and execute when those values change. |
316+
| Root | | A computation that has no owner. created by `createRoot`. |
317+
| Scope | _Not to be confused with:_ root, effect (specific kinds of scopes) | A body of a function (a chunk of code). |
318+
| Solid | SolidJS (unless outside the community/internal writings) | A JavaScript framework made up of a library (providing primitives and UI utilities) and a compiler (allowing you to write in JSX). Its differentiating feature is its reactivity system. |
319+
| Tracking scope | Tracking context, reactive context, reactive scope, reactive root | A scope that, when run, Solid automatically tracks all read signals |

app.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default defineConfig({
5858
crawlLinks: true,
5959
autoSubfolderIndex: false,
6060
failOnError: true,
61+
// eslint-disable-next-line no-useless-escape
6162
ignore: [/\{\getPath}/, /.*?emojiSvg\(.*/],
6263
},
6364
},
@@ -67,7 +68,7 @@ export default defineConfig({
6768
docsData(),
6869
vinxiMdx.withImports({})({
6970
define: {
70-
"import.meta.env": `'import.meta.env'`,
71+
"import.meta.env": "'import.meta.env'",
7172
},
7273
jsx: true,
7374
jsxImportSource: "solid-js",

env.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,16 @@ interface ImportMetaEnv {
77
interface ImportMeta {
88
readonly env: ImportMetaEnv;
99
}
10+
11+
declare namespace NodeJS {
12+
interface ProcessEnv {
13+
readonly ORAMA_PRIVATE_API_KEY: string;
14+
readonly ORAMA_PRIVATE_INDEX_ID: string;
15+
}
16+
}
17+
18+
declare module "solid:collection" {
19+
// eslint-disable-next-line
20+
const component: any;
21+
export default component;
22+
}

0 commit comments

Comments
 (0)