Created
January 26, 2023 05:26
-
-
Save ZackDeRose/7f035cf26201e167237edcf821895317 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
async function createReactApplication( | |
tree: Tree, | |
options: AppGeneratorSchema, | |
webAppName: string | |
) { | |
await reactAppGenerator(tree, { | |
name: webAppName, | |
linter: Linter.EsLint, | |
style: 'css', | |
e2eTestRunner: 'none', | |
unitTestRunner: 'vitest', | |
bundler: 'vite', | |
devServerPort: options.frontendPort, | |
}); | |
await setupTailwindGenerator(tree, { project: webAppName }); | |
createAppTsxBoilerPlate(tree, options.name); | |
adjustDefaultDevPort(tree, options); | |
addFullstackServeTarget(tree, options); | |
} | |
function addFullstackServeTarget(tree: Tree, options: AppGeneratorSchema) { | |
const { fileName: frontEndKabobCase } = names(`${options.name}-web`); | |
const { fileName: backEndKabobCase } = names(`${options.name}-server`); | |
updateJson(tree, `apps/${frontEndKabobCase}/project.json`, (json) => { | |
return { | |
...json, | |
targets: { | |
...json.targets, | |
'serve-fullstack': { | |
executor: '@nx-trpc-example/plugin:serve-fullstack', | |
options: { | |
frontendProject: frontEndKabobCase, | |
backendProject: backEndKabobCase, | |
}, | |
}, | |
}, | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment