diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..9c117065b --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn lint-staged +yarn generate diff --git a/.pnp.cjs b/.pnp.cjs index 1211e317e..bc096f514 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -71,12 +71,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["eslint-plugin-react-hooks", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:4.6.0"],\ ["eslint-plugin-react-native", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:4.0.0"],\ ["expo-module-scripts", "npm:3.0.4"],\ - ["husky", "npm:4.3.8"],\ + ["husky", "npm:8.0.3"],\ ["jest", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:29.6.0"],\ ["jest-cli", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:29.6.0"],\ ["lint-staged", "npm:12.5.0"],\ ["metro-react-native-babel-preset", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:0.76.7"],\ ["node-dir", "npm:0.1.17"],\ + ["pinst", "npm:3.0.0"],\ ["prettier", "npm:2.8.1"],\ ["prop-types", "npm:15.8.1"],\ ["react", "npm:18.2.0"],\ @@ -6168,12 +6169,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["eslint-plugin-react-hooks", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:4.6.0"],\ ["eslint-plugin-react-native", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:4.0.0"],\ ["expo-module-scripts", "npm:3.0.4"],\ - ["husky", "npm:4.3.8"],\ + ["husky", "npm:8.0.3"],\ ["jest", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:29.6.0"],\ ["jest-cli", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:29.6.0"],\ ["lint-staged", "npm:12.5.0"],\ ["metro-react-native-babel-preset", "virtual:cce37341f1bd47a997e98e1a7d65a55e905402214e20352cf4048df3a7edd8e59456ea74ef47c4f395a6d5154d4005d441272de1beea6bfd91d8e1d39ae76247#npm:0.76.7"],\ ["node-dir", "npm:0.1.17"],\ + ["pinst", "npm:3.0.0"],\ ["prettier", "npm:2.8.1"],\ ["prop-types", "npm:15.8.1"],\ ["react", "npm:18.2.0"],\ @@ -7177,15 +7179,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["@types/parse-json", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/@types-parse-json-npm-4.0.0-298522afa6-fd6bce2b67.zip/node_modules/@types/parse-json/",\ - "packageDependencies": [\ - ["@types/parse-json", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["@types/prettier", [\ ["npm:2.7.1", {\ "packageLocation": "./.yarn/cache/@types-prettier-npm-2.7.1-d46ada27e6-5e3f58e229.zip/node_modules/@types/prettier/",\ @@ -9616,15 +9609,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["compare-versions", [\ - ["npm:3.6.0", {\ - "packageLocation": "./.yarn/cache/compare-versions-npm-3.6.0-0bb57ed638-7492a50cda.zip/node_modules/compare-versions/",\ - "packageDependencies": [\ - ["compare-versions", "npm:3.6.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["component-emitter", [\ ["npm:1.3.0", {\ "packageLocation": "./.yarn/cache/component-emitter-npm-1.3.0-4b848565b9-b3c46de38f.zip/node_modules/component-emitter/",\ @@ -9746,18 +9730,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["parse-json", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ - }],\ - ["npm:7.1.0", {\ - "packageLocation": "./.yarn/cache/cosmiconfig-npm-7.1.0-13a5090bcd-c53bf7befc.zip/node_modules/cosmiconfig/",\ - "packageDependencies": [\ - ["cosmiconfig", "npm:7.1.0"],\ - ["@types/parse-json", "npm:4.0.0"],\ - ["import-fresh", "npm:3.3.0"],\ - ["parse-json", "npm:5.2.0"],\ - ["path-type", "npm:4.0.0"],\ - ["yaml", "npm:1.10.2"]\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["create-eslint-index", [\ @@ -12027,16 +11999,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["find-versions", [\ - ["npm:4.0.0", {\ - "packageLocation": "./.yarn/cache/find-versions-npm-4.0.0-e4bd62bace-2b4c749dc3.zip/node_modules/find-versions/",\ - "packageDependencies": [\ - ["find-versions", "npm:4.0.0"],\ - ["semver-regex", "npm:3.1.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["find-yarn-workspace-root", [\ ["npm:2.0.0", {\ "packageLocation": "./.yarn/cache/find-yarn-workspace-root-npm-2.0.0-e58a501607-fa5ca8f9d0.zip/node_modules/find-yarn-workspace-root/",\ @@ -12802,20 +12764,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["husky", [\ - ["npm:4.3.8", {\ - "packageLocation": "./.yarn/unplugged/husky-npm-4.3.8-f7cd00e56d/node_modules/husky/",\ + ["npm:8.0.3", {\ + "packageLocation": "./.yarn/cache/husky-npm-8.0.3-b0b59c5127-837bc7e441.zip/node_modules/husky/",\ "packageDependencies": [\ - ["husky", "npm:4.3.8"],\ - ["chalk", "npm:4.1.2"],\ - ["ci-info", "npm:2.0.0"],\ - ["compare-versions", "npm:3.6.0"],\ - ["cosmiconfig", "npm:7.1.0"],\ - ["find-versions", "npm:4.0.0"],\ - ["opencollective-postinstall", "npm:2.0.3"],\ - ["pkg-dir", "npm:5.0.0"],\ - ["please-upgrade-node", "npm:3.2.0"],\ - ["slash", "npm:3.0.0"],\ - ["which-pm-runs", "npm:1.1.0"]\ + ["husky", "npm:8.0.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -16719,15 +16671,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["opencollective-postinstall", [\ - ["npm:2.0.3", {\ - "packageLocation": "./.yarn/cache/opencollective-postinstall-npm-2.0.3-954643c36b-0a68c5cef1.zip/node_modules/opencollective-postinstall/",\ - "packageDependencies": [\ - ["opencollective-postinstall", "npm:2.0.3"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["optionator", [\ ["npm:0.9.1", {\ "packageLocation": "./.yarn/cache/optionator-npm-0.9.1-577e397aae-dbc6fa0656.zip/node_modules/optionator/",\ @@ -17072,6 +17015,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["pinst", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/pinst-npm-3.0.0-5d2b6c1dda-4ae48a6a60.zip/node_modules/pinst/",\ + "packageDependencies": [\ + ["pinst", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["pirates", [\ ["npm:4.0.5", {\ "packageLocation": "./.yarn/cache/pirates-npm-4.0.5-22f8e827ce-c9994e61b8.zip/node_modules/pirates/",\ @@ -17108,14 +17060,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["find-up", "npm:4.1.0"]\ ],\ "linkType": "HARD"\ - }],\ - ["npm:5.0.0", {\ - "packageLocation": "./.yarn/cache/pkg-dir-npm-5.0.0-3ba6768b42-b167bb8dac.zip/node_modules/pkg-dir/",\ - "packageDependencies": [\ - ["pkg-dir", "npm:5.0.0"],\ - ["find-up", "npm:5.0.0"]\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["pkg-up", [\ @@ -17128,16 +17072,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["please-upgrade-node", [\ - ["npm:3.2.0", {\ - "packageLocation": "./.yarn/cache/please-upgrade-node-npm-3.2.0-3f653350ed-d87c41581a.zip/node_modules/please-upgrade-node/",\ - "packageDependencies": [\ - ["please-upgrade-node", "npm:3.2.0"],\ - ["semver-compare", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["plist", [\ ["npm:3.0.6", {\ "packageLocation": "./.yarn/cache/plist-npm-3.0.6-19666ae92c-e21390fab8.zip/node_modules/plist/",\ @@ -18318,24 +18252,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["semver-compare", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/semver-compare-npm-1.0.0-33f7033df0-dd1d7e2909.zip/node_modules/semver-compare/",\ - "packageDependencies": [\ - ["semver-compare", "npm:1.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["semver-regex", [\ - ["npm:3.1.4", {\ - "packageLocation": "./.yarn/cache/semver-regex-npm-3.1.4-e2bca95a0a-3962105908.zip/node_modules/semver-regex/",\ - "packageDependencies": [\ - ["semver-regex", "npm:3.1.4"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["send", [\ ["npm:0.18.0", {\ "packageLocation": "./.yarn/cache/send-npm-0.18.0-faadf6353f-74fc07ebb5.zip/node_modules/send/",\ @@ -20158,15 +20074,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["which-pm-runs", [\ - ["npm:1.1.0", {\ - "packageLocation": "./.yarn/cache/which-pm-runs-npm-1.1.0-1a7fd7650e-39a56ee508.zip/node_modules/which-pm-runs/",\ - "packageDependencies": [\ - ["which-pm-runs", "npm:1.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["wide-align", [\ ["npm:1.1.5", {\ "packageLocation": "./.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5fc37cd56.zip/node_modules/wide-align/",\ diff --git a/package.json b/package.json index 4d76fc703..5d8b810e5 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,12 @@ "unittest:single": "jest --testNamePattern", "lint": "eslint .", "lint:fix": "eslint . --fix", - "prepack": "yarn build:plugin", + "prepack": "pinst --disable && yarn build:plugin", "test:plugin": "jest plugin", "build:plugin": "tsc --build plugin", - "lint:plugin": "eslint plugin/src/*" + "lint:plugin": "eslint plugin/src/*", + "postinstall": "husky install", + "postpack": "pinst --enable" }, "peerDependencies": { "react": ">=16.6.1", @@ -83,12 +85,13 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.0.0", "expo-module-scripts": "^3.0.4", - "husky": "4.3.8", + "husky": "^8.0.0", "jest": "^29.6.0", "jest-cli": "^29.6.0", "lint-staged": "^12.1.2", "metro-react-native-babel-preset": "^0.76.7", "node-dir": "0.1.17", + "pinst": "^3.0.0", "prettier": "^2.0.4", "prop-types": "^15.8.1", "react": "^18.2.0", @@ -113,11 +116,6 @@ "fixtures" ] }, - "husky": { - "hooks": { - "pre-commit": "lint-staged && npm run generate" - } - }, "lint-staged": { "*.{js,jsx,ts,tsx}": "yarn lint" }, diff --git a/yarn.lock b/yarn.lock index ebce000da..a9c452e99 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2721,12 +2721,13 @@ __metadata: eslint-plugin-react-hooks: ^4.6.0 eslint-plugin-react-native: ^4.0.0 expo-module-scripts: ^3.0.4 - husky: 4.3.8 + husky: ^8.0.0 jest: ^29.6.0 jest-cli: ^29.6.0 lint-staged: ^12.1.2 metro-react-native-babel-preset: ^0.76.7 node-dir: 0.1.17 + pinst: ^3.0.0 prettier: ^2.0.4 prop-types: ^15.8.1 react: ^18.2.0 @@ -3579,13 +3580,6 @@ __metadata: languageName: node linkType: hard -"@types/parse-json@npm:^4.0.0": - version: 4.0.0 - resolution: "@types/parse-json@npm:4.0.0" - checksum: fd6bce2b674b6efc3db4c7c3d336bd70c90838e8439de639b909ce22f3720d21344f52427f1d9e57b265fcb7f6c018699b99e5e0c208a1a4823014269a6bf35b - languageName: node - linkType: hard - "@types/prettier@npm:^2.1.5": version: 2.7.1 resolution: "@types/prettier@npm:2.7.1" @@ -5274,13 +5268,6 @@ __metadata: languageName: node linkType: hard -"compare-versions@npm:^3.6.0": - version: 3.6.0 - resolution: "compare-versions@npm:3.6.0" - checksum: 7492a50cdaa2c27f5254eee7c4b38856e1c164991bab3d98d7fd067fe4b570d47123ecb92523b78338be86aa221668fd3868bfe8caa5587dc3ebbe1a03d52b5d - languageName: node - linkType: hard - "component-emitter@npm:^1.2.1": version: 1.3.0 resolution: "component-emitter@npm:1.3.0" @@ -5387,19 +5374,6 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^7.0.0": - version: 7.1.0 - resolution: "cosmiconfig@npm:7.1.0" - dependencies: - "@types/parse-json": ^4.0.0 - import-fresh: ^3.2.1 - parse-json: ^5.0.0 - path-type: ^4.0.0 - yaml: ^1.10.0 - checksum: c53bf7befc1591b2651a22414a5e786cd5f2eeaa87f3678a3d49d6069835a9d8d1aef223728e98aa8fec9a95bf831120d245096db12abe019fecb51f5696c96f - languageName: node - linkType: hard - "create-eslint-index@npm:^1.0.0": version: 1.0.0 resolution: "create-eslint-index@npm:1.0.0" @@ -6979,15 +6953,6 @@ __metadata: languageName: node linkType: hard -"find-versions@npm:^4.0.0": - version: 4.0.0 - resolution: "find-versions@npm:4.0.0" - dependencies: - semver-regex: ^3.1.2 - checksum: 2b4c749dc33e3fa73a457ca4df616ac13b4b32c53f6297bc862b0814d402a6cfec93a0d308d5502eeb47f2c125906e0f861bf01b756f08395640892186357711 - languageName: node - linkType: hard - "find-yarn-workspace-root@npm:^2.0.0": version: 2.0.0 resolution: "find-yarn-workspace-root@npm:2.0.0" @@ -7670,24 +7635,12 @@ __metadata: languageName: node linkType: hard -"husky@npm:4.3.8": - version: 4.3.8 - resolution: "husky@npm:4.3.8" - dependencies: - chalk: ^4.0.0 - ci-info: ^2.0.0 - compare-versions: ^3.6.0 - cosmiconfig: ^7.0.0 - find-versions: ^4.0.0 - opencollective-postinstall: ^2.0.2 - pkg-dir: ^5.0.0 - please-upgrade-node: ^3.2.0 - slash: ^3.0.0 - which-pm-runs: ^1.0.0 +"husky@npm:^8.0.0": + version: 8.0.3 + resolution: "husky@npm:8.0.3" bin: - husky-run: bin/run.js - husky-upgrade: lib/upgrader/bin.js - checksum: ac5e6c72053b2a25532f4137f4b036c9057a4b31980f41c7c2efe05e094d2e06b5c8adc0aafba5c6b70e204ab05d4a916233aec9dffc7a0ccfdd14d4b01c719b + husky: lib/bin.js + checksum: 837bc7e4413e58c1f2946d38fb050f5d7324c6f16b0fd66411ffce5703b294bd21429e8ba58711cd331951ee86ed529c5be4f76805959ff668a337dbfa82a1b0 languageName: node linkType: hard @@ -11175,15 +11128,6 @@ __metadata: languageName: node linkType: hard -"opencollective-postinstall@npm:^2.0.2": - version: 2.0.3 - resolution: "opencollective-postinstall@npm:2.0.3" - bin: - opencollective-postinstall: index.js - checksum: 0a68c5cef135e46d11e665d5077398285d1ce5311c948e8327b435791c409744d4a6bb9c55bd6507fb5f2ef34b0ad920565adcdaf974cbdae701aead6f32b396 - languageName: node - linkType: hard - "optionator@npm:^0.9.1": version: 0.9.1 resolution: "optionator@npm:0.9.1" @@ -11345,7 +11289,7 @@ __metadata: languageName: node linkType: hard -"parse-json@npm:^5.0.0, parse-json@npm:^5.2.0": +"parse-json@npm:^5.2.0": version: 5.2.0 resolution: "parse-json@npm:5.2.0" dependencies: @@ -11498,6 +11442,15 @@ __metadata: languageName: node linkType: hard +"pinst@npm:^3.0.0": + version: 3.0.0 + resolution: "pinst@npm:3.0.0" + bin: + pinst: bin.js + checksum: 4ae48a6a60f79c37071233af51b4d91bfc85cfa3c12b66ccda60cdb642b4d14a4ab0cb3587afc55b1f6192cea1772a5e4822026a0d0d3528296edef00cc2d61f + languageName: node + linkType: hard + "pirates@npm:^4.0.1, pirates@npm:^4.0.4, pirates@npm:^4.0.5": version: 4.0.5 resolution: "pirates@npm:4.0.5" @@ -11533,15 +11486,6 @@ __metadata: languageName: node linkType: hard -"pkg-dir@npm:^5.0.0": - version: 5.0.0 - resolution: "pkg-dir@npm:5.0.0" - dependencies: - find-up: ^5.0.0 - checksum: b167bb8dac7bbf22b1d5e30ec223e6b064b84b63010c9d49384619a36734caf95ed23ad23d4f9bd975e8e8082b60a83395f43a89bb192df53a7c25a38ecb57d9 - languageName: node - linkType: hard - "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -11551,15 +11495,6 @@ __metadata: languageName: node linkType: hard -"please-upgrade-node@npm:^3.2.0": - version: 3.2.0 - resolution: "please-upgrade-node@npm:3.2.0" - dependencies: - semver-compare: ^1.0.0 - checksum: d87c41581a2a022fbe25965a97006238cd9b8cbbf49b39f78d262548149a9d30bd2bdf35fec3d810e0001e630cd46ef13c7e19c389dea8de7e64db271a2381bb - languageName: node - linkType: hard - "plist@npm:^3.0.5": version: 3.0.6 resolution: "plist@npm:3.0.6" @@ -12536,20 +12471,6 @@ __metadata: languageName: node linkType: hard -"semver-compare@npm:^1.0.0": - version: 1.0.0 - resolution: "semver-compare@npm:1.0.0" - checksum: dd1d7e2909744cf2cf71864ac718efc990297f9de2913b68e41a214319e70174b1d1793ac16e31183b128c2b9812541300cb324db8168e6cf6b570703b171c68 - languageName: node - linkType: hard - -"semver-regex@npm:^3.1.2": - version: 3.1.4 - resolution: "semver-regex@npm:3.1.4" - checksum: 3962105908e326aa2cd5c851a2f6d4cc7340d1b06560afc35cd5348d9fa5b1cc0ac0cad7e7cef2072bc12b992c5ae654d9e8d355c19d75d4216fced3b6c5d8a7 - languageName: node - linkType: hard - "semver@npm:7.3.2": version: 7.3.2 resolution: "semver@npm:7.3.2" @@ -14183,13 +14104,6 @@ __metadata: languageName: node linkType: hard -"which-pm-runs@npm:^1.0.0": - version: 1.1.0 - resolution: "which-pm-runs@npm:1.1.0" - checksum: 39a56ee50886fb33ec710e3b36dc9fe3d0096cac44850d9ca0c6186c4cb824d6c8125f013e0562e7c94744e1e8e4a6ab695592cdb12555777c7a4368143d822c - languageName: node - linkType: hard - "which@npm:^1.2.9": version: 1.3.1 resolution: "which@npm:1.3.1" @@ -14397,7 +14311,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^1.10.0, yaml@npm:^1.10.2": +"yaml@npm:^1.10.2": version: 1.10.2 resolution: "yaml@npm:1.10.2" checksum: ce4ada136e8a78a0b08dc10b4b900936912d15de59905b2bf415b4d33c63df1d555d23acb2a41b23cf9fb5da41c256441afca3d6509de7247daa062fd2c5ea5f