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

don't add migrate as a blueprint to application config. #21

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ permissions:
jobs:
migrate:
strategy:
fail-fast: false
matrix:
include:
- tests: 7.9.3-latest
Expand Down
8 changes: 2 additions & 6 deletions cli/cli.cjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env node

const { dirname, basename, join } = require('path');
const { dirname, join } = require('path');
const { version, bin } = require('../package.json');

// Get package name to use as namespace.
// Allows blueprints to be aliased.
const packagePath = dirname(__dirname);
const packageFolderName = basename(packagePath);
const devBlueprintPath = join(packagePath, '.blueprint');
const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packageFolderName}` : packageFolderName;

(async () => {
const { runJHipster, done, logger } = await import('generator-jhipster/cli');
Expand All @@ -19,9 +17,7 @@ const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packa
executableVersion: version,
defaultCommand: 'migrate',
devBlueprintPath,
blueprints: {
[blueprint]: version,
},
commands: require('./commands.cjs'),
printBlueprintLogo: () => {
console.log('===================== JHipster migrate =====================');
console.log('');
Expand Down
2 changes: 1 addition & 1 deletion cli/commands.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
migrate: {
description: 'Run migrate sub-generator (migrate blueprint)',
desc: 'Run migrate sub-generator (migrate blueprint)',
blueprint: 'generator-jhipster-migrate',
},
};
4 changes: 2 additions & 2 deletions generators/migrate/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
import { GENERATOR_JHIPSTER } from 'generator-jhipster';
import command from './command.js';
import { GENERATOR_BOOTSTRAP } from 'generator-jhipster/generators';
import { fileURLToPath } from 'url';
import { normalizeBlueprintName } from './internal/blueprints.js';

export default class extends BaseGenerator {
Expand Down Expand Up @@ -553,7 +552,8 @@ export default class extends BaseGenerator {
}
}
} else if (jhipsterVersion === 'bundled') {
cli = join(fileURLToPath(new URL('../../cli/cli.cjs', import.meta.url)));
const packagePath = this.env.getPackagePath('jhipster:app');
cli = join(packagePath, 'dist/cli/jhipster.cjs');
cliOptions = ['app', ...cliOptions];
} else if (jhipsterVersion !== 'none') {
if (jhipsterVersion === 'current') {
Expand Down
Loading