Skip to content

Commit

Permalink
feat(js): generate JS monorepos with workspaces enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Sep 18, 2024
1 parent 00fa390 commit 932f933
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ function createFiles(tree: Tree, options: NormalizedSchema) {
options.preset === Preset.RemixStandalone ||
options.preset === Preset.TsStandalone
? './files-root-app'
: options.preset === Preset.NPM
: (options.preset === Preset.TS &&
process.env.NX_ADD_TS_PLUGIN === 'true') ||
options.preset === Preset.NPM
? './files-package-based-repo'
: './files-integrated-repo';
generateFiles(tree, join(__dirname, filesDirName), options.directory, {
Expand Down Expand Up @@ -409,7 +411,10 @@ function normalizeOptions(options: NormalizedSchema) {
}

function setUpWorkspacesInPackageJson(tree: Tree, options: NormalizedSchema) {
if (options.preset === Preset.NPM) {
if (
options.preset === Preset.NPM ||
(options.preset === Preset.TS && process.env.NX_ADD_TS_PLUGIN === 'true')
) {
if (options.packageManager === 'pnpm') {
tree.write(
join(options.directory, 'pnpm-workspace.yaml'),
Expand Down

0 comments on commit 932f933

Please sign in to comment.