Skip to content

Commit

Permalink
Rewrite a build process. Use external bundler grisaia-package-builder…
Browse files Browse the repository at this point in the history
…. Reduce scripts and config amount. Fix eslint + prettier setup. Fix global types declarations.
  • Loading branch information
Liakhovskyi Vladyslav committed Sep 14, 2023
1 parent 055d4dd commit ea3074d
Show file tree
Hide file tree
Showing 43 changed files with 9,352 additions and 8,472 deletions.
18 changes: 9 additions & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
2 changes: 1 addition & 1 deletion .changeset/dirty-timers-push.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"react-grecaptcha-v3": patch
'react-grecaptcha-v3': patch
---

Reduce complexity of build process. Gracefully reduce amount of dependenciec and package.json file size.
2 changes: 1 addition & 1 deletion .changeset/friendly-spiders-collect.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"react-grecaptcha-v3": patch
'react-grecaptcha-v3': patch
---

Reduced .eslintrc config size
2 changes: 1 addition & 1 deletion .changeset/heavy-pears-cover.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"react-grecaptcha-v3": patch
'react-grecaptcha-v3': patch
---

Unnecesarry config removed.
2 changes: 1 addition & 1 deletion .changeset/itchy-ligers-hammer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"react-grecaptcha-v3": patch
'react-grecaptcha-v3': patch
---

Reduce scripts amount. Be eloquent in this question.
2 changes: 1 addition & 1 deletion .changeset/perfect-pears-do.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"react-grecaptcha-v3": patch
'react-grecaptcha-v3': patch
---

Upgrade rimraf
2 changes: 1 addition & 1 deletion .changeset/slimy-cycles-burn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"react-grecaptcha-v3": patch
'react-grecaptcha-v3': patch
---

Fixed typo in Readme
76 changes: 36 additions & 40 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
{
"ignorePatterns": [
"node_modules/",
"dist/",
"coverage/",
"benchmark/",
"scripts/",
"docs/"
],
"parserOptions": {
"project": ["./tsconfig.json","./__tests__/tsconfig.json"]
},
"extends": ["eslint-config-grisaia-react", "eslint-config-grisaia-typescript","prettier"],
"plugins": [ "prettier"],
"rules": {
"no-console": [
"error",
{
"allow": ["warn", "error"]
}
"ignorePatterns": [
"node_modules/",
"dist/",
"coverage/",
"benchmark/",
"scripts/",
"docs/"
],
"prettier/prettier": [
"error",
{
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "es5"
}
"parserOptions": {
"project": ["./tsconfig.json", "./__tests__/tsconfig.json"]
},
"extends": [
"eslint-config-grisaia-react",
"eslint-config-grisaia-typescript",
"prettier"
],
"plugins": ["prettier"],
"rules": {
"no-console": [
"error",
{
"allow": ["warn", "error"]
}
]
},
"overrides": [
{
"files": ["*.test.ts", "*.test.tsx", "*.spec.ts", "*.spec.tsx"],
"globals": {
"vi": true
},
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"react-hooks/rules-of-hooks": "off",
"react-hooks/exhaustive-deps": "off"
}
}
]
},
"overrides": [
{
"files": ["*.test.ts", "*.test.tsx", "*.spec.ts", "*.spec.tsx"],
"globals": {
"vi": true
},
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"react-hooks/rules-of-hooks": "off",
"react-hooks/exhaustive-deps": "off"
}
}
]
}
88 changes: 44 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
name: CI
on:
push:
branches: [main]
pull_request:
push:
branches: [main]
pull_request:
permissions:
contents: read # to fetch code (actions/checkout)
contents: read # to fetch code (actions/checkout)

env:
# We only install Chromium manually
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
# We only install Chromium manually
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'

jobs:
Tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
include:
- node-version: 16
os: ubuntu-latest
- node-version: 16
os: windows-latest
- node-version: 16
os: macOS-latest
- node-version: 18
os: ubuntu-latest
- node-version: 20
os: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test
env:
CI: true
Lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
- run: 'pnpm i && pnpm lint && pnpm test'
Tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
include:
- node-version: 16
os: ubuntu-latest
- node-version: 16
os: windows-latest
- node-version: 16
os: macOS-latest
- node-version: 18
os: ubuntu-latest
- node-version: 20
os: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test
env:
CI: true
Lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
- run: 'pnpm i && pnpm lint && pnpm test'
68 changes: 34 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Release

on:
push:
branches:
- main
push:
branches:
- main

permissions: {}
jobs:
release:
# prevents this action from running on forks
if: github.repository == 'RustedLabs/react-grecaptcha-v3'
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
id-token: write
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/[email protected]
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: pnpm
release:
# prevents this action from running on forks
if: github.repository == 'RustedLabs/react-grecaptcha-v3'
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
id-token: write
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/[email protected]
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true,
"arrowParens": "avoid"
}
Loading

0 comments on commit ea3074d

Please sign in to comment.