Skip to content

Commit

Permalink
feat: Group generators by package
Browse files Browse the repository at this point in the history
  • Loading branch information
codinsonn committed Nov 25, 2023
1 parent 68654b3 commit 9f6e8f0
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-anonymous-default-export */
import { PlopTypes } from '@turbo/gen'
// Utils
import { parseWorkspaces } from '../../packages/@aetherspace/scripts/helpers/scriptUtils'
import { parseWorkspaces } from '../scripts/helpers/scriptUtils'

/* --- Disclaimer ------------------------------------------------------------------------------ */

Expand Down Expand Up @@ -103,7 +103,7 @@ export const registerAetherResolverGenerator = (plop: PlopTypes.NodePlopAPI) =>
const jsDocArgsTitle = `/** --- ${argsSchemaName} ${argsSchemaLines} */`
const jsDocArgsDescription = `/** -i- ${argsSchemaDescription} */`
const jsDocArgsHeader = `${jsDocArgsTitle}\n${jsDocArgsDescription}`
const argsSchemaBody = ['test: z.string(),']
const argsSchemaBody = ["test: z.string().default('Hello World'),"]
const argsDescriptionStatement = `.describe(d.${argsSchemaName})`

const resSchemaDescription = `Response for the ${resolverName}() resolver`
Expand Down Expand Up @@ -177,7 +177,7 @@ export const registerAetherResolverGenerator = (plop: PlopTypes.NodePlopAPI) =>
extraActions.push({
type: 'add',
path: apiRoutePath,
templateFile: 'templates/resolver-route.hbs',
templateFile: '../../packages/@aetherspace/generators/templates/resolver-route.hbs',
data: {
resolverName,
resolverImportPath,
Expand All @@ -193,7 +193,7 @@ export const registerAetherResolverGenerator = (plop: PlopTypes.NodePlopAPI) =>
{
type: 'add',
path: `${workspacePath}/schemas/${resolverSchemaName}.ts`,
templateFile: 'templates/resolver-bridge.hbs',
templateFile: '../../packages/@aetherspace/generators/templates/resolver-bridge.hbs',
data: {
descriptions: descriptions.join('\n '),
resolverName,
Expand Down Expand Up @@ -222,7 +222,7 @@ export const registerAetherResolverGenerator = (plop: PlopTypes.NodePlopAPI) =>
{
type: 'add',
path: `${workspacePath}/resolvers/${resolverName}.ts`,
templateFile: 'templates/basic-resolver.hbs',
templateFile: '../../packages/@aetherspace/generators/templates/basic-resolver.hbs',
data: {
resolverName,
ResolverName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-anonymous-default-export */
import { PlopTypes } from '@turbo/gen'
// Utils
import { parseWorkspaces } from '../../packages/@aetherspace/scripts/helpers/scriptUtils'
import { parseWorkspaces } from '../scripts/helpers/scriptUtils'

/* --- Disclaimer ------------------------------------------------------------------------------ */

Expand Down Expand Up @@ -82,7 +82,7 @@ export const registerAetherRouteGenerator = (plop: PlopTypes.NodePlopAPI) => {
{
type: 'add',
path: `${workspacePath}/screens/${ScreenName}.tsx`,
templateFile: 'templates/route-screen.hbs',
templateFile: '../../packages/@aetherspace/generators/templates/route-screen.hbs',
data: {
screenName,
ScreenName,
Expand All @@ -98,7 +98,7 @@ export const registerAetherRouteGenerator = (plop: PlopTypes.NodePlopAPI) => {
{
type: 'add',
path: screenRoutePath,
templateFile: 'templates/screen-route.hbs',
templateFile: '../../packages/@aetherspace/generators/templates/screen-route.hbs',
data: {
screenName,
ScreenName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-anonymous-default-export */
import { PlopTypes } from '@turbo/gen'
// Utils
import { parseWorkspaces } from '../../packages/@aetherspace/scripts/helpers/scriptUtils'
import { parseWorkspaces } from '../scripts/helpers/scriptUtils'

/* --- Disclaimer ------------------------------------------------------------------------------ */

Expand Down Expand Up @@ -91,7 +91,7 @@ export const registerAetherSchemaGenerator = (plop: PlopTypes.NodePlopAPI) => {
{
type: 'add',
path: `${workspacePath}/schemas/${schemaName}.ts`,
templateFile: 'templates/basic-schema.hbs',
templateFile: '../../packages/@aetherspace/generators/templates/basic-schema.hbs',
data: {
descriptions: descriptions.join('\n '),
jsDocHeader: `${jsDocTitle}\n${jsDocDescription}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const registerAetherWorkspaceGenerator = (plop: PlopTypes.NodePlopAPI) =>
{
type: 'add',
path: `${workspacePath}/package.json`,
templateFile: 'templates/package-json.hbs',
templateFile: '../../packages/@aetherspace/generators/templates/package-json.hbs',
data: { packageLicense, privateLine },
},
] as PlopTypes.ActionType[]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions turbo/generators/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import path from 'path'
import { PlopTypes } from '@turbo/gen'
import { execSync } from 'child_process'
// Generators
import { registerAetherWorkspaceGenerator } from './aether-workspace'
import { registerAetherSchemaGenerator } from './aether-schema'
import { registerAetherResolverGenerator } from './aether-resolver'
import { registerAetherRouteGenerator } from './aether-route'
import { registerAetherWorkspaceGenerator } from '../../packages/@aetherspace/generators/aether-workspace'
import { registerAetherSchemaGenerator } from '../../packages/@aetherspace/generators/aether-schema'
import { registerAetherResolverGenerator } from '../../packages/@aetherspace/generators/aether-resolver'
import { registerAetherRouteGenerator } from '../../packages/@aetherspace/generators/aether-route'

/* --- Disclaimer ------------------------------------------------------------------------------ */

Expand Down

0 comments on commit 9f6e8f0

Please sign in to comment.