Skip to content

Commit

Permalink
chore: update schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
tinesoft committed Jan 9, 2025
1 parent 096503e commit cb49b0b
Show file tree
Hide file tree
Showing 21 changed files with 126 additions and 104 deletions.
3 changes: 1 addition & 2 deletions packages/nx-flutter/src/generators/preset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"description": "Name of the project.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe('application generator', () => {
let options: NormalizedSchema;
const _options: ProjectGeneratorOptions = {
directory: 'testapp',
name: 'testapp',
template: 'app',
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import { Tree } from '@nx/devkit';
import { ProjectGeneratorOptions, NormalizedSchema } from '../schema';
import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils';
import {
determineProjectNameAndRootOptions,
ensureProjectName,
} from '@nx/devkit/src/generators/project-name-and-root-utils';

export async function normalizeOptions(
tree: Tree,
options: ProjectGeneratorOptions
): Promise<NormalizedSchema> {
const projectType = options.template === 'app' ? 'application' : 'library';
await ensureProjectName(
tree,
options as ProjectGeneratorOptions,
projectType
);
const { projectName, projectRoot } = await determineProjectNameAndRootOptions(
tree,
{
name: options.name,
projectType: options.template === 'app' ? 'application' : 'library',
projectType,
directory: options.directory,
//rootProject: options.rootProject,
}
Expand Down
3 changes: 1 addition & 2 deletions packages/nx-flutter/src/generators/project/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"description": "Name of the project.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
Expand Down
15 changes: 7 additions & 8 deletions packages/nx-ktor/src/generators/preset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
},
"x-prompt": "Which directory do you want to create the project in?"
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"ktorVersion": {
"description": "Ktor version.",
"type": "string",
Expand Down Expand Up @@ -107,6 +99,13 @@
"x-prompt": "What artifactId would you like to use?",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "Name of the project.",
"alias": "projectName",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"configurationLocation": {
"description": "Configuratin Location.",
"type": "string",
Expand Down
1 change: 0 additions & 1 deletion packages/nx-ktor/src/generators/project/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ describe('project generator', () => {
let options: NormalizedSchema;
const _options: ProjectGeneratorOptions = {
directory: 'ktapp',
name: 'ktapp',
groupId: 'com.tinesoft',
artifactId: 'ktapp',
buildSystem: 'MAVEN',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { Tree } from '@nx/devkit';
import { ProjectGeneratorOptions, NormalizedSchema } from '../schema';
import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils';
import {
determineProjectNameAndRootOptions,
ensureProjectName,
} from '@nx/devkit/src/generators/project-name-and-root-utils';

export async function normalizeOptions(
tree: Tree,
options: ProjectGeneratorOptions
): Promise<NormalizedSchema> {
await ensureProjectName(
tree,
options as ProjectGeneratorOptions,
'application'
);
const { projectName, projectRoot } = await determineProjectNameAndRootOptions(
tree,
{
Expand Down
15 changes: 7 additions & 8 deletions packages/nx-ktor/src/generators/project/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
},
"x-prompt": "Which directory do you want to create the project in?"
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"ktorVersion": {
"description": "Ktor version.",
"type": "string",
Expand Down Expand Up @@ -102,6 +94,13 @@
"x-prompt": "What artifactId would you like to use?",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "Name of the project.",
"alias": "projectName",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"configurationLocation": {
"description": "Configuratin Location.",
"type": "string",
Expand Down
3 changes: 1 addition & 2 deletions packages/nx-micronaut/src/generators/preset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"description": "Name of the project.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ describe('project generator', () => {
let options: NormalizedSchema;
const _options: ProjectGeneratorOptions = {
directory: 'mnapp',
name: 'mnapp',
projectType: 'default',
basePackage: 'com.tinesoft',
buildSystem: 'MAVEN',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { Tree } from '@nx/devkit';
import { ProjectGeneratorOptions, NormalizedSchema } from '../schema';
import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils';
import {
determineProjectNameAndRootOptions,
ensureProjectName,
} from '@nx/devkit/src/generators/project-name-and-root-utils';

export async function normalizeOptions(
tree: Tree,
options: ProjectGeneratorOptions
): Promise<NormalizedSchema> {
await ensureProjectName(
tree,
options as ProjectGeneratorOptions,
'application'
);
const { projectName, projectRoot } = await determineProjectNameAndRootOptions(
tree,
{
Expand Down
3 changes: 1 addition & 2 deletions packages/nx-micronaut/src/generators/project/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"description": "Name of the project.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
Expand Down
15 changes: 7 additions & 8 deletions packages/nx-quarkus/src/generators/preset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
},
"x-prompt": "Which directory do you want to create the project in?"
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"projectType": {
"description": "Type of project.",
"default": "application",
Expand Down Expand Up @@ -116,6 +108,13 @@
"x-prompt": "What artifactId would you like to use?",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "Name of the project.",
"alias": "projectName",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"skipFormat": {
"description": "Skip formatting files (using Spotless plugin).",
"type": "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ describe('project generator', () => {
let options: NormalizedSchema;
const _options: ProjectGeneratorOptions = {
directory: 'quarkusapp',
name: 'quarkusapp',
projectType: 'application',
groupId: 'com.tinesoft',
artifactId: 'demo',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { Tree } from '@nx/devkit';
import { ProjectGeneratorOptions, NormalizedSchema } from '../schema';
import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils';
import {
determineProjectNameAndRootOptions,
ensureProjectName,
} from '@nx/devkit/src/generators/project-name-and-root-utils';

export async function normalizeOptions(
tree: Tree,
options: ProjectGeneratorOptions
): Promise<NormalizedSchema> {
await ensureProjectName(
tree,
options as ProjectGeneratorOptions,
options.projectType
);
const { projectName, projectRoot } = await determineProjectNameAndRootOptions(
tree,
{
Expand Down
15 changes: 7 additions & 8 deletions packages/nx-quarkus/src/generators/project/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
},
"x-prompt": "Which directory do you want to create the project in?"
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"projectType": {
"description": "Type of project.",
"default": "application",
Expand Down Expand Up @@ -111,6 +103,13 @@
"x-prompt": "What artifactId would you like to use?",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "Name of the project.",
"alias": "projectName",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"skipFormat": {
"description": "Skip formatting files (using Spotless plugin).",
"type": "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('preset generator', () => {

it('should run successfully', async () => {
await presetGenerator(tree, options);
const config = readProjectConfiguration(tree, 'bootapp');
const config = readProjectConfiguration(tree, options.name);
expect(config).toBeDefined();
});
});
16 changes: 8 additions & 8 deletions packages/nx-spring-boot/src/generators/preset/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
},
"x-prompt": "Which directory do you want to create the project in?"
},
"name": {
"type": "string",
"description": "Name of the project to generate.",
"alias": "projectName",
"x-prompt": "What name would you like to use?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"projectType": {
"description": "Type of project.",
"default": "application",
Expand Down Expand Up @@ -177,6 +169,13 @@
"x-prompt": "What artifactId would you like to use?",
"x-priority": "important"
},
"name": {
"description": "Name of the project.",
"type": "string",
"default": "demo",
"alias": "projectName",
"x-priority": "important"
},
"packageName": {
"description": "Name of the main package of the project.",
"type": "string",
Expand All @@ -187,6 +186,7 @@
"description": {
"description": "Description of the project.",
"type": "string",
"default": "Demo project for Spring Boot",
"x-priority": "internal"
},
"skipFormat": {
Expand Down
Loading

0 comments on commit cb49b0b

Please sign in to comment.