Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement base-workspaces #23392

Merged
merged 27 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generators/aws/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import AwsFactory from './lib/aws.mjs';
import statistics from '../statistics.mjs';
import { GENERATOR_AWS } from '../generator-list.mjs';
import { databaseTypes } from '../../jdl/jhipster/index.mjs';
import { buildApplication } from '../base-docker/utils.mjs';
import { buildApplication } from '../server/internal/index.mjs';

const { MYSQL, POSTGRESQL, MARIADB } = databaseTypes;

Expand Down
2 changes: 1 addition & 1 deletion generators/azure-app-service/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { JAVA_VERSION, SERVER_MAIN_RES_DIR } from '../generator-constants.mjs';
import { GENERATOR_AZURE_APP_SERVICE } from '../generator-list.mjs';
import { buildToolTypes } from '../../jdl/jhipster/index.mjs';
import { mavenPluginConfiguration } from './templates.mjs';
import { buildApplication } from '../base-docker/utils.mjs';
import { buildApplication } from '../server/internal/index.mjs';

const isWin32 = os.platform() === 'win32';

Expand Down
2 changes: 1 addition & 1 deletion generators/azure-spring-cloud/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { GENERATOR_AZURE_SPRING_CLOUD } from '../generator-list.mjs';
import { mavenProfile } from './templates.mjs';
import { createPomStorage } from '../maven/support/pom-store.mjs';
import { getFrontendAppName } from '../base/support/index.mjs';
import { buildApplication } from '../base-docker/utils.mjs';
import { buildApplication } from '../server/internal/index.mjs';

const { MEMCACHED } = cacheTypes;

Expand Down
4 changes: 2 additions & 2 deletions generators/base-application/generator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,13 @@ export default class BaseApplicationGenerator<
});
}

getArgsForPriority(priorityName) {
getArgsForPriority(priorityName): any[] {
const args = super.getArgsForPriority(priorityName);
let firstArg = this.getTaskFirstArgForPriority(priorityName);
if (args.length > 0) {
firstArg = { ...args[0], ...firstArg };
}
return [firstArg] as any;
return [firstArg];
}

/**
Expand Down
15 changes: 10 additions & 5 deletions generators/base-core/generator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -982,18 +982,23 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
});
}

private calculateApplicationId(applicationPath: string) {
const dirname = basename(applicationPath);
return `${createHash('shake256', { outputLength: 1 }).update(applicationPath, 'utf8').digest('hex')}-${dirname}`;
}

protected getSharedApplication(applicationFolder: string = this.destinationPath()) {
return this.options.sharedData.applications?.[this.calculateApplicationId(applicationFolder)];
}

private createSharedData({
jhipsterOldVersion,
help,
}: {
jhipsterOldVersion: string | null;
help?: boolean;
}): SharedData<BaseApplication> {
const destinationPath = this.destinationPath();
const dirname = basename(destinationPath);
const applicationId =
this.options.applicationId ??
`${createHash('shake256', { outputLength: 1 }).update(destinationPath, 'utf8').digest('hex')}-${dirname}`;
const applicationId = this.options.applicationId ?? this.calculateApplicationId(this.destinationPath());
if (this.options.sharedData.applications === undefined) {
this.options.sharedData.applications = {};
}
Expand Down
148 changes: 0 additions & 148 deletions generators/base-docker/docker-cli.mjs

This file was deleted.

114 changes: 0 additions & 114 deletions generators/base-docker/generator.mjs

This file was deleted.

7 changes: 7 additions & 0 deletions generators/base-workspaces/command.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { JHipsterCommandDefinition } from '../base/api.mjs';

const command: JHipsterCommandDefinition = {
options: {},
};

export default command;
Loading
Loading