From b737463348f37c684f926f47be5b95a2f5d10969 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Tue, 10 Sep 2024 21:04:15 -0300 Subject: [PATCH] convert files to typescript and move testing to lib (#27237) --- .blueprint/cli/{commands.mjs => commands.mts} | 0 .../{generator.mjs => generator.mts} | 0 .../code-workspace/{index.mjs => index.mts} | 0 .blueprint/{constants.js => constants.ts} | 0 .blueprint/from-issue/command.mts | 2 +- .blueprint/from-issue/generator.mts | 2 +- .../from-issue/{index.mjs => index.mts} | 0 .../{generator.mjs => generator.mts} | 0 .../{index.mjs => index.mts} | 0 .../templates/generator.spec.ts.ejs | 2 +- .../{generator.mjs => generator.mts} | 6 +++-- .../generate-sample/{index.mjs => index.mts} | 0 ...tity-samples.js => copy-entity-samples.ts} | 0 ...-samples.js => copy-jdl-entity-samples.ts} | 0 ...{generate-sample.js => generate-sample.ts} | 10 +++++++- ...low-samples.js => get-workflow-samples.ts} | 4 ++-- .../{generator.mjs => generator.mts} | 2 +- .../update-vscode/{index.mjs => index.mts} | 0 cli/cli.spec.mts | 2 +- cli/environment-builder.mjs | 4 +++- cli/environment-builder.spec.mts | 2 +- cli/program.spec.mts | 2 +- generators/angular/generator.spec.ts | 2 +- generators/app/composing.spec.ts | 2 +- generators/app/generator.spec.ts | 2 +- generators/base-application/generator.spec.ts | 2 +- generators/base-core/generator-core.spec.ts | 2 +- generators/base/blueprints.spec.ts | 2 +- generators/base/generator.spec.ts | 2 +- .../generator.spec.ts | 2 +- .../generator.spec.ts | 2 +- .../generator.spec.ts | 2 +- .../bootstrap-application/generator.spec.ts | 2 +- .../support/auto-crlf-transform.spec.ts | 2 +- generators/ci-cd/ci-cd.spec.ts | 2 +- generators/client/generator-needles.spec.ts | 2 +- generators/client/generator.spec.ts | 2 +- .../generators/common/generator.spec.ts | 2 +- generators/client/needle-client.spec.ts | 2 +- generators/client/prompts.spec.ts | 2 +- generators/common/generator.spec.ts | 2 +- generators/cucumber/generator.spec.ts | 2 +- generators/cypress/generator.spec.ts | 2 +- .../docker-compose/docker-compose.spec.ts | 2 +- .../service-discovery-matcher.ts | 2 +- generators/docker/generator.spec.ts | 2 +- generators/entities/generator.spec.ts | 2 +- generators/entity/database-changelog.spec.ts | 2 +- generators/entity/single-entity.spec.ts | 2 +- generators/export-jdl/export-jdl.spec.ts | 2 +- generators/feign-client/generator.spec.ts | 2 +- generators/gatling/generator.spec.ts | 2 +- .../generate-blueprint/generator.spec.ts | 2 +- generators/git/generator.spec.ts | 2 +- generators/gradle/generator.spec.ts | 2 +- .../generators/code-quality/generator.spec.ts | 2 +- .../gradle/generators/jib/generator.spec.ts | 2 +- generators/gradle/needles.spec.ts | 2 +- generators/heroku/heroku.spec.ts | 2 +- generators/init/generator.spec.ts | 2 +- generators/java/generator.spec.ts | 2 +- .../generators/bootstrap/generator.spec.ts | 2 +- .../generators/build-tool/generator.spec.ts | 2 +- .../generators/code-quality/generator.spec.ts | 2 +- .../java/generators/domain/generator.spec.ts | 2 +- .../java/generators/jib/generator.spec.ts | 2 +- .../java/generators/node/generator.spec.ts | 2 +- .../openapi-generator/generator.spec.ts | 2 +- .../generators/bootstrap/generator.spec.ts | 2 +- .../generators/eslint/generator.spec.ts | 2 +- .../generators/husky/generator.spec.ts | 2 +- .../generators/prettier/generator.spec.ts | 2 +- generators/jdl/command.ts | 4 ++-- generators/jdl/generator.spec.ts | 2 +- .../kubernetes-helm/kubernetes.helm.spec.ts | 2 +- generators/kubernetes-knative/knative.spec.ts | 2 +- generators/kubernetes/kubernetes.spec.ts | 2 +- .../languages/generator-needles.spec.ts | 2 +- generators/languages/generator.spec.ts | 2 +- generators/languages/languages.spec.ts | 2 +- .../liquibase/incremental-liquibase.spec.ts | 2 +- generators/liquibase/needles.spec.ts | 2 +- generators/maven/generator.spec.ts | 2 +- .../generators/code-quality/generator.spec.ts | 2 +- .../frontend-plugin/generator.spec.ts | 2 +- .../maven/generators/jib/generator.spec.ts | 2 +- generators/maven/needles.spec.ts | 2 +- generators/react/generator.spec.ts | 2 +- generators/server/generator.spec.ts | 2 +- generators/server/needle-logback.spec.ts | 2 +- generators/server/support/needles.spec.ts | 2 +- generators/spring-boot/generator.spec.ts | 2 +- generators/spring-cache/generator.spec.ts | 2 +- generators/spring-cache/needles.spec.ts | 2 +- .../generator-pulsar.spec.ts | 2 +- .../spring-cloud-stream/generator.spec.ts | 2 +- .../generators/gateway/generator.spec.ts | 2 +- .../database-changelog.spec.ts | 2 +- .../spring-data-cassandra/generator.spec.ts | 2 +- .../spring-data-couchbase/generator.spec.ts | 2 +- .../__test-support/elastic-search-matcher.ts | 2 +- .../generator.spec.ts | 2 +- .../spring-data-mongodb/generator.spec.ts | 2 +- .../spring-data-neo4j/generator.spec.ts | 2 +- .../spring-data-relational/generator.spec.ts | 2 +- .../sql-entities.spec.ts | 2 +- generators/spring-websocket/generator.spec.ts | 2 +- generators/upgrade/generator.spec.ts | 2 +- generators/upgrade/upgrade.spec.ts | 2 +- generators/vue/generator.spec.ts | 2 +- .../converters/exporters/export-utils.spec.ts | 2 +- .../converters/exporters/jdl-exporter.spec.ts | 2 +- .../jhipster-deployment-exporter.spec.ts | 2 +- .../jhipster-entity-exporter.spec.ts | 2 +- .../converters/json-to-jdl-converter.spec.ts | 2 +- lib/jdl/core/linters/jdl-linter.spec.ts | 2 +- lib/jdl/core/readers/file-reader.spec.ts | 2 +- lib/jdl/core/readers/jdl-reader.spec.ts | 2 +- lib/jdl/integration-test.spec.ts | 2 +- {testing => lib/testing}/get-generator.ts | 9 +++----- {testing => lib/testing}/github.ts | 0 {testing => lib/testing}/helpers.ts | 23 +++++++++---------- {testing => lib/testing}/index.ts | 0 {testing => lib/testing}/sample-config.ts | 6 ++--- .../testing}/support/application-samples.ts | 2 +- .../testing}/support/client-samples.ts | 0 .../testing}/support/deployment-samples.ts | 0 .../testing}/support/entity-samples.ts | 2 +- {testing => lib/testing}/support/matcher.ts | 0 .../testing}/support/matrix-utils.ts | 0 .../testing}/support/server-samples.ts | 0 lib/types/application/options.d.ts | 1 + lib/types/application/yo-rc.d.ts | 1 + package.json | 4 ++-- .../needle-client-angular-generator.spec.ts | 2 +- test/needle-api/needle-client-angular.spec.ts | 2 +- .../needle-client-react-generator.spec.ts | 2 +- test/needle-api/needle-client-react.spec.ts | 2 +- .../needle-client-vue-generator.spec.ts | 2 +- test/needle-api/needle-client-vue.spec.ts | 2 +- test/support/check-enforcements.ts | 2 +- test/support/tests.js | 2 +- tsconfig.json | 2 +- 143 files changed, 155 insertions(+), 145 deletions(-) rename .blueprint/cli/{commands.mjs => commands.mts} (100%) rename .blueprint/code-workspace/{generator.mjs => generator.mts} (100%) rename .blueprint/code-workspace/{index.mjs => index.mts} (100%) rename .blueprint/{constants.js => constants.ts} (100%) rename .blueprint/from-issue/{index.mjs => index.mts} (100%) rename .blueprint/generate-generator/{generator.mjs => generator.mts} (100%) rename .blueprint/generate-generator/{index.mjs => index.mts} (100%) rename .blueprint/generate-sample/{generator.mjs => generator.mts} (96%) rename .blueprint/generate-sample/{index.mjs => index.mts} (100%) rename .blueprint/generate-sample/support/{copy-entity-samples.js => copy-entity-samples.ts} (100%) rename .blueprint/generate-sample/support/{copy-jdl-entity-samples.js => copy-jdl-entity-samples.ts} (100%) rename .blueprint/generate-sample/support/{generate-sample.js => generate-sample.ts} (95%) rename .blueprint/generate-sample/support/{get-workflow-samples.js => get-workflow-samples.ts} (90%) rename .blueprint/update-vscode/{generator.mjs => generator.mts} (95%) rename .blueprint/update-vscode/{index.mjs => index.mts} (100%) rename {testing => lib/testing}/get-generator.ts (60%) rename {testing => lib/testing}/github.ts (100%) rename {testing => lib/testing}/helpers.ts (95%) rename {testing => lib/testing}/index.ts (100%) rename {testing => lib/testing}/sample-config.ts (85%) rename {testing => lib/testing}/support/application-samples.ts (88%) rename {testing => lib/testing}/support/client-samples.ts (100%) rename {testing => lib/testing}/support/deployment-samples.ts (100%) rename {testing => lib/testing}/support/entity-samples.ts (96%) rename {testing => lib/testing}/support/matcher.ts (100%) rename {testing => lib/testing}/support/matrix-utils.ts (100%) rename {testing => lib/testing}/support/server-samples.ts (100%) diff --git a/.blueprint/cli/commands.mjs b/.blueprint/cli/commands.mts similarity index 100% rename from .blueprint/cli/commands.mjs rename to .blueprint/cli/commands.mts diff --git a/.blueprint/code-workspace/generator.mjs b/.blueprint/code-workspace/generator.mts similarity index 100% rename from .blueprint/code-workspace/generator.mjs rename to .blueprint/code-workspace/generator.mts diff --git a/.blueprint/code-workspace/index.mjs b/.blueprint/code-workspace/index.mts similarity index 100% rename from .blueprint/code-workspace/index.mjs rename to .blueprint/code-workspace/index.mts diff --git a/.blueprint/constants.js b/.blueprint/constants.ts similarity index 100% rename from .blueprint/constants.js rename to .blueprint/constants.ts diff --git a/.blueprint/from-issue/command.mts b/.blueprint/from-issue/command.mts index 6fa388652a0e..05339b16bccc 100644 --- a/.blueprint/from-issue/command.mts +++ b/.blueprint/from-issue/command.mts @@ -18,7 +18,7 @@ */ import type { JHipsterCommandDefinition } from '../../lib/command/index.js'; import { GENERATOR_APP, GENERATOR_WORKSPACES } from '../../generators/generator-list.js'; -import { parseIssue } from '../../testing/github.js'; +import { parseIssue } from '../../lib/testing/github.js'; const command: JHipsterCommandDefinition = { configs: { diff --git a/.blueprint/from-issue/generator.mts b/.blueprint/from-issue/generator.mts index e3e521d42161..a26bf834d205 100644 --- a/.blueprint/from-issue/generator.mts +++ b/.blueprint/from-issue/generator.mts @@ -1,7 +1,7 @@ import { join } from 'node:path'; import BaseGenerator from '../../generators/base/index.js'; -import { getGithubIssue, setGithubTaskOutput, prepareSample } from '../../testing/index.js'; +import { getGithubIssue, setGithubTaskOutput, prepareSample } from '../../lib/testing/index.js'; import { promptSamplesFolder } from '../support.mjs'; import { GENERATOR_APP, GENERATOR_JDL, GENERATOR_WORKSPACES } from '../../generators/generator-list.js'; import { extractDataFromInfo, type InfoData } from '../../generators/info/support/index.js'; diff --git a/.blueprint/from-issue/index.mjs b/.blueprint/from-issue/index.mts similarity index 100% rename from .blueprint/from-issue/index.mjs rename to .blueprint/from-issue/index.mts diff --git a/.blueprint/generate-generator/generator.mjs b/.blueprint/generate-generator/generator.mts similarity index 100% rename from .blueprint/generate-generator/generator.mjs rename to .blueprint/generate-generator/generator.mts diff --git a/.blueprint/generate-generator/index.mjs b/.blueprint/generate-generator/index.mts similarity index 100% rename from .blueprint/generate-generator/index.mjs rename to .blueprint/generate-generator/index.mts diff --git a/.blueprint/generate-generator/templates/generator.spec.ts.ejs b/.blueprint/generate-generator/templates/generator.spec.ts.ejs index ea65ff227c52..8a6bd47eb943 100644 --- a/.blueprint/generate-generator/templates/generator.spec.ts.ejs +++ b/.blueprint/generate-generator/templates/generator.spec.ts.ejs @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, it, describe, expect } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '<%- generatorRelativePath %>../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '<%- generatorRelativePath %>../testing/index.js'; +import { defaultHelpers as helpers, result } from '<%- generatorRelativePath %>../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/.blueprint/generate-sample/generator.mjs b/.blueprint/generate-sample/generator.mts similarity index 96% rename from .blueprint/generate-sample/generator.mjs rename to .blueprint/generate-sample/generator.mts index 2ff2bd5a5c60..d8e37704b3dc 100644 --- a/.blueprint/generate-sample/generator.mjs +++ b/.blueprint/generate-sample/generator.mts @@ -5,6 +5,7 @@ import { packageJson } from '../../lib/index.js'; import { promptSamplesFolder } from '../support.mjs'; import { GENERATOR_APP, GENERATOR_INFO, GENERATOR_JDL } from '../../generators/generator-list.js'; import { entitiesByType, generateSample } from './support/index.js'; +import assert from 'assert'; export default class extends BaseGenerator { sampleName; @@ -65,11 +66,12 @@ export default class extends BaseGenerator { destProjectFolder: this.projectFolder, fork: false, }); + assert.ok(sample, `Sample ${this.sampleName} not found`); // Cleanup mem-fs files. Reload them from disk. await this.pipeline( { refresh: true, pendingFiles: false }, - transform(() => {}), + transform(() => undefined), ); let generatorOptions = { @@ -124,7 +126,7 @@ export default class extends BaseGenerator { generatorOptions: { samplePath: this.sampleName, }, - }); + } as any); } }, async info() { diff --git a/.blueprint/generate-sample/index.mjs b/.blueprint/generate-sample/index.mts similarity index 100% rename from .blueprint/generate-sample/index.mjs rename to .blueprint/generate-sample/index.mts diff --git a/.blueprint/generate-sample/support/copy-entity-samples.js b/.blueprint/generate-sample/support/copy-entity-samples.ts similarity index 100% rename from .blueprint/generate-sample/support/copy-entity-samples.js rename to .blueprint/generate-sample/support/copy-entity-samples.ts diff --git a/.blueprint/generate-sample/support/copy-jdl-entity-samples.js b/.blueprint/generate-sample/support/copy-jdl-entity-samples.ts similarity index 100% rename from .blueprint/generate-sample/support/copy-jdl-entity-samples.js rename to .blueprint/generate-sample/support/copy-jdl-entity-samples.ts diff --git a/.blueprint/generate-sample/support/generate-sample.js b/.blueprint/generate-sample/support/generate-sample.ts similarity index 95% rename from .blueprint/generate-sample/support/generate-sample.js rename to .blueprint/generate-sample/support/generate-sample.ts index a7a3d42246cf..1a096a624331 100644 --- a/.blueprint/generate-sample/support/generate-sample.js +++ b/.blueprint/generate-sample/support/generate-sample.ts @@ -21,7 +21,15 @@ export const generateSample = async ( jdlEntity: passedJdlEntity, jdlSamples: passedJdlSamples, fork = true, - } = {}, + }: { + destProjectFolder: string; + environment?: string; + war?: boolean; + entity?: string; + jdlEntity?: string; + jdlSamples?: string; + fork?: boolean; + }, ) => { if (!sampleName) { throw new Error('Sample name is required'); diff --git a/.blueprint/generate-sample/support/get-workflow-samples.js b/.blueprint/generate-sample/support/get-workflow-samples.ts similarity index 90% rename from .blueprint/generate-sample/support/get-workflow-samples.js rename to .blueprint/generate-sample/support/get-workflow-samples.ts index beb06cb79590..9249f1435f35 100644 --- a/.blueprint/generate-sample/support/get-workflow-samples.js +++ b/.blueprint/generate-sample/support/get-workflow-samples.ts @@ -7,7 +7,7 @@ export const DAILY_PREFIX = 'daily-'; export const isDaily = workflow => workflow.startsWith(DAILY_PREFIX); -export const getWorkflowSamples = (workflows = WORKFLOW_NAMES) => +export const getWorkflowSamples = (workflows: string[] = WORKFLOW_NAMES) => Object.fromEntries( workflows.map(workflow => [ workflow, @@ -27,7 +27,7 @@ export const getWorkflowSamples = (workflows = WORKFLOW_NAMES) => ]), ); -export default workflows => +export default (workflows?: string[]) => Object.fromEntries( Object.values(getWorkflowSamples(workflows)) .map(workflowSamples => Object.entries(workflowSamples)) diff --git a/.blueprint/update-vscode/generator.mjs b/.blueprint/update-vscode/generator.mts similarity index 95% rename from .blueprint/update-vscode/generator.mjs rename to .blueprint/update-vscode/generator.mts index 8140d068e5a8..cb6c67ac1249 100644 --- a/.blueprint/update-vscode/generator.mjs +++ b/.blueprint/update-vscode/generator.mts @@ -13,7 +13,7 @@ export default class extends BaseGenerator { async generateVscodeLaunch() { const vscodeLaunch = join(getPackageRoot(), '.vscode/launch.json'); - const baseFile = { + const baseFile: { version: string; inputs: any[]; configurations: any } = { version: '0.2.0', inputs: [], configurations: [ diff --git a/.blueprint/update-vscode/index.mjs b/.blueprint/update-vscode/index.mts similarity index 100% rename from .blueprint/update-vscode/index.mjs rename to .blueprint/update-vscode/index.mts diff --git a/cli/cli.spec.mts b/cli/cli.spec.mts index e7e94858bae6..a1ed19599aa4 100644 --- a/cli/cli.spec.mts +++ b/cli/cli.spec.mts @@ -10,7 +10,7 @@ import type FullEnvironment from 'yeoman-environment'; import { coerce } from 'semver'; import quibble from 'quibble'; -import { defaultHelpers as helpers, createBlueprintFiles } from '../testing/index.js'; +import { defaultHelpers as helpers, createBlueprintFiles } from '../lib/testing/index.js'; import { getCommand as actualGetCommonand } from './utils.mjs'; import { createProgram } from './program.mjs'; diff --git a/cli/environment-builder.mjs b/cli/environment-builder.mjs index c84ff76461c2..61a4f695413b 100644 --- a/cli/environment-builder.mjs +++ b/cli/environment-builder.mjs @@ -406,7 +406,9 @@ export default class EnvironmentBuilder { for (const [blueprint, packagePath] of blueprintPackagePaths) { let blueprintCommand; const blueprintCommandFile = `${packagePath}/cli/commands`; - const blueprintCommandExtension = ['.js', '.cjs', '.mjs'].find(extension => existsSync(`${blueprintCommandFile}${extension}`)); + const blueprintCommandExtension = ['.js', '.cjs', '.mjs', '.ts', '.cts', '.mts'].find(extension => + existsSync(`${blueprintCommandFile}${extension}`), + ); if (blueprintCommandExtension) { const blueprintCommandsUrl = pathToFileURL(resolve(`${blueprintCommandFile}${blueprintCommandExtension}`)); try { diff --git a/cli/environment-builder.spec.mts b/cli/environment-builder.spec.mts index 3540d81b31b0..b7d701a54e4f 100644 --- a/cli/environment-builder.spec.mts +++ b/cli/environment-builder.spec.mts @@ -22,7 +22,7 @@ import fs from 'fs'; import { expect } from 'chai'; import sinon from 'sinon'; import { before, it, describe, after, expect as jestExpect, beforeEach } from 'esmocha'; -import { defaultHelpers as helpers, createBlueprintFiles } from '../testing/index.js'; +import { defaultHelpers as helpers, createBlueprintFiles } from '../lib/testing/index.js'; import EnvironmentBuilder from './environment-builder.mjs'; diff --git a/cli/program.spec.mts b/cli/program.spec.mts index b43444feb536..ca1debf43cb2 100644 --- a/cli/program.spec.mts +++ b/cli/program.spec.mts @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { describe, it, beforeEach } from 'esmocha'; -import { defaultHelpers as helpers } from '../testing/index.js'; +import { defaultHelpers as helpers } from '../lib/testing/index.js'; import { createProgram } from './program.mjs'; describe('cli - program', () => { diff --git a/generators/angular/generator.spec.ts b/generators/angular/generator.spec.ts index 58aa9977e360..6103f39635a1 100644 --- a/generators/angular/generator.spec.ts +++ b/generators/angular/generator.spec.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; diff --git a/generators/app/composing.spec.ts b/generators/app/composing.spec.ts index 06059b1cef86..43366967c78a 100644 --- a/generators/app/composing.spec.ts +++ b/generators/app/composing.spec.ts @@ -1,7 +1,7 @@ import assert from 'assert'; import { before, describe, it } from 'esmocha'; -import { defaultHelpers as helpers } from '../../testing/index.js'; +import { defaultHelpers as helpers } from '../../lib/testing/index.js'; import { GENERATOR_APP } from '../generator-list.js'; const allMockedComposedGenerators = [ diff --git a/generators/app/generator.spec.ts b/generators/app/generator.spec.ts index b2b7524cb097..d0288ce07ee0 100644 --- a/generators/app/generator.spec.ts +++ b/generators/app/generator.spec.ts @@ -22,7 +22,7 @@ import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { getCommandHelpOutput, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/base-application/generator.spec.ts b/generators/base-application/generator.spec.ts index 8da8983dc4e4..0903d3e5181f 100644 --- a/generators/base-application/generator.spec.ts +++ b/generators/base-application/generator.spec.ts @@ -22,7 +22,7 @@ import { before, describe, esmocha, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import EnvironmentBuilder from '../../cli/environment-builder.mjs'; -import { defaultHelpers as helpers } from '../../testing/index.js'; +import { defaultHelpers as helpers } from '../../lib/testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; import Generator from './index.js'; diff --git a/generators/base-core/generator-core.spec.ts b/generators/base-core/generator-core.spec.ts index 7e9da7a853b2..e180a3d7e901 100644 --- a/generators/base-core/generator-core.spec.ts +++ b/generators/base-core/generator-core.spec.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, it, expect as jestExpect } from 'esmocha'; -import { basicHelpers as helpers } from '../../testing/index.js'; +import { basicHelpers as helpers } from '../../lib/testing/index.js'; import { createJHipsterLogger } from '../base/support/index.js'; import Base from './index.js'; diff --git a/generators/base/blueprints.spec.ts b/generators/base/blueprints.spec.ts index 99a6dfb3592e..5993cf600357 100644 --- a/generators/base/blueprints.spec.ts +++ b/generators/base/blueprints.spec.ts @@ -3,7 +3,7 @@ import { mock } from 'node:test'; import { before, describe, expect, it } from 'esmocha'; import type { RunResult } from 'yeoman-test'; -import { basicHelpers as helpers } from '../../testing/index.js'; +import { basicHelpers as helpers } from '../../lib/testing/index.js'; import { packageJson } from '../../lib/index.js'; import BaseGenerator from './index.js'; diff --git a/generators/base/generator.spec.ts b/generators/base/generator.spec.ts index eee1f0ee1f70..2fb0608affee 100644 --- a/generators/base/generator.spec.ts +++ b/generators/base/generator.spec.ts @@ -22,7 +22,7 @@ import { before, describe, esmocha, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import EnvironmentBuilder from '../../cli/environment-builder.mjs'; -import { defaultHelpers as helpers } from '../../testing/index.js'; +import { defaultHelpers as helpers } from '../../lib/testing/index.js'; import { getCommandHelpOutput, shouldSupportFeatures } from '../../test/support/tests.js'; import BaseGenerator from './index.js'; diff --git a/generators/bootstrap-application-base/generator.spec.ts b/generators/bootstrap-application-base/generator.spec.ts index 56ea0d3e893d..9500d1898344 100644 --- a/generators/bootstrap-application-base/generator.spec.ts +++ b/generators/bootstrap-application-base/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, beforeEach, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; import { parseChangelog } from '../base/support/timestamp.js'; import Generator from './index.js'; diff --git a/generators/bootstrap-application-client/generator.spec.ts b/generators/bootstrap-application-client/generator.spec.ts index f53fc3a41a0c..14cbd082d717 100644 --- a/generators/bootstrap-application-client/generator.spec.ts +++ b/generators/bootstrap-application-client/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { defaultHelpers as helpers } from '../../testing/index.js'; +import { defaultHelpers as helpers } from '../../lib/testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; import Generator from './index.js'; diff --git a/generators/bootstrap-application-server/generator.spec.ts b/generators/bootstrap-application-server/generator.spec.ts index f53fc3a41a0c..14cbd082d717 100644 --- a/generators/bootstrap-application-server/generator.spec.ts +++ b/generators/bootstrap-application-server/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { defaultHelpers as helpers } from '../../testing/index.js'; +import { defaultHelpers as helpers } from '../../lib/testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; import Generator from './index.js'; diff --git a/generators/bootstrap-application/generator.spec.ts b/generators/bootstrap-application/generator.spec.ts index ff97849fb75c..0b8a26a5144e 100644 --- a/generators/bootstrap-application/generator.spec.ts +++ b/generators/bootstrap-application/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { fieldTypes } from '../../lib/jhipster/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; import Generator from './index.js'; diff --git a/generators/bootstrap/support/auto-crlf-transform.spec.ts b/generators/bootstrap/support/auto-crlf-transform.spec.ts index bea661055653..da765171e6e8 100644 --- a/generators/bootstrap/support/auto-crlf-transform.spec.ts +++ b/generators/bootstrap/support/auto-crlf-transform.spec.ts @@ -1,5 +1,5 @@ import { before, describe, expect, it } from 'esmocha'; -import { defaultHelpers as helpers } from '../../../testing/index.js'; +import { defaultHelpers as helpers } from '../../../lib/testing/index.js'; import { detectCrLf } from './auto-crlf-transform.js'; describe('generator - bootstrap - utils', () => { diff --git a/generators/ci-cd/ci-cd.spec.ts b/generators/ci-cd/ci-cd.spec.ts index 14cad421280e..a72fea4131b3 100644 --- a/generators/ci-cd/ci-cd.spec.ts +++ b/generators/ci-cd/ci-cd.spec.ts @@ -1,6 +1,6 @@ import { before, describe, expect, it } from 'esmocha'; import { GENERATOR_CI_CD } from '../generator-list.js'; -import { dryRunHelpers as helpers } from '../../testing/index.js'; +import { dryRunHelpers as helpers } from '../../lib/testing/index.js'; const expectedFiles = { travis: ['.travis.yml'], diff --git a/generators/client/generator-needles.spec.ts b/generators/client/generator-needles.spec.ts index c23d1245527e..c8a178bafbf0 100644 --- a/generators/client/generator-needles.spec.ts +++ b/generators/client/generator-needles.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { getGenerator, basicHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_WEBPACK_DIR } from '../generator-constants.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; import ClientGenerator from './index.js'; diff --git a/generators/client/generator.spec.ts b/generators/client/generator.spec.ts index 597aad778ddb..c640a5783301 100644 --- a/generators/client/generator.spec.ts +++ b/generators/client/generator.spec.ts @@ -22,7 +22,7 @@ import assert from 'assert'; import { snakeCase } from 'lodash-es'; import { before, describe, expect, it } from 'esmocha'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; -import { defaultHelpers as helpers, result } from '../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../lib/testing/index.js'; import { testFrameworkTypes } from '../../lib/jhipster/index.js'; import { GENERATOR_CLIENT } from '../generator-list.js'; import Generator from './index.js'; diff --git a/generators/client/generators/common/generator.spec.ts b/generators/client/generators/common/generator.spec.ts index efabf488d39b..af4664c7bb71 100644 --- a/generators/client/generators/common/generator.spec.ts +++ b/generators/client/generators/common/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/client/needle-client.spec.ts b/generators/client/needle-client.spec.ts index 6f0ad7790070..ddb8ac028090 100644 --- a/generators/client/needle-client.spec.ts +++ b/generators/client/needle-client.spec.ts @@ -1,7 +1,7 @@ import { before, describe, it } from 'esmocha'; import ClientGenerator from '../../generators/client/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; -import { getGenerator, dryRunHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, dryRunHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; const mockBlueprintSubGen: any = class extends ClientGenerator { constructor(args, opts, features) { diff --git a/generators/client/prompts.spec.ts b/generators/client/prompts.spec.ts index 46101b54e3eb..1229dea387c3 100644 --- a/generators/client/prompts.spec.ts +++ b/generators/client/prompts.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { defaultHelpers as helpers } from '../../testing/index.js'; +import { defaultHelpers as helpers } from '../../lib/testing/index.js'; import { applicationTypes, authenticationTypes, diff --git a/generators/common/generator.spec.ts b/generators/common/generator.spec.ts index c2c9c414e7cd..1422cea6d17e 100644 --- a/generators/common/generator.spec.ts +++ b/generators/common/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { basicHelpers, defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { basicHelpers, defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; import { GENERATOR_COMMON } from '../generator-list.js'; import Generator from './index.js'; diff --git a/generators/cucumber/generator.spec.ts b/generators/cucumber/generator.spec.ts index 5916773ed2f6..8ec5f8ac062d 100644 --- a/generators/cucumber/generator.spec.ts +++ b/generators/cucumber/generator.spec.ts @@ -4,7 +4,7 @@ import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../lib/testing/index.js'; import { GENERATOR_CUCUMBER } from '../generator-list.js'; import Generator from './index.js'; diff --git a/generators/cypress/generator.spec.ts b/generators/cypress/generator.spec.ts index 02309b37c74d..49b22a11a182 100644 --- a/generators/cypress/generator.spec.ts +++ b/generators/cypress/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { after, before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { clientFrameworkTypes, testFrameworkTypes } from '../../lib/jhipster/index.js'; -import { AuthenticationTypeMatrix, extendMatrix, fromMatrix, defaultHelpers as helpers } from '../../testing/index.js'; +import { AuthenticationTypeMatrix, extendMatrix, fromMatrix, defaultHelpers as helpers } from '../../lib/testing/index.js'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; import { GENERATOR_CYPRESS } from '../generator-list.js'; import Generator from './generator.js'; diff --git a/generators/docker-compose/docker-compose.spec.ts b/generators/docker-compose/docker-compose.spec.ts index 410b93e35c9f..df8c6d86ad92 100644 --- a/generators/docker-compose/docker-compose.spec.ts +++ b/generators/docker-compose/docker-compose.spec.ts @@ -2,7 +2,7 @@ import { before, describe, expect, it } from 'esmocha'; import monitoringTypes from '../../lib/jhipster/monitoring-types.js'; import applicationTypes from '../../lib/jhipster/application-types.js'; import { GENERATOR_DOCKER_COMPOSE } from '../generator-list.js'; -import { getGenerator, defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { getGenerator, defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; const { PROMETHEUS } = monitoringTypes; const { MICROSERVICE, MONOLITH } = applicationTypes; diff --git a/generators/docker/__test-support/service-discovery-matcher.ts b/generators/docker/__test-support/service-discovery-matcher.ts index c43e4b5b30c6..c5634e16c79c 100644 --- a/generators/docker/__test-support/service-discovery-matcher.ts +++ b/generators/docker/__test-support/service-discovery-matcher.ts @@ -1,7 +1,7 @@ import type { RunResult } from 'yeoman-test'; import { JAVA_DOCKER_DIR } from '../../generator-constants.js'; -import { matchWrittenConfig, matchWrittenFiles } from '../../../testing/index.js'; +import { matchWrittenConfig, matchWrittenFiles } from '../../../lib/testing/index.js'; const expectedEurekaFiles = () => { return [ diff --git a/generators/docker/generator.spec.ts b/generators/docker/generator.spec.ts index ecb162fe7937..be4d0f171529 100644 --- a/generators/docker/generator.spec.ts +++ b/generators/docker/generator.spec.ts @@ -28,7 +28,7 @@ import { extendMatrix, defaultHelpers as helpers, runResult, -} from '../../testing/index.js'; +} from '../../lib/testing/index.js'; import { matchElasticSearchDocker } from '../spring-data-elasticsearch/__test-support/elastic-search-matcher.js'; import { cacheTypes, databaseTypes, searchEngineTypes, serviceDiscoveryTypes } from '../../lib/jhipster/index.js'; diff --git a/generators/entities/generator.spec.ts b/generators/entities/generator.spec.ts index 6620f64b7b9c..12fed50c5465 100644 --- a/generators/entities/generator.spec.ts +++ b/generators/entities/generator.spec.ts @@ -23,7 +23,7 @@ import { snakeCase } from 'lodash-es'; import { CLIENT_MAIN_SRC_DIR, SERVER_MAIN_RES_DIR, SERVER_MAIN_SRC_DIR } from '../generator-constants.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { skipPrettierHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { skipPrettierHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import Generator from './generator.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/entity/database-changelog.spec.ts b/generators/entity/database-changelog.spec.ts index d5cb2139fa2f..5ded0b45dfdb 100644 --- a/generators/entity/database-changelog.spec.ts +++ b/generators/entity/database-changelog.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { getGenerator, defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { getGenerator, defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { SERVER_MAIN_RES_DIR } from '../generator-constants.js'; import BaseApplicationGenerator from '../base-application/generator.js'; diff --git a/generators/entity/single-entity.spec.ts b/generators/entity/single-entity.spec.ts index f5860a204578..df693f860a7c 100644 --- a/generators/entity/single-entity.spec.ts +++ b/generators/entity/single-entity.spec.ts @@ -1,5 +1,5 @@ import { after, before, describe, expect, it } from 'esmocha'; -import { skipPrettierHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { skipPrettierHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_MAIN_SRC_DIR, SERVER_MAIN_RES_DIR, SERVER_MAIN_SRC_DIR } from '../generator-constants.js'; import BaseApplicationGenerator from '../base-application/generator.js'; import { GENERATOR_ENTITY } from '../generator-list.js'; diff --git a/generators/export-jdl/export-jdl.spec.ts b/generators/export-jdl/export-jdl.spec.ts index 4418c45357af..e6c84bc6b53d 100644 --- a/generators/export-jdl/export-jdl.spec.ts +++ b/generators/export-jdl/export-jdl.spec.ts @@ -1,5 +1,5 @@ import { before, describe, expect, it } from 'esmocha'; -import { defaultHelpers as helpers } from '../../testing/index.js'; +import { defaultHelpers as helpers } from '../../lib/testing/index.js'; import { GENERATOR_EXPORT_JDL } from '../generator-list.js'; const files = { diff --git a/generators/feign-client/generator.spec.ts b/generators/feign-client/generator.spec.ts index 2807193b43d5..22e01f037471 100644 --- a/generators/feign-client/generator.spec.ts +++ b/generators/feign-client/generator.spec.ts @@ -1,7 +1,7 @@ import { basename, dirname } from 'path'; import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; import Generator from '../server/index.js'; diff --git a/generators/gatling/generator.spec.ts b/generators/gatling/generator.spec.ts index 833e2cbb423a..90e216ead5e2 100644 --- a/generators/gatling/generator.spec.ts +++ b/generators/gatling/generator.spec.ts @@ -4,7 +4,7 @@ import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../lib/testing/index.js'; import { GENERATOR_GATLING } from '../generator-list.js'; import Generator from './index.js'; diff --git a/generators/generate-blueprint/generator.spec.ts b/generators/generate-blueprint/generator.spec.ts index ddf1f4718c95..c49640c9ac20 100644 --- a/generators/generate-blueprint/generator.spec.ts +++ b/generators/generate-blueprint/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import Generator from './index.js'; diff --git a/generators/git/generator.spec.ts b/generators/git/generator.spec.ts index 96deb327a74e..1a7f507f8a47 100644 --- a/generators/git/generator.spec.ts +++ b/generators/git/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { access } from 'fs/promises'; import { before, describe, expect, it } from 'esmocha'; import { testBlueprintSupport } from '../../test/support/tests.js'; -import { skipPrettierHelpers as helpers } from '../../testing/index.js'; +import { skipPrettierHelpers as helpers } from '../../lib/testing/index.js'; import { GENERATOR_GIT } from '../generator-list.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/gradle/generator.spec.ts b/generators/gradle/generator.spec.ts index a8d91fe5e2ee..86ea4bba54c7 100644 --- a/generators/gradle/generator.spec.ts +++ b/generators/gradle/generator.spec.ts @@ -20,7 +20,7 @@ import { basename, dirname, join } from 'path'; import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { GENERATOR_JHIPSTER } from '../generator-constants.js'; import { GENERATOR_GRADLE } from '../generator-list.js'; diff --git a/generators/gradle/generators/code-quality/generator.spec.ts b/generators/gradle/generators/code-quality/generator.spec.ts index 5dc2b4c4b8b5..791b1266bbef 100644 --- a/generators/gradle/generators/code-quality/generator.spec.ts +++ b/generators/gradle/generators/code-quality/generator.spec.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/gradle/generators/jib/generator.spec.ts b/generators/gradle/generators/jib/generator.spec.ts index 5dc2b4c4b8b5..791b1266bbef 100644 --- a/generators/gradle/generators/jib/generator.spec.ts +++ b/generators/gradle/generators/jib/generator.spec.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/gradle/needles.spec.ts b/generators/gradle/needles.spec.ts index c43e26c7f92e..e5d81ccdf317 100644 --- a/generators/gradle/needles.spec.ts +++ b/generators/gradle/needles.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { dryRunHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { dryRunHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import BaseApplicationGenerator from '../base-application/index.js'; import { GENERATOR_SERVER } from '../generator-list.js'; diff --git a/generators/heroku/heroku.spec.ts b/generators/heroku/heroku.spec.ts index 6e5a519dcd7f..7652c283e222 100644 --- a/generators/heroku/heroku.spec.ts +++ b/generators/heroku/heroku.spec.ts @@ -2,7 +2,7 @@ import type { SinonStub } from 'sinon'; import sinon from 'sinon'; import { beforeEach, describe, expect, it } from 'esmocha'; import { SERVER_MAIN_RES_DIR } from '../generator-constants.js'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { GENERATOR_HEROKU } from '../generator-list.js'; const expectedFiles = { diff --git a/generators/init/generator.spec.ts b/generators/init/generator.spec.ts index b88ba3f4bfa7..9e7148c1e1f1 100644 --- a/generators/init/generator.spec.ts +++ b/generators/init/generator.spec.ts @@ -20,7 +20,7 @@ import { basename, dirname, join } from 'path'; import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { basicTests, getCommandHelpOutput, testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../lib/testing/index.js'; import { GENERATOR_INIT } from '../generator-list.js'; import { defaultConfig, requiredConfig } from './config.js'; diff --git a/generators/java/generator.spec.ts b/generators/java/generator.spec.ts index 359d763cc29e..acd97da14b73 100644 --- a/generators/java/generator.spec.ts +++ b/generators/java/generator.spec.ts @@ -4,7 +4,7 @@ import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/java/generators/bootstrap/generator.spec.ts b/generators/java/generators/bootstrap/generator.spec.ts index 34542f9f4209..496ceb4cd007 100644 --- a/generators/java/generators/bootstrap/generator.spec.ts +++ b/generators/java/generators/bootstrap/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/java/generators/build-tool/generator.spec.ts b/generators/java/generators/build-tool/generator.spec.ts index 9df72024194a..ce27d0a57e85 100644 --- a/generators/java/generators/build-tool/generator.spec.ts +++ b/generators/java/generators/build-tool/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/java/generators/code-quality/generator.spec.ts b/generators/java/generators/code-quality/generator.spec.ts index 6d6c8119832e..0dd9a1a6f75a 100644 --- a/generators/java/generators/code-quality/generator.spec.ts +++ b/generators/java/generators/code-quality/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/java/generators/domain/generator.spec.ts b/generators/java/generators/domain/generator.spec.ts index 97f3a9e24815..38b5700b6b9d 100644 --- a/generators/java/generators/domain/generator.spec.ts +++ b/generators/java/generators/domain/generator.spec.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/java/generators/jib/generator.spec.ts b/generators/java/generators/jib/generator.spec.ts index cb03e83638cc..49bfaf569062 100644 --- a/generators/java/generators/jib/generator.spec.ts +++ b/generators/java/generators/jib/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/java/generators/node/generator.spec.ts b/generators/java/generators/node/generator.spec.ts index e485937724c8..facfbdd95f46 100644 --- a/generators/java/generators/node/generator.spec.ts +++ b/generators/java/generators/node/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/java/generators/openapi-generator/generator.spec.ts b/generators/java/generators/openapi-generator/generator.spec.ts index 80c47cdb6537..26cc62536166 100644 --- a/generators/java/generators/openapi-generator/generator.spec.ts +++ b/generators/java/generators/openapi-generator/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { fromMatrix, defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { fromMatrix, defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/javascript/generators/bootstrap/generator.spec.ts b/generators/javascript/generators/bootstrap/generator.spec.ts index c430ee0e73d5..9d1df71b18e2 100644 --- a/generators/javascript/generators/bootstrap/generator.spec.ts +++ b/generators/javascript/generators/bootstrap/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { extendMatrix, fromMatrix, defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { extendMatrix, fromMatrix, defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/javascript/generators/eslint/generator.spec.ts b/generators/javascript/generators/eslint/generator.spec.ts index 6d5d804ac9d7..42a88b9923a3 100644 --- a/generators/javascript/generators/eslint/generator.spec.ts +++ b/generators/javascript/generators/eslint/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/javascript/generators/husky/generator.spec.ts b/generators/javascript/generators/husky/generator.spec.ts index b7d633b1a86e..de7a78703816 100644 --- a/generators/javascript/generators/husky/generator.spec.ts +++ b/generators/javascript/generators/husky/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { fromMatrix, defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { fromMatrix, defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/javascript/generators/prettier/generator.spec.ts b/generators/javascript/generators/prettier/generator.spec.ts index 7f4cc7bc6107..baff267f5dde 100644 --- a/generators/javascript/generators/prettier/generator.spec.ts +++ b/generators/javascript/generators/prettier/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { fromMatrix, defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { fromMatrix, defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/jdl/command.ts b/generators/jdl/command.ts index 024a982d15dc..de1afb3144f1 100644 --- a/generators/jdl/command.ts +++ b/generators/jdl/command.ts @@ -1,7 +1,7 @@ import type { JHipsterCommandDefinition } from '../../lib/command/index.js'; import { GENERATOR_WORKSPACES } from '../generator-list.js'; -const command: JHipsterCommandDefinition = { +const command = { arguments: { jdlFiles: { type: Array, @@ -52,6 +52,6 @@ const command: JHipsterCommandDefinition = { }, }, import: [GENERATOR_WORKSPACES], -}; +} as const satisfies JHipsterCommandDefinition; export default command; diff --git a/generators/jdl/generator.spec.ts b/generators/jdl/generator.spec.ts index afdc6d2b1591..459c5a321afb 100644 --- a/generators/jdl/generator.spec.ts +++ b/generators/jdl/generator.spec.ts @@ -24,7 +24,7 @@ import type { SinonSpy } from 'sinon'; import type { RunResult } from 'yeoman-test'; import { getCommandHelpOutput, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import * as GENERATORS from '../generator-list.js'; import { GENERATOR_JDL } from '../generator-list.js'; import Generator from './index.js'; diff --git a/generators/kubernetes-helm/kubernetes.helm.spec.ts b/generators/kubernetes-helm/kubernetes.helm.spec.ts index 9c408dac86a8..ebe20426149b 100644 --- a/generators/kubernetes-helm/kubernetes.helm.spec.ts +++ b/generators/kubernetes-helm/kubernetes.helm.spec.ts @@ -1,5 +1,5 @@ import { before, describe, expect, it } from 'esmocha'; -import { getGenerator, basicHelpers as helpers } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers } from '../../lib/testing/index.js'; import { GENERATOR_KUBERNETES_HELM } from '../generator-list.js'; const expectedFiles = { diff --git a/generators/kubernetes-knative/knative.spec.ts b/generators/kubernetes-knative/knative.spec.ts index 5bf81bdf99d0..02fbe1cce589 100644 --- a/generators/kubernetes-knative/knative.spec.ts +++ b/generators/kubernetes-knative/knative.spec.ts @@ -1,5 +1,5 @@ import { before, describe, expect, it } from 'esmocha'; -import { getGenerator, dryRunHelpers as helpers } from '../../testing/index.js'; +import { getGenerator, dryRunHelpers as helpers } from '../../lib/testing/index.js'; import { GENERATOR_KUBERNETES_KNATIVE } from '../generator-list.js'; const expectedFiles = { diff --git a/generators/kubernetes/kubernetes.spec.ts b/generators/kubernetes/kubernetes.spec.ts index 3d98666f1e77..bde78bc651fd 100644 --- a/generators/kubernetes/kubernetes.spec.ts +++ b/generators/kubernetes/kubernetes.spec.ts @@ -1,5 +1,5 @@ import { before, describe, expect, it } from 'esmocha'; -import { getGenerator, basicHelpers as helpers, runResult } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { GENERATOR_KUBERNETES } from '../generator-list.js'; const expectedFiles = { diff --git a/generators/languages/generator-needles.spec.ts b/generators/languages/generator-needles.spec.ts index 99363225ca06..db16f53d2454 100644 --- a/generators/languages/generator-needles.spec.ts +++ b/generators/languages/generator-needles.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { getGenerator, defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; import LanguagesGenerator from './index.js'; diff --git a/generators/languages/generator.spec.ts b/generators/languages/generator.spec.ts index 88e4f7011711..37e0a1ea0884 100644 --- a/generators/languages/generator.spec.ts +++ b/generators/languages/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import { GENERATOR_LANGUAGES } from '../generator-list.js'; import Generator from './index.js'; diff --git a/generators/languages/languages.spec.ts b/generators/languages/languages.spec.ts index 525e06f735b0..ceff153a8000 100644 --- a/generators/languages/languages.spec.ts +++ b/generators/languages/languages.spec.ts @@ -1,7 +1,7 @@ import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; import { before, describe, it } from 'esmocha'; -import { basicHelpers, defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { basicHelpers, defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_MAIN_SRC_DIR, SERVER_MAIN_RES_DIR } from '../generator-constants.js'; import { supportedLanguages } from './support/index.js'; diff --git a/generators/liquibase/incremental-liquibase.spec.ts b/generators/liquibase/incremental-liquibase.spec.ts index fbe22800ff15..23aa62f86cfe 100644 --- a/generators/liquibase/incremental-liquibase.spec.ts +++ b/generators/liquibase/incremental-liquibase.spec.ts @@ -2,7 +2,7 @@ import path, { basename, join } from 'path'; import { existsSync, mkdirSync, writeFileSync } from 'fs'; import { fileURLToPath } from 'url'; import { after, before, describe, expect, it } from 'esmocha'; -import { skipPrettierHelpers as helpers, runResult } from '../../testing/index.js'; +import { skipPrettierHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { SERVER_MAIN_RES_DIR } from '../generator-constants.js'; import { createImporterFromContent } from '../../lib/jdl/jdl-importer.js'; diff --git a/generators/liquibase/needles.spec.ts b/generators/liquibase/needles.spec.ts index f211c7a30379..0c8e0de15894 100644 --- a/generators/liquibase/needles.spec.ts +++ b/generators/liquibase/needles.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { dryRunHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { dryRunHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import BaseApplicationGenerator from '../base-application/index.js'; import { SERVER_MAIN_RES_DIR } from '../generator-constants.js'; import { GENERATOR_LIQUIBASE } from '../generator-list.js'; diff --git a/generators/maven/generator.spec.ts b/generators/maven/generator.spec.ts index 33d607efec08..748ff3c8cec5 100644 --- a/generators/maven/generator.spec.ts +++ b/generators/maven/generator.spec.ts @@ -20,7 +20,7 @@ import { basename, dirname, join } from 'path'; import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { GENERATOR_MAVEN } from '../generator-list.js'; import MavenGenerator from './generator.js'; diff --git a/generators/maven/generators/code-quality/generator.spec.ts b/generators/maven/generators/code-quality/generator.spec.ts index 3d0512a73699..665821bbefd2 100644 --- a/generators/maven/generators/code-quality/generator.spec.ts +++ b/generators/maven/generators/code-quality/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/maven/generators/frontend-plugin/generator.spec.ts b/generators/maven/generators/frontend-plugin/generator.spec.ts index 213bab1e05f8..c8c254abd18c 100644 --- a/generators/maven/generators/frontend-plugin/generator.spec.ts +++ b/generators/maven/generators/frontend-plugin/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/maven/generators/jib/generator.spec.ts b/generators/maven/generators/jib/generator.spec.ts index 86d348aadb67..8fb1850d62f2 100644 --- a/generators/maven/generators/jib/generator.spec.ts +++ b/generators/maven/generators/jib/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/maven/needles.spec.ts b/generators/maven/needles.spec.ts index e21e5f83c12a..df2eb350984d 100644 --- a/generators/maven/needles.spec.ts +++ b/generators/maven/needles.spec.ts @@ -1,5 +1,5 @@ import { before, describe, expect, it } from 'esmocha'; -import { dryRunHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { dryRunHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import BaseApplicationGenerator from '../base-application/index.js'; import { GENERATOR_MAVEN } from '../generator-list.js'; diff --git a/generators/react/generator.spec.ts b/generators/react/generator.spec.ts index 0b1b27399de3..d40b281b692c 100644 --- a/generators/react/generator.spec.ts +++ b/generators/react/generator.spec.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; diff --git a/generators/server/generator.spec.ts b/generators/server/generator.spec.ts index 41c0bd7d0585..ed02e4f93418 100644 --- a/generators/server/generator.spec.ts +++ b/generators/server/generator.spec.ts @@ -22,7 +22,7 @@ import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; -import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { GENERATOR_SERVER, GENERATOR_SPRING_BOOT } from '../generator-list.js'; import { filterBasicServerGenerators, shouldComposeWithCouchbase, shouldComposeWithSpringCloudStream } from './__test-support/index.js'; import Generator from './index.js'; diff --git a/generators/server/needle-logback.spec.ts b/generators/server/needle-logback.spec.ts index 27345bb5cdab..a00c9f173751 100644 --- a/generators/server/needle-logback.spec.ts +++ b/generators/server/needle-logback.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { dryRunHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { dryRunHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import BaseApplicationGenerator from '../base-application/index.js'; import { SERVER_MAIN_RES_DIR } from '../generator-constants.js'; import { GENERATOR_SERVER } from '../generator-list.js'; diff --git a/generators/server/support/needles.spec.ts b/generators/server/support/needles.spec.ts index 8302a7bf6def..5ec860b76712 100644 --- a/generators/server/support/needles.spec.ts +++ b/generators/server/support/needles.spec.ts @@ -17,7 +17,7 @@ * limitations under the License. */ import { before, describe, expect, it } from 'esmocha'; -import { defaultHelpers as helpers, runResult } from '../../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../../lib/testing/index.js'; import { GENERATOR_SPRING_BOOT } from '../../generator-list.js'; import { insertContentIntoApplicationProperties } from './needles.js'; diff --git a/generators/spring-boot/generator.spec.ts b/generators/spring-boot/generator.spec.ts index af9db5162394..c6bc95abfc2f 100644 --- a/generators/spring-boot/generator.spec.ts +++ b/generators/spring-boot/generator.spec.ts @@ -2,7 +2,7 @@ import { basename, dirname } from 'path'; import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; import Generator from '../server/index.js'; diff --git a/generators/spring-cache/generator.spec.ts b/generators/spring-cache/generator.spec.ts index 2999ca89e380..4857599499fd 100644 --- a/generators/spring-cache/generator.spec.ts +++ b/generators/spring-cache/generator.spec.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { fromMatrix, defaultHelpers as helpers, result } from '../../testing/index.js'; +import { fromMatrix, defaultHelpers as helpers, result } from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import { GENERATOR_SPRING_CACHE } from '../generator-list.js'; diff --git a/generators/spring-cache/needles.spec.ts b/generators/spring-cache/needles.spec.ts index 2ec0194e6865..7116e6f4253d 100644 --- a/generators/spring-cache/needles.spec.ts +++ b/generators/spring-cache/needles.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import BaseApplicationGenerator from '../base-application/index.js'; import { SERVER_MAIN_SRC_DIR } from '../generator-constants.js'; import { GENERATOR_SPRING_CACHE } from '../generator-list.js'; diff --git a/generators/spring-cloud-stream/generator-pulsar.spec.ts b/generators/spring-cloud-stream/generator-pulsar.spec.ts index 46ed4cc57229..0fa8f4607f57 100644 --- a/generators/spring-cloud-stream/generator-pulsar.spec.ts +++ b/generators/spring-cloud-stream/generator-pulsar.spec.ts @@ -22,7 +22,7 @@ import { after, before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { buildSamplesFromMatrix, buildServerMatrix, defaultHelpers as helpers } from '../../testing/index.js'; +import { buildSamplesFromMatrix, buildServerMatrix, defaultHelpers as helpers } from '../../lib/testing/index.js'; import { messageBrokerTypes } from '../../lib/jhipster/index.js'; import Generator from './index.js'; diff --git a/generators/spring-cloud-stream/generator.spec.ts b/generators/spring-cloud-stream/generator.spec.ts index 7837314a45a6..3623bf873c1f 100644 --- a/generators/spring-cloud-stream/generator.spec.ts +++ b/generators/spring-cloud-stream/generator.spec.ts @@ -22,7 +22,7 @@ import { after, before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { buildSamplesFromMatrix, buildServerMatrix, defaultHelpers as helpers } from '../../testing/index.js'; +import { buildSamplesFromMatrix, buildServerMatrix, defaultHelpers as helpers } from '../../lib/testing/index.js'; import { messageBrokerTypes } from '../../lib/jhipster/index.js'; import Generator from './index.js'; diff --git a/generators/spring-cloud/generators/gateway/generator.spec.ts b/generators/spring-cloud/generators/gateway/generator.spec.ts index 3bb5b8e2cd1c..3cd23977ba47 100644 --- a/generators/spring-cloud/generators/gateway/generator.spec.ts +++ b/generators/spring-cloud/generators/gateway/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url'; import { before, describe, expect, it } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../../../lib/testing/index.js'; import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/generators/spring-data-cassandra/database-changelog.spec.ts b/generators/spring-data-cassandra/database-changelog.spec.ts index 8196adba5132..06abd7b73c92 100644 --- a/generators/spring-data-cassandra/database-changelog.spec.ts +++ b/generators/spring-data-cassandra/database-changelog.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { dryRunHelpers as helpers } from '../../testing/index.js'; +import { dryRunHelpers as helpers } from '../../lib/testing/index.js'; import { SERVER_MAIN_RES_DIR } from '../generator-constants.js'; import { GENERATOR_SPRING_DATA_CASSANDRA } from '../generator-list.js'; diff --git a/generators/spring-data-cassandra/generator.spec.ts b/generators/spring-data-cassandra/generator.spec.ts index 78239387844b..c54947a4bffb 100644 --- a/generators/spring-data-cassandra/generator.spec.ts +++ b/generators/spring-data-cassandra/generator.spec.ts @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { buildServerSamples, entitiesSimple as entities, defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { buildServerSamples, entitiesSimple as entities, defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import Generator from '../server/index.js'; diff --git a/generators/spring-data-couchbase/generator.spec.ts b/generators/spring-data-couchbase/generator.spec.ts index 29e4b8397254..6f72952005a7 100644 --- a/generators/spring-data-couchbase/generator.spec.ts +++ b/generators/spring-data-couchbase/generator.spec.ts @@ -28,7 +28,7 @@ import { extendMatrix, defaultHelpers as helpers, runResult, -} from '../../testing/index.js'; +} from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import { databaseTypes } from '../../lib/jhipster/index.js'; diff --git a/generators/spring-data-elasticsearch/__test-support/elastic-search-matcher.ts b/generators/spring-data-elasticsearch/__test-support/elastic-search-matcher.ts index 2e9afd49d4af..5a604def0dc1 100644 --- a/generators/spring-data-elasticsearch/__test-support/elastic-search-matcher.ts +++ b/generators/spring-data-elasticsearch/__test-support/elastic-search-matcher.ts @@ -1,7 +1,7 @@ import type { RunResult } from 'yeoman-test'; import { JAVA_DOCKER_DIR, SERVER_MAIN_SRC_DIR } from '../../generator-constants.js'; -import { matchWrittenConfig, matchWrittenFiles } from '../../../testing/index.js'; +import { matchWrittenConfig, matchWrittenFiles } from '../../../lib/testing/index.js'; const expectedElasticsearchFiles = () => { return [`${JAVA_DOCKER_DIR}elasticsearch.yml`]; diff --git a/generators/spring-data-elasticsearch/generator.spec.ts b/generators/spring-data-elasticsearch/generator.spec.ts index aa164ab62595..f18c7ad9bb38 100644 --- a/generators/spring-data-elasticsearch/generator.spec.ts +++ b/generators/spring-data-elasticsearch/generator.spec.ts @@ -28,7 +28,7 @@ import { extendMatrix, defaultHelpers as helpers, runResult, -} from '../../testing/index.js'; +} from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import { applicationTypes, authenticationTypes, databaseTypes, searchEngineTypes } from '../../lib/jhipster/index.js'; import { filterBasicServerGenerators, shouldComposeWithSpringCloudStream } from '../server/__test-support/index.js'; diff --git a/generators/spring-data-mongodb/generator.spec.ts b/generators/spring-data-mongodb/generator.spec.ts index 63dfb8225fb1..250cca1b5094 100644 --- a/generators/spring-data-mongodb/generator.spec.ts +++ b/generators/spring-data-mongodb/generator.spec.ts @@ -27,7 +27,7 @@ import { entitiesSimple as entities, defaultHelpers as helpers, runResult, -} from '../../testing/index.js'; +} from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import Generator from '../server/index.js'; diff --git a/generators/spring-data-neo4j/generator.spec.ts b/generators/spring-data-neo4j/generator.spec.ts index bf68cc196c25..5b11aea0a446 100644 --- a/generators/spring-data-neo4j/generator.spec.ts +++ b/generators/spring-data-neo4j/generator.spec.ts @@ -7,7 +7,7 @@ import { entitiesSimple as entities, defaultHelpers as helpers, runResult, -} from '../../testing/index.js'; +} from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import Generator from '../server/index.js'; diff --git a/generators/spring-data-relational/generator.spec.ts b/generators/spring-data-relational/generator.spec.ts index 8a7e12244fb0..1dbf61c35f92 100644 --- a/generators/spring-data-relational/generator.spec.ts +++ b/generators/spring-data-relational/generator.spec.ts @@ -10,7 +10,7 @@ import { extendMatrix, defaultHelpers as helpers, runResult, -} from '../../testing/index.js'; +} from '../../lib/testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import Generator from '../server/index.js'; diff --git a/generators/spring-data-relational/sql-entities.spec.ts b/generators/spring-data-relational/sql-entities.spec.ts index 9441d4faa973..98c20b64f8ea 100644 --- a/generators/spring-data-relational/sql-entities.spec.ts +++ b/generators/spring-data-relational/sql-entities.spec.ts @@ -7,7 +7,7 @@ import { extendMatrix, defaultHelpers as helpers, runResult, -} from '../../testing/index.js'; +} from '../../lib/testing/index.js'; import { filterBasicServerGenerators } from '../server/__test-support/index.js'; import { cacheTypes, databaseTypes } from '../../lib/jhipster/index.js'; diff --git a/generators/spring-websocket/generator.spec.ts b/generators/spring-websocket/generator.spec.ts index fa50cc84f5bb..a4a79fb2733f 100644 --- a/generators/spring-websocket/generator.spec.ts +++ b/generators/spring-websocket/generator.spec.ts @@ -4,7 +4,7 @@ import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import { defaultHelpers as helpers, result } from '../../testing/index.js'; +import { defaultHelpers as helpers, result } from '../../lib/testing/index.js'; import { GENERATOR_SPRING_WEBSOCKET } from '../generator-list.js'; import Generator from './index.js'; diff --git a/generators/upgrade/generator.spec.ts b/generators/upgrade/generator.spec.ts index 256db0b5b0d2..196c21c9744a 100644 --- a/generators/upgrade/generator.spec.ts +++ b/generators/upgrade/generator.spec.ts @@ -23,7 +23,7 @@ import { snakeCase } from 'lodash-es'; import { simpleGit } from 'simple-git'; import { shouldSupportFeatures } from '../../test/support/tests.js'; -import { basicHelpers as helpers, result } from '../../testing/index.js'; +import { basicHelpers as helpers, result } from '../../lib/testing/index.js'; import { UPGRADE_BRANCH } from './support/index.js'; import Generator from './index.js'; diff --git a/generators/upgrade/upgrade.spec.ts b/generators/upgrade/upgrade.spec.ts index d3f7381420e8..65d96600295b 100644 --- a/generators/upgrade/upgrade.spec.ts +++ b/generators/upgrade/upgrade.spec.ts @@ -6,7 +6,7 @@ import { before, describe, expect, it } from 'esmocha'; import { execaCommandSync } from 'execa'; import { packageJson } from '../../lib/index.js'; import { GENERATOR_APP, GENERATOR_UPGRADE } from '../generator-list.js'; -import { getGenerator, basicHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; const writeJsonSync = (file, content) => writeFileSync(file, JSON.stringify(content, null, 2)); diff --git a/generators/vue/generator.spec.ts b/generators/vue/generator.spec.ts index 912f7741d94e..a6c515e0a301 100644 --- a/generators/vue/generator.spec.ts +++ b/generators/vue/generator.spec.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'url'; import { before, describe, expect, it } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import { checkEnforcements, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/index.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; diff --git a/lib/jdl/converters/exporters/export-utils.spec.ts b/lib/jdl/converters/exporters/export-utils.spec.ts index 0f21240fcb9c..be41c8c3e564 100644 --- a/lib/jdl/converters/exporters/export-utils.spec.ts +++ b/lib/jdl/converters/exporters/export-utils.spec.ts @@ -22,7 +22,7 @@ import { dirname } from 'path'; import { fileURLToPath } from 'url'; import { beforeEach, describe, expect, it } from 'esmocha'; import { writeConfigFile } from '../exporters/export-utils.js'; -import { basicHelpers as helpers } from '../../../../testing/index.js'; +import { basicHelpers as helpers } from '../../../../lib/testing/index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/lib/jdl/converters/exporters/jdl-exporter.spec.ts b/lib/jdl/converters/exporters/jdl-exporter.spec.ts index 6e899b00a439..95f68731ff35 100644 --- a/lib/jdl/converters/exporters/jdl-exporter.spec.ts +++ b/lib/jdl/converters/exporters/jdl-exporter.spec.ts @@ -26,7 +26,7 @@ import exportToJDL from '../exporters/jdl-exporter.js'; import JDLApplication from '../../core/models/jdl-application.js'; import type { JDLJSONApplicationConfiguration } from '../../core/parsing/jdl-parsing-types.js'; import { applicationOptions } from '../../core/built-in-options/index.js'; -import { basicHelpers as helpers } from '../../../../testing/index.js'; +import { basicHelpers as helpers } from '../../../../lib/testing/index.js'; import { getDefaultRuntime } from '../../core/runtime.js'; const { diff --git a/lib/jdl/converters/exporters/jhipster-deployment-exporter.spec.ts b/lib/jdl/converters/exporters/jhipster-deployment-exporter.spec.ts index 4ab129363917..2852d1be004d 100644 --- a/lib/jdl/converters/exporters/jhipster-deployment-exporter.spec.ts +++ b/lib/jdl/converters/exporters/jhipster-deployment-exporter.spec.ts @@ -24,7 +24,7 @@ import { expect } from 'chai'; import exportDeployments from '../exporters/jhipster-deployment-exporter.js'; import JDLDeployment from '../../core/models/jdl-deployment.js'; import { deploymentOptions } from '../../core/built-in-options/index.js'; -import { basicHelpers as helpers } from '../../../../testing/index.js'; +import { basicHelpers as helpers } from '../../../../lib/testing/index.js'; const { DeploymentTypes: { DOCKERCOMPOSE, KUBERNETES }, diff --git a/lib/jdl/converters/exporters/jhipster-entity-exporter.spec.ts b/lib/jdl/converters/exporters/jhipster-entity-exporter.spec.ts index a0a98911fd47..d6297f80aeac 100644 --- a/lib/jdl/converters/exporters/jhipster-entity-exporter.spec.ts +++ b/lib/jdl/converters/exporters/jhipster-entity-exporter.spec.ts @@ -23,7 +23,7 @@ import exportEntities from '../exporters/jhipster-entity-exporter.js'; import { applicationTypes } from '../../core/built-in-options/index.js'; import { doesDirectoryExist } from '../../core/utils/file-utils.js'; -import { basicHelpers as helpers } from '../../../../testing/index.js'; +import { basicHelpers as helpers } from '../../../../lib/testing/index.js'; import { entityOptions } from '../../../jhipster/index.js'; const { MapperTypes, PaginationTypes, ServiceTypes } = entityOptions; diff --git a/lib/jdl/converters/json-to-jdl-converter.spec.ts b/lib/jdl/converters/json-to-jdl-converter.spec.ts index 8f75ee47c00c..6f81ea924925 100644 --- a/lib/jdl/converters/json-to-jdl-converter.spec.ts +++ b/lib/jdl/converters/json-to-jdl-converter.spec.ts @@ -22,7 +22,7 @@ import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; import { beforeEach, describe, it, expect as jestExpect } from 'esmocha'; import { expect } from 'chai'; -import { createJHipsterConfigFiles, basicHelpers as helpers } from '../../../testing/index.js'; +import { createJHipsterConfigFiles, basicHelpers as helpers } from '../../../lib/testing/index.js'; import { getTestFile } from '../core/__test-support__/index.js'; import { convertSingleContentToJDL, convertToJDL } from './json-to-jdl-converter.js'; diff --git a/lib/jdl/core/linters/jdl-linter.spec.ts b/lib/jdl/core/linters/jdl-linter.spec.ts index 5b4548a68994..4f9459bf8352 100644 --- a/lib/jdl/core/linters/jdl-linter.spec.ts +++ b/lib/jdl/core/linters/jdl-linter.spec.ts @@ -22,7 +22,7 @@ import { dirname } from 'path'; import { fileURLToPath } from 'url'; import { expect } from 'chai'; import { beforeEach, describe, it, expect as jestExpect } from 'esmocha'; -import { basicHelpers as helpers } from '../../../../testing/index.js'; +import { basicHelpers as helpers } from '../../../../lib/testing/index.js'; import { createJDLLinterFromContent, createJDLLinterFromFile, getTestFile } from '.././__test-support__/index.js'; import type { JDLLinter } from './jdl-linter.js'; import type Issues from './issues/issues.js'; diff --git a/lib/jdl/core/readers/file-reader.spec.ts b/lib/jdl/core/readers/file-reader.spec.ts index 82236dd81d76..fe1f488fede3 100644 --- a/lib/jdl/core/readers/file-reader.spec.ts +++ b/lib/jdl/core/readers/file-reader.spec.ts @@ -21,7 +21,7 @@ import fs from 'fs'; import { beforeEach, describe, it, expect as jestExpect } from 'esmocha'; import { expect } from 'chai'; import { readFile, readFiles } from '../readers/file-reader.js'; -import { basicHelpers as helpers } from '../../../../testing/index.js'; +import { basicHelpers as helpers } from '../../../../lib/testing/index.js'; describe('jdl - FileReader', () => { beforeEach(async () => { diff --git a/lib/jdl/core/readers/jdl-reader.spec.ts b/lib/jdl/core/readers/jdl-reader.spec.ts index 4d43227e51da..e1b991396f72 100644 --- a/lib/jdl/core/readers/jdl-reader.spec.ts +++ b/lib/jdl/core/readers/jdl-reader.spec.ts @@ -23,7 +23,7 @@ import { dirname } from 'path'; import { fileURLToPath } from 'url'; import { after, beforeEach, describe, it } from 'esmocha'; import { expect } from 'chai'; -import { basicHelpers as helpers } from '../../../../testing/index.js'; +import { basicHelpers as helpers } from '../../../../lib/testing/index.js'; import { getTestFile, parseFromContent, parseFromFiles } from '.././__test-support__/index.js'; const __filename = fileURLToPath(import.meta.url); diff --git a/lib/jdl/integration-test.spec.ts b/lib/jdl/integration-test.spec.ts index 4c8b09fffd52..6f4f3269e212 100644 --- a/lib/jdl/integration-test.spec.ts +++ b/lib/jdl/integration-test.spec.ts @@ -21,7 +21,7 @@ import { dirname } from 'path'; import { fileURLToPath } from 'url'; import { expect } from 'chai'; import { beforeEach, describe, it, expect as jestExpect } from 'esmocha'; -import { basicHelpers as helpers } from '../../testing/index.js'; +import { basicHelpers as helpers } from '../../lib/testing/index.js'; import { applicationTypes } from '../jhipster/index.js'; import { convert as convertWithoutApplication } from './converters/jdl-to-json/jdl-without-application-to-json-converter.js'; import exportToJDL from './converters/exporters/jdl-exporter.js'; diff --git a/testing/get-generator.ts b/lib/testing/get-generator.ts similarity index 60% rename from testing/get-generator.ts rename to lib/testing/get-generator.ts index 9dc19e94c821..3e80610d7c07 100644 --- a/testing/get-generator.ts +++ b/lib/testing/get-generator.ts @@ -1,12 +1,9 @@ -import { fileURLToPath } from 'url'; -import { dirname, resolve } from 'path'; +import { resolve } from 'path'; import { existsSync } from 'fs'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); +import { getPackageRoot } from '../index.js'; export const getGeneratorFolder = (generatorName: string) => { - return resolve(__dirname, '../generators', generatorName.split(':').join('/generators/')); + return resolve(getPackageRoot(), 'generators', generatorName.split(':').join('/generators/')); }; const getGenerator = (generatorName: string) => { diff --git a/testing/github.ts b/lib/testing/github.ts similarity index 100% rename from testing/github.ts rename to lib/testing/github.ts diff --git a/testing/helpers.ts b/lib/testing/helpers.ts similarity index 95% rename from testing/helpers.ts rename to lib/testing/helpers.ts index 90331d922b8b..28b2023422e7 100644 --- a/testing/helpers.ts +++ b/lib/testing/helpers.ts @@ -1,5 +1,4 @@ import { basename, dirname, join } from 'path'; -import { fileURLToPath } from 'url'; import { merge, set, snakeCase } from 'lodash-es'; import type { RunContextSettings, RunResult } from 'yeoman-test'; import { RunContext, YeomanTest, result } from 'yeoman-test'; @@ -7,16 +6,16 @@ import { globSync } from 'glob'; import type { BaseEnvironmentOptions, GetGeneratorConstructor, BaseGenerator as YeomanGenerator } from '@yeoman/types'; import type { EmptyObject } from 'type-fest'; -import EnvironmentBuilder from '../cli/environment-builder.mjs'; -import { JHIPSTER_CONFIG_DIR } from '../generators/generator-constants.js'; -import { GENERATOR_WORKSPACES } from '../generators/generator-list.js'; -import { createJHipsterLogger, normalizePathEnd, parseCreationTimestamp } from '../generators/base/support/index.js'; -import BaseGenerator from '../generators/base/index.js'; -import type { JHipsterGeneratorOptions } from '../generators/base/api.js'; -import { getPackageRoot, isDistFolder } from '../lib/index.js'; -import type { JSONEntity } from '../lib/jdl/core/types/json-config.js'; -import type CoreGenerator from '../generators/base-core/generator.js'; -import type { ApplicationConfiguration } from '../lib/types/application/yo-rc.js'; +import EnvironmentBuilder from '../../cli/environment-builder.mjs'; +import { JHIPSTER_CONFIG_DIR } from '../../generators/generator-constants.js'; +import { GENERATOR_WORKSPACES } from '../../generators/generator-list.js'; +import { createJHipsterLogger, normalizePathEnd, parseCreationTimestamp } from '../../generators/base/support/index.js'; +import BaseGenerator from '../../generators/base/index.js'; +import type { JHipsterGeneratorOptions } from '../../generators/base/api.js'; +import { getPackageRoot, isDistFolder } from '../index.js'; +import type { JSONEntity } from '../jdl/core/types/json-config.js'; +import type CoreGenerator from '../../generators/base-core/generator.js'; +import type { ApplicationConfiguration } from '../types/application/yo-rc.js'; import getGenerator from './get-generator.js'; type BaseEntity = { name: string } & JSONEntity; @@ -43,7 +42,7 @@ const DEFAULT_TEST_SETTINGS = { forwardCwd: true }; const DEFAULT_TEST_OPTIONS = { skipInstall: true }; const DEFAULT_TEST_ENV_OPTIONS = { skipInstall: true, dryRun: false }; -const generatorsDir = join(fileURLToPath(import.meta.url), '../../generators'); +const generatorsDir = join(getPackageRoot(), 'generators'); const allGenerators = [ ...globSync('*/index.{j,t}s', { cwd: generatorsDir, posix: true }).map(file => dirname(file)), ...globSync('*/generators/*/index.{j,t}s', { cwd: generatorsDir, posix: true }).map(file => dirname(file).replace('/generators/', ':')), diff --git a/testing/index.ts b/lib/testing/index.ts similarity index 100% rename from testing/index.ts rename to lib/testing/index.ts diff --git a/testing/sample-config.ts b/lib/testing/sample-config.ts similarity index 85% rename from testing/sample-config.ts rename to lib/testing/sample-config.ts index ead912abff19..dc14c5081b2c 100644 --- a/testing/sample-config.ts +++ b/lib/testing/sample-config.ts @@ -1,9 +1,9 @@ import { lstat, readFile } from 'node:fs/promises'; import { join } from 'node:path'; -import type { InfoFile } from '../generators/info/support/extract-info.js'; -import { GENERATOR_JHIPSTER } from '../generators/generator-constants.js'; -import { mutateData } from '../lib/utils/object.js'; +import type { InfoFile } from '../../generators/info/support/extract-info.js'; +import { GENERATOR_JHIPSTER } from '../../generators/generator-constants.js'; +import { mutateData } from '../utils/object.js'; const isFile = async (filename: string): Promise => { try { diff --git a/testing/support/application-samples.ts b/lib/testing/support/application-samples.ts similarity index 88% rename from testing/support/application-samples.ts rename to lib/testing/support/application-samples.ts index 694afb75a34a..197fb59554fd 100644 --- a/testing/support/application-samples.ts +++ b/lib/testing/support/application-samples.ts @@ -1,4 +1,4 @@ -import { applicationTypes, authenticationTypes } from '../../lib/jhipster/index.js'; +import { applicationTypes, authenticationTypes } from '../../jhipster/index.js'; const { JWT, OAUTH2, SESSION } = authenticationTypes; const { GATEWAY, MICROSERVICE, MONOLITH } = applicationTypes; diff --git a/testing/support/client-samples.ts b/lib/testing/support/client-samples.ts similarity index 100% rename from testing/support/client-samples.ts rename to lib/testing/support/client-samples.ts diff --git a/testing/support/deployment-samples.ts b/lib/testing/support/deployment-samples.ts similarity index 100% rename from testing/support/deployment-samples.ts rename to lib/testing/support/deployment-samples.ts diff --git a/testing/support/entity-samples.ts b/lib/testing/support/entity-samples.ts similarity index 96% rename from testing/support/entity-samples.ts rename to lib/testing/support/entity-samples.ts index 92a25aefd710..4edee5cfe4da 100644 --- a/testing/support/entity-samples.ts +++ b/lib/testing/support/entity-samples.ts @@ -1,4 +1,4 @@ -import { fieldTypes } from '../../lib/jhipster/index.js'; +import { fieldTypes } from '../../jhipster/index.js'; const { CommonDBTypes: { UUID }, diff --git a/testing/support/matcher.ts b/lib/testing/support/matcher.ts similarity index 100% rename from testing/support/matcher.ts rename to lib/testing/support/matcher.ts diff --git a/testing/support/matrix-utils.ts b/lib/testing/support/matrix-utils.ts similarity index 100% rename from testing/support/matrix-utils.ts rename to lib/testing/support/matrix-utils.ts diff --git a/testing/support/server-samples.ts b/lib/testing/support/server-samples.ts similarity index 100% rename from testing/support/server-samples.ts rename to lib/testing/support/server-samples.ts diff --git a/lib/types/application/options.d.ts b/lib/types/application/options.d.ts index 56475beacb92..2f2785969462 100644 --- a/lib/types/application/options.d.ts +++ b/lib/types/application/options.d.ts @@ -10,6 +10,7 @@ export type ApplicationOptions = Simplify< ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & + ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & diff --git a/lib/types/application/yo-rc.d.ts b/lib/types/application/yo-rc.d.ts index b7d1df3e5a5a..f306fa4b7f5c 100644 --- a/lib/types/application/yo-rc.d.ts +++ b/lib/types/application/yo-rc.d.ts @@ -18,6 +18,7 @@ export type ApplicationConfiguration = Simplify< ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & + ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand diff --git a/package.json b/package.json index 2135866b6ae2..eda434319458 100644 --- a/package.json +++ b/package.json @@ -74,8 +74,8 @@ "default": "./dist/lib/jdl/index.js" }, "./testing": { - "types": "./dist/testing/index.d.ts", - "default": "./dist/testing/index.js" + "types": "./dist/lib/testing/index.d.ts", + "default": "./dist/lib/testing/index.js" } }, "main": "./dist/generators/index.js", diff --git a/test/needle-api/needle-client-angular-generator.spec.ts b/test/needle-api/needle-client-angular-generator.spec.ts index 06181dc9ea6d..35951c5bac53 100644 --- a/test/needle-api/needle-client-angular-generator.spec.ts +++ b/test/needle-api/needle-client-angular-generator.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; +import { defaultHelpers as helpers, runResult } from '../../lib/testing/index.js'; import AngularGenerator from '../../generators/angular/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../../generators/generator-constants.js'; diff --git a/test/needle-api/needle-client-angular.spec.ts b/test/needle-api/needle-client-angular.spec.ts index 5665fb00189f..e9a9bb2981c1 100644 --- a/test/needle-api/needle-client-angular.spec.ts +++ b/test/needle-api/needle-client-angular.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { getGenerator, basicHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../../generators/generator-constants.js'; import BaseApplicationGenerator from '../../generators/base-application/index.js'; diff --git a/test/needle-api/needle-client-react-generator.spec.ts b/test/needle-api/needle-client-react-generator.spec.ts index da4911379477..7bf36be67fd4 100644 --- a/test/needle-api/needle-client-react-generator.spec.ts +++ b/test/needle-api/needle-client-react-generator.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { getGenerator, defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, defaultHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../../generators/generator-constants.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; import ReactGenerator from '../../generators/react/index.js'; diff --git a/test/needle-api/needle-client-react.spec.ts b/test/needle-api/needle-client-react.spec.ts index 04a1a2ea4ad6..9b34e5d94f5d 100644 --- a/test/needle-api/needle-client-react.spec.ts +++ b/test/needle-api/needle-client-react.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { getGenerator, basicHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../../generators/generator-constants.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; import BaseApplicationGenerator from '../../generators/base-application/index.js'; diff --git a/test/needle-api/needle-client-vue-generator.spec.ts b/test/needle-api/needle-client-vue-generator.spec.ts index 375cb41a0b41..1388d8a56bb7 100644 --- a/test/needle-api/needle-client-vue-generator.spec.ts +++ b/test/needle-api/needle-client-vue-generator.spec.ts @@ -1,5 +1,5 @@ import { before, describe, it } from 'esmocha'; -import { getGenerator, basicHelpers as helpers, result as runResult } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers, result as runResult } from '../../lib/testing/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../../generators/generator-constants.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; diff --git a/test/needle-api/needle-client-vue.spec.ts b/test/needle-api/needle-client-vue.spec.ts index 7f2b84c60a0e..07870f8fbb53 100644 --- a/test/needle-api/needle-client-vue.spec.ts +++ b/test/needle-api/needle-client-vue.spec.ts @@ -1,5 +1,5 @@ import { before, describe } from 'esmocha'; -import { getGenerator, basicHelpers as helpers } from '../../testing/index.js'; +import { getGenerator, basicHelpers as helpers } from '../../lib/testing/index.js'; import ClientGenerator from '../../generators/client/index.js'; import { clientFrameworkTypes } from '../../lib/jhipster/index.js'; diff --git a/test/support/check-enforcements.ts b/test/support/check-enforcements.ts index d38435506a41..91ae950039bd 100644 --- a/test/support/check-enforcements.ts +++ b/test/support/check-enforcements.ts @@ -20,7 +20,7 @@ import assert from 'assert'; import { opendirSync, readFileSync, writeFileSync } from 'fs'; import path, { basename } from 'path'; import { before, describe, it } from 'mocha'; -import { getGeneratorFolder } from '../../testing/get-generator.js'; +import { getGeneratorFolder } from '../../lib/testing/get-generator.js'; const fixEnforcements = process.argv.includes('--fix-enforcements'); diff --git a/test/support/tests.js b/test/support/tests.js index f633d5141b09..c6f45832682e 100644 --- a/test/support/tests.js +++ b/test/support/tests.js @@ -3,7 +3,7 @@ import sinon from 'sinon'; import { after, before, describe, expect, it } from 'esmocha'; import { buildJHipster } from '../../cli/index.mjs'; import { GENERATOR_JHIPSTER } from '../../generators/generator-constants.js'; -import { getGenerator, skipPrettierHelpers as helpers } from '../../testing/index.js'; +import { getGenerator, skipPrettierHelpers as helpers } from '../../lib/testing/index.js'; import { ENTITY_PRIORITY_NAMES, PRIORITY_NAMES, PRIORITY_NAMES_LIST } from '../../generators/base-application/priorities.js'; import { WORKSPACES_PRIORITY_NAMES } from '../../generators/base-workspaces/priorities.js'; diff --git a/tsconfig.json b/tsconfig.json index 6dea1945d0b7..a66da68e0fdb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "include": ["./cli", "./generators", "./jdl", "./lib", "./testing"], + "include": ["./cli", "./generators", "./lib"], "exclude": ["**/*.spec.*", "**/__*/**", "**/node_modules", "**/.*/"], "compilerOptions": { /* Language and Environment */