{"_id":"@code0312/deploy1-ben-tsdx","name":"@code0312/deploy1-ben-tsdx","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"version":"0.1.0","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test --passWithNoTests","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{"react":">=16"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@code0312/deploy1-ben-tsdx","author":{"name":"Ben"},"module":"dist/deploy1-ben-test.esm.js","size-limit":[{"path":"dist/deploy1-ben-test.cjs.production.min.js","limit":"10 KB"},{"path":"dist/deploy1-ben-test.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^8.2.4","@types/react":"^18.0.35","@types/react-dom":"^18.0.11","husky":"^8.0.3","react":"^18.2.0","react-dom":"^18.2.0","size-limit":"^8.2.4","tsdx":"^0.14.1","tslib":"^2.5.0","typescript":"^5.0.4"},"description":"Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.","_id":"@code0312/deploy1-ben-tsdx@0.1.0","_nodeVersion":"19.6.0","_npmVersion":"9.4.0","dist":{"integrity":"sha512-LijFz9Rk+Le1TBs/39soq4QBDYYjUR9bDLvL/2WcAQFRvgsygvUjTQP0VtV9RyxuOol1dvXfGVQk0oh2seDW4w==","shasum":"99da6a5b4369dcf9fcac65cbfedd0f38a22c7cf4","tarball":"https://registry.npmjs.org/@code0312/deploy1-ben-tsdx/-/deploy1-ben-tsdx-0.1.0.tgz","fileCount":12,"unpackedSize":10781,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDP3KJqluXJkF7XvBBSq+MBmprLAp34eusb6do4gvQ1AwIgdwgngf/VhpkHBikct6M70mSajI4DVXxkXs9ORIra4lI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPXGFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9GA//aS5Iukt3ANpr8VS3fmwdLt2eGiuxcCXWIH1ELF8/ZCgHijch\r\nOonyVLpHzu0CE4Lz+Dwvq8f56MLZ3HrC8H6E87+p30mt1cZVaQpLmcqKDe+g\r\notrWQySa8ddMNH+AMtXTMIYIN7gt4mXr4MV5aXBI+28/c79y/aAbo8p7ho/x\r\n5ORL69gqTW+OrLD7h4zJbOqvBvZM8Be5BMV2Dfyv8z3xU/7KS5lC69H7e0Vr\r\nGFY+m9fSv6i4zhtAOZhc31aO2fjmHO6JLLWukElIox90ScyIbwSCeJ6SLzsw\r\nWko81SXE7IdJyZ/Jo0pl0Yk2xMj1p+Kp6W6EARCy7GlRUqHdWZV2JcSw0fQH\r\n6G4VuORv1Ctj+lEqxLk0MpyaYvUlr/JVmh6bt/PfkPhKtN9gFvR2y+0+SGSy\r\nvX+8v3+6vcszI6xZ6hdZm/9qQK2eMrW6W7zHMjwuJ3GjB+qYJskbiW8PXKVD\r\n3oGHIf5HRznbBVbnnWgEYq9EvwjEvmtkDWbKzEajukI4kxH5eJxY0F6jCo0M\r\n+LEBME7aB3I0m8CTrE++xzzWTUq2oo3uJ9v91/6c/GAFO45vjqLR1WkmRGYR\r\nJOawjMT2jDk216XcPG2bkOR6qpoyzN+QitSJyPRN0bdKuT9UeN8Z7U0Doio/\r\nhLPn++kCdT5zPHjk7Iw60yyblWCDPI7SM0M=\r\n=WAjj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"code0312","email":"code0312@gmail.com"},"directories":{},"maintainers":[{"name":"code0312","email":"code0312@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deploy1-ben-tsdx_0.1.0_1681748356982_0.3727673408828698"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-17T16:19:16.923Z","0.1.0":"2023-04-17T16:19:17.129Z","modified":"2023-04-17T16:19:17.345Z"},"maintainers":[{"name":"code0312","email":"code0312@gmail.com"}],"description":"Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.","author":{"name":"Ben"},"license":"MIT","readme":"# TSDX React User Guide\n\nCongrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.\n\n> This TSDX setup is meant for developing React component libraries (not apps!) that can be published to NPM. If you’re looking to build a React-based app, you should use `create-react-app`, `razzle`, `nextjs`, `gatsby`, or `react-static`.\n\n> If you’re new to TypeScript and React, checkout [this handy cheatsheet](https://github.com/sw-yx/react-typescript-cheatsheet/)\n\n## Commands\n\nTSDX scaffolds your new library inside `/src`, and also sets up a [Parcel-based](https://parceljs.org) playground for it inside `/example`.\n\nThe recommended workflow is to run TSDX in one terminal:\n\n```bash\nnpm start # or yarn start\n```\n\nThis builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.\n\nThen run the example inside another:\n\n```bash\ncd example\nnpm i # or yarn to install dependencies\nnpm start # or yarn start\n```\n\nThe default example imports and live reloads whatever is in `/dist`, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. **No symlinking required**, we use [Parcel's aliasing](https://parceljs.org/module_resolution.html#aliases).\n\nTo do a one-off build, use `npm run build` or `yarn build`.\n\nTo run tests, use `npm test` or `yarn test`.\n\n## Configuration\n\nCode quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.\n\n### Jest\n\nJest tests are set up to run with `npm test` or `yarn test`.\n\n### Bundle analysis\n\nCalculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `npm run size` and visulize it with `npm run analyze`.\n\n#### Setup Files\n\nThis is the folder structure we set up for you:\n\n```txt\n/example\n  index.html\n  index.tsx       # test your component here in a demo app\n  package.json\n  tsconfig.json\n/src\n  index.tsx       # EDIT THIS\n/test\n  blah.test.tsx   # EDIT THIS\n.gitignore\npackage.json\nREADME.md         # EDIT THIS\ntsconfig.json\n```\n\n#### React Testing Library\n\nWe do not set up `react-testing-library` for you yet, we welcome contributions and documentation on this.\n\n### Rollup\n\nTSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.\n\n### TypeScript\n\n`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.\n\n## Continuous Integration\n\n### GitHub Actions\n\nTwo actions are added by default:\n\n- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix\n- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)\n\n## Optimizations\n\nPlease see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:\n\n```js\n// ./types/index.d.ts\ndeclare var __DEV__: boolean;\n\n// inside your code...\nif (__DEV__) {\n  console.log('foo');\n}\n```\n\nYou can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.\n\n## Module Formats\n\nCJS, ESModules, and UMD module formats are supported.\n\nThe appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.\n\n## Deploying the Example Playground\n\nThe Playground is just a simple [Parcel](https://parceljs.org) app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for **manually** deploying with the Netlify CLI (`npm i -g netlify-cli`):\n\n```bash\ncd example # if not already in the example folder\nnpm run build # builds to dist\nnetlify deploy # deploy the dist folder\n```\n\nAlternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify:\n\n```bash\nnetlify init\n# build command: yarn build && cd example && yarn && yarn build\n# directory to deploy: example/dist\n# pick yes for netlify.toml\n```\n\n## Named Exports\n\nPer Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.\n\n## Including Styles\n\nThere are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.\n\nFor vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.\n\n## Publishing to NPM\n\nWe recommend using [np](https://github.com/sindresorhus/np).\n\n## Usage with Lerna\n\nWhen creating a new package with TSDX within a project set up with Lerna, you might encounter a `Cannot resolve dependency` error when trying to run the `example` project. To fix that you will need to make changes to the `package.json` file _inside the `example` directory_.\n\nThe problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's `package.json` might not point to the right place, as those dependencies might have been installed in the root of your Lerna project.\n\nChange the `alias` to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below.\n\n```diff\n   \"alias\": {\n-    \"react\": \"../node_modules/react\",\n-    \"react-dom\": \"../node_modules/react-dom\"\n+    \"react\": \"../../../node_modules/react\",\n+    \"react-dom\": \"../../../node_modules/react-dom\"\n   },\n```\n\nAn alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. [However, that might cause other problems.](https://github.com/palmerhq/tsdx/issues/64)\n","readmeFilename":"README.md"}