-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
153 additions
and
228 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { uniq } from '@nx/plugin/testing'; | ||
import { | ||
uniq, | ||
} from '@nx/plugin/testing'; | ||
import { checkFilesExist, createTestProject, readJson, runNxCommandAsync } from '@nxrocks/common/testing'; | ||
checkFilesExist, | ||
createTestProject, | ||
readJson, | ||
runNxCommandAsync, | ||
} from '@nxrocks/common/testing'; | ||
import { execSync } from 'child_process'; | ||
import { rmSync } from 'fs-extra'; | ||
|
||
//jest.mock('enquirer'); // we mock 'enquirer' to bypass the interactive prompt | ||
import * as enquirer from 'enquirer'; | ||
import { getPackageManagerCommand } from '@nx/devkit'; | ||
|
||
describe('nx-flutter e2e', () => { | ||
let projectDirectory: string; | ||
|
@@ -16,24 +20,28 @@ describe('nx-flutter e2e', () => { | |
|
||
// The plugin has been built and published to a local registry in the jest globalSetup | ||
// Install the plugin built with the latest source code into the test repo | ||
execSync(`npm install @nxrocks/[email protected]`, { | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
env: process.env, | ||
}); | ||
execSync( | ||
`${getPackageManagerCommand().addDev} @nxrocks/[email protected]`, | ||
{ | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
env: process.env, | ||
} | ||
); | ||
}); | ||
|
||
afterAll(() => { | ||
// Cleanup the test project | ||
projectDirectory && rmSync(projectDirectory, { | ||
recursive: true, | ||
force: true, | ||
}); | ||
projectDirectory && | ||
rmSync(projectDirectory, { | ||
recursive: true, | ||
force: true, | ||
}); | ||
}); | ||
|
||
it('should be installed', () => { | ||
// npm ls will fail if the package is not installed properly | ||
execSync('npm ls @nxrocks/nx-flutter', { | ||
execSync(`${getPackageManagerCommand().list} @nxrocks/nx-flutter`, { | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
}); | ||
|
@@ -154,7 +162,7 @@ describe('nx-flutter e2e', () => { | |
const appName = uniq('nx-flutter'); | ||
|
||
await runNxCommandAsync( | ||
`generate @nxrocks/nx-flutter:create ${appName} --directory subdir --no-interactive` | ||
`generate @nxrocks/nx-flutter:new --directory subdir/${appName} --no-interactive` | ||
); | ||
expect(() => | ||
checkFilesExist(`subdir/${appName}/pubspec.yaml`) | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ describe('nx-ktor e2e', () => { | |
// The plugin has been built and published to a local registry in the jest globalSetup | ||
// Install the plugin built with the latest source code into the test repo | ||
execSync( | ||
`${getPackageManagerCommand().install} @nxrocks/[email protected]`, | ||
`${getPackageManagerCommand().addDev} @nxrocks/[email protected]`, | ||
{ | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
|
@@ -78,7 +78,7 @@ describe('nx-ktor e2e', () => { | |
it('should create src in the specified directory', async () => { | ||
const prjName = uniq('nx-ktor'); | ||
await runNxCommandAsync( | ||
`generate @nxrocks/nx-ktor:new ${prjName} --directory subdir --no-interactive` | ||
`generate @nxrocks/nx-ktor:new --directory subdir/${prjName} --no-interactive` | ||
); | ||
expect(() => | ||
checkFilesExist( | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ describe('nx-melos e2e', () => { | |
// The plugin has been built and published to a local registry in the jest globalSetup | ||
// Install the plugin built with the latest source code into the test repo | ||
execSync( | ||
`${getPackageManagerCommand().install} @nxrocks/[email protected]`, | ||
`${getPackageManagerCommand().addDev} @nxrocks/[email protected]`, | ||
{ | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ describe('nx-micronaut e2e', () => { | |
// The plugin has been built and published to a local registry in the jest globalSetup | ||
// Install the plugin built with the latest source code into the test repo | ||
execSync( | ||
`${getPackageManagerCommand().install} @nxrocks/[email protected]`, | ||
`${getPackageManagerCommand().addDev} @nxrocks/[email protected]`, | ||
{ | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
|
@@ -206,7 +206,7 @@ describe('nx-micronaut e2e', () => { | |
it('should create src in the specified directory', async () => { | ||
const prjName = uniq('nx-micronaut'); | ||
await runNxCommandAsync( | ||
`generate @nxrocks/nx-micronaut:new ${prjName} --directory subdir --no-interactive` | ||
`generate @nxrocks/nx-micronaut:new --directory subdir/${prjName} --no-interactive` | ||
); | ||
expect(() => | ||
checkFilesExist( | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ describe('nx-quarkus e2e', () => { | |
// The plugin has been built and published to a local registry in the jest globalSetup | ||
// Install the plugin built with the latest source code into the test repo | ||
execSync( | ||
`${getPackageManagerCommand().add} @nxrocks/[email protected]`, | ||
`${getPackageManagerCommand().addDev} @nxrocks/[email protected]`, | ||
{ | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
|
@@ -222,7 +222,7 @@ describe('nx-quarkus e2e', () => { | |
const prjName = uniq('nx-quarkus'); | ||
|
||
await runNxCommandAsync( | ||
`generate @nxrocks/nx-quarkus:new ${prjName} --projectType ${projectType} --directory subdir --no-interactive` | ||
`generate @nxrocks/nx-quarkus:new --directory subdir/${prjName} --projectType ${projectType} --no-interactive` | ||
); | ||
expect(() => | ||
checkFilesExist( | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ describe('nx-spring-boot e2e', () => { | |
// The plugin has been built and published to a local registry in the jest globalSetup | ||
// Install the plugin built with the latest source code into the test repo | ||
execSync( | ||
`${getPackageManagerCommand().install} @nxrocks/[email protected]`, | ||
`${getPackageManagerCommand().addDev} @nxrocks/[email protected]`, | ||
{ | ||
cwd: projectDirectory, | ||
stdio: 'inherit', | ||
|
@@ -291,7 +291,7 @@ describe('nx-spring-boot e2e', () => { | |
const prjName = uniq('nx-spring-boot'); | ||
|
||
await runNxCommandAsync( | ||
`generate @nxrocks/nx-spring-boot:new ${prjName} --projectType ${projectType} --directory subdir --no-interactive` | ||
`generate @nxrocks/nx-spring-boot:new --directory subdir/${prjName} --projectType ${projectType} --no-interactive` | ||
); | ||
expect(() => | ||
checkFilesExist( | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import { CreateWorkspaceOptions } from 'create-nx-workspace'; | ||
|
||
|
||
export interface CLIArguments extends CreateWorkspaceOptions { | ||
name: string; | ||
useNxWrapper?: boolean; | ||
nxCloud: 'yes' | 'github' | 'circleci' | 'skip'; | ||
interactive: boolean; | ||
verbose: boolean; | ||
$0?: string; | ||
_?: string[] | ||
} | ||
|
||
useNxWrapper?: boolean; | ||
verbose?: boolean; | ||
presetVersion?: string; | ||
$0?: string; | ||
_?: string[]; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import { ProjectGeneratorOptions } from '../project/schema'; | ||
|
||
export interface PresetGeneratorSchema | ||
extends Omit<ProjectGeneratorOptions, 'name'> { | ||
prjName?: string; // we cannot use "projectName" nor "name" because they have special meanings in Nx | ||
} | ||
export type PresetGeneratorSchema = ProjectGeneratorOptions; |
This file contains 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
Oops, something went wrong.