Core Dependencies

Details about the key dependencies and libraries that power this code scaffolding engine.

Overview of Dependencies

The kschema-fs-api-gen-post-actions package works hand-in-hand with two custom utility libraries developed by KeshavSoft. These dependencies isolate endpoint parsing logic and standard REST API code generation respectively.

1. express-fix-endpoints-post-js

This library is responsible for modifying the Express router registration file (typically end-points.js) whenever a new POST action is created.

💡 Why not standard AST parsing?

Standard AST (Abstract Syntax Tree) modification tools can be fragile and prone to destroying code styling, formatting, or comments. The express-fix-endpoints-post-js package is tailored to preserve file structure while reliably appending imports and route registrations.

Key Roles & Functions

2. kschema-fs-api-gen-rest

This library handles generating matching database CRUD and REST specification schemas when the optional inGenerateRest flag is set to true during programmatic invocation.

// Example activation:
await insertAsIs({
  toPath: './src/api',
  inFolderName: 'InsertAsIs',
  inGenerateRest: true // activates kschema-fs-api-gen-rest integration
});

Key Roles & Functions