forked from Doist/typist
-
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
Showing
126 changed files
with
72,425 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,24 @@ | ||
############################################ | ||
# GENERATED BY IGNORE-SYNC, DO NOT EDIT!!! # | ||
# https://github.com/foray1010/ignore-sync # | ||
############################################ | ||
|
||
# Project cache | ||
.cache/ | ||
|
||
# Visual Studio Code | ||
.vscode/ | ||
|
||
# Project output | ||
dist/ | ||
storybook-static/ | ||
|
||
# Project dependencies | ||
node_modules/ | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# Log files | ||
*.log | ||
npm-debug.log* |
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,2 @@ | ||
[local] | ||
.gitignore |
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,71 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true, | ||
jest: true, | ||
}, | ||
globals: { | ||
global: true, | ||
module: true, | ||
}, | ||
ignorePatterns: ['.eslintrc.js'], | ||
plugins: ['unicorn'], | ||
extends: [ | ||
'@doist/eslint-config/recommended-requiring-type-checking', | ||
'@doist/eslint-config/simple-import-sort', | ||
'@doist/eslint-config/react', | ||
], | ||
parserOptions: { | ||
ecmaFeatures: { | ||
impliedStrict: true, | ||
}, | ||
sourceType: 'module', | ||
project: ['./tsconfig.json'], | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
'import/resolver': { | ||
typescript: { | ||
alwaysTryTypes: true, | ||
project: ['./tsconfig.json'], | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
// Rules no longer necessary with the new JSX Transformer | ||
// ref: https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html | ||
'react/jsx-uses-react': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
|
||
// Experimental `eslint-plugin-unicorn` rules | ||
// ref: https://github.com/Doist/eslint-config/issues/46 | ||
'unicorn/throw-new-error': 'error', | ||
'unicorn/prefer-optional-catch-binding': 'error', | ||
}, | ||
overrides: [ | ||
// | ||
{ | ||
files: ['**/*.test.js', '**/*.test.ts'], | ||
plugins: ['jest'], | ||
extends: ['plugin:jest/recommended', 'plugin:jest/style'], | ||
}, | ||
// Disable rules that are pointless for Typescript files (this shouldn't be needed, but for | ||
// some reason `react/prop-types` is being flagged for Typescript files) | ||
{ | ||
files: ['./{src,stories}/**/*.tsx'], | ||
rules: { | ||
'react/prop-types': 'off', | ||
}, | ||
}, | ||
// Disable rules that conflict with Storybook stories and TypeScript typings | ||
{ | ||
files: ['./stories/**/*.{story,stories}.tsx', './typings/**/*.d.ts'], | ||
rules: { | ||
'func-style': 'off', | ||
'import/no-default-export': 'off', | ||
}, | ||
}, | ||
], | ||
} |
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,2 @@ | ||
# Automatic end-of-line normalization for all text files | ||
* text=auto eol=lf |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
{ | ||
"extends": [ | ||
"github>doist/renovate-config:frontend-base", | ||
"github>doist/renovate-config-internal:npm-registry-token" | ||
], | ||
"packageRules": [ | ||
{ | ||
"matchPackagePatterns": ["^@tiptap/"], | ||
"groupName": "tiptap packages" | ||
} | ||
], | ||
"npmrc": "@doist:registry=https://npm.pkg.github.com/\nalways-auth=true\nengine-strict=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,155 @@ | ||
name: CI Validation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
env: | ||
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }} | ||
|
||
concurrency: | ||
group: check-ci-validation-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare-workflow: | ||
name: Prepare Workflow | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version-file: .node-version | ||
|
||
- name: Cache project 'node_modules' directory | ||
uses: actions/cache@v3 | ||
id: node-modules-cache | ||
with: | ||
key: node-modules-cache-${{ hashFiles('**/package-lock.json', '**/.node-version') }} | ||
path: node_modules/ | ||
|
||
- name: Install project npm dependencies | ||
if: ${{ steps.node-modules-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
npm ci | ||
static-code-analysis: | ||
name: Static Code Analysis | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
needs: | ||
- prepare-workflow | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version-file: .node-version | ||
|
||
- name: Cache project 'node_modules' directory | ||
uses: actions/cache@v3 | ||
id: node-modules-cache | ||
with: | ||
key: node-modules-cache-${{ hashFiles('**/package-lock.json', '**/.node-version') }} | ||
path: node_modules/ | ||
|
||
- name: Install project npm dependencies | ||
if: ${{ steps.node-modules-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
npm ci | ||
- name: Analyse code style with Prettier | ||
run: | | ||
npm run prettier:check | ||
- name: Analyse code quality with ESLint | ||
run: | | ||
npm run eslint:check | ||
- name: Perform type checking with TypeScript | ||
run: | | ||
npm run typescript:check | ||
unit-testing: | ||
name: Unit Testing | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
needs: | ||
- prepare-workflow | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version-file: .node-version | ||
|
||
- name: Cache project 'node_modules' directory | ||
uses: actions/cache@v3 | ||
id: node-modules-cache | ||
with: | ||
key: node-modules-cache-${{ hashFiles('**/package-lock.json', '**/.node-version') }} | ||
path: node_modules/ | ||
|
||
- name: Install project npm dependencies | ||
if: ${{ steps.node-modules-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
npm ci | ||
- name: Test codebase correctnesss | ||
run: | | ||
npm run test | ||
build-package: | ||
name: Build Package | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
needs: | ||
- prepare-workflow | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version-file: .node-version | ||
|
||
- name: Cache project 'node_modules' directory | ||
uses: actions/cache@v3 | ||
id: node-modules-cache | ||
with: | ||
key: node-modules-cache-${{ hashFiles('**/package-lock.json', '**/.node-version') }} | ||
path: node_modules/ | ||
|
||
- name: Install project npm dependencies | ||
if: ${{ steps.node-modules-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
npm ci | ||
- name: Build `@doist/typist` package | ||
run: | | ||
npm run build |
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 @@ | ||
name: Semantic Pull Request | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- edited | ||
- opened | ||
- synchronize | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
validate-title: | ||
name: Validate Title | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Validate pull request title | ||
uses: amannn/action-semantic-pull-request@v5 |
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,101 @@ | ||
name: Typist Package Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prepare-workflow: | ||
name: Prepare Workflow | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
if: github.ref == 'refs/heads/main' | ||
|
||
outputs: | ||
main-ci-validation-status: ${{ steps.gh-run-list.outputs.main-ci-validation-status }} | ||
main-ci-validation-conclusion: ${{ steps.gh-run-list.outputs.main-ci-validation-conclusion }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GH_REPO_TOKEN }} | ||
|
||
- name: Get latest 'CI Validation' workflow run status for `main` branch | ||
id: gh-run-list | ||
run: | | ||
LATEST_WORKFLOW_RUN=$(gh run list --branch main --workflow check-ci-validation.yml --limit 1) | ||
echo "main-ci-validation-status=$(echo $LATEST_WORKFLOW_RUN | awk '{print $1}')" >> $GITHUB_OUTPUT | ||
echo "main-ci-validation-conclusion=$(echo $LATEST_WORKFLOW_RUN | awk '{print $2}')" >> $GITHUB_OUTPUT | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release-and-publish: | ||
name: Release & Publish | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
needs: | ||
- prepare-workflow | ||
|
||
if: | | ||
needs.prepare-workflow.outputs.main-ci-validation-status == 'completed' && | ||
needs.prepare-workflow.outputs.main-ci-validation-conclusion == 'success' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GH_REPO_TOKEN }} | ||
|
||
- name: Prepare Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version-file: .node-version | ||
|
||
- name: Cache project 'node_modules' directory | ||
uses: actions/cache@v3 | ||
id: node-modules-cache | ||
with: | ||
key: node-modules-cache-${{ hashFiles('**/package-lock.json', '**/.node-version') }} | ||
path: node_modules/ | ||
|
||
- name: Install project npm dependencies | ||
if: ${{ steps.node-modules-cache.outputs.cache-hit != 'true' }} | ||
run: | | ||
npm ci | ||
- name: Build package | ||
run: | | ||
npm run build | ||
- name: Run automated package publishing | ||
run: | | ||
npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_REPO_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
GIT_AUTHOR_EMAIL: doistbot@users.noreply.github.com | ||
GIT_AUTHOR_NAME: Doist Bot | ||
GIT_COMMITTER_EMAIL: doistbot@users.noreply.github.com | ||
GIT_COMMITTER_NAME: Doist Bot | ||
|
||
validation-failure: | ||
name: Validation Failure | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
needs: | ||
- prepare-workflow | ||
|
||
if: | | ||
needs.prepare-workflow.outputs.main-ci-validation-status != 'completed' || | ||
needs.prepare-workflow.outputs.main-ci-validation-conclusion != 'success' | ||
steps: | ||
- name: Log error message and set failing exit code | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.setFailed("Latest 'CI Validation' workflow for the `main` branch is still running or some checks were not successful.") |
Oops, something went wrong.