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
1 parent
19e04fb
commit 073a789
Showing
26 changed files
with
10,186 additions
and
43 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,3 @@ | ||
{ | ||
"path": "cz-conventional-changelog" | ||
} |
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,13 @@ | ||
; editorconfig.org | ||
root = true | ||
charset= utf8 | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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 |
---|---|---|
@@ -1 +1 @@ | ||
/dist | ||
dist |
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,59 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime', | ||
'eslint:recommended', | ||
'plugin:prettier/recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['import', 'jsx-a11y', 'react', 'react-hooks', '@typescript-eslint', 'prettier'], | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'error', | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/member-delimiter-style': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'import/order': [ | ||
'error', | ||
{ | ||
alphabetize: { | ||
caseInsensitive: true, | ||
order: 'asc', | ||
}, | ||
}, | ||
], | ||
'no-console': 'error', | ||
'no-warning-comments': ['warn', {location: 'start', terms: ['todo', '@todo', 'fixme']}], | ||
'padding-line-between-statements': [ | ||
'warn', | ||
{blankLine: 'always', prev: '*', next: 'block'}, | ||
{blankLine: 'always', prev: '*', next: 'block-like'}, | ||
{blankLine: 'always', prev: 'const', next: 'expression'}, | ||
{blankLine: 'always', prev: 'let', next: 'expression'}, | ||
{blankLine: 'always', prev: 'var', next: 'expression'}, | ||
{blankLine: 'always', prev: 'block', next: '*'}, | ||
{blankLine: 'always', prev: 'block-like', next: '*'}, | ||
{blankLine: 'always', prev: '*', next: 'return'}, | ||
], | ||
'react/prop-types': 'off', | ||
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies | ||
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks | ||
'react/no-unescaped-entities': 'off', | ||
}, | ||
settings: {react: {version: 'detect'}}, | ||
} |
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,50 @@ | ||
name: CI & Release | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
- beta | ||
- alpha | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.platform }} | ||
name: Node.js ${{ matrix.node-version }} / ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest] | ||
node-version: [lts/*, current] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm i pnpm@latest -g | ||
- run: pnpm install | ||
- run: pnpm build | ||
- run: pnpm lint | ||
- run: pnpm test | ||
|
||
release: | ||
name: 'Semantic release' | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Need to fetch entire commit history to | ||
# analyze every commit since last release | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- run: npm i pnpm@latest -g | ||
- run: pnpm install | ||
# Branches that will release new versions are defined in .releaserc.json | ||
- run: pnpm exec semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/dist | ||
/node_modules | ||
.DS_Store | ||
.workshop | ||
dist | ||
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm exec commitlint --edit $1 |
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,6 @@ | ||
{ | ||
"semi": false, | ||
"printWidth": 100, | ||
"bracketSpacing": false, | ||
"singleQuote": true | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Sanity.io | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,14 @@ | ||
'use strict' | ||
|
||
// | ||
// NOTE: this file is only here to make Jest tests run on CI | ||
// This should be removed (along with babel dependencies) when possible | ||
// | ||
|
||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', {modules: 'commonjs'}], | ||
['@babel/preset-react', {runtime: 'automatic'}], | ||
'@babel/preset-typescript', | ||
], | ||
} |
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
|
||
'use strict' | ||
|
||
const {createJestConfig} = require('../../../test/jestConfig') | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
module.exports = createJestConfig({ | ||
displayName: require('./package.json').name, | ||
}) | ||
module.exports = { | ||
moduleFileExtensions: ['cjs', 'js', 'jsx', 'mjs', 'ts', 'tsx'], | ||
modulePathIgnorePatterns: ['<rootDir>/dist/'], | ||
setupFilesAfterEnv: ['<rootDir>/test/setupFilesAfterEnv.ts'], | ||
testRegex: '(/__tests__/.*|\\.test)\\.[jt]sx?$', | ||
transform: { | ||
'\\.[jt]sx?$': [ | ||
'babel-jest', | ||
// rootMode upwards makes use of the global babel.config.js | ||
{rootMode: 'upward'}, | ||
], | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
import {defineConfig} from '@sanity/pkg-utils' | ||
import baseConfig from '../../../package.config' | ||
|
||
export default defineConfig({...baseConfig}) | ||
export default defineConfig({ | ||
extract: { | ||
rules: { | ||
'ae-internal-missing-underscore': 'off', | ||
}, | ||
}, | ||
minify: false, | ||
tsconfig: 'tsconfig.dist.json', | ||
}) |
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
Oops, something went wrong.