create-nx-workspace
Advanced tools
Comparing version
@@ -135,2 +135,3 @@ "use strict"; | ||
.version('version', chalk.dim `Show version`, nx_version_1.nxVersion); | ||
let rawArgs; | ||
async function main(parsedArgs) { | ||
@@ -140,3 +141,3 @@ output_1.output.log({ | ||
}); | ||
const workspaceInfo = await (0, create_workspace_1.createWorkspace)(parsedArgs.preset, parsedArgs); | ||
const workspaceInfo = await (0, create_workspace_1.createWorkspace)(parsedArgs.preset, parsedArgs, rawArgs); | ||
await (0, ab_testing_1.recordStat)({ | ||
@@ -150,2 +151,3 @@ nxVersion: nx_version_1.nxVersion, | ||
parsedArgs.nxCloud, | ||
rawArgs.nxCloud, | ||
], | ||
@@ -172,2 +174,3 @@ }); | ||
async function normalizeArgsMiddleware(argv) { | ||
rawArgs = argv; | ||
output_1.output.log({ | ||
@@ -174,0 +177,0 @@ title: "Let's create a new workspace [https://nx.dev/getting-started/intro]", |
{ | ||
"name": "create-nx-workspace", | ||
"version": "0.0.0-pr-31885-39ea6c0", | ||
"version": "0.0.0-pr-31935-f9bc715", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Smart Repos · Fast Builds", |
import { CreateWorkspaceOptions } from './create-workspace-options'; | ||
export declare function createWorkspace<T extends CreateWorkspaceOptions>(preset: string, options: T): Promise<{ | ||
export declare function createWorkspace<T extends CreateWorkspaceOptions>(preset: string, options: T, rawArgs?: T): Promise<{ | ||
nxCloudInfo: string | undefined; | ||
@@ -4,0 +4,0 @@ directory: string; |
@@ -15,3 +15,3 @@ "use strict"; | ||
const preset_1 = require("./utils/preset/preset"); | ||
async function createWorkspace(preset, options) { | ||
async function createWorkspace(preset, options, rawArgs) { | ||
const { packageManager, name, nxCloud, skipGit = false, defaultBase = 'main', commit, cliName, useGitHub, } = options; | ||
@@ -39,3 +39,3 @@ if (cliName) { | ||
} | ||
const { connectCloudUrl, output } = await (0, nx_cloud_1.getOnboardingInfo)(nxCloud, token, directory, useGitHub); | ||
const { connectCloudUrl, output } = await (0, nx_cloud_1.getOnboardingInfo)(nxCloud, token, directory, rawArgs?.nxCloud, useGitHub); | ||
connectUrl = connectCloudUrl; | ||
@@ -42,0 +42,0 @@ nxCloudInfo = output; |
declare const outputMessages: { | ||
readonly 'create-nx-workspace-success-ci-setup': readonly [{ | ||
readonly code: "ci-setup-visit"; | ||
readonly createMessage: (url: string) => { | ||
readonly createMessage: (url: string | null) => { | ||
title: string; | ||
@@ -12,3 +12,3 @@ type: string; | ||
readonly code: "remote-cache-visit"; | ||
readonly createMessage: (url: string) => { | ||
readonly createMessage: (url: string | null) => { | ||
title: string; | ||
@@ -23,3 +23,3 @@ type: string; | ||
readonly code: "ci-setup-visit"; | ||
readonly createMessage: (url: string) => { | ||
readonly createMessage: (url: string | null) => { | ||
title: string; | ||
@@ -31,3 +31,3 @@ type: string; | ||
readonly code: "remote-cache-visit"; | ||
readonly createMessage: (url: string) => { | ||
readonly createMessage: (url: string | null) => { | ||
title: string; | ||
@@ -34,0 +34,0 @@ type: string; |
@@ -8,7 +8,11 @@ "use strict"; | ||
code: 'ci-setup-visit', | ||
createMessage: (url) => ({ | ||
title: `Your CI setup is almost complete.`, | ||
type: 'success', | ||
bodyLines: [`Finish it by visiting: ${url}`], | ||
}), | ||
createMessage: (url) => { | ||
return { | ||
title: `Your CI setup is almost complete.`, | ||
type: 'success', | ||
bodyLines: [ | ||
`Push your repository and finish the setup${url ? `: ${url}` : ''}`, | ||
], | ||
}; | ||
}, | ||
}, | ||
@@ -19,7 +23,11 @@ ], | ||
code: 'remote-cache-visit', | ||
createMessage: (url) => ({ | ||
title: `Your remote cache setup is almost complete.`, | ||
type: 'success', | ||
bodyLines: [`Finish it by visiting: ${url}`], | ||
}), | ||
createMessage: (url) => { | ||
return { | ||
title: `Your remote cache is almost complete.`, | ||
type: 'success', | ||
bodyLines: [ | ||
`Push your repository and finish the setup${url ? `: ${url}` : ''}`, | ||
], | ||
}; | ||
}, | ||
}, | ||
@@ -26,0 +34,0 @@ ], |
export type NxCloud = 'yes' | 'github' | 'gitlab' | 'azure' | 'bitbucket-pipelines' | 'circleci' | 'skip'; | ||
export declare function readNxCloudToken(directory: string): string | undefined; | ||
export declare function getOnboardingInfo(nxCloud: NxCloud, token: string, directory: string, useGitHub?: boolean): Promise<{ | ||
export declare function getOnboardingInfo(nxCloud: NxCloud, token: string, directory: string, rawNxCloud?: NxCloud, useGitHub?: boolean): Promise<{ | ||
output: string; | ||
connectCloudUrl: string; | ||
}>; |
@@ -20,3 +20,3 @@ "use strict"; | ||
} | ||
async function getOnboardingInfo(nxCloud, token, directory, useGitHub) { | ||
async function getOnboardingInfo(nxCloud, token, directory, rawNxCloud, useGitHub) { | ||
// nx-ignore-next-line | ||
@@ -35,3 +35,3 @@ const { createNxCloudOnboardingURL } = require(require.resolve('nx/src/nx-cloud/utilities/url-shorten', { | ||
const out = new output_1.CLIOutput(false); | ||
const message = createMessage(connectCloudUrl); | ||
const message = createMessage(typeof rawNxCloud === 'string' ? null : connectCloudUrl); | ||
if (message.type === 'success') { | ||
@@ -38,0 +38,0 @@ out.success(message); |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
115170
0.42%3148
0.35%