diff --git a/.prettierignore b/.prettierignore index a0aeab9..916f5db 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,4 @@ build .build dist -example-app \ No newline at end of file +example-app diff --git a/example-app/package-lock.json b/example-app/package-lock.json index ad5371c..6303d67 100644 --- a/example-app/package-lock.json +++ b/example-app/package-lock.json @@ -17,8 +17,8 @@ "@types/react-router": "^5.1.20", "@types/react-router-dom": "^5.3.3", "ionicons": "^7.4.0", - "react": "19.0.0", - "react-dom": "19.0.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", "react-router": "^5.3.4", "react-router-dom": "^5.3.4" }, @@ -28,8 +28,8 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^16.2.0", "@testing-library/user-event": "^14.4.3", - "@types/react": "19.0.10", - "@types/react-dom": "19.0.4", + "@types/react": "^19.0.10", + "@types/react-dom": "^19.0.4", "@vitejs/plugin-legacy": "^5.0.0", "@vitejs/plugin-react": "^4.0.1", "cypress": "^13.5.0", @@ -42,35 +42,36 @@ "terser": "^5.4.0", "typescript": "^5.1.6", "typescript-eslint": "^8.24.0", - "vite": "~5.2.0", + "vite": "^5.2.0", "vitest": "^0.34.6" } }, "..": { "name": "@capacitor/haptics", - "version": "8.0.0-next.2", + "version": "8.0.0-next.3", "license": "MIT", "devDependencies": { "@capacitor/android": "next", "@capacitor/core": "next", - "@capacitor/docgen": "0.2.2", + "@capacitor/docgen": "^0.3.0", "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", - "@ionic/prettier-config": "~1.0.1", - "@ionic/swiftlint-config": "^1.1.2", + "@ionic/prettier-config": "^4.0.0", + "@ionic/swiftlint-config": "^2.0.0", "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^7.1.0", "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^12.0.0", - "@semantic-release/npm": "^13.1.1", + "@semantic-release/github": "^12.0.2", + "@semantic-release/npm": "^13.1.2", + "@types/node": "^24.10.1", "eslint": "^8.57.0", - "prettier": "~2.3.0", - "prettier-plugin-java": "~1.0.2", - "rimraf": "^6.0.1", - "rollup": "^4.26.0", - "semantic-release": "^25.0.1", - "swiftlint": "^1.0.1", - "typescript": "~4.1.5" + "prettier": "^3.6.2", + "prettier-plugin-java": "^2.7.7", + "rimraf": "^6.1.2", + "rollup": "^4.53.3", + "semantic-release": "^25.0.2", + "swiftlint": "^2.0.0", + "typescript": "^5.9.3" }, "peerDependencies": { "@capacitor/core": "next" @@ -114,7 +115,6 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -3269,7 +3269,6 @@ "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -3416,8 +3415,7 @@ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/chai-subset": { "version": "1.3.6", @@ -3547,7 +3545,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.10.tgz", "integrity": "sha512-JuRQ9KXLEjaUNjTWpzuR231Z2WpIwczOkBEIvbHNCzQefFIT0L8IqE6NV6ULLyC1SI/i234JnDoMkfg+RjQj2g==", "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -3558,7 +3555,6 @@ "integrity": "sha512-4fSQ8vWFkg+TGhePfUzVmat3eC14TXYSsiiDSLI0dVLsrm9gZFABjPy/Qu6TKgl1tq1Bu1yDsuQgY3A3DOjCcg==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "^19.0.0" } @@ -3696,7 +3692,6 @@ "integrity": "sha512-tK3GPFWbirvNgsNKto+UmB/cRtn6TZfyw0D6IKrW55n6Vbs7KJoZtI//kpTKzE/DUmmnAFD8/Ca46s7Obs92/w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.46.4", "@typescript-eslint/types": "8.46.4", @@ -4193,7 +4188,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -4784,7 +4778,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5727,7 +5720,6 @@ "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -6004,7 +5996,6 @@ "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -9494,7 +9485,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9504,7 +9494,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz", "integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.25.0" }, @@ -9534,7 +9523,6 @@ "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.12.13", "history": "^4.9.0", @@ -9555,7 +9543,6 @@ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.12.13", "history": "^4.9.0", @@ -10759,7 +10746,6 @@ "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", @@ -11084,7 +11070,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11310,7 +11295,6 @@ "integrity": "sha512-TFQLuwWLPms+NBNlh0D9LZQ+HXW471COABxw/9TEUBrjuHMo9BrYBPrN/SYAwIuVL+rLerycxiLT41t4f5MZpA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.20.1", "postcss": "^8.4.38", diff --git a/example-app/package.json b/example-app/package.json index fd42424..f73e535 100644 --- a/example-app/package.json +++ b/example-app/package.json @@ -21,8 +21,8 @@ "@types/react-router": "^5.1.20", "@types/react-router-dom": "^5.3.3", "ionicons": "^7.4.0", - "react": "19.0.0", - "react-dom": "19.0.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", "react-router": "^5.3.4", "react-router-dom": "^5.3.4" }, @@ -32,8 +32,8 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^16.2.0", "@testing-library/user-event": "^14.4.3", - "@types/react": "19.0.10", - "@types/react-dom": "19.0.4", + "@types/react": "^19.0.10", + "@types/react-dom": "^19.0.4", "@vitejs/plugin-legacy": "^5.0.0", "@vitejs/plugin-react": "^4.0.1", "cypress": "^13.5.0", @@ -46,7 +46,7 @@ "terser": "^5.4.0", "typescript": "^5.1.6", "typescript-eslint": "^8.24.0", - "vite": "~5.2.0", + "vite": "^5.2.0", "vitest": "^0.34.6" }, "overrides": { diff --git a/package.json b/package.json index 41341a6..e1a051e 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format", "eslint": "eslint . --ext ts", - "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", + "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java", "swiftlint": "node-swiftlint", "docgen": "docgen --api HapticsPlugin --output-readme README.md --output-json dist/docs.json", "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", @@ -49,24 +49,25 @@ "devDependencies": { "@capacitor/android": "next", "@capacitor/core": "next", - "@capacitor/docgen": "0.2.2", + "@capacitor/docgen": "^0.3.0", "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", - "@ionic/prettier-config": "~1.0.1", - "@ionic/swiftlint-config": "^1.1.2", + "@ionic/prettier-config": "^4.0.0", + "@ionic/swiftlint-config": "^2.0.0", "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^7.1.0", "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^12.0.0", - "@semantic-release/npm": "^13.1.1", + "@semantic-release/github": "^12.0.2", + "@semantic-release/npm": "^13.1.2", + "@types/node": "^24.10.1", "eslint": "^8.57.0", - "prettier": "~2.3.0", - "prettier-plugin-java": "~1.0.2", - "rimraf": "^6.0.1", - "rollup": "^4.26.0", - "semantic-release": "^25.0.1", - "swiftlint": "^1.0.1", - "typescript": "~4.1.5" + "prettier": "^3.6.2", + "prettier-plugin-java": "^2.7.7", + "rimraf": "^6.1.2", + "rollup": "^4.53.3", + "semantic-release": "^25.0.2", + "swiftlint": "^2.0.0", + "typescript": "^5.9.3" }, "peerDependencies": { "@capacitor/core": "next" diff --git a/src/index.ts b/src/index.ts index 7fa70d0..40351d9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import { registerPlugin } from '@capacitor/core'; import type { HapticsPlugin } from './definitions'; const Haptics = registerPlugin('Haptics', { - web: () => import('./web').then(m => new m.HapticsWeb()), + web: () => import('./web').then((m) => new m.HapticsWeb()), }); export * from './definitions'; diff --git a/src/web.ts b/src/web.ts index 55ed830..d799b62 100644 --- a/src/web.ts +++ b/src/web.ts @@ -1,12 +1,7 @@ import { WebPlugin } from '@capacitor/core'; import { ImpactStyle, NotificationType } from './definitions'; -import type { - HapticsPlugin, - ImpactOptions, - NotificationOptions, - VibrateOptions, -} from './definitions'; +import type { HapticsPlugin, ImpactOptions, NotificationOptions, VibrateOptions } from './definitions'; export class HapticsWeb extends WebPlugin implements HapticsPlugin { selectionStarted = false; @@ -49,9 +44,7 @@ export class HapticsWeb extends WebPlugin implements HapticsPlugin { return [61]; } - private patternForNotification( - type: NotificationType = NotificationType.Success, - ): number[] { + private patternForNotification(type: NotificationType = NotificationType.Success): number[] { if (type === NotificationType.Warning) { return [30, 40, 30, 50, 60]; } else if (type === NotificationType.Error) {