{"_id":"@asyncdev01/frontpage","name":"@asyncdev01/frontpage","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@asyncdev01/frontpage","version":"0.1.0","description":"Scaffolding tool for generating React Query hooks and services from Zod schemas","main":"dist/index.js","types":"dist/index.d.ts","bin":{"front-forge":"dist/cli.js"},"publishConfig":{"access":"public"},"scripts":{"dev":"nodemon --exec ts-node -r tsconfig-paths/register src/server.ts","build":"tsc -p tsconfig.build.json","start":"node ./dist/server.js","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"tsc --noEmit","scaffold":"ts-node -r tsconfig-paths/register scripts/scaffold.ts"},"keywords":["nodejs","typescript","express","rest-api","production-ready"],"author":"","license":"ISC","devDependencies":{"@tsconfig/node24":"^24.0.3","@types/compression":"^1.7.5","@types/cors":"^2.8.17","@types/express":"^5.0.6","@types/jest":"^29.5.12","@types/morgan":"^1.9.9","@types/node":"^25.0.3","@types/supertest":"^6.0.2","jest":"^29.7.0","nodemon":"^3.1.0","prisma":"6.19.1","supertest":"^7.0.0","ts-jest":"^29.1.2","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0","typescript":"^5.9.3"},"dependencies":{"@prisma/client":"6.19.1","@types/uuid":"^10.0.0","@tanstack/react-query":"^5.62.11","compression":"^1.7.4","cors":"^2.8.5","dotenv":"^16.4.5","express":"^5.2.1","express-rate-limit":"^7.4.1","helmet":"^8.0.0","morgan":"^1.10.0","uuid":"^13.0.0","winston":"^3.17.0","zod":"^3.24.1"},"_id":"@asyncdev01/frontpage@0.1.0","gitHead":"c7a17e1be4b33af1562128eeff944025d04c97bf","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-Eplx2nLuD4heIOapbKRcjRTeDZzkdujYYB4l6vq7wNkWI/U9V6ZZOr1HtA3a1Pn2tT0nAjgygLKtKQsiVViNkg==","shasum":"7179dea0dba941f202e6b83675a5eb12b3aae8c9","tarball":"https://registry.npmjs.org/@asyncdev01/frontpage/-/frontpage-0.1.0.tgz","fileCount":20,"unpackedSize":27932,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAvn/6D3B0/qnUaa9tgbfHa1bVzqUYHjeaKOJ6gmzlHrAiAbn3h95Vc9SLEC95BdoRGFGkel4rVHSh6XvOekvyTDAQ=="}]},"_npmUser":{"name":"asyncdev01","email":"asyncdev8@gmail.com"},"directories":{},"maintainers":[{"name":"asyncdev01","email":"asyncdev8@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/frontpage_0.1.0_1767180137826_0.9457186250511207"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-31T11:22:17.703Z","0.1.0":"2025-12-31T11:22:17.949Z","modified":"2025-12-31T11:22:18.232Z"},"maintainers":[{"name":"asyncdev01","email":"asyncdev8@gmail.com"}],"description":"Scaffolding tool for generating React Query hooks and services from Zod schemas","keywords":["nodejs","typescript","express","rest-api","production-ready"],"license":"ISC","readme":"# @async/frontpage\r\n\r\nFront Forge is a scaffolding tool and core library for generating React Query hooks and services from Zod schemas. It helps you automate the repetitive work of building API layers for your TypeScript projects.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @async/frontpage\r\n```\r\n\r\n## Scaffolding Tool\r\n\r\nThe CLI tool allows you to generate hooks and services directly from your Zod schemas.\r\n\r\n### Usage\r\n\r\n```bash\r\nnpx front-forge --schema=./src/zod/vehicle.zod.ts\r\n```\r\n\r\n#### Options\r\n\r\n- `--schema`, `-s`: Path to the Zod schema file (base name must be `{entity}.zod.ts`).\r\n- `--output`, `-o`: Output directory for generated files (default: `src`).\r\n\r\n## Core Library\r\n\r\nThe package also provides base classes and utilities that the generated code depends on.\r\n\r\n### APIService\r\n\r\nA base class for building API services with support for query parameter chaining.\r\n\r\n```typescript\r\nimport { APIService } from \"@async/frontpage\";\r\n\r\nclass MyService extends APIService {\r\n  // your custom methods\r\n}\r\n```\r\n\r\n### asyncHandler\r\n\r\nA wrapper for async route handlers to catch errors and pass them to error middleware (useful for Express).\r\n\r\n```typescript\r\nimport { asyncHandler } from \"@async/frontpage\";\r\n\r\napp.get(\r\n  \"/users\",\r\n  asyncHandler(async (req, res) => {\r\n    const users = await userService.getAllUsers();\r\n    res.json(users);\r\n  })\r\n);\r\n```\r\n\r\n### apiClient\r\n\r\nA flexible fetch wrapper for making API requests.\r\n\r\n```typescript\r\nimport { apiClient } from \"@async/frontpage\";\r\n\r\napiClient.setBaseUrl(\"https://api.example.com\");\r\n```\r\n\r\n## Schema Requirements\r\n\r\nThe scrubber expects a Zod schema file with the following naming convention:\r\n`{entity-name}.zod.ts` (e.g., `user.zod.ts`).\r\n\r\nIt parses the file to extract:\r\n\r\n1. **Entity Name**: Derived from the filename.\r\n2. **Types**: It can detect `WithRelation` types to generate specialized hooks.\r\n3. **Array Fields**: Automatically detects array fields to generate \"include\" hooks.\r\n\r\n## License\r\n\r\nISC\r\n","readmeFilename":"README.md","_rev":"1-9b2b4a05af4bf87e94fb42e354f01e6e"}