5.0.0 • Published 12 months ago
@graphee/cli v5.0.0
@graphee/cli
TODO: description
Usage
const cli = require('@graphee/cli');
// TODO: DEMONSTRATE API
Overriding config
create file in root called `grapheeConfig.ts
import { UserDto } from 'users';
import { TenantDto } from 'tenants';
interface AddPlugin {
add: { content: string[] };
}
type ConfigObject = {
plugins?: AddPlugin[] | undefined;
config: {
[key: string]: string | boolean | Record<string, string>;
mappers: Record<string, string>;
};
};
type FullConfig = {
react?: ConfigObject | undefined;
client?: ConfigObject | undefined;
server?: ConfigObject | undefined;
};
const Config: FullConfig = {
server: {
plugins: [
{
add: { content: ["import { random } from 'module';"] },
},
],
config: {
mappers: {
Tenant: 'TenantDto',
User: 'UserDto',
},
},
},
client: {
config: {
mappers: {
Tenant: 'TenantDto',
},
},
},
react: {
config: {
mappers: {
User: 'UserDto',
},
},
},
};
export default Config;
Imports will be automatically added if the Object exists in the Mappers.