Skip to content

Commit

Permalink
drop project-name generator and others adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Nov 1, 2024
1 parent 2abfbf7 commit e5038e5
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 182 deletions.
8 changes: 1 addition & 7 deletions .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
"sbs": true,
"written": true
},
"project-name": {
"command": false,
"priorities": ["initializing", "prompting", "configuring", "default", "end"],
"sbs": true,
"written": true
},
"react-native": {
"command": false,
"priorities": ["initializing", "prompting", "configuring", "default", "end"],
Expand All @@ -39,6 +33,6 @@
"packageJsonType": "module",
"sampleWritten": true,
"skipCommitHook": true,
"subGenerators": ["app", "project-name", "react-native", "spring-boot"]
"subGenerators": ["app", "react-native", "spring-boot"]
}
}
2 changes: 1 addition & 1 deletion cli/cli-customizations.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file will not be overwritten by generate-blueprint
module.exports = {
defaultCommand: 'app',
defaultCommand: 'react-native',
printBlueprintLogo: undefined,
printLogo: async () => {
const { printJHipsterLogo } = await import('./print-jhipster-logo.js');
Expand Down
9 changes: 0 additions & 9 deletions generators/project-name/__snapshots__/generator.spec.mjs.snap

This file was deleted.

5 changes: 0 additions & 5 deletions generators/project-name/command.mjs

This file was deleted.

114 changes: 0 additions & 114 deletions generators/project-name/generator.mjs

This file was deleted.

26 changes: 0 additions & 26 deletions generators/project-name/generator.spec.mjs

This file was deleted.

2 changes: 0 additions & 2 deletions generators/project-name/index.mjs

This file was deleted.

7 changes: 7 additions & 0 deletions generators/react-native/command.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { asCommand } from 'generator-jhipster';
import { DEFAULT_ENABLE_DETOX } from '../constants.mjs';

export default asCommand({
configs: {
detox: {
description: 'Generate Detox tests',
prompt: {
name: 'detox',
type: 'confirm',
message: 'Do you want to enable end-to-end tests with Detox?',
default: DEFAULT_ENABLE_DETOX,
},
scope: 'blueprint',
},
},
Expand Down
26 changes: 8 additions & 18 deletions generators/react-native/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-applica
import { generateTestEntity } from 'generator-jhipster/generators/client/support';
import { camelCase, kebabCase, snakeCase, startCase } from 'lodash-es';
import semver from 'semver';
import { DEFAULT_BACKEND_PATH, DEFAULT_ENABLE_DETOX } from '../constants.mjs';
import { DEFAULT_BACKEND_PATH, DEFAULT_REACT_NATIVE_APP_NAME } from '../constants.mjs';
import files from './files.mjs';
import entityFiles from './entity-files.mjs';
import {
Expand All @@ -22,7 +22,7 @@ import {

export default class extends BaseApplicationGenerator {
constructor(args, opts, features) {
super(args, opts, { ...features, sbsBlueprint: true, jhipster7Migration: true });
super(args, opts, { ...features, queueCommandTasks: true, sbsBlueprint: true, jhipster7Migration: true });

if (this.options.help) return;

Expand Down Expand Up @@ -65,22 +65,20 @@ export default class extends BaseApplicationGenerator {
message: 'Enter the directory where your JHipster app is located:',
default: DEFAULT_BACKEND_PATH,
},
{
name: 'detox',
type: 'confirm',
message: 'Do you want to enable end-to-end tests with Detox?',
default: DEFAULT_ENABLE_DETOX,
},
],
this.reactNativeStorage,
);
this.reactNativeStorage.defaults({ appDir: DEFAULT_BACKEND_PATH, reactNativeDir: null, detox: DEFAULT_ENABLE_DETOX });
this.reactNativeStorage.defaults({ appDir: DEFAULT_BACKEND_PATH, reactNativeDir: null });

if (this.reactNativeConfig.appDir) {
this.addBackendStorages();
}

await this.dependsOnJHipster('bootstrap-application');
await this.dependsOnJHipster('bootstrap-application', {
generatorOptions: {
defaultBaseName: () => DEFAULT_REACT_NATIVE_APP_NAME,
},
});
await this.dependsOnJHipster('init');
}

Expand Down Expand Up @@ -152,14 +150,6 @@ export default class extends BaseApplicationGenerator {
});
}

get [BaseApplicationGenerator.LOADING]() {
return this.asLoadingTaskGroup({
async loadCommand({ application }) {
await this.loadCurrentJHipsterCommandConfig(application);
},
});
}

get [BaseApplicationGenerator.PREPARING]() {
return this.asPreparingTaskGroup({
dependencies({ application }) {
Expand Down

0 comments on commit e5038e5

Please sign in to comment.