diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..4f78614 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/typescript-node:dev-22-bookworm diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 537ffce..9cfd5aa 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,13 @@ { - "forwardPorts": [8000], - "image": "mcr.microsoft.com/devcontainers/typescript-node", + "build": { + "dockerfile": "Dockerfile" + }, + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "forwardPorts": [ + 8000 + ], "remoteUser": "node", "updateContentCommand": "npm clean-install && npm run build" } diff --git a/.eslintrc.production.yml b/.eslintrc.production.yml index b63635d..5e19a32 100644 --- a/.eslintrc.production.yml +++ b/.eslintrc.production.yml @@ -36,15 +36,15 @@ rules: - '**/*.css' - dotenv/config settings: - import/extensions: - - .cjs - - .mjs - - .js - - .jsx - - .cts - - .mts - - .ts - - .tsx import/resolver: - node: true + node: + extensions: + - .cjs + - .mjs + - .js + - .jsx + - .cts + - .mts + - .ts + - .tsx typescript: true diff --git a/.eslintrc.react.yml b/.eslintrc.react.yml index e746daa..3e6a779 100644 --- a/.eslintrc.react.yml +++ b/.eslintrc.react.yml @@ -1,7 +1,11 @@ extends: - plugin:react/recommended + - plugin:react-hooks/recommended plugins: - react + - react-hooks settings: react: version: 18.3.1 +rules: + react-hooks/refs: off diff --git a/.eslintrc.test.yml b/.eslintrc.test.yml new file mode 100644 index 0000000..0255384 --- /dev/null +++ b/.eslintrc.test.yml @@ -0,0 +1,11 @@ +env: + commonjs: true + es2021: true + es2022: true + jest: true +rules: + # Disable for convenience + react/display-name: off + # Disable for convenience + react/prop-types: off + '@typescript-eslint/no-require-imports': off diff --git a/.eslintrc.yml b/.eslintrc.yml index ddb1c8c..ec49405 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -11,7 +11,7 @@ overrides: - '**/*.mts' - '**/*.ts' - '**/*.tsx' - - extends: .eslintrc.jest.yml + - extends: .eslintrc.test.yml files: - '**/__tests__/**' - '**/*.spec.cjs' diff --git a/.github/workflows/bump-dependencies.yml b/.github/workflows/bump-dependencies.yml index d15d165..7380df8 100644 --- a/.github/workflows/bump-dependencies.yml +++ b/.github/workflows/bump-dependencies.yml @@ -1,4 +1,4 @@ -name: Bump dependencies +name: 🧼 Bump dependencies on: workflow_dispatch: {} @@ -9,6 +9,6 @@ jobs: contents: write id-token: write secrets: - APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} - PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} + WORKFLOW_BOT_APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} + WORKFLOW_BOT_PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} uses: compulim/workflows/.github/workflows/bump-dependencies.yml@main diff --git a/.github/workflows/bump-scaffold.yml b/.github/workflows/bump-scaffold.yml index 3d09428..98ca022 100644 --- a/.github/workflows/bump-scaffold.yml +++ b/.github/workflows/bump-scaffold.yml @@ -1,10 +1,10 @@ -name: Bump scaffold +name: 🧼 Bump scaffold on: workflow_dispatch: inputs: package-name: - default: react-dictate-button + default: 'react-dictate-button' description: Name of the package required: true type: string diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 910c1ba..ba9602f 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -16,9 +16,8 @@ jobs: id-token: write pages: write secrets: - APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} - uses: compulim/workflows/.github/workflows/continuous-deployment.yml@main + WORKFLOW_BOT_APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} + WORKFLOW_BOT_PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} + uses: compulim/workflows/.github/workflows/continuous-deployment-oidc.yml@main with: - package-name: react-dictate-button + package-name: 'react-dictate-button' diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index fc655f0..ad7ba7c 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -1,4 +1,4 @@ -name: Prepare release +name: 🚢 Prepare release on: workflow_dispatch: @@ -19,8 +19,8 @@ jobs: contents: write id-token: write secrets: - APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} - PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} + WORKFLOW_BOT_APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} + WORKFLOW_BOT_PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} uses: compulim/workflows/.github/workflows/prepare-release.yml@main with: version-to-bump: ${{ inputs.version-to-bump }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 855b748..4740209 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -11,10 +11,9 @@ jobs: pages: write id-token: write secrets: - APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} - uses: compulim/workflows/.github/workflows/publish-release.yml@main + WORKFLOW_BOT_APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }} + WORKFLOW_BOT_PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }} + uses: compulim/workflows/.github/workflows/publish-release-oidc.yml@main with: - package-name: react-dictate-button + package-name: 'react-dictate-button' tag: ${{ github.ref_name }} diff --git a/.github/workflows/pull-request-validation.yml b/.github/workflows/pull-request-validation.yml index 82142f0..aa09348 100644 --- a/.github/workflows/pull-request-validation.yml +++ b/.github/workflows/pull-request-validation.yml @@ -14,6 +14,6 @@ jobs: switch: [current, react-16, react-17, react-18] uses: compulim/workflows/.github/workflows/pull-request-validation.yml@main with: - package-name: react-dictate-button + package-name: 'react-dictate-button' skip-integration-test: false switch: ${{ matrix.switch }} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..97b895e --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +ignore-scripts=true diff --git a/.prettierrc.yml b/.prettierrc.yml index 97987e7..46b5589 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1,7 +1,7 @@ arrowParens: avoid +bracketSameLine: false bracketSpacing: true endOfLine: auto -jsxBracketSameLine: false printWidth: 120 proseWrap: preserve quoteProps: as-needed diff --git a/package-lock.json b/package-lock.json index 54ece03..fd06526 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^7.0.1", "prettier": "^3.1.1" } }, @@ -71,6 +72,7 @@ "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.0", @@ -3872,6 +3874,7 @@ "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -4121,6 +4124,7 @@ "integrity": "sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -4132,6 +4136,7 @@ "integrity": "sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "@types/react": "^18.0.0" } @@ -4209,6 +4214,7 @@ "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", @@ -4404,6 +4410,7 @@ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -4948,6 +4955,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", @@ -5717,6 +5725,7 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -5768,6 +5777,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -5931,6 +5941,7 @@ "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -6056,6 +6067,26 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" } }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, "node_modules/eslint-plugin-react/node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -6937,6 +6968,23 @@ "node": ">= 0.4" } }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -9433,6 +9481,7 @@ "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -9689,6 +9738,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -9717,6 +9767,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -10886,6 +10937,7 @@ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -11110,21 +11162,6 @@ "webidl-conversions": "^4.0.2" } }, - "node_modules/tsup/node_modules/yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", - "dev": true, - "license": "ISC", - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -11244,6 +11281,7 @@ "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11629,6 +11667,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/zod": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.2.1.tgz", + "integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + }, "packages/integration-test": { "name": "react-dictate-button-integration-test", "version": "0.0.0-0", @@ -11832,6 +11894,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, + "peer": true, "requires": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.0", @@ -14275,6 +14338,7 @@ "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "dev": true, + "peer": true, "requires": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -14472,6 +14536,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.18.tgz", "integrity": "sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==", "dev": true, + "peer": true, "requires": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -14482,6 +14547,7 @@ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.5.tgz", "integrity": "sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==", "dev": true, + "peer": true, "requires": {} }, "@types/semver": { @@ -14535,6 +14601,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, + "peer": true, "requires": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", @@ -14642,7 +14709,8 @@ "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "dev": true + "dev": true, + "peer": true }, "acorn-jsx": { "version": "5.3.2", @@ -15015,6 +15083,7 @@ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "dev": true, + "peer": true, "requires": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", @@ -15543,6 +15612,7 @@ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", "dev": true, + "peer": true, "requires": { "@esbuild/aix-ppc64": "0.24.2", "@esbuild/android-arm": "0.24.2", @@ -15582,6 +15652,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, + "peer": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -15760,6 +15831,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, + "peer": true, "requires": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -15872,6 +15944,19 @@ } } }, + "eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "requires": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + } + }, "eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -16363,6 +16448,21 @@ "function-bind": "^1.1.2" } }, + "hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true + }, + "hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "requires": { + "hermes-estree": "0.25.1" + } + }, "html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -18086,7 +18186,8 @@ "version": "3.4.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", - "dev": true + "dev": true, + "peer": true }, "prettier-linter-helpers": { "version": "1.0.0", @@ -18245,6 +18346,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "peer": true, "requires": { "loose-envify": "^1.1.0" } @@ -18384,6 +18486,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "peer": true, "requires": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -19200,7 +19303,8 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true + "dev": true, + "peer": true } } }, @@ -19331,14 +19435,6 @@ "tr46": "^1.0.1", "webidl-conversions": "^4.0.2" } - }, - "yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", - "dev": true, - "optional": true, - "peer": true } } }, @@ -19420,7 +19516,8 @@ "version": "5.7.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", - "dev": true + "dev": true, + "peer": true }, "unbox-primitive": { "version": "1.1.0", @@ -19672,6 +19769,20 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "zod": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.2.1.tgz", + "integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==", + "dev": true, + "peer": true + }, + "zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "requires": {} } } } diff --git a/package.json b/package.json index fda4b78..bbbd169 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^7.0.1", "prettier": "^3.1.1" } } diff --git a/packages/integration-test/.eslintrc.custom.yml b/packages/integration-test/.eslintrc.custom.yml index 162435c..48acf78 100644 --- a/packages/integration-test/.eslintrc.custom.yml +++ b/packages/integration-test/.eslintrc.custom.yml @@ -1,9 +1,9 @@ -env: - browser: true -extends: - - ../../.eslintrc.react.yml -rules: - # Disable for convenience - react/display-name: off - # Disable for convenience - react/prop-types: off +env: + browser: true +extends: + - ../../.eslintrc.react.yml +rules: + # Disable for convenience + react/display-name: off + # Disable for convenience + react/prop-types: off diff --git a/packages/integration-test/.eslintrc.yml b/packages/integration-test/.eslintrc.yml index 0f03d05..5fe2114 100644 --- a/packages/integration-test/.eslintrc.yml +++ b/packages/integration-test/.eslintrc.yml @@ -1,7 +1,18 @@ extends: - ./.eslintrc.custom.yml +ignorePatterns: + - test/webDriver/**/dist/** + - test/webDriver/static/** overrides: - env: commonjs: true files: + - '**/*.cjs' - '**/*.js' + rules: + import/no-commonjs: off + - files: + - '**/*.mjs' + parserOptions: + ecmaVersion: latest + sourceType: module diff --git a/packages/integration-test/.gitignore b/packages/integration-test/.gitignore index 936e5c5..a39d331 100644 --- a/packages/integration-test/.gitignore +++ b/packages/integration-test/.gitignore @@ -1,2 +1,3 @@ /node_modules/ /package-lock.json +/test/webDriver/static/ diff --git a/packages/integration-test/docker-compose.yml b/packages/integration-test/docker-compose.yml new file mode 100644 index 0000000..c6dfd76 --- /dev/null +++ b/packages/integration-test/docker-compose.yml @@ -0,0 +1,39 @@ +services: + chromium: + depends_on: + - hub + environment: + SE_ENABLE_TRACING: false + SE_EVENT_BUS_HOST: hub + SE_EVENT_BUS_PUBLISH_PORT: 4442 + SE_EVENT_BUS_SUBSCRIBE_PORT: 4443 + SE_NODE_SESSION_TIMEOUT: 15 + image: selenium/node-chromium:140.0 + shm_size: 2gb + stop_grace_period: 0s + volumes: + - /dev/shm:/dev/shm + + hub: + environment: + GRID_TIMEOUT: 5 + SE_ENABLE_TRACING: false + healthcheck: + interval: 1s + retries: 30 + start_period: 30s + test: ["CMD-SHELL", "curl -s -f http://localhost:4444/wd/hub/status 2>/dev/null | jq '.value.nodes | length > 0' | grep -q true"] + timeout: 10s + image: selenium/hub:4.38 + ports: + - "4444:4444" + stop_grace_period: 0s + + web: + image: nginx:alpine + ports: + - "8080:80" + stop_grace_period: 0s + volumes: + - ./test/webDriver:/usr/share/nginx/html:ro + - ./nginx.conf:/etc/nginx/nginx.conf:ro diff --git a/packages/integration-test/jest.config.json b/packages/integration-test/jest.config.json index 9c305d4..ef4301b 100644 --- a/packages/integration-test/jest.config.json +++ b/packages/integration-test/jest.config.json @@ -1,7 +1,7 @@ { "testMatch": ["**/__tests__/**/*.?([cm])[jt]s?(x)", "**/?(*.)+(spec|test).?([cm])[jt]s?(x)"], "transform": { - "\\.cjsx?$": [ + "\\.c?jsx?$": [ "babel-jest", { "presets": [ diff --git a/packages/integration-test/nginx.conf b/packages/integration-test/nginx.conf new file mode 100644 index 0000000..5b819a9 --- /dev/null +++ b/packages/integration-test/nginx.conf @@ -0,0 +1,35 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; + + types { + application/javascript mjs; + } +} diff --git a/packages/integration-test/package.json b/packages/integration-test/package.json index 1d0310f..0fc66de 100644 --- a/packages/integration-test/package.json +++ b/packages/integration-test/package.json @@ -4,10 +4,15 @@ "description": "", "private": true, "scripts": { + "build": "npm run build:copy && npm run build:custom --if-present", + "build:copy": "mkdir -p ./test/webDriver/static/; SRC=$(node --eval=\"console.log(require('path').resolve(require('resolve-cwd')('react-dictate-button'), '../../dist'))\"); DEST=$(realpath ./test/webDriver/static); rm -rf $DEST; mkdir -p $DEST/js/; cp $SRC/** $DEST/js/", "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", + "docker": "docker compose up --quiet-pull --scale chromium=4", + "posttest": "if test \"$CI\" = \"true\"; then docker compose logs; docker compose down; fi", "precommit": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts ./", + "pretest": "if test \"$CI\" = \"true\"; then npm run build; npm run docker -- --detach --wait; fi", "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/integration-test/tsconfig.json b/packages/integration-test/tsconfig.json index b44fbda..a5f3edc 100644 --- a/packages/integration-test/tsconfig.json +++ b/packages/integration-test/tsconfig.json @@ -1,10 +1,11 @@ // This configuration file is for VSCode only. { "compilerOptions": { - "jsx": "react", - "module": "Preserve", + "allowJs": true, + "module": "esnext", "moduleResolution": "bundler", - "noEmit": true + "noEmit": true, + "target": "esnext" }, "extends": "./tsconfig.custom.json" } diff --git a/packages/pages/package.json b/packages/pages/package.json index 9c07ea4..e6e3a22 100644 --- a/packages/pages/package.json +++ b/packages/pages/package.json @@ -4,7 +4,7 @@ "description": "", "private": true, "scripts": { - "build": "esbuild --bundle --entry-names=[name]/[ext]/main --jsx=transform --minify --outdir=./public/static/ --sourcemap app=./src/index.tsx", + "build": "esbuild --bundle --entry-names=[name]/[ext]/main --jsx=transform --minify --outdir=./public/static/ --sourcemap app=./src/app/index.tsx", "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", @@ -12,7 +12,7 @@ "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", + "start": "npm run build -- --define:IS_DEVELOPMENT=true --servedir=./public --watch", "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" }, "author": "William Wong (https://github.com/compulim)", diff --git a/packages/pages/src/App.tsx b/packages/pages/src/app/App.tsx similarity index 100% rename from packages/pages/src/App.tsx rename to packages/pages/src/app/App.tsx diff --git a/packages/pages/src/DictationTextBox.tsx b/packages/pages/src/app/DictationTextBox.tsx similarity index 100% rename from packages/pages/src/DictationTextBox.tsx rename to packages/pages/src/app/DictationTextBox.tsx diff --git a/packages/pages/src/index.css b/packages/pages/src/app/index.css similarity index 100% rename from packages/pages/src/index.css rename to packages/pages/src/app/index.css diff --git a/packages/pages/src/index.tsx b/packages/pages/src/app/index.tsx similarity index 100% rename from packages/pages/src/index.tsx rename to packages/pages/src/app/index.tsx diff --git a/packages/pages/src/tsconfig.json b/packages/pages/src/tsconfig.json index 017f0c9..f167a59 100644 --- a/packages/pages/src/tsconfig.json +++ b/packages/pages/src/tsconfig.json @@ -3,15 +3,12 @@ "allowImportingTsExtensions": true, "esModuleInterop": true, "jsx": "react", - "lib": [ - "DOM", - "ESNext", - "WebWorker" - ], - "moduleResolution": "Bundler", + "lib": ["DOM", "ESNext", "WebWorker"], + "module": "esnext", + "moduleResolution": "bundler", "noEmit": true, "strict": true, - "target": "ESNext", + "target": "esnext", "types": [] }, "extends": "./tsconfig.custom.json" diff --git a/packages/react-dictate-button/.eslintrc.custom.yml b/packages/react-dictate-button/.eslintrc.custom.yml index 5c9fc4c..e69de29 100644 --- a/packages/react-dictate-button/.eslintrc.custom.yml +++ b/packages/react-dictate-button/.eslintrc.custom.yml @@ -1,2 +0,0 @@ -env: - browser: true diff --git a/packages/react-dictate-button/__tests__/__setup__/typingTestTransformer.js b/packages/react-dictate-button/__tests__/__setup__/typingTestTransformer.js index b8d3ed5..5462b3e 100644 --- a/packages/react-dictate-button/__tests__/__setup__/typingTestTransformer.js +++ b/packages/react-dictate-button/__tests__/__setup__/typingTestTransformer.js @@ -7,13 +7,19 @@ const run = ({ filename }) => { const typeScript = require('typescript'); const TS_EXPECT_ERROR = /(\/\/\s+)(@ts-expect-error)[\s+(.*)]/gu; + /** @type {import('typescript').CompilerOptions} */ const TSCONFIG = { allowImportingTsExtensions: true, allowSyntheticDefaultImports: true, jsx: typeScript.JsxEmit.React, + lib: ['lib.dom.d.ts', 'lib.esnext.d.ts'], + module: typeScript.ModuleKind.ESNext, + moduleResolution: typeScript.ModuleResolutionKind.Bundler, noEmit: true, skipLibCheck: true, - strict: true + strict: true, + target: typeScript.ScriptTarget.ESNext, + types: [] }; async function compile(filename) { diff --git a/packages/react-dictate-button/jest.config.json b/packages/react-dictate-button/jest.config.json index 2d4d678..6deb5c5 100644 --- a/packages/react-dictate-button/jest.config.json +++ b/packages/react-dictate-button/jest.config.json @@ -1,19 +1,31 @@ { + "testEnvironment": "@happy-dom/jest-environment", "testPathIgnorePatterns": ["/__setup__/", "/lib/", "/node_modules/", "/__types__/", "\\.pnp\\.[^\\/]+$"], "transform": { "/__tests__/types/": ["/__tests__/__setup__/typingTestTransformer.js"], - "\\.[jt]sx?$": [ + "\\.m?[jt]sx?$": [ "babel-jest", { - "plugins": [["babel-plugin-transform-define", { "IS_DEVELOPMENT": true }]], "presets": [ - ["@babel/preset-react", { "runtime": "classic" }], - ["@babel/preset-typescript", { "allowDeclareFields": true }], + [ + "@babel/preset-react", + { + "runtime": "classic" + } + ], + [ + "@babel/preset-typescript", + { + "allowDeclareFields": true + } + ], [ "@babel/preset-env", { "modules": "commonjs", - "targets": { "node": "20" } + "targets": { + "node": "20" + } } ] ], diff --git a/packages/react-dictate-button/package.json b/packages/react-dictate-button/package.json index 2cacf8e..e71f912 100644 --- a/packages/react-dictate-button/package.json +++ b/packages/react-dictate-button/package.json @@ -3,6 +3,7 @@ "version": "0.0.0-0", "description": "A button to start dictation using Web Speech API, with an easy to understand event lifecycle.", "files": [ + "./*.js", "./dist/" ], "exports": { @@ -40,7 +41,7 @@ "precommit:typescript:production": "tsc --noEmit --project ./src/tsconfig.precommit.production.json", "precommit:typescript:test": "tsc --noEmit --project ./src/tsconfig.precommit.test.json", "prepack": "cp ../../CHANGELOG.md . && cp ../../LICENSE . && cp ../../README.md .", - "start": "npm run build -- --onSuccess=\"touch ../pages/src/index.jsx ../integration-test/jest.config.json\" --watch", + "start": "npm run build -- --onSuccess \"touch ../pages/package.json\" --watch", "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/react-dictate-button/src/Composer.tsx b/packages/react-dictate-button/src/Composer.tsx index 03a6f18..719a492 100644 --- a/packages/react-dictate-button/src/Composer.tsx +++ b/packages/react-dictate-button/src/Composer.tsx @@ -139,7 +139,7 @@ const Composer = ({ if (stateRef.current !== 'error') { stateRef.current = 'idle'; } - }, [onEndRef, stateRef]); + }, [emitDictate, onEndRef, stateRef]); const emitError = useCallback( event => { diff --git a/packages/react-dictate-button/src/index.spec.ts b/packages/react-dictate-button/src/index.spec.ts index 44d2019..a4b85cd 100644 --- a/packages/react-dictate-button/src/index.spec.ts +++ b/packages/react-dictate-button/src/index.spec.ts @@ -1,3 +1,5 @@ +/// + test('import should work', () => { require('./index'); }); diff --git a/packages/react-dictate-button/src/private/assert.ts b/packages/react-dictate-button/src/private/assert.ts index d522af3..ce5ad3e 100644 --- a/packages/react-dictate-button/src/private/assert.ts +++ b/packages/react-dictate-button/src/private/assert.ts @@ -3,7 +3,7 @@ declare global { } export default function assert(truthy: boolean) { - if (IS_DEVELOPMENT && !truthy) { + if (typeof IS_DEVELOPMENT !== 'undefined' && IS_DEVELOPMENT && !truthy) { throw new Error('Assertion failed.'); } } diff --git a/packages/react-dictate-button/src/tsconfig.json b/packages/react-dictate-button/src/tsconfig.json index b4c9c14..9a7e319 100644 --- a/packages/react-dictate-button/src/tsconfig.json +++ b/packages/react-dictate-button/src/tsconfig.json @@ -9,10 +9,7 @@ "noEmit": true, "strict": true, "target": "ESNext", - "types": [ - "jest", - "node" - ] + "types": ["node"] }, "extends": "./tsconfig.custom.json" } diff --git a/packages/react-dictate-button/src/tsconfig.precommit.production.json b/packages/react-dictate-button/src/tsconfig.precommit.production.json index 68f3ff3..177a039 100644 --- a/packages/react-dictate-button/src/tsconfig.precommit.production.json +++ b/packages/react-dictate-button/src/tsconfig.precommit.production.json @@ -10,12 +10,6 @@ "target": "ESNext", "types": [] }, - "exclude": [ - "**/*.spec.ts", - "**/*.spec.tsx", - "**/*.test.ts", - "**/*.test.tsx", - "__tests__/**/*" - ], + "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "__tests__/**/*"], "extends": "./tsconfig.custom.json" } diff --git a/packages/react-dictate-button/src/tsconfig.precommit.test.json b/packages/react-dictate-button/src/tsconfig.precommit.test.json index 54576c2..85397d5 100644 --- a/packages/react-dictate-button/src/tsconfig.precommit.test.json +++ b/packages/react-dictate-button/src/tsconfig.precommit.test.json @@ -8,17 +8,8 @@ "noEmit": true, "strict": true, "target": "ESNext", - "types": [ - "jest", - "node" - ] + "types": ["node"] }, "extends": "@tsconfig/recommended/tsconfig.json", - "include": [ - "**/*.spec.ts", - "**/*.spec.tsx", - "**/*.test.ts", - "**/*.test.tsx", - "__tests__/**/*" - ] + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "__tests__/**/*"] } diff --git a/packages/react-dictate-button/tsup.config.ts b/packages/react-dictate-button/tsup.config.ts index 9772880..ee1849d 100644 --- a/packages/react-dictate-button/tsup.config.ts +++ b/packages/react-dictate-button/tsup.config.ts @@ -2,13 +2,13 @@ import { defineConfig } from 'tsup'; export default defineConfig([ { - define: { IS_DEVELOPMENT: 'false' }, dts: true, entry: { 'react-dictate-button': './src/index.ts', 'react-dictate-button.internal': './src/internal.ts' }, format: ['cjs', 'esm'], - sourcemap: true + sourcemap: true, + target: 'esnext' } ]);