2.3.1 • Published 5 years ago
@fbi-js/factory-node v2.3.1
factory-node
Templates and commands for node.js applications development.
This is a factory for fbi v4
Usage
npx fbi create factory-nodeRequirements
node v10+fbi v4.6.1+
Templates
app: web application base on @mrapi/appservice: API service base on @mrapi/serviceTypes:
Simple: GraphQL/OpenAPI service using @nexus/schema/express-openapiPrisma: GraphQL/OpenAPI service using @nexus/schema/express-openapi and Prisma (including DB process service)Aggregation: GraphQL/OpenAPI aggregation service using graphql-tools
gateway: API gateway base on @mrapi/gateway
Features
Multiple modules: One service can contain multiple modules, each module can have different endpoints, or can be merged by GraphQL stitching, more info.Multiple tenants: IBM Docs. more info
Development
Build your own factory-node based on @fbi-js/factory-node,
Create a project
npx fbi create @fbi-js/factory-factory
npm i @fbi-js/factory-nodeCreate and modify files
// src/index.ts
import FactoryNodeBase from '@fbi-js/factory-node'
import CommandX from './commands/my-command'
import TemplateX from './templates/my-template'
const { name, description } = require('../package.json')
export default class FactoryNode extends FactoryNodeBase {
id = name
description = description
// 1. replace default commands
commands = [new CommandX(this)]
templates = [new TemplateX(this)]
constructor() {
super()
// 2. OR: extends default commands
// this.commands.push(new CommandX(this))
// this.templates.push(new TemplateX(this))
}
}Compile ts files
yarn buildTest
fbi linkfbi createChangelog
Contribution
Please make sure to read the Contributing Guide before making a pull request.
Thank you to all the people who already contributed to fbi factory!
License
Licensed under MIT.