-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 10a1416
Showing
17 changed files
with
17,305 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true | ||
}, | ||
extends: [ | ||
'@codingame/eslint-config', | ||
'@codingame/eslint-config-react' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Checks | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-commits: | ||
name: Lint commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# we actually need "github.event.pull_request.commits + 1" commit | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
- run: npm ci | ||
- run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
check: | ||
name: Check build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.10.0 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
- name: Generate release notes preview | ||
id: build-release-notes | ||
uses: guilhermetod/[email protected] | ||
- name: Comment release notes preview | ||
if: steps.build-release-notes.outputs.releaseNotes | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
body: | | ||
## 👋 Hey there! | ||
Thank you for you contribution. Below is a preview of the release notes if your PR gets merged. | ||
Please, make sure it includes all your significant changes with descriptive messages. | ||
Keep in mind that release notes are automatically generated from the commit messages according to [conventional commits](https://www.conventionalcommits.org/). | ||
--- | ||
${{ steps.build-release-notes.outputs.releaseNotes }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Release | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.10.0 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist/* | ||
stats.html | ||
.vscode | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# json-schema-l10n | ||
|
||
This library uses `JSONSchema6` from the library `json-schema`. | ||
|
||
It adds a localization object for the description of the JSON schema. | ||
|
||
## Installation | ||
|
||
```npm | ||
npm install @codingame/json-schema-l10n | ||
``` | ||
|
||
## Implementation | ||
|
||
### Types | ||
|
||
The implemented types are: | ||
|
||
- `Descriptions`: an object that stores the localized descriptions by locale | ||
- `LocalizedJSONSchema`: an interface that extends `JSONSchema6` with localized descriptions added | ||
|
||
### Functions | ||
|
||
The implemented functions are: | ||
|
||
- `getDescriptions`: | ||
- takes in parameters a schema with localized descriptions and optionnaly the locale of the default description (default value is `'en'`) | ||
- returns the localized descriptions of the schema | ||
- `getLocalizedDescription`: | ||
- takes in parameters a schema with localized descriptions, the locale for which we want the description and optionnaly the locale of the default description (default value is `'en'`) | ||
- returns the description for the wanted locale, or `undefined` if not found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@codingame/commitlint-config-codingame'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
Oops, something went wrong.