Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .blueprint/cli/commands.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2013-1 the original author or authors from the JHipster project.
* Copyright 2013-2026 the original author or authors from the JHipster project.
*
* This file is part of the JHipster project, see https://www.jhipster.tech/
* for more information.
Expand Down
12 changes: 5 additions & 7 deletions .blueprint/generate-sample/command.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2013-2025 the original author or authors from the JHipster project.
* Copyright 2013-2026 the original author or authors from the JHipster project.
*
* This file is part of the JHipster project, see https://www.jhipster.tech/
* for more information.
Expand All @@ -16,8 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { GENERATOR_APP } from 'generator-jhipster/generators';
import { getGithubSamplesGroup, getGithubSamplesGroups } from 'generator-jhipster/testing';
import { getGithubSamplesGroup, getGithubSamplesGroups } from 'generator-jhipster/ci';

const DEFAULT_SAMPLES_GROUP = 'samples';

Expand Down Expand Up @@ -45,7 +44,7 @@ const command = {
},
prompt: gen => ({
when: !gen.all && !gen.sampleName,
type: 'list',
type: 'select',
message: 'which sample group do you want to lookup?',
choices: async () => getGithubSamplesGroups(gen.templatePath(gen.samplesFolder ?? '')),
default: DEFAULT_SAMPLES_GROUP,
Expand All @@ -58,7 +57,7 @@ const command = {
sampleName: {
prompt: gen => ({
when: !gen.all,
type: 'list',
type: 'select',
message: 'which sample do you want to generate?',
choices: async answers => {
const samples = await getGithubSamplesGroup(gen.templatePath(), answers.samplesGroup ?? gen.samplesGroup);
Expand All @@ -75,8 +74,7 @@ const command = {
scope: 'generator',
},
},
options: {},
import: [GENERATOR_APP],
import: ['app'],
};

export default command;
23 changes: 10 additions & 13 deletions .blueprint/generate-sample/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { readdir } from 'node:fs/promises';
import { readFileSync } from 'node:fs';
import { readdir } from 'node:fs/promises';
import { extname, join } from 'node:path';
import BaseGenerator from 'generator-jhipster/generators/base';
import { getGithubSamplesGroup } from 'generator-jhipster/testing';

export default class extends BaseGenerator {
import { getGithubSamplesGroup } from 'generator-jhipster/ci';
import BaseCoreGenerator from 'generator-jhipster/generators/base-core';

export default class extends BaseCoreGenerator {
/** @type {string | undefined} */
samplesFolder;
/** @type {string} */
Expand All @@ -20,12 +21,8 @@ export default class extends BaseGenerator {
/** @type {any} */
generatorOptions;

constructor(args, opts, features) {
super(args, opts, { ...features, queueCommandTasks: true, jhipsterBootstrap: false });
}

get [BaseGenerator.WRITING]() {
return this.asWritingTaskGroup({
get [BaseCoreGenerator.WRITING]() {
return this.asAnyTaskGroup({
async copySample() {
const { samplesFolder, samplesGroup, all, sampleName } = this;
const samplesPath = samplesFolder ? join(samplesFolder, samplesGroup) : samplesGroup;
Expand Down Expand Up @@ -61,8 +58,8 @@ export default class extends BaseGenerator {
});
}

get [BaseGenerator.END]() {
return this.asEndTaskGroup({
get [BaseCoreGenerator.END]() {
return this.asAnyTaskGroup({
async generateYoRcSample() {
if (this.sampleType !== 'yo-rc') return;

Expand Down Expand Up @@ -91,7 +88,7 @@ export default class extends BaseGenerator {
}

getDefaultComposeOptions() {
const packageJson = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)));
const packageJson = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), { encoding: 'utf-8' }));
const projectVersion = `${packageJson.version}-git`;
return {
skipJhipsterDependencies: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,71 @@ exports[`generator - github-build-matrix > with samples > should match matrix va
"include": [
{
"default-environment": "prod",
"java-version": "17",
"java-version": "21",
"job-name": "21-points",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"node-version": "22.15.0",
"npm-version": "11.3.0",
"node-version": "24.14.0",
"npm-version": "11.11.0",
"os": "ubuntu-latest",
"sample": "21-points",
"sample-type": "jdl",
"samples-group": "samples",
},
{
"default-environment": "prod",
"java-version": "17",
"java-version": "21",
"job-name": "flickr2",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"node-version": "22.15.0",
"npm-version": "11.3.0",
"node-version": "24.14.0",
"npm-version": "11.11.0",
"os": "ubuntu-latest",
"sample": "flickr2",
"sample-type": "jdl",
"samples-group": "samples",
},
{
"default-environment": "prod",
"java-version": "17",
"java-version": "21",
"job-name": "gateway-oauth2",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"node-version": "22.15.0",
"npm-version": "11.3.0",
"node-version": "24.14.0",
"npm-version": "11.11.0",
"os": "ubuntu-latest",
"sample": "gateway-oauth2",
"sample-type": "jdl",
"samples-group": "samples",
},
{
"default-environment": "prod",
"java-version": "17",
"java-version": "21",
"job-name": "monolith-jwt",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"node-version": "22.15.0",
"npm-version": "11.3.0",
"node-version": "24.14.0",
"npm-version": "11.11.0",
"os": "ubuntu-latest",
"sample": "monolith-jwt",
"sample-type": "jdl",
"samples-group": "samples",
},
{
"default-environment": "prod",
"java-version": "17",
"java-version": "21",
"job-name": "monolith-oauth2",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"node-version": "22.15.0",
"npm-version": "11.3.0",
"node-version": "24.14.0",
"npm-version": "11.11.0",
"os": "ubuntu-latest",
"sample": "monolith-oauth2",
"sample-type": "jdl",
"samples-group": "samples",
},
{
"default-environment": "prod",
"java-version": "17",
"java-version": "21",
"job-name": "reactive-oauth2",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"node-version": "22.15.0",
"npm-version": "11.3.0",
"node-version": "24.14.0",
"npm-version": "11.11.0",
"os": "ubuntu-latest",
"sample": "reactive-oauth2",
"sample-type": "jdl",
Expand Down
1 change: 0 additions & 1 deletion .blueprint/github-build-matrix/command.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const command = {
scope: 'generator',
},
},
options: {},
};

export default command;
15 changes: 6 additions & 9 deletions .blueprint/github-build-matrix/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import { join } from 'node:path';
import BaseGenerator from 'generator-jhipster/generators/base';
import { convertToGitHubMatrix, getGithubOutputFile, getGithubSamplesGroup, setGithubTaskOutput } from 'generator-jhipster/testing';

export default class extends BaseGenerator {
import { convertToGitHubMatrix, getGithubOutputFile, getGithubSamplesGroup, setGithubTaskOutput } from 'generator-jhipster/ci';
import BaseCoreGenerator from 'generator-jhipster/generators/base-core';

export default class extends BaseCoreGenerator {
/** @type {string} */
samplesFolder;
/** @type {string} */
samplesGroup;
/** @type {object} */
matrix;

constructor(args, opts, features) {
super(args, opts, { ...features, queueCommandTasks: true, jhipsterBootstrap: false });
}

get [BaseGenerator.WRITING]() {
return this.asWritingTaskGroup({
get [BaseCoreGenerator.WRITING]() {
return this.asAnyTaskGroup({
async buildMatrix() {
const { samplesGroup = 'samples' } = this;
const templatePath = this.templatePath('../../generate-sample/templates/');
Expand Down
14 changes: 6 additions & 8 deletions .blueprint/github-build-matrix/generator.spec.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import { basename, dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { beforeAll, describe, expect, it } from 'vitest';
import { getGithubSamplesGroups, defaultHelpers as helpers, runResult } from 'generator-jhipster/testing';
import { basename, join } from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
import { getGithubSamplesGroups } from 'generator-jhipster/ci';
import { defaultHelpers as helpers, runResult } from 'generator-jhipster/testing';

const generator = basename(__dirname);
const generator = basename(import.meta.dirname);

describe(`generator - ${generator}`, async () => {
const groups = await getGithubSamplesGroups(join(__dirname, '../generate-sample/templates/'));
const groups = await getGithubSamplesGroups(join(import.meta.dirname, '../generate-sample/templates/'));
for (const workflow of groups.map(sample => sample.split('.')[0])) {
describe(`with ${workflow}`, () => {
beforeAll(async () => {
await helpers.runJHipster(join(__dirname, 'index.mjs'), { useEnvironmentBuilder: true }).withArguments(workflow);
await helpers.runJHipster(join(import.meta.dirname, 'index.mjs'), { prepareEnvironment: true }).withArguments(workflow);
});

it('should match matrix value', () => {
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*.scss text
*.sh text eol=lf
*.sql text
*.txt text
*.ts text
*.xml text
*.yaml text
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
path: generator-jhipster-ionic
- uses: jhipster/actions/setup-runner@v1
with:
node-version: 20
node-version: 24
binary-dir: ${{ github.workspace }}/generator-jhipster-ionic/cli/
- uses: jhipster/actions/cache-npm-dependencies@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm run test
4 changes: 2 additions & 2 deletions .github/workflows/ionic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
path: ${{ github.workspace }}/backend
- uses: jhipster/actions/setup-runner@v1
with:
node-version: 20
java-version: 17
node-version: 24
java-version: 21
maven-cache: true
gradle-cache: true
binary-dir: ${{ github.workspace }}/generator-jhipster-ionic/cli/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --access public
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules/
npm-debug.log.*
/.awcache/*
/.cache-loader/*
/dist/

######################
# SASS
Expand All @@ -20,7 +21,6 @@ npm-debug.log.*
.project
.metadata
tmp/
tmp/**/*
*.tmp
*.bak
*.swp
Expand Down
3 changes: 2 additions & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"additionalSubGenerators": "ionic",
"baseName": "ionic",
"cli": true,
"defaultCommand": "generate-blueprint",
"entities": [],
"generators": {
"app": {
Expand Down Expand Up @@ -35,7 +36,7 @@
}
},
"githubWorkflows": true,
"jhipsterVersion": "8.11.0",
"jhipsterVersion": "9.0.0",
"js": false,
"localBlueprint": false,
"packageJsonType": "module",
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Before you submit your pull request consider the following guidelines:

- In GitHub, send a pull request to `jhipster/generator-jhipster-ionic:main`.
- If we suggest changes then

- Make the required updates.
- Re-run the JHipster tests on your sample generated project to ensure tests are still passing.
- Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
Expand Down
5 changes: 3 additions & 2 deletions cli/cli.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env node

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

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

// Get package name to use as namespace.
// Allows blueprints to be aliased.
Expand Down
7 changes: 4 additions & 3 deletions eslint.config.js → eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import globals from 'globals';
import { defineConfig } from 'eslint/config';
import prettier from 'eslint-plugin-prettier/recommended';
import jhipster from 'generator-jhipster/eslint';
import globals from 'globals';
// jhipster-needle-eslint-add-import - JHipster will add additional import here

export default [
export default defineConfig(
{
languageOptions: {
globals: {
Expand All @@ -15,4 +16,4 @@ export default [
jhipster.recommended,
// jhipster-needle-eslint-add-config - JHipster will add additional config here
prettier,
];
);
4 changes: 2 additions & 2 deletions generators/app/__snapshots__/generator.spec.mjs.snap
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ exports[`SubGenerator app of ionic JHipster blueprint > run > should succeed 1`]
"../ionic4j/cypress/tsconfig.json": {
"stateCleared": "modified",
},
"../ionic4j/eslint.config.mjs": {
"../ionic4j/eslint.config.ts": {
"stateCleared": "modified",
},
"../ionic4j/ionic.config.json": {
Expand Down Expand Up @@ -562,7 +562,7 @@ exports[`SubGenerator app of ionic JHipster blueprint > with custom ionic path >
"../ionic-app/cypress/tsconfig.json": {
"stateCleared": "modified",
},
"../ionic-app/eslint.config.mjs": {
"../ionic-app/eslint.config.ts": {
"stateCleared": "modified",
},
"../ionic-app/ionic.config.json": {
Expand Down
Loading
Loading