diff --git a/.eslintrc.react.yml b/.eslintrc.react.yml index 923e17c..e746daa 100644 --- a/.eslintrc.react.yml +++ b/.eslintrc.react.yml @@ -4,4 +4,4 @@ plugins: - react settings: react: - version: 18.2.0 + version: 18.3.1 diff --git a/.github/workflows/pull-request-validation.yml b/.github/workflows/pull-request-validation.yml index b182bdc..39790e0 100644 --- a/.github/workflows/pull-request-validation.yml +++ b/.github/workflows/pull-request-validation.yml @@ -9,11 +9,9 @@ jobs: call-workflow: strategy: matrix: - node-version: [20.x] switch: [current] uses: compulim/workflows/.github/workflows/pull-request-validation.yml@main with: - node-version: ${{ matrix.node-version }} package-name: iter-fest skip-integration-test: false switch: ${{ matrix.switch }} diff --git a/package.json b/package.json index 72fc3c8..09ea0c0 100644 --- a/package.json +++ b/package.json @@ -14,15 +14,15 @@ "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:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", + "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", - "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | 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", "postscaffold": "npm run postscaffold:eslint:react && npm run postscaffold --if-present --workspaces", "postscaffold:eslint:react": "npm run bump:eslintrc", "precommit": "npm run precommit --if-present --workspaces", "switch:_": "npm run --if-present --workspaces switch && npm install --legacy-peer-deps --prefer-dedupe", - "test": "npm run test --if-present --workspaces" + "test": "npm run test --if-present --workspaces" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.4.0", diff --git a/packages/integration-test/package.json b/packages/integration-test/package.json index 722e242..93c5999 100644 --- a/packages/integration-test/package.json +++ b/packages/integration-test/package.json @@ -2,11 +2,12 @@ "name": "iter-fest-integration-test", "version": "0.0.0-0", "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:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", - "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", + "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 ./", "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" diff --git a/packages/iter-fest/__tests__/types/.gitignore b/packages/iter-fest/__tests__/types/.gitignore new file mode 100644 index 0000000..5ad8225 --- /dev/null +++ b/packages/iter-fest/__tests__/types/.gitignore @@ -0,0 +1 @@ +*.tmp.tsx diff --git a/packages/iter-fest/jest.config.json b/packages/iter-fest/jest.config.json index acdf35d..d49d9d7 100644 --- a/packages/iter-fest/jest.config.json +++ b/packages/iter-fest/jest.config.json @@ -1,7 +1,15 @@ { - "testPathIgnorePatterns": ["/__setup__/", "/lib/", "/node_modules/", "/__types__/", "\\.pnp\\.[^\\/]+$"], + "testPathIgnorePatterns": [ + "/__setup__/", + "/lib/", + "/node_modules/", + "/__types__/", + "\\.pnp\\.[^\\/]+$" + ], "transform": { - "/__tests__/types/": ["/__tests__/__setup__/typingTestTransformer.js"], + "/__tests__/types/": [ + "/__tests__/__setup__/typingTestTransformer.js" + ], "\\.[jt]sx?$": [ "babel-jest", { @@ -26,5 +34,7 @@ } ] }, - "watchPathIgnorePatterns": ["\\.tmp\\."] + "watchPathIgnorePatterns": [ + "\\.tmp\\." + ] } diff --git a/packages/iter-fest/package.json b/packages/iter-fest/package.json index 7392374..c2ace45 100644 --- a/packages/iter-fest/package.json +++ b/packages/iter-fest/package.json @@ -230,11 +230,11 @@ "main": "./dist/iter-fest.js", "typings": "./dist/iter-fest.d.ts", "scripts": { - "build": "tsup --config tsup.config.ts", + "build": "tsup", "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix", "bump:auditfix": "npm audit fix || exit 0", - "bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", - "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", + "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:eslint && npm run precommit:typescript:production && npm run precommit:typescript:test", "precommit:eslint": "eslint ./src/", "precommit:typescript:production": "tsc --noEmit --project ./src/tsconfig.precommit.production.json", diff --git a/packages/iter-fest/src/tsconfig.json b/packages/iter-fest/src/tsconfig.json index efce718..ebe1e5a 100644 --- a/packages/iter-fest/src/tsconfig.json +++ b/packages/iter-fest/src/tsconfig.json @@ -2,10 +2,12 @@ { "compilerOptions": { "esModuleInterop": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", + "jsx": "react", + "module": "ESNext", + "moduleResolution": "Bundler", "noEmit": true, - "strict": true + "strict": true, + "target": "ESNext" }, "extends": "@tsconfig/strictest/tsconfig.json" } diff --git a/packages/iter-fest/src/tsconfig.precommit.production.json b/packages/iter-fest/src/tsconfig.precommit.production.json index 1cbac25..40cc24f 100644 --- a/packages/iter-fest/src/tsconfig.precommit.production.json +++ b/packages/iter-fest/src/tsconfig.precommit.production.json @@ -2,10 +2,11 @@ "compilerOptions": { "esModuleInterop": true, "jsx": "react", - "module": "NodeNext", - "moduleResolution": "NodeNext", + "module": "ESNext", + "moduleResolution": "Bundler", "noEmit": true, - "strict": true + "strict": true, + "target": "ESNext" }, "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "__tests__/**/*"], "extends": "@tsconfig/strictest/tsconfig.json" diff --git a/packages/iter-fest/src/tsconfig.precommit.test.json b/packages/iter-fest/src/tsconfig.precommit.test.json index 6fc3084..7f4ffb7 100644 --- a/packages/iter-fest/src/tsconfig.precommit.test.json +++ b/packages/iter-fest/src/tsconfig.precommit.test.json @@ -2,8 +2,8 @@ "compilerOptions": { "esModuleInterop": true, "jsx": "react", - "module": "NodeNext", - "moduleResolution": "NodeNext", + "module": "ESNext", + "moduleResolution": "Bundler", "noEmit": true, "strict": true, "target": "ESNext" diff --git a/packages/pages/package.json b/packages/pages/package.json index a1a071a..bf877fb 100644 --- a/packages/pages/package.json +++ b/packages/pages/package.json @@ -2,12 +2,13 @@ "name": "iter-fest-pages", "version": "0.0.0-0", "description": "", + "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:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", - "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.localPeerDependencies // {}) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | has($K) | not)) | map(.key + \"@latest\") | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", + "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:typescript": "tsc --project ./src/tsconfig.json", "reinstall": "rm -r node_modules package-lock.json && npm install",