{"_id":"@asaidimu/blueprint","_rev":"3-b350023bee44c5a0c28ead86cfa75b1f","name":"@asaidimu/blueprint","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@asaidimu/blueprint","version":"1.0.0","keywords":["tooling"],"author":{"name":"Saidimu","email":"47994458+asaidimu@users.noreply.github.com"},"license":"MIT","_id":"@asaidimu/blueprint@1.0.0","maintainers":[{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"}],"homepage":"https://github.com/ausaidimu/#readme","bugs":{"url":"https://github.com/ausaidimu//issues"},"dist":{"shasum":"13f135b1478b7d69761a2521086bf50e82ceb651","tarball":"https://registry.npmjs.org/@asaidimu/blueprint/-/blueprint-1.0.0.tgz","fileCount":7,"integrity":"sha512-mbOQ27rPk3a8dEID61mj7xSR9vkLoGXuo/sw1lsE92hCsZX9jF1sLK0pw4G6Beq5Ut9b/wKTPEDGuAyow0OPow==","signatures":[{"sig":"MEUCIQDFd4Yzs3aFXfJ61D7cKZDN0YrAQlKQRIJSgTLkcCZiQwIgM3EoKBWOm4SGcylOyH0/iolndASpe5eKkf76H3WYX4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25182},"main":"index.js","types":"index.d.ts","gitHead":"501f40b7629ba34d61692f79733863a3c0e3a3d2","_npmUser":{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"},"repository":{"url":"git+https://github.com/ausaidimu/blueprint.git","type":"git"},"_npmVersion":"10.5.2","description":"Project template manager","directories":{},"_nodeVersion":"20.13.1","dependencies":{"zod":"^3.23.8","handlebars":"^4.7.8","handlebars-helpers":"^0.10.0"},"publishConfig":{"tag":"latest","access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/blueprint_1.0.0_1732624017470_0.040496279432054916","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@asaidimu/blueprint","version":"1.0.1","keywords":["tooling"],"author":{"name":"Saidimu","email":"47994458+asaidimu@users.noreply.github.com"},"license":"MIT","_id":"@asaidimu/blueprint@1.0.1","maintainers":[{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"}],"homepage":"https://github.com/ausaidimu/#readme","bugs":{"url":"https://github.com/ausaidimu//issues"},"dist":{"shasum":"8ffef782989773483cca705b6a08f178528cfbba","tarball":"https://registry.npmjs.org/@asaidimu/blueprint/-/blueprint-1.0.1.tgz","fileCount":7,"integrity":"sha512-Th4i7Gxs4Azz6kyvYKxsAKS1iaodcuvQrTwfSKi5iePCfgn6JsJFcXcdTGCGqCRZMlV6X6HeNwSV0tMU5BvhyQ==","signatures":[{"sig":"MEYCIQDLijnVPpTbH7hxwEtGORZiSh9DCT3ZsmqXOLMA+LBetgIhANAwobHg5UdUnjFZeLlHDeK9K8HSjfaJRYkcuNHhbUBS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25176},"main":"index.js","types":"index.d.ts","gitHead":"43e0f43502512df05366a068fe166c30a730278b","_npmUser":{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"},"repository":{"url":"git+https://github.com/ausaidimu/blueprint.git","type":"git"},"_npmVersion":"10.5.2","description":"Project template manager","directories":{},"_nodeVersion":"20.13.1","dependencies":{"zod":"^3.23.8","handlebars":"^4.7.8","handlebars-helpers":"^0.10.0"},"publishConfig":{"tag":"latest","access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/blueprint_1.0.1_1732624236890_0.5243310684047875","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@asaidimu/blueprint","version":"1.1.0","keywords":["tooling"],"author":{"name":"Saidimu","email":"47994458+asaidimu@users.noreply.github.com"},"license":"MIT","_id":"@asaidimu/blueprint@1.1.0","maintainers":[{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"}],"homepage":"https://github.com/asaidimu/blueprint/#readme","bugs":{"url":"https://github.com/asaidimu/blueprint/issues"},"dist":{"shasum":"071a8cfee9961c6cef22f7ab2b76fed23af4174a","tarball":"https://registry.npmjs.org/@asaidimu/blueprint/-/blueprint-1.1.0.tgz","fileCount":7,"integrity":"sha512-YQ11lau1HaREkZn5zRLKvpNskhd/eB46Lj6UEmPpsZDsRo8OPdW+Xdpko3RKkNlvDCMzvo2jGZyCKIq1Xna1Fg==","signatures":[{"sig":"MEUCIQCKVQx87r07saHq+XIS+G4frjHTlPICEzhjwep5ip59fQIgKhYNc2pNmeZVVhkMqpcc+YkESgcHzHLhMq1Y1wQkV1g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25721},"main":"index.js","types":"index.d.ts","gitHead":"56e3f47cccd6c8597a7bc01b0f8c5917b45584a1","_npmUser":{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"},"repository":{"url":"git+https://github.com/asaidimu/blueprint.git","type":"git"},"_npmVersion":"10.8.2","description":"Project template manager","directories":{},"_nodeVersion":"20.18.0","dependencies":{"zod":"^3.23.8","handlebars":"^4.7.8","handlebars-helpers":"^0.10.0"},"publishConfig":{"tag":"latest","access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/blueprint_1.1.0_1732794615990_0.4607426255432372","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@asaidimu/blueprint","version":"1.1.1","description":"Project template manager","main":"index.js","types":"index.d.ts","keywords":["tooling"],"author":{"name":"Saidimu","email":"47994458+asaidimu@users.noreply.github.com"},"license":"MIT","dependencies":{"handlebars-helpers":"^0.10.0","handlebars":"^4.7.8","zod":"^3.23.8"},"repository":{"type":"git","url":"git+https://github.com/asaidimu/blueprint.git"},"bugs":{"url":"https://github.com/asaidimu/blueprint/issues"},"homepage":"https://github.com/asaidimu/blueprint/#readme","publishConfig":{"registry":"https://registry.npmjs.org/","tag":"latest","access":"public"},"_id":"@asaidimu/blueprint@1.1.1","gitHead":"94a7573cd21267d52ff942ec66952163faf02c5f","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-moyrSLgypfE2ul5KQsW9CoFUtKRkABiOKOOTxGM1+JEbgK3LgxFNlD+1Cpaomj0hVXjhPf/82x6lgufactswzw==","shasum":"cce6fb5decddc16215dc2d20929cb92f95cad4af","tarball":"https://registry.npmjs.org/@asaidimu/blueprint/-/blueprint-1.1.1.tgz","fileCount":7,"unpackedSize":25721,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJ67b/Z5MdWErfJWUfOANk+FgFCb3Pr50FKUIIFc2YtAiEA+U+FfF6lBYcXbxaN/ncgT4egVJTp4ewYcAy8Lig9A28="}]},"_npmUser":{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"},"directories":{},"maintainers":[{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/blueprint_1.1.1_1736606331467_0.3807636973538888"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-26T12:26:57.343Z","modified":"2025-01-11T14:38:51.793Z","1.0.0":"2024-11-26T12:26:57.640Z","1.0.1":"2024-11-26T12:30:37.070Z","1.1.0":"2024-11-28T11:50:16.157Z","1.1.1":"2025-01-11T14:38:51.636Z"},"bugs":{"url":"https://github.com/asaidimu/blueprint/issues"},"author":{"name":"Saidimu","email":"47994458+asaidimu@users.noreply.github.com"},"license":"MIT","homepage":"https://github.com/asaidimu/blueprint/#readme","keywords":["tooling"],"repository":{"type":"git","url":"git+https://github.com/asaidimu/blueprint.git"},"description":"Project template manager","maintainers":[{"name":"asaidimu","email":"lolokilesaidimu@gmail.com"}],"readme":"# BluePrint: A Component Generation Library\n\n## Overview\n\nThis library provides a flexible, extensible system for generating and managing project components with support for templating, hooks, and nested component structures.\n\n## Features\n\n- **Dynamic Component Generation**: Create components with customizable templates\n- **Nested Component Support**: Build complex project structures with hierarchical components\n- **Lifecycle Hooks**: Execute custom logic before and after component operations\n- **Template Rendering**: Use Handlebars for dynamic template generation\n- **Flexible Configuration**: Supports various project and component configurations\n\n## Installation\n\n```bash\nnpm install @asaidimu/blueprint\n```\n\n## Core Concepts\n\n### Project\n\nThe `Project` class represents the root of your project structure. It manages top-level components and provides initialization capabilities.\n\n```typescript\nconst project = new Project('/path/to/project');\nawait project.initialize({\n  components: {\n    // Define your component types\n  },\n  hooks: {\n    // Optional project-level hooks\n  }\n});\n```\n\n### Component\n\n`Component` represents individual project elements that can:\n- Generate files from templates\n- Create sub-components\n- Apply lifecycle hooks\n- Update and remove themselves\n\n## Basic Usage\n\n### Creating a Project\n\n```typescript\nconst project = new Project('/my-project');\nawait project.initialize({\n  components: {\n    'service': {\n      name: 'service',\n      path: 'src/services',\n      templates: [\n        {\n          source: 'service.ts.hbs',\n          target: '{{name}}.ts'\n        }\n      ]\n    }\n  }\n});\n```\n\n### Creating a Component\n\n```typescript\n// Create a top-level component\nconst userService = await project.create('service', {\n  name: 'UserService'\n});\n\n// Add a sub-component to an existing component\nconst helperMethod = await userService.add('method', {\n  name: 'validateUser'\n});\n```\n\n## Advanced Features\n\n### Hooks\n\nDefine lifecycle hooks for granular control:\n\n```typescript\nconst serviceConfig = {\n  name: 'service',\n  path: 'src/services',\n  templates: [...],\n  hooks: {\n    beforeCreate: async (context) => {\n      // Validate options\n      // Perform pre-creation logic\n    },\n    afterCreate: async (context) => {\n      // Log creation\n      // Trigger additional processes\n    }\n  }\n};\n```\n\n## Validation\n\nComponent options can be validated using Zod schemas:\n\n- Define validation rules when adding components\n- Prevent invalid component creation\n- Transform and normalize input data\n- Provides detailed error messages\n\n```typescript\ncomponent.addComponent({\n  schema: z.object({\n      name: z.string().min(3),\n      type: z.enum(['service', 'model'])\n  })\n})\n```\n\n### Template Rendering\n\nUse Handlebars for dynamic template generation:\n\n```handlebars\n// service.ts.hbs\nexport class {{pascalCase name}} {\n  constructor(private config: {{configType}}) {}\n\n  async {{methodName}}() {\n    // Generated method\n  }\n}\n```\n\n## API Reference\n\n### Project Methods\n- `initialize(config?)`: Set up project structure\n- `addComponent(config)`: Register a component type\n- `create(type, options)`: Create a top-level component\n\n### Component Methods\n- `create(options)`: Create the component\n- `update(options)`: Update component files\n- `remove()`: Delete the component\n- `add(type, options)`: Create a nested sub-component\n\n## Template File Configuration\n\n- `source`: Path to the Handlebars template\n- `target`: Output file path (supports Handlebars interpolation)\n- `required`: Whether the file must always be generated\n\n## Error Handling\n\nThe library throws descriptive errors for:\n- Unknown component types\n- Invalid configurations\n- File system issues\n\n## Performance Considerations\n\n- Uses async/await for non-blocking file operations\n- Supports recursive directory creation\n- Minimal overhead for template rendering\n\n## Limitations\n\n- Requires Node.js with native `fs/promises` support\n- Template paths must be resolvable\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push and submit a Pull Request\n\n## License\n\nMIT License\n\n## Contact\n\nFor questions, issues, or support, please open a GitHub issue.\n","readmeFilename":"README.md"}