Skip to content

Commit

Permalink
Merge branch 'main' into hatchify
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-coder authored Apr 12, 2024
2 parents 225ee10 + 07a2a94 commit c79d259
Show file tree
Hide file tree
Showing 128 changed files with 7,609 additions and 6,668 deletions.
61 changes: 31 additions & 30 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,38 @@ module.exports = {
'@ephys/eslint-config-typescript/commonjs',
'plugin:mdx/recommended',
],
rules: {
// there are not supported enough in recent browsers to justify enforcing their usage
'prefer-object-has-own': 'off',
'unicorn/prefer-at': 'off',
'unicorn/prefer-string-replace-all': 'off',

'unicorn/prefer-spread': 'off',
'unicorn/no-useless-undefined': 'off',
},
overrides: [{
files: ['*.mdx/**', '*.md/**'],
rules: {
// these rules require proper type-checking and cannot be enabled on code snippets inside markdown files
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/prefer-includes': 'off',
'@typescript-eslint/prefer-readonly': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/consistent-type-exports': 'off',
'@typescript-eslint/prefer-return-this-type': 'off',
overrides: [
{
files: ['*.mdx/**', '*.md/**'],
rules: {
// these rules require proper type-checking and cannot be enabled on code snippets inside markdown files
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/prefer-includes': 'off',
'@typescript-eslint/prefer-readonly': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/consistent-type-exports': 'off',
'@typescript-eslint/prefer-return-this-type': 'off',
},
},
}],
{
files: ['*.d.ts', 'src/pages/*', 'src/theme/**/*'],
rules: {
// in .d.ts files, we don't really have a choice as it's dictated by the file that's being typed.
// For pages and theme files, docusaurus imposes the default export
'import/no-default-export': 'off',
},
},
],
ignorePatterns: [
// archives
'static/v1',
Expand Down
10 changes: 3 additions & 7 deletions .github/ISSUE_TEMPLATE/documentation_issue.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: 📗 Documentation Issue
about: Documentation is unclear, or otherwise insufficient/misleading, examples aren't working as expected
title: ""
labels: ""
assignees: ""
title: ''
labels: ''
assignees: ''
---

## Issue Description
Expand All @@ -14,12 +14,8 @@ Try to be as clear as possible. Don't assume that the maintainers will immediate

### What was unclear/insufficient/not covered in the documentation



### If possible: Provide some suggestion on how we can enhance the docs



### Additional context

<-- Add any other context or screenshots about the issue here. -->
16 changes: 9 additions & 7 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
pull_request:
branches:
- main
push:
branches:
- renovate/** # support automergeType=branch

# This configuration cancels previous runs if a new run is started on the same PR. Only one run at a time per PR.
# From https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value
Expand All @@ -20,13 +23,12 @@ jobs:
node-version: 20.x
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint-no-fix
- run: yarn lint-scss-no-fix
- run: yarn typecheck
- run: yarn test:format
- run: yarn test:typings
- run: yarn sync
- run: yarn build
- name: Deploy to Draft to Netlify
if: '! github.event.pull_request.head.repo.fork'
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref, 'refs/heads/renovate') }}
id: deployment
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand All @@ -36,20 +38,20 @@ jobs:
netlify deploy --dir build --message '${{ github.event.commits[0].message }}' > log.tmp.txt 2>&1
cat log.tmp.txt | grep -E 'Website draft URL:' > log.txt
- name: Read deployment log
if: '! github.event.pull_request.head.repo.fork'
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref, 'refs/heads/renovate') }}
id: logs
uses: juliangruber/read-file-action@v1
with:
path: log.txt
- name: Comment PR with draft publish logs
if: '! github.event.pull_request.head.repo.fork'
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref, 'refs/heads/renovate') }}
id: create-comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
${{ steps.logs.outputs.content }}
- name: Comment debug
if: '! github.event.pull_request.head.repo.fork'
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref, 'refs/heads/renovate') }}
run: |
echo "Comment ID - ${{ steps.create-comment.outputs.comment-id }}"
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
node-version: 20.x
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint-no-fix
- run: yarn typecheck
- run: yarn test:format
- run: yarn test:typings
- run: yarn sync
- run: yarn build
- name: Prepare Netlify dependencies
Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.yarn
static/v5
static/v4
static/v3
static/v2
static/v1
5 changes: 4 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"singleQuote": true
"bracketSameLine": true,
"printWidth": 100,
"singleQuote": true,
"arrowParens": "avoid"
}
2 changes: 2 additions & 0 deletions docs/_fragments/_decorator-info.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ Using legacy decorators requires to use a transpiler such as [TypeScript](https:
[Babel](https://babeljs.io/docs/babel-plugin-proposal-decorators) or others to compile them to JavaScript.
Alternatively, Sequelize also supports [a legacy approach](../other-topics/legacy-model-definitions.mdx) that does not require using decorators, but this is discouraged.

If you're using TypeScript, you will also need to configure it to be able to resolve this export, [see our Getting Started guide](../getting-started.mdx#typescript) for more information.

:::
4 changes: 2 additions & 2 deletions docs/_fragments/_uuid-support-table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { DialectTableFilter } from '@site/src/components/dialect-table-filter.ts
<DialectTableFilter>

| | PostgreSQL | MariaDB | MySQL | MSSQL | SQLite | Snowflake | db2 | ibmi |
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|--------|-----------|-----|------|
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------ | --------- | --- | ---- |
| `uuidV1` | [`uuid_generate_v1`](https://www.postgresql.org/docs/current/uuid-ossp.html) (requires `uuid-ossp`) | [`UUID`](https://mariadb.com/kb/en/uuid/) | [`UUID`](https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid) | N/A | N/A | N/A | N/A | N/A |
| `uuidV4` | __pg >= v13__: [`gen_random_uuid`](https://www.postgresql.org/docs/current/functions-uuid.html) <br/>__pg &lt; v13__: [`uuid_generate_v4`](https://www.postgresql.org/docs/current/uuid-ossp.html) (requires `uuid-ossp`) | N/A | N/A | [`NEWID`](https://learn.microsoft.com/en-us/sql/t-sql/functions/newid-transact-sql?view=sql-server-ver16) | N/A | N/A | N/A | N/A |
| `uuidV4` | **pg >= v13**: [`gen_random_uuid`](https://www.postgresql.org/docs/current/functions-uuid.html) <br/>**pg &lt; v13**: [`uuid_generate_v4`](https://www.postgresql.org/docs/current/uuid-ossp.html) (requires `uuid-ossp`) | N/A | N/A | [`NEWID`](https://learn.microsoft.com/en-us/sql/t-sql/functions/newid-transact-sql?view=sql-server-ver16) | N/A | N/A | N/A | N/A |

</DialectTableFilter>
10 changes: 5 additions & 5 deletions docs/associations/association-scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SELECT * FROM `restaurants` WHERE `restaurants`.`status` = 'open' AND `restauran

## BelongsToMany scope

All associations support specifying a scope to filter the target model, but the `BelongsToMany` association
All associations support specifying a scope to filter the target model, but the `BelongsToMany` association
also supports specifying a scope to filter the join table. This is useful when you want to filter based on extra information
stored in the join table.

Expand All @@ -71,7 +71,7 @@ class Person extends Model {}
class Game extends Model {
/** This association will list everyone that worked on the game */
@BelongsToMany(() => Person, {
through: GameAuthor
through: GameAuthor,
})
allAuthors;
}
Expand All @@ -89,10 +89,10 @@ class Game extends Model {
otherKey: 'personId',
})
allAuthors;

/** This association will list everyone that worked on the game as a programmer */
@BelongsToMany(() => Person, {
through: {
through: {
model: GameAuthor,
foreignKey: 'gameId',
otherKey: 'personId',
Expand All @@ -101,7 +101,7 @@ class Game extends Model {
},
})
programmers;

/** This association will list everyone that worked on the game as a designer */
@BelongsToMany(() => Person, {
through: {
Expand Down
16 changes: 8 additions & 8 deletions docs/associations/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ title: Basics

# Association Basics

Sequelize provides what are called __associations__.
These can be declared on your models to define common [__relationships__](https://en.wikipedia.org/wiki/Cardinality_(data_modeling)) between your tables.
Sequelize provides what are called **associations**.
These can be declared on your models to define common [**relationships**](<https://en.wikipedia.org/wiki/Cardinality_(data_modeling)>) between your tables.

The two concepts are closely related, but not the same. __Associations__ are defined in JavaScript between your _models_, while
__relationships__ are defined in your database between your _tables_.
The two concepts are closely related, but not the same. **Associations** are defined in JavaScript between your _models_, while
**relationships** are defined in your database between your _tables_.

Sequelize supports the standard associations: [One-To-One](https://en.wikipedia.org/wiki/One-to-one_%28data_model%29), [One-To-Many](https://en.wikipedia.org/wiki/One-to-many_%28data_model%29) and [Many-To-Many](https://en.wikipedia.org/wiki/Many-to-many_%28data_model%29).

## One-to-one Relationships

In a One-To-One relationship, a row of one table is associated with a single row of another table.
In a One-To-One relationship, a row of one table is associated with a single row of another table.

The most common type of One-To-One relationship is one where one side is mandatory, and the other side is optional.
For instance, a driving license always belongs to a single person, but a person can have zero or one driving licenses <small>(from the same place)</small>.
Expand All @@ -25,7 +25,7 @@ erDiagram
people ||--o| driving_licenses : drivingLicense
```

One-To-One relationships can be created by using __the [`HasOne`](./has-one.md) association__.
One-To-One relationships can be created by using **the [`HasOne`](./has-one.md) association**.

## One-to-many Relationships

Expand All @@ -38,7 +38,7 @@ erDiagram
people ||--o{ cities : birthplace
```

One-To-Many relationships can be created by using __the [`HasMany`](./has-many.md) association__.
One-To-Many relationships can be created by using **the [`HasMany`](./has-many.md) association**.

## Many-to-many Relationships

Expand All @@ -51,4 +51,4 @@ erDiagram
people }o--o{ toots : likedToots
```

Many-To-Many relationships can be created by using __the [`BelongsToMany`](./belongs-to-many.md) association__.
Many-To-Many relationships can be created by using **the [`BelongsToMany`](./belongs-to-many.md) association**.
Loading

0 comments on commit c79d259

Please sign in to comment.