create-nx-workspace
Advanced tools
Comparing version 0.0.0-pr-29176-d3c6c29 to 0.0.0-pr-29314-bfd9d0c
@@ -6,2 +6,5 @@ import * as yargs from 'yargs'; | ||
preset: Preset; | ||
linter?: 'none' | 'eslint'; | ||
formatter?: 'none' | 'prettier'; | ||
workspaces?: boolean; | ||
} | ||
@@ -13,3 +16,2 @@ interface NoneArguments extends BaseArguments { | ||
appName?: string | undefined; | ||
formatter?: 'none' | 'prettier'; | ||
} | ||
@@ -26,5 +28,2 @@ interface ReactArguments extends BaseArguments { | ||
e2eTestRunner: 'none' | 'cypress' | 'playwright'; | ||
linter?: 'none' | 'eslint'; | ||
formatter?: 'none' | 'prettier'; | ||
workspaces?: boolean; | ||
} | ||
@@ -31,0 +30,0 @@ interface AngularArguments extends BaseArguments { |
@@ -574,2 +574,5 @@ "use strict"; | ||
let e2eTestRunner = undefined; | ||
let linter; | ||
let formatter; | ||
const workspaces = parsedArgs.workspaces ?? false; | ||
if (parsedArgs.preset && parsedArgs.preset !== preset_1.Preset.Vue) { | ||
@@ -586,3 +589,5 @@ preset = parsedArgs.preset; | ||
const framework = await determineVueFramework(parsedArgs); | ||
const workspaceType = await determineStandaloneOrMonorepo(); | ||
const workspaceType = workspaces | ||
? 'monorepo' | ||
: await determineStandaloneOrMonorepo(); | ||
if (workspaceType === 'standalone') { | ||
@@ -645,3 +650,19 @@ appName = parsedArgs.appName ?? parsedArgs.name; | ||
} | ||
return { preset, style, appName, e2eTestRunner }; | ||
if (workspaces) { | ||
linter = await determineLinterOptions(parsedArgs); | ||
formatter = await determineFormatterOptions(parsedArgs); | ||
} | ||
else { | ||
linter = 'eslint'; | ||
formatter = 'prettier'; | ||
} | ||
return { | ||
preset, | ||
style, | ||
appName, | ||
e2eTestRunner, | ||
linter, | ||
formatter, | ||
workspaces, | ||
}; | ||
} | ||
@@ -801,2 +822,5 @@ async function determineAngularOptions(parsedArgs) { | ||
let docker; | ||
let linter; | ||
let formatter; | ||
const workspaces = parsedArgs.workspaces ?? false; | ||
if (parsedArgs.preset) { | ||
@@ -821,3 +845,5 @@ preset = parsedArgs.preset; | ||
framework = await determineNodeFramework(parsedArgs); | ||
const workspaceType = await determineStandaloneOrMonorepo(); | ||
const workspaceType = workspaces | ||
? 'monorepo' | ||
: await determineStandaloneOrMonorepo(); | ||
if (workspaceType === 'standalone') { | ||
@@ -856,2 +882,10 @@ preset = preset_1.Preset.NodeStandalone; | ||
} | ||
if (workspaces) { | ||
linter = await determineLinterOptions(parsedArgs); | ||
formatter = await determineFormatterOptions(parsedArgs); | ||
} | ||
else { | ||
linter = 'eslint'; | ||
formatter = 'prettier'; | ||
} | ||
return { | ||
@@ -862,2 +896,5 @@ preset, | ||
docker, | ||
linter, | ||
formatter, | ||
workspaces, | ||
}; | ||
@@ -864,0 +901,0 @@ } |
{ | ||
"name": "create-nx-workspace", | ||
"version": "0.0.0-pr-29176-d3c6c29", | ||
"version": "0.0.0-pr-29314-bfd9d0c", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Smart Monorepos · Fast CI", |
@@ -83,6 +83,6 @@ "use strict"; | ||
case preset_1.Preset.WebComponents: | ||
return ['apps/**', 'packages/**']; | ||
return ['apps/**', 'libs/**', 'packages/**']; | ||
default: | ||
return ['packages/**']; | ||
return ['libs/**', 'packages/**']; | ||
} | ||
} |
@@ -7,2 +7,4 @@ "use strict"; | ||
exports.determinePackageManager = determinePackageManager; | ||
const enquirer = require("enquirer"); | ||
const chalk = require("chalk"); | ||
const ab_testing_1 = require("../utils/nx/ab-testing"); | ||
@@ -13,10 +15,12 @@ const output_1 = require("../utils/output"); | ||
const string_utils_1 = require("../utils/string-utils"); | ||
const enquirer = require("enquirer"); | ||
const chalk = require("chalk"); | ||
const is_ci_1 = require("../utils/ci/is-ci"); | ||
async function determineNxCloud(parsedArgs) { | ||
if (parsedArgs.nxCloud === undefined) { | ||
return nxCloudPrompt('setupCI'); | ||
if (parsedArgs.nxCloud) { | ||
return parsedArgs.nxCloud; | ||
} | ||
else if (!parsedArgs.interactive || (0, is_ci_1.isCI)()) { | ||
return 'skip'; | ||
} | ||
else { | ||
return parsedArgs.nxCloud; | ||
return nxCloudPrompt('setupCI'); | ||
} | ||
@@ -63,5 +67,5 @@ } | ||
if (parsedArgs.defaultBase) { | ||
return Promise.resolve(parsedArgs.defaultBase); | ||
return parsedArgs.defaultBase; | ||
} | ||
if (parsedArgs.allPrompts) { | ||
else if (parsedArgs.allPrompts) { | ||
return enquirer | ||
@@ -87,3 +91,3 @@ .prompt([ | ||
} | ||
return Promise.resolve((0, default_base_1.deduceDefaultBase)()); | ||
return (0, default_base_1.deduceDefaultBase)(); | ||
} | ||
@@ -94,3 +98,3 @@ async function determinePackageManager(parsedArgs) { | ||
if (package_manager_1.packageManagerList.includes(packageManager)) { | ||
return Promise.resolve(packageManager); | ||
return packageManager; | ||
} | ||
@@ -107,3 +111,3 @@ output_1.output.error({ | ||
} | ||
if (parsedArgs.allPrompts) { | ||
else if (parsedArgs.allPrompts) { | ||
return enquirer | ||
@@ -126,3 +130,3 @@ .prompt([ | ||
} | ||
return Promise.resolve((0, package_manager_1.detectInvokedPackageManager)()); | ||
return (0, package_manager_1.detectInvokedPackageManager)(); | ||
} |
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
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
111387
3043