Skip to content

Commit c34f7d6

Browse files
Bump scaffold (#69)
* Bump scaffold * Revert * Rectify * Add eslint-import-resolver-* * Fix ESLint * Extends react --------- Co-authored-by: @compulim <@compulim> Co-authored-by: William Wong <[email protected]>
1 parent 35ff2d2 commit c34f7d6

38 files changed

+248
-67
lines changed

.eslintrc.jest.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ rules:
88
react/display-name: off
99
# Disable for convenience
1010
react/prop-types: off
11+
'@typescript-eslint/no-require-imports': off

.eslintrc.production.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ rules:
2424
import/exports-last: error
2525
import/extensions:
2626
- error
27-
- always
27+
- ignorePackages # eslint-plugin-import does not understand named import
2828
import/first: error
2929
import/newline-after-import: error
3030
import/no-anonymous-default-export: error
3131
import/no-duplicates: error
3232
import/no-namespace: error
33-
import/no-unassigned-import: error
33+
import/no-unassigned-import:
34+
- error
35+
- allow:
36+
- '**/*.css'
37+
- dotenv/config
3438
settings:
3539
import/extensions:
3640
- .cjs
@@ -41,3 +45,6 @@ settings:
4145
- .mts
4246
- .ts
4347
- .tsx
48+
import/resolver:
49+
node: true
50+
typescript: true

.eslintrc.typescript.yml

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ parser: '@typescript-eslint/parser'
44
plugins:
55
- '@typescript-eslint'
66
rules:
7+
# Shortening if-statement into &&, ||, or ternary operators.
8+
'@typescript-eslint/no-unused-expressions': off
9+
710
'@typescript-eslint/no-unused-vars':
811
- error
912
- argsIgnorePattern: ^_

.eslintrc.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
env:
2-
browser: true
31
extends:
42
- eslint:recommended
53
overrides:

.github/workflows/prepare-release.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
name: Prepare release
22

33
on:
4-
workflow_dispatch: {}
4+
workflow_dispatch:
5+
inputs:
6+
version-to-bump:
7+
default: patch
8+
description: Version to bump
9+
options:
10+
- major
11+
- minor
12+
- patch
13+
required: true
14+
type: choice
515

616
jobs:
717
call-workflow:
@@ -10,3 +20,5 @@ jobs:
1020
id-token: write
1121
secrets: inherit
1222
uses: compulim/workflows/.github/workflows/prepare-release.yml@main
23+
with:
24+
version-to-bump: ${{ inputs.version-to-bump }}

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
### Breaking changes
10+
### Removed
1111

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

1816
### Added
1917

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

2523
### Changed
2624

25+
- 💢 Moved build tools from Babel to tsup/esbuild
26+
- 💢 Outside of `<Provider>`, when `useBuildComponentCallback` and `<Proxy>` is used with `fallbackComponent`, they will render the fallback component and no longer throwing exception
2727
- 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)
2828
- Production dependencies
2929
- [`@babel/[email protected]`](https://npmjs.com/package/@babel/runtime-corejs3)

package-lock.json

+117-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
],
1313
"scripts": {
1414
"build": "npm run build --if-present --workspaces",
15-
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix && npm run bump:packages && npm run bump:eslintrc",
16-
"bump:auditfix": "npm audit fix || exit 0",
15+
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:packages && npm run bump:eslintrc",
1716
"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",
1817
"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",
1918
"bump:packages": "npm run bump --if-present --workspaces",
@@ -31,6 +30,8 @@
3130
"@typescript-eslint/eslint-plugin": "^7.4.0",
3231
"@typescript-eslint/parser": "^7.4.0",
3332
"eslint": "^8.57.0",
33+
"eslint-import-resolver-node": "^0.3.9",
34+
"eslint-import-resolver-typescript": "^3.6.3",
3435
"eslint-plugin-import": "^2.31.0",
3536
"eslint-plugin-prettier": "^5.1.3",
3637
"eslint-plugin-react": "^7.34.1",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
env:
2+
browser: true
3+
extends:
4+
- ../../.eslintrc.react.yml
5+
rules:
6+
# Disable for convenience
7+
react/display-name: off
8+
# Disable for convenience
9+
react/prop-types: off
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
extends:
2-
- ../../.eslintrc.react.yml
3-
- ../../.eslintrc.jest.yml
2+
- ./.eslintrc.custom.yml

packages/integration-test/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
"description": "",
55
"private": true,
66
"scripts": {
7-
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix",
8-
"bump:auditfix": "npm audit fix || exit 0",
7+
"bump": "npm run bump:prod && npm run bump:dev",
98
"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",
109
"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",
11-
"precommit": "eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./",
10+
"precommit": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./",
1211
"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",
1312
"test": "jest"
1413
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@tsconfig/strictest/tsconfig.json"
3+
}

packages/integration-test/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
{
33
"compilerOptions": {
44
"jsx": "react"
5-
}
5+
},
6+
"extends": "./tsconfig.custom.json"
67
}

packages/pages/.eslintrc.custom.yml

Whitespace-only changes.

packages/pages/.eslintrc.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
env:
2+
browser: true
3+
extends:
4+
- ./.eslintrc.custom.yml

packages/pages/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"private": true,
66
"scripts": {
77
"build": "esbuild --bundle --entry-names=[name]/[ext]/main --jsx=automatic --minify --outdir=./public/static/ --sourcemap app=./src/app/index.tsx",
8-
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix",
9-
"bump:auditfix": "npm audit fix || exit 0",
8+
"bump": "npm run bump:prod && npm run bump:dev",
109
"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",
1110
"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",
12-
"precommit": "npm run precommit:typescript",
11+
"precommit": "npm run precommit:eslint && npm run precommit:typescript",
12+
"precommit:eslint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./src/",
1313
"precommit:typescript": "tsc --project ./src/tsconfig.json",
1414
"reinstall": "rm -r node_modules package-lock.json && npm install",
1515
"start": "npm run build -- --servedir=./public",

packages/pages/src/app/App.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
22

3-
import DecorationDemo from './decoration/Demo';
4-
import FluentButtonDemo from './fluentButton/Demo';
5-
import FluentDemo from './fluentDetailsList/Demo';
6-
import LinkDecoratorDemo from './linkDecorator/Demo';
7-
import RowCounterDemo from './rowCounter/Demo';
8-
import SimpleDemo from './simple/Demo';
3+
import DecorationDemo from './decoration/Demo.tsx';
4+
import FluentButtonDemo from './fluentButton/Demo.tsx';
5+
import FluentDemo from './fluentDetailsList/Demo.tsx';
6+
import LinkDecoratorDemo from './linkDecorator/Demo.tsx';
7+
import RowCounterDemo from './rowCounter/Demo.tsx';
8+
import SimpleDemo from './simple/Demo.tsx';
99

1010
const App = () => {
1111
return (

0 commit comments

Comments
 (0)