{"_id":"@brown-ccv/rn-use-dev-mode","_rev":"2-717efd6538dadda355d030272e2ed0c8","name":"@brown-ccv/rn-use-dev-mode","dist-tags":{"latest":"0.4.2"},"versions":{"0.4.0":{"name":"@brown-ccv/rn-use-dev-mode","version":"0.4.0","description":"A React Native hook that handles enabling a 'developer mode' in response to a certain number of taps from the user.","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/src/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"example":"yarn workspace rn-use-dev-mode-example","test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli lib","prepare":"bob build","release":"release-it"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/brown-ccv/rnutils.git"},"author":{"name":"brown-ccv","email":"galen_winsor@brown.edu","url":"https://github.com/brown-ccv"},"license":"MIT","bugs":{"url":"https://github.com/brown-ccv/rnutils/issues"},"homepage":"https://github.com/brown-ccv/rnutils#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.5.0","@react-native/eslint-config":"^0.72.2","@release-it-plugins/workspaces":"^4.0.0","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","jest":"^28.1.1","react":"17.0.2","react-native":"0.70.0","react-native-builder-bob":"^0.23.1","release-it":"^15.0.0","typescript":"^5.0.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","engines":{"node":">= 18.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it-plugins/workspaces":true,"@release-it/conventional-changelog":{"preset":"angular"}}},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"dependencies":{"react-native-root-toast":"^3.5.1"},"gitHead":"e4861952f98353f84da57c1908c27f27e12a2222","_id":"@brown-ccv/rn-use-dev-mode@0.4.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-TdxxPM4ZGwj5xVpPmI751vuM3cliR2Lk0EBkwCK/NGcnt2Gu0Mj9OG6MkBCvZIpyXQ0YCmdYDiF2h9ABQiofxw==","shasum":"b2a3599f042da12e8ec6deb899c1a0e008234c1c","tarball":"https://registry.npmjs.org/@brown-ccv/rn-use-dev-mode/-/rn-use-dev-mode-0.4.0.tgz","fileCount":10,"unpackedSize":26066,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCenCdzpk989PjYm9ljEk2Als2C+TzG8tF+YYb9E21IpQIgLPk2BEZRPK3QgV3Wqc3IC6BGJDETsJCGYaYNruxfq5c="}]},"_npmUser":{"name":"ccv-bot","email":"ccv-bot@brown.edu"},"directories":{},"maintainers":[{"name":"robert-gemma-jr","email":"gemr1035@gmail.com"},{"name":"galenwinsor","email":"galen_winsor@brown.edu"},{"name":"broarr","email":"bradford_roarr@brown.edu"},{"name":"ccv-bot","email":"ccv-bot@brown.edu"},{"name":"pstey","email":"paul_stey@brown.edu"},{"name":"mcmcgrath13","email":"mary_mcgrath@brown.edu"},{"name":"mirestrepo","email":"maria_restrepo@brown.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rn-use-dev-mode_0.4.0_1698689580903_0.7116475329747245"},"_hasShrinkwrap":false},"0.4.1":{"name":"@brown-ccv/rn-use-dev-mode","version":"0.4.1","description":"A React Native hook that handles enabling a 'developer mode' in response to a certain number of taps from the user.","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/src/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"example":"yarn workspace rn-use-dev-mode-example","test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli lib","prepare":"bob build","release":"release-it"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/brown-ccv/rnutils.git"},"author":{"name":"brown-ccv","email":"galen_winsor@brown.edu","url":"https://github.com/brown-ccv"},"license":"MIT","bugs":{"url":"https://github.com/brown-ccv/rnutils/issues"},"homepage":"https://github.com/brown-ccv/rnutils#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.5.0","@react-native/eslint-config":"^0.72.2","@release-it-plugins/workspaces":"^4.0.0","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","jest":"^28.1.1","react":"17.0.2","react-native":"0.70.0","react-native-builder-bob":"^0.23.1","release-it":"^15.0.0","typescript":"^5.0.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","engines":{"node":">= 18.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it-plugins/workspaces":true,"@release-it/conventional-changelog":{"preset":"angular"}}},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"dependencies":{"react-native-root-toast":"^3.5.1"},"gitHead":"bd022f5b758be8a95c1fc1f924878ef34b9109fa","_id":"@brown-ccv/rn-use-dev-mode@0.4.1","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-KXk6WWV49jVaK55A/0x7kfOqTpTLA0wowP26Ev4lwGG5BjHcq1HS0RpaWWbjU1fekKksftMmjUT+35t7mUfBJA==","shasum":"05e9048e423da3019418f9d55b92037c4d212d56","tarball":"https://registry.npmjs.org/@brown-ccv/rn-use-dev-mode/-/rn-use-dev-mode-0.4.1.tgz","fileCount":10,"unpackedSize":26066,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZ2BAO3mJ66ZLt+X1Wj452Yj4wyh+7nJzWxjfWY0dEDAiEAggnFSHiBNCW/1FIsmDfb68JIezpih96ZYIXnvNSdWN4="}]},"_npmUser":{"name":"ccv-bot","email":"ccv-bot@brown.edu"},"directories":{},"maintainers":[{"name":"robert-gemma-jr","email":"gemr1035@gmail.com"},{"name":"galenwinsor","email":"galen_winsor@brown.edu"},{"name":"broarr","email":"bradford_roarr@brown.edu"},{"name":"ccv-bot","email":"ccv-bot@brown.edu"},{"name":"pstey","email":"paul_stey@brown.edu"},{"name":"mcmcgrath13","email":"mary_mcgrath@brown.edu"},{"name":"mirestrepo","email":"maria_restrepo@brown.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rn-use-dev-mode_0.4.1_1698689788282_0.05928657925465153"},"_hasShrinkwrap":false},"0.4.2":{"name":"@brown-ccv/rn-use-dev-mode","version":"0.4.2","description":"A React Native hook that handles enabling a 'developer mode' in response to a certain number of taps from the user.","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/src/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"example":"yarn workspace rn-use-dev-mode-example","test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli lib","prepare":"bob build","release":"release-it"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/brown-ccv/rnutils.git"},"author":{"name":"brown-ccv","email":"galen_winsor@brown.edu","url":"https://github.com/brown-ccv"},"license":"MIT","bugs":{"url":"https://github.com/brown-ccv/rnutils/issues"},"homepage":"https://github.com/brown-ccv/rnutils#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.5.0","@react-native/eslint-config":"^0.72.2","@release-it-plugins/workspaces":"^4.0.0","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","jest":"^28.1.1","react":"17.0.2","react-native":"0.70.0","react-native-builder-bob":"^0.23.1","release-it":"^15.0.0","typescript":"^5.0.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","engines":{"node":">= 18.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it-plugins/workspaces":true,"@release-it/conventional-changelog":{"preset":"angular"}}},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"dependencies":{"react-native-root-toast":"^3.5.1"},"gitHead":"461c35ea204b73610c89163e1ef3aaad0031c76f","_id":"@brown-ccv/rn-use-dev-mode@0.4.2","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-rbs9tZCkI+cVRrp+RLMMG4c30fEt+BeAJ2dQPZxciIxxaK0NkkHL5hCrKQ3sWkQDyqeTFlzq1DLuTNCp4RHxBg==","shasum":"1820225dc623ea1d98c4de523c08c442de0ea6c1","tarball":"https://registry.npmjs.org/@brown-ccv/rn-use-dev-mode/-/rn-use-dev-mode-0.4.2.tgz","fileCount":10,"unpackedSize":26220,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxwD/Zm+bjiMZzGb7pBAp/bMxHhIhOIqC7dmW3SKlxdwIhAOzXU9R5GzxarAFXv5aUg8rCehNYfmDD5RYACmyxLI6x"}]},"_npmUser":{"name":"ccv-bot","email":"ccv-bot@brown.edu"},"directories":{},"maintainers":[{"name":"robert-gemma-jr","email":"gemr1035@gmail.com"},{"name":"galenwinsor","email":"galen_winsor@brown.edu"},{"name":"broarr","email":"bradford_roarr@brown.edu"},{"name":"ccv-bot","email":"ccv-bot@brown.edu"},{"name":"pstey","email":"paul_stey@brown.edu"},{"name":"mcmcgrath13","email":"mary_mcgrath@brown.edu"},{"name":"mirestrepo","email":"maria_restrepo@brown.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rn-use-dev-mode_0.4.2_1698691056441_0.1607376346757956"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-30T18:13:00.825Z","0.4.0":"2023-10-30T18:13:01.100Z","modified":"2023-10-30T18:37:36.882Z","0.4.1":"2023-10-30T18:16:28.488Z","0.4.2":"2023-10-30T18:37:36.582Z"},"maintainers":[{"name":"robert-gemma-jr","email":"gemr1035@gmail.com"},{"name":"galenwinsor","email":"galen_winsor@brown.edu"},{"name":"broarr","email":"bradford_roarr@brown.edu"},{"name":"ccv-bot","email":"ccv-bot@brown.edu"},{"name":"pstey","email":"paul_stey@brown.edu"},{"name":"mcmcgrath13","email":"mary_mcgrath@brown.edu"},{"name":"mirestrepo","email":"maria_restrepo@brown.edu"}],"description":"A React Native hook that handles enabling a 'developer mode' in response to a certain number of taps from the user.","homepage":"https://github.com/brown-ccv/rnutils#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/brown-ccv/rnutils.git"},"author":{"name":"brown-ccv","email":"galen_winsor@brown.edu","url":"https://github.com/brown-ccv"},"bugs":{"url":"https://github.com/brown-ccv/rnutils/issues"},"license":"MIT","readme":"# @brown-ccv/rn-use-dev-mode\n\nA \"developer mode\" state manager for enabling developer-facing UI during production in React web and native applications.\n\nThe package provides a React `Context` object that keeps track of a count state variable, with an exposed increment function. When the count reaches a provided maximum, the user is asked for a PIN; if that is correct, developer mode is enabled. It's up to the developer how to handle calling the increment function.\n\n## Installation\n\n```sh\nnpm install @brown-ccv/rn-use-dev-mode\n```\n\nor\n\n```sh\nyarn add @brown-ccv/rn-use-dev-mode\n```\n\nor\n\n```sh\npnpm add @brown-ccv/rn-use-dev-mode\n```\n\n## Usage\n\nSee [the documentation](#documentation) for details on exported functions.\n\nIn the root component of your project, import the `DeveloperModeProvider` component and\nwrap it around all parts of the application that need access to the context object:\n\n```js\nimport { DeveloperModeProvider } from \"@brown-ccv/rn-use-dev-mode\";\n\nexport function SomeRootComponent() {\n  // ...\n\n  return (\n    <>\n      <!-- ... -->\n      <DeveloperModeProvider maxCount={10} pin={\"1234\"}>\n        <SomeChild />\n      </DeveloperModeProvider>\n      <!-- ... -->\n    </>\n  );\n}\n```\n\nIn child components, import the `useDeveloperMode` hook:\n\n```js\nimport { useDeveloperMode } from \"@brown-ccv/rn-use-dev-mode\";\n\nexport function SomeChild() {\n  // ...\n\n  const { devMode, count, incrementCount } = useDeveloperMode();\n\n  // ...\n\n  return (\n    <>\n      <p>Count: {count}</p>\n      <button onClick={incrementCount}>Increment</button>\n      <p>{devMode ? \"Dev mode is enabled!\" : \"Dev mode is disabled\"}</p>\n    </>\n  );\n}\n```\n\n## Documentation\n\nThe developer mode `Context` object has the following structure:\n\n- `devMode`: a `boolean`, whether or not developer mode is enabled.\n- `count`: a `number`; when `count` reaches a given value, the user is prompted for the PIN.\n- `incrementCount`: a function that, when called, increments `count` by one.\n\nTo access the `Context`, the package exports two functions:\n\n### `DeveloperModeProvider`\n\nA component which returns a [React `Context.Provider`](https://react.dev/reference/react/createContext#provider) and accepts any valid React children.\n\n#### Props\n\n- `maxCount`: When `count` reaches this value, developer mode is enabled.\n\n#### Returns\n\nAll children of this component can call `useDeveloperMode` to access [the developer mode `Context` object](#usage).\n\n### `useDeveloperMode`\n\nA hook that returns the current `value` of the [`Context`](#usage).\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","readmeFilename":"README.md"}