create-nx-workspace
Advanced tools
Comparing version 20.0.0-beta.3 to 20.0.0-beta.4
@@ -9,5 +9,6 @@ import * as yargs from 'yargs'; | ||
stack: 'none'; | ||
workspaceType: 'package-based' | 'integrated' | 'standalone'; | ||
js: boolean; | ||
appName: string | undefined; | ||
workspaceType?: 'package-based' | 'integrated' | 'standalone'; | ||
js?: boolean; | ||
appName?: string | undefined; | ||
formatter?: 'none' | 'prettier'; | ||
} | ||
@@ -14,0 +15,0 @@ interface ReactArguments extends BaseArguments { |
@@ -270,3 +270,6 @@ "use strict"; | ||
name: `none`, | ||
message: `None: Configures a TypeScript/JavaScript project with minimal structure.`, | ||
message: process.env.NX_ADD_PLUGINS !== 'false' && | ||
process.env.NX_ADD_TS_PLUGIN === 'true' | ||
? `None: Configures a TypeScript/JavaScript monorepo.` | ||
: `None: Configures a TypeScript/JavaScript project with minimal structure.`, | ||
}, | ||
@@ -311,31 +314,8 @@ { | ||
async function determineNoneOptions(parsedArgs) { | ||
let preset; | ||
let workspaceType = undefined; | ||
let appName = undefined; | ||
let js; | ||
if (parsedArgs.preset) { | ||
preset = parsedArgs.preset; | ||
} | ||
else { | ||
workspaceType = await determinePackageBasedOrIntegratedOrStandalone(); | ||
if (workspaceType === 'standalone') { | ||
preset = preset_1.Preset.TsStandalone; | ||
} | ||
else if (workspaceType === 'integrated') { | ||
preset = preset_1.Preset.Apps; | ||
} | ||
else { | ||
preset = preset_1.Preset.NPM; | ||
} | ||
} | ||
if (parsedArgs.js !== undefined) { | ||
js = parsedArgs.js; | ||
} | ||
else if (preset === preset_1.Preset.TsStandalone) { | ||
// Only standalone TS preset generates a default package, so we need to provide --js and --appName options. | ||
appName = parsedArgs.name; | ||
if (process.env.NX_ADD_PLUGINS !== 'false' && | ||
process.env.NX_ADD_TS_PLUGIN === 'true') { | ||
const reply = await enquirer.prompt([ | ||
{ | ||
name: 'ts', | ||
message: `Would you like to use TypeScript with this project?`, | ||
name: 'prettier', | ||
message: `Would you like to use Prettier for code formatting?`, | ||
type: 'autocomplete', | ||
@@ -350,9 +330,61 @@ choices: [ | ||
], | ||
initial: 0, | ||
initial: 1, | ||
skip: !parsedArgs.interactive || (0, is_ci_1.isCI)(), | ||
}, | ||
]); | ||
js = reply.ts === 'No'; | ||
return { | ||
preset: preset_1.Preset.TS, | ||
formatter: reply.prettier === 'Yes' ? 'prettier' : 'none', | ||
}; | ||
} | ||
return { preset, js, appName }; | ||
else { | ||
let preset; | ||
let workspaceType = undefined; | ||
let appName = undefined; | ||
let js; | ||
if (parsedArgs.preset) { | ||
preset = parsedArgs.preset; | ||
} | ||
else { | ||
workspaceType = await determinePackageBasedOrIntegratedOrStandalone(); | ||
if (workspaceType === 'standalone') { | ||
preset = preset_1.Preset.TsStandalone; | ||
} | ||
else if (workspaceType === 'integrated') { | ||
preset = preset_1.Preset.Apps; | ||
} | ||
else { | ||
preset = preset_1.Preset.NPM; | ||
} | ||
} | ||
if (preset === preset_1.Preset.TS) { | ||
return { preset, formatter: 'prettier' }; | ||
} | ||
if (parsedArgs.js !== undefined) { | ||
js = parsedArgs.js; | ||
} | ||
else if (preset === preset_1.Preset.TsStandalone) { | ||
// Only standalone TS preset generates a default package, so we need to provide --js and --appName options. | ||
appName = parsedArgs.name; | ||
const reply = await enquirer.prompt([ | ||
{ | ||
name: 'ts', | ||
message: `Would you like to use TypeScript with this project?`, | ||
type: 'autocomplete', | ||
choices: [ | ||
{ | ||
name: 'Yes', | ||
}, | ||
{ | ||
name: 'No', | ||
}, | ||
], | ||
initial: 0, | ||
skip: !parsedArgs.interactive || (0, is_ci_1.isCI)(), | ||
}, | ||
]); | ||
js = reply.ts === 'No'; | ||
} | ||
return { preset, js, appName }; | ||
} | ||
} | ||
@@ -359,0 +391,0 @@ async function determineReactOptions(parsedArgs) { |
{ | ||
"name": "create-nx-workspace", | ||
"version": "20.0.0-beta.3", | ||
"version": "20.0.0-beta.4", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Smart Monorepos · Fast CI", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112649
3049
17