{"_rev":"4-351bb78741455ffd98253ce2eaec9e02","time":{"created":"2024-12-10T04:08:27.406Z","modified":"2024-12-10T04:08:28.007Z","0.0.0":"2024-11-28T11:13:39.909Z","0.0.1":"2024-11-28T11:32:35.216Z","4.0.0":"2024-12-10T04:08:27.672Z"},"_id":"@4o/engineer","name":"@4o/engineer","dist-tags":{"latest":"4.0.0"},"versions":{"4.0.0":{"name":"@4o/engineer","version":"4.0.0","license":"MIT","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.esm.js","type":"module","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"scripts":{"build":"rollup -c","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","lint":"eslint \"src/**/*.js\"","lint:fix":"eslint \"src/**/*.js\" --fix","format":"prettier --write \"src/**/*.js\"","prepare":"yarn build"},"dependencies":{"@4o/operator":"*","liquidjs":"^10.18.0","superstruct":"^2.0.2"},"devDependencies":{"@babel/core":"^7.26.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/plugin-proposal-optional-chaining":"^7.21.0","@babel/plugin-proposal-private-property-in-object":"^7.21.0-placeholder-for-preset-env.2","@babel/preset-env":"^7.26.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.1","@rollup/plugin-node-resolve":"^15.3.0","@semantic-release/npm":"^12.0.1","@types/babel__core":"^7.20.5","eslint":"^9.13.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jest":"^29.7.0","prettier":"^3.2.0","rollup":"^4.12.0"},"packageManager":"yarn@4.5.1","directories":{"example":"examples"},"author":"","description":"Engineer is a powerful, flexible code generation toolkit designed to streamline the process of creating boilerplate code, configuration files, and project structures using liquid templates and a declarative configuration approach.","_id":"@4o/engineer@4.0.0","gitHead":"0504e83df6cef27241b0060a1d0d349a8e17bac1","_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"integrity":"sha512-kq9ZY9UTBJZ9WOx6Y2NyitT4AmMG6uXARr89T/Icrfvg5venXMw8xSlY99hvxOtp+wOo9XPVq96CJDqn1sCWvg==","shasum":"0ee182b3c8db87c427da24beafa1a195e6a07068","tarball":"https://registry.npmjs.org/@4o/engineer/-/engineer-4.0.0.tgz","fileCount":11,"unpackedSize":235960,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEId2EoOajCGNGQGrmk/c/NVURXfnMBey9TqWiQA3NOkAiEAr9zdtF3tSIwu2DrK/fj+4x1nYRBz89pwNu+pWXC3QVw="}]},"_npmUser":{"name":"ericksatelite","email":"erick.ruano@satelite.digital"},"maintainers":[{"name":"ericksatelite","email":"erick.ruano@satelite.digital"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/engineer_4.0.0_1733803707521_0.44555271275997543"},"_hasShrinkwrap":false}},"maintainers":[{"name":"ericksatelite","email":"erick.ruano@satelite.digital"}],"description":"Engineer is a powerful, flexible code generation toolkit designed to streamline the process of creating boilerplate code, configuration files, and project structures using liquid templates and a declarative configuration approach.","license":"MIT","readme":"# 🚀 Engineer: Automated Code Generation Toolkit\r\n\r\n## Overview\r\n\r\nEngineer is a powerful, flexible code generation toolkit designed to streamline the process of creating boilerplate code, configuration files, and project structures using liquid templates and a declarative configuration approach.\r\n\r\n## 🌟 Features\r\n\r\n- **Dynamic Template Generation**: Create code from liquid templates with context-aware rendering\r\n- **Flexible Configuration**: Define complex entity relationships and generation strategies\r\n- **Multi-Template Support**: Generate multiple file types in a single run\r\n- **Extensible Actions**: Easily add custom generation actions\r\n- **Type-Safe Configuration**: Built-in configuration validation with Superstruct\r\n\r\n## 📦 Installation\r\n\r\nInstall Engineer using npm:\r\n\r\n```bash\r\nnpm install @4o/engineer\r\n```\r\n\r\n## 🔧 Configuration\r\n\r\nCreate an `engineer.config.js` file in your project root:\r\n\r\n```javascript\r\nconst config = () => {\r\n  const context = {\r\n    // Define your project's context and entities\r\n    entities: [\r\n      // Entity definitions\r\n    ]\r\n  };\r\n\r\n  return {\r\n    context,\r\n    templates: [\r\n      // Template generation instructions\r\n    ]\r\n  };\r\n};\r\n\r\nexport default config;\r\n```\r\n\r\n### Configuration Options\r\n\r\n- `context`: An object containing your project's data model\r\n- `templates`: An array of template generation instructions\r\n  - `type`: Generation type (`\"once\"` or `\"loop\"`)\r\n  - `name`: Template identifier\r\n  - `template`: Path to the liquid template\r\n  - `path`: Output file path (supports dynamic paths with liquid syntax)\r\n  - `iterator`: (Optional) Used for loop-based generation\r\n\r\n## 🚀 Usage\r\n\r\nCreate a simple script to run Engineer:\r\n\r\n```javascript\r\nimport engineer from \"@4o/engineer\";\r\n\r\nconst main = async () => {\r\n  console.time('engineer');\r\n  await engineer();\r\n  console.timeEnd('engineer');\r\n};\r\n\r\nmain();\r\n```\r\n\r\n## 📝 Liquid Template Example\r\n\r\n```liquid\r\n{% for entity in entities %}\r\nmodel {{entity.name}} {\r\n  // Model definition using entity metadata\r\n}\r\n{% endfor %}\r\n```\r\n\r\n## 🔍 Generation Strategies\r\n\r\n### One-Time Generation\r\nUse `type: \"once\"` to generate a single file:\r\n```javascript\r\n{\r\n  type: \"once\",\r\n  name: \"prisma-schema\",\r\n  template: \"./prisma.liquid\",\r\n  path: \"./out/prisma/schema.prisma\"\r\n}\r\n```\r\n\r\n### Loop-Based Generation\r\nUse `type: \"loop\"` to generate multiple files:\r\n```javascript\r\n{\r\n  type: \"loop\",\r\n  name: \"module\",\r\n  template: \"./module.liquid\",\r\n  path: \"./out/modules/{{name}}.js\",\r\n  iterator: \"entities\"\r\n}\r\n```\r\n\r\n## 🛠️ Supported Actions\r\n\r\n- `compile`: Render liquid templates\r\n- `writeTextToFile`: Write generated content to files\r\n- `readTextFromFile`: Read template files\r\n- `parseState`: Extract nested object properties\r\n- `log`: Console logging\r\n\r\n## 🚨 Error Handling\r\n\r\nEngineer provides detailed configuration and runtime error messages to help diagnose issues quickly.\r\n\r\n## 🤝 Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Commit your changes\r\n4. Push to the branch\r\n5. Create a Pull Request\r\n\r\n## 📄 License\r\n\r\n[Add your project's license information]\r\n\r\n## 🔗 Dependencies\r\n\r\n- Liquid.js: Template rendering\r\n- Superstruct: Configuration validation\r\n- Node.js File System APIs\r\n\r\n## 📧 Contact\r\n\r\n[Add contact information or project maintainer details]","readmeFilename":"README.md"}