Skip to content

Commit

Permalink
Bump scaffold (#69)
Browse files Browse the repository at this point in the history
* Bump scaffold

* Revert

* Rectify

* Add eslint-import-resolver-*

* Fix ESLint

* Extends react

---------

Co-authored-by: @compulim <@compulim>
Co-authored-by: William Wong <[email protected]>
  • Loading branch information
compulim-workflow-bot[bot] and compulim authored Oct 13, 2024
1 parent 35ff2d2 commit c34f7d6
Show file tree
Hide file tree
Showing 38 changed files with 248 additions and 67 deletions.
1 change: 1 addition & 0 deletions .eslintrc.jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rules:
react/display-name: off
# Disable for convenience
react/prop-types: off
'@typescript-eslint/no-require-imports': off
11 changes: 9 additions & 2 deletions .eslintrc.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ rules:
import/exports-last: error
import/extensions:
- error
- always
- ignorePackages # eslint-plugin-import does not understand named import
import/first: error
import/newline-after-import: error
import/no-anonymous-default-export: error
import/no-duplicates: error
import/no-namespace: error
import/no-unassigned-import: error
import/no-unassigned-import:
- error
- allow:
- '**/*.css'
- dotenv/config
settings:
import/extensions:
- .cjs
Expand All @@ -41,3 +45,6 @@ settings:
- .mts
- .ts
- .tsx
import/resolver:
node: true
typescript: true
3 changes: 3 additions & 0 deletions .eslintrc.typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ parser: '@typescript-eslint/parser'
plugins:
- '@typescript-eslint'
rules:
# Shortening if-statement into &&, ||, or ternary operators.
'@typescript-eslint/no-unused-expressions': off

'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: ^_
Expand Down
2 changes: 0 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
env:
browser: true
extends:
- eslint:recommended
overrides:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
name: Prepare release

on:
workflow_dispatch: {}
workflow_dispatch:
inputs:
version-to-bump:
default: patch
description: Version to bump
options:
- major
- minor
- patch
required: true
type: choice

jobs:
call-workflow:
Expand All @@ -10,3 +20,5 @@ jobs:
id-token: write
secrets: inherit
uses: compulim/workflows/.github/workflows/prepare-release.yml@main
with:
version-to-bump: ${{ inputs.version-to-bump }}
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Breaking changes
### Removed

- Removed named exports, please import the defaults instead
- 💢 Removed named exports, please import the defaults instead
- Use `import { createChainOfResponsibility } from 'react-chain-of-responsibility'` instead
- `import { createChainOfResponsibilityForFluentUI } from 'react-chain-of-responsibility/fluentUI'` for Fluent UI renderer function
- Moved build tools from Babel to tsup/esbuild
- Outside of `<Provider>`, when `useBuildComponentCallback` and `<Proxy>` is used with `fallbackComponent`, they will render the fallback component and no longer throwing exception

### Added

Expand All @@ -24,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- 💢 Moved build tools from Babel to tsup/esbuild
- 💢 Outside of `<Provider>`, when `useBuildComponentCallback` and `<Proxy>` is used with `fallbackComponent`, they will render the fallback component and no longer throwing exception
- Bumped dependencies, by [@compulim](https://github.com/compulim), in PR [#49](https://github.com/compulim/react-chain-of-responsibility/pull/49), [#58](https://github.com/compulim/react-chain-of-responsibility/pull/58), [#63](https://github.com/compulim/react-chain-of-responsibility/pull/63), and [#67](https://github.com/compulim/react-chain-of-responsibility/pull/67)
- Production dependencies
- [`@babel/[email protected]`](https://npmjs.com/package/@babel/runtime-corejs3)
Expand Down
124 changes: 117 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
],
"scripts": {
"build": "npm run build --if-present --workspaces",
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix && npm run bump:packages && npm run bump:eslintrc",
"bump:auditfix": "npm audit fix || exit 0",
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:packages && npm run bump:eslintrc",
"bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
"bump:eslintrc": "if [ -f node_modules/react/package.json ]; then docker run -e VERSION=$(cat node_modules/react/package.json | jq -r '.version') -i --rm mikefarah/yq '.settings.react.version = strenv(VERSION)' < ./.eslintrc.react.yml | tee /tmp/output.tmp && mv /tmp/output.tmp ./.eslintrc.react.yml; fi",
"bump:packages": "npm run bump --if-present --workspaces",
Expand All @@ -31,6 +30,8 @@
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"eslint": "^8.57.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
Expand Down
9 changes: 9 additions & 0 deletions packages/integration-test/.eslintrc.custom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
env:
browser: true
extends:
- ../../.eslintrc.react.yml
rules:
# Disable for convenience
react/display-name: off
# Disable for convenience
react/prop-types: off
3 changes: 1 addition & 2 deletions packages/integration-test/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
extends:
- ../../.eslintrc.react.yml
- ../../.eslintrc.jest.yml
- ./.eslintrc.custom.yml
5 changes: 2 additions & 3 deletions packages/integration-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
"description": "",
"private": true,
"scripts": {
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix",
"bump:auditfix": "npm audit fix || exit 0",
"bump": "npm run bump:prod && npm run bump:dev",
"bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
"bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
"precommit": "eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./",
"precommit": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./",
"switch": "cat package.json | jq --arg SWITCH_NAME $SWITCH_NAME -r '(.[\"switch:\" + $SWITCH_NAME] // {}) as $TEMPLATE | .devDependencies += ($TEMPLATE.devDependencies // {}) | .dependencies += ($TEMPLATE.dependencies // {})' | tee ./package.json.tmp && mv ./package.json.tmp ./package.json",
"test": "jest"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/integration-test/tsconfig.custom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@tsconfig/strictest/tsconfig.json"
}
3 changes: 2 additions & 1 deletion packages/integration-test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
{
"compilerOptions": {
"jsx": "react"
}
},
"extends": "./tsconfig.custom.json"
}
Empty file.
4 changes: 4 additions & 0 deletions packages/pages/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
env:
browser: true
extends:
- ./.eslintrc.custom.yml
6 changes: 3 additions & 3 deletions packages/pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"private": true,
"scripts": {
"build": "esbuild --bundle --entry-names=[name]/[ext]/main --jsx=automatic --minify --outdir=./public/static/ --sourcemap app=./src/app/index.tsx",
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix",
"bump:auditfix": "npm audit fix || exit 0",
"bump": "npm run bump:prod && npm run bump:dev",
"bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
"bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
"precommit": "npm run precommit:typescript",
"precommit": "npm run precommit:eslint && npm run precommit:typescript",
"precommit:eslint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./src/",
"precommit:typescript": "tsc --project ./src/tsconfig.json",
"reinstall": "rm -r node_modules package-lock.json && npm install",
"start": "npm run build -- --servedir=./public",
Expand Down
12 changes: 6 additions & 6 deletions packages/pages/src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

import DecorationDemo from './decoration/Demo';
import FluentButtonDemo from './fluentButton/Demo';
import FluentDemo from './fluentDetailsList/Demo';
import LinkDecoratorDemo from './linkDecorator/Demo';
import RowCounterDemo from './rowCounter/Demo';
import SimpleDemo from './simple/Demo';
import DecorationDemo from './decoration/Demo.tsx';
import FluentButtonDemo from './fluentButton/Demo.tsx';
import FluentDemo from './fluentDetailsList/Demo.tsx';
import LinkDecoratorDemo from './linkDecorator/Demo.tsx';
import RowCounterDemo from './rowCounter/Demo.tsx';
import SimpleDemo from './simple/Demo.tsx';

const App = () => {
return (
Expand Down
Loading

0 comments on commit c34f7d6

Please sign in to comment.