Skip to content

Commit

Permalink
Merge branch 'main' into request-event-locals
Browse files Browse the repository at this point in the history
  • Loading branch information
atilafassina authored Sep 27, 2024
2 parents 632448d + faf1ccd commit 00546a3
Show file tree
Hide file tree
Showing 174 changed files with 9,340 additions and 6,653 deletions.
33 changes: 0 additions & 33 deletions .eslintrc.cjs

This file was deleted.

45 changes: 45 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"ignorePatterns": ["node_modules/", "dist/"],
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:solid/typescript"
],
"overrides": [
{
"env": {
"node": true
},
"files": [".eslintrc.{js,cjs}"],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "solid"],
"rules": {
"quotes": ["error", "double"],
"semi": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
}
}
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Thank you for taking the time to open this PR! We appreciate your contribution and effort in helping improve the project. -->

- [ ] I have read the [Contribution guide](https://github.com/solidjs/solid-docs/blob/main/CONTRIBUTING.md)
- [ ] This PR references an issue (except for typos, broken links, or other minor problems)

### Description(required)
<!-- Provide a detailed description of the changes in this PR. Why is it necessary, and what does it do? -->

### Related issues & labels

- Closes #<!-- Add the issue number this PR closes (if applicable). For multiple issues, separate them with commas. Example: #123, #456 -->
- Suggested label(s) (optional): <!-- Suggest any labels that help categorize this PR, such as 'bug', 'enhancement', 'documentation', etc. -->
35 changes: 18 additions & 17 deletions .github/workflows/orama_sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Sync Orama

on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -11,20 +12,20 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- name: Install dependencies
run: pnpm i
- name: Sync Orama
run: pnpm sync:orama
env:
ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }}
ORAMA_PRIVATE_INDEX_ID: ${{ secrets.ORAMA_PRIVATE_INDEX_ID }}
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- name: Install dependencies
run: pnpm i
- name: Sync Orama
run: pnpm sync:orama
env:
ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }}
ORAMA_PRIVATE_INDEX_ID: ${{ secrets.ORAMA_PRIVATE_INDEX_ID }}
71 changes: 71 additions & 0 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: 🔍 Lint / Type Checks

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- run: pnpm i
- uses: actions/cache/save@v4
with:
path: |
node_modules
~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}

typecheck:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- uses: actions/cache/restore@v4
with:
path: |
node_modules
~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Generate virtual modules
run: pnpm sync
- name: TypeScript check
run: pnpm check:types

lint:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- uses: actions/cache/restore@v4
with:
path: |
node_modules
~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: ESLint check
run: pnpm check:lint
20 changes: 8 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,16 @@ Though it is not a hard requirement, we'd deeply appreciate if you could recomme

#### Adding support to a new language

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

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

- country code (ISO 3166-1 alpha-2): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

- E.g.: Canadian French would be: `fr-ca`

2. Add it to the barrel file: `src/i18n/dictionaries/index.ts`. So it will be identified by the routing system.

3. Add the important UI translations.

> [!TIP]
> To save time, you can use chatGPT to translate the `default.ts` dictionary to the language and adjust based on context.
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.
3. Add the language to the `array` in `./scripts/collections/index.mjs` so internal files are created.
4. Add the important UI translations to `./src/i18n/dictionaries/{locale}/ui.ts`
5. Add at least the index page `./src/routes/{locale}/index.mdx`, so others and yourself could see things in action.

#### Adding translations to a supported language

Expand Down
40 changes: 21 additions & 19 deletions WRITING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ But beyond just your written content, there are several other things to consider
#### Tables

Though not used all that often, tables are an important tool for several reasons:

- They break up text.
- They offer clear information to the reader.
- They are easy to look through and understand.

Solid uses Markdown for tables, so here's how to make one.

1. Start with a vertical line, also called a pipe: `|`.
2. Insert your first heading and end with another pipe.
3. Write the next heading and end it with a pipe. Repeat until you have your column headings.
Expand Down Expand Up @@ -87,10 +89,10 @@ Start with three back ticks, ```, write your code, then close the block with thr

Here's an example in raw Markdown:

```
````
```bash
npm install
``````
````

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

```
# SolidJS documentation
# Solid documentation
## Introduction
```
Expand Down Expand Up @@ -174,9 +176,9 @@ We would prefer you to keep page linking in mind while you're working on your co
The following two points are what you should pay attention to:

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

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

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

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

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

| Terms to use | Terms not to use | Definition |
| --- | --- | --- |
| Computation, reactive computation | *Not to be confused with*: computed | A scope that automatically reruns when its dependencies change (it doesn't necessarily _have_ dependencies). |
| Core primitive | API function | A primitive provided by the Solid core library; this typically provides reactive behaviors but not necessarily ( `createContext` does not). |
| Custom primitive | hook | A primitive created outside of the Solid core library; i.e., a function that provides a composable piece of functionality. |
| 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. |
| Primitive | Hook | A function that serves as a building block of reactivity or behavior. usually begins with `create` or `use`. |
| 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). |
| Reactivity | | A system for writing expressions or behaviors that depend on certain values and execute when those values change. |
| Root | | A computation that has no owner. created by `createRoot`. |
| Scope | *Not to be confused with:* root, effect (specific kinds of scopes) | A body of a function (a chunk of code). |
| 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. |
| Tracking scope | Tracking context, reactive context, reactive scope, reactive root | A scope that, when run, Solid automatically tracks all read signals |
| Terms to use | Terms not to use | Definition |
| --------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Computation, reactive computation | _Not to be confused with_: computed | A scope that automatically reruns when its dependencies change (it doesn't necessarily _have_ dependencies). |
| Core primitive | API function | A primitive provided by the Solid core library; this typically provides reactive behaviors but not necessarily ( `createContext` does not). |
| Custom primitive | hook | A primitive created outside of the Solid core library; i.e., a function that provides a composable piece of functionality. |
| 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. |
| Primitive | Hook | A function that serves as a building block of reactivity or behavior. usually begins with `create` or `use`. |
| 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). |
| Reactivity | | A system for writing expressions or behaviors that depend on certain values and execute when those values change. |
| Root | | A computation that has no owner. created by `createRoot`. |
| Scope | _Not to be confused with:_ root, effect (specific kinds of scopes) | A body of a function (a chunk of code). |
| 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. |
| Tracking scope | Tracking context, reactive context, reactive scope, reactive root | A scope that, when run, Solid automatically tracks all read signals |
3 changes: 2 additions & 1 deletion app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default defineConfig({
crawlLinks: true,
autoSubfolderIndex: false,
failOnError: true,
// eslint-disable-next-line no-useless-escape
ignore: [/\{\getPath}/, /.*?emojiSvg\(.*/],
},
},
Expand All @@ -67,7 +68,7 @@ export default defineConfig({
docsData(),
vinxiMdx.withImports({})({
define: {
"import.meta.env": `'import.meta.env'`,
"import.meta.env": "'import.meta.env'",
},
jsx: true,
jsxImportSource: "solid-js",
Expand Down
13 changes: 13 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@ interface ImportMetaEnv {
interface ImportMeta {
readonly env: ImportMetaEnv;
}

declare namespace NodeJS {
interface ProcessEnv {
readonly ORAMA_PRIVATE_API_KEY: string;
readonly ORAMA_PRIVATE_INDEX_ID: string;
}
}

declare module "solid:collection" {
// eslint-disable-next-line
const component: any;
export default component;
}
Loading

0 comments on commit 00546a3

Please sign in to comment.