-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch from yarn to npm * add storybook demo folder to test with a built version of the library * move webpack related code to demo folder * clean up (dev)dependencies of the main package * remove cypress * add github docs & publish workflows * update eslint to muban config, and fix all issues * ignore some eslint rules in the examples folder * remove gsap * export most used types from the package index * move cjs build to /dist/cjs * output declarations in dedicated folder
- Loading branch information
Showing
141 changed files
with
102,422 additions
and
20,568 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 |
---|---|---|
@@ -1,178 +1,12 @@ | ||
var typeScriptSettings = { | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier/@typescript-eslint', | ||
'plugin:prettier/recommended', | ||
'plugin:import/typescript', | ||
'@muban/eslint-config', | ||
], | ||
rules: { | ||
'@typescript-eslint/array-type': ['error', { default: 'generic', readonly: 'generic' }], | ||
'@typescript-eslint/ban-ts-comment': 'error', | ||
'@typescript-eslint/consistent-type-assertions': 'error', | ||
'@typescript-eslint/explicit-member-accessibility': 'error', | ||
'@typescript-eslint/indent': 'off', | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
selector: 'default', | ||
format: ['camelCase'], | ||
leadingUnderscore: 'forbid', | ||
trailingUnderscore: 'forbid', | ||
}, | ||
{ | ||
selector: 'typeLike', | ||
format: ['PascalCase'], | ||
}, | ||
{ | ||
selector: 'variable', | ||
format: ['camelCase', 'UPPER_CASE', 'PascalCase'], | ||
}, | ||
{ | ||
selector: 'enumMember', | ||
format: ['PascalCase'], | ||
}, | ||
{ | ||
selector: 'parameter', | ||
format: ['camelCase', 'PascalCase'], | ||
}, | ||
], | ||
'@typescript-eslint/no-empty-function': 'error', | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true, varsIgnorePattern: "Fragment" }, | ||
], | ||
'no-use-before-define': 'off', | ||
'@typescript-eslint/no-use-before-define': ['error', { functions: false }], | ||
'@typescript-eslint/prefer-interface': 'off', | ||
'@typescript-eslint/prefer-readonly': 'error', | ||
camelcase: 'off', | ||
}, | ||
}; | ||
|
||
const reactSettings = { | ||
// parserOptions: { | ||
// ecmaFeatures: { | ||
// jsx: true, | ||
// }, | ||
// }, | ||
// extends: ['prettier/react'], | ||
// rules: { | ||
// // 'react/jsx-key': 2, | ||
// 'react/jsx-no-comment-textnodes': 2, | ||
// 'react/jsx-no-duplicate-props': 2, | ||
// 'react/jsx-no-target-blank': 2, | ||
// 'react/jsx-no-undef': 2, | ||
// 'react/jsx-uses-react': 2, | ||
// 'react/jsx-uses-vars': 2, | ||
// 'react/jsx-boolean-value': 'error', | ||
// 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }], | ||
// 'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }], | ||
// }, | ||
}; | ||
|
||
const mhtmlSettings = { | ||
extends: ['plugin:lit/recommended', 'plugin:lit-a11y/recommended'], | ||
rules: { | ||
"lit/no-legacy-template-syntax": 'off', | ||
"lit/no-private-properties": 'off', | ||
"lit/no-property-change-update": 'off', | ||
"lit/no-template-map": 'off', | ||
"lit/binding-positions": 'off', | ||
"lit/no-invalid-html": 'off', | ||
|
||
// "lit/attribute-value-entities": 'off', | ||
// "lit/no-duplicate-template-bindings": 'off', | ||
// "lit/no-invalid-escape-sequences": 'off', | ||
// "lit/no-template-arrow": 'off', | ||
// "lit/no-template-bind": 'off', | ||
// "lit/no-value-attribute": 'off', | ||
} | ||
} | ||
|
||
module.exports = { | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.ts", "**/test-utils/**/*.ts"]}] | ||
}, | ||
plugins: ['import', 'unicorn', 'babel', 'react', 'lit', 'lit-a11y'], | ||
env: { | ||
browser: true, | ||
es6: true, | ||
}, | ||
globals: { | ||
require: true, | ||
process: true, | ||
}, | ||
settings: { | ||
react: { | ||
createClass: 'createReactClass', // Regex for Component Factory to use, | ||
// default to "createReactClass" | ||
pragma: 'createElement', // Pragma to use, default to "React" | ||
version: 'detect', // React version. "detect" automatically picks the version you have installed. | ||
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value. | ||
// default to latest and warns if missing | ||
// It will default to "detect" in the future | ||
flowVersion: '0.53', // Flow version | ||
}, | ||
}, | ||
rules: { | ||
'no-console': 'warn', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts'], | ||
...typeScriptSettings, | ||
...mhtmlSettings, | ||
extends: [...typeScriptSettings.extends, ...mhtmlSettings.extends], | ||
rules: { | ||
...typeScriptSettings.rules, | ||
...mhtmlSettings.rules, | ||
}, | ||
}, | ||
{ | ||
files: ['*.tsx'], | ||
...typeScriptSettings, | ||
parserOptions: { | ||
...typeScriptSettings.parserOptions, | ||
...reactSettings.parserOptions, | ||
}, | ||
rules: { | ||
...typeScriptSettings.rules, | ||
...reactSettings.rules, | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
selector: 'default', | ||
format: ['camelCase'], | ||
leadingUnderscore: 'forbid', | ||
trailingUnderscore: 'forbid', | ||
}, | ||
{ | ||
selector: 'typeLike', | ||
format: ['PascalCase'], | ||
}, | ||
{ | ||
selector: 'variable', | ||
// Exception for FunctionComponents | ||
format: ['camelCase', 'PascalCase', 'UPPER_CASE'], | ||
}, | ||
{ | ||
selector: 'function', | ||
// Exception for FunctionComponents | ||
format: ['camelCase', 'PascalCase'], | ||
}, | ||
{ | ||
selector: 'enumMember', | ||
format: ['PascalCase'], | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
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 @@ | ||
# NOTE: taken from https://github.com/MylesBorins/node-osc/blob/main/.github/workflows/bump-version.yml | ||
|
||
name: Bump version, Tag & Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Semver type of new version (major / minor / patch / prerelease)' | ||
required: true | ||
prereleaseid: | ||
description: 'Prerelease id (rc)' | ||
default: '' | ||
|
||
jobs: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Install npm packages | ||
run: npm ci | ||
|
||
- name: Setup Git | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- name: bump version | ||
run: | | ||
npm version ${{ github.event.inputs.version }} --no-git-tag-version --preid ${{ github.event.inputs.prereleaseid }} | ||
git add . | ||
git commit -m "v$(npm pkg get version | tr -d '"')" | ||
git tag $(npm pkg get version | tr -d '"') -m "v$(npm pkg get version | tr -d '"')" | ||
- name: publish | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | ||
npm publish | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Push latest version | ||
run: git push origin main --follow-tags |
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,35 @@ | ||
name: Update Docs | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
update-docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out source | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Install npm packages | ||
run: npm ci | ||
|
||
- name: Build Docs | ||
run: npm run docs:build | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: crazy-max/ghaction-github-pages@v2 | ||
with: | ||
target_branch: gh-pages | ||
build_dir: docs/.vuepress/dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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
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 @@ | ||
14 | ||
16 |
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 @@ | ||
14 | ||
16 |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.