From a6566717ad32e6671449bc751bffe2cacd7d0a8e Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Tue, 16 Aug 2022 11:27:16 -0300 Subject: [PATCH 01/25] fix test file extension --- test/{app-required-config.js => app-required-config.spec.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{app-required-config.js => app-required-config.spec.js} (100%) diff --git a/test/app-required-config.js b/test/app-required-config.spec.js similarity index 100% rename from test/app-required-config.js rename to test/app-required-config.spec.js From cd3c638ab306d7bbe80fa36cb1cb79d2f574dd7b Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 29 Jul 2022 16:44:11 -0300 Subject: [PATCH 02/25] add support to local blueprint --- cli/environment-builder.js | 16 ++++- .../client/templates/angular/package.json.ejs | 4 +- .../client/templates/react/package.json.ejs | 4 +- .../client/templates/vue/package.json.ejs | 4 +- generators/generator-base-blueprint.js | 5 +- generators/server/templates/package.json.ejs | 4 +- test/blueprint/local-blueprint.spec.js | 59 +++++++++++++++++++ test/utils-blueprint.spec.js | 14 +++-- utils/blueprint.js | 10 ++++ 9 files changed, 105 insertions(+), 15 deletions(-) create mode 100644 test/blueprint/local-blueprint.spec.js diff --git a/cli/environment-builder.js b/cli/environment-builder.js index 80fbfd61cfb8..1455b73418e6 100644 --- a/cli/environment-builder.js +++ b/cli/environment-builder.js @@ -20,6 +20,7 @@ const assert = require('assert'); const chalk = require('chalk'); const _ = require('lodash'); const path = require('path'); +const { existsSync } = require('fs'); const Environment = require('yeoman-environment'); const { CLI_NAME, logger } = require('./utils'); const { loadYoRc, packageNameToNamespace } = require('../generators/utils'); @@ -88,7 +89,7 @@ module.exports = class EnvironmentBuilder { } prepare({ blueprints, lookups } = {}) { - this._lookupJHipster()._loadBlueprints(blueprints)._lookups(lookups)._lookupBlueprints()._loadSharedOptions(); + this._lookupJHipster()._lookupLocalBlueprint()._loadBlueprints(blueprints)._lookups(lookups)._lookupBlueprints()._loadSharedOptions(); return this; } @@ -125,6 +126,19 @@ module.exports = class EnvironmentBuilder { return this; } + _lookupLocalBlueprint() { + const localBlueprintPath = path.join(process.cwd(), '.blueprint'); + if (existsSync(localBlueprintPath)) { + // Register jhipster generators. + const generators = this.env.lookup({ packagePaths: [localBlueprintPath], lookups: ['.'] }); + if (generators.length > 0) { + this.env.alias(/^@jhipster\/jhipster-local(:(.*))?$/, '.blueprint$1'); + this.env.sharedOptions.localBlueprint = true; + } + } + return this; + } + _lookups(lookups = []) { lookups = [].concat(lookups); lookups.forEach(lookup => { diff --git a/generators/client/templates/angular/package.json.ejs b/generators/client/templates/angular/package.json.ejs index 152f8c81de92..88a27f59d727 100644 --- a/generators/client/templates/angular/package.json.ejs +++ b/generators/client/templates/angular/package.json.ejs @@ -144,8 +144,8 @@ "default_environment": "prod" }, "scripts": { - "prettier:check": "prettier --check \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"", - "prettier:format": "prettier --write \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"", + "prettier:check": "prettier --check \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"", + "prettier:format": "prettier --write \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"", "lint": "eslint . --ext .js,.ts", "lint:fix": "<%= clientPackageManager %> run lint -- --fix", "cleanup": "rimraf <%= DIST_DIR %>", diff --git a/generators/client/templates/react/package.json.ejs b/generators/client/templates/react/package.json.ejs index 4b539ffeb6b1..eb8188cd6230 100644 --- a/generators/client/templates/react/package.json.ejs +++ b/generators/client/templates/react/package.json.ejs @@ -173,8 +173,8 @@ "default_environment": "prod" }, "scripts": { - "prettier:check": "prettier --check \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"", - "prettier:format": "prettier --write \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"", + "prettier:check": "prettier --check \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"", + "prettier:format": "prettier --write \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"", "lint": "eslint . --ext .js,.ts,.jsx,.tsx", "lint:fix": "<%= clientPackageManager %> run lint -- --fix", "cleanup": "rimraf <%= DIST_DIR %>", diff --git a/generators/client/templates/vue/package.json.ejs b/generators/client/templates/vue/package.json.ejs index 8f7bcf655bfc..e008f90f9254 100644 --- a/generators/client/templates/vue/package.json.ejs +++ b/generators/client/templates/vue/package.json.ejs @@ -144,8 +144,8 @@ "default_environment": "prod" }, "scripts": { - "prettier:check": "prettier --check \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"", - "prettier:format": "prettier --write \"{,src/**/,webpack/}*.{<%= getPrettierExtensions() %>}\"", + "prettier:check": "prettier --check \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"", + "prettier:format": "prettier --write \"{,src/**/,webpack/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"", "lint": "eslint . --ext .ts,.vue ", "lint:fix": "eslint . --ext .ts,.vue --fix", "cleanup": "rimraf <%= DIST_DIR %>", diff --git a/generators/generator-base-blueprint.js b/generators/generator-base-blueprint.js index 6d78af7631f0..f5deba1c7ce5 100644 --- a/generators/generator-base-blueprint.js +++ b/generators/generator-base-blueprint.js @@ -409,7 +409,10 @@ module.exports = class JHipsterBaseBlueprintGenerator extends BaseGenerator { this._configureBlueprints(); } - const blueprints = this.jhipsterConfig.blueprints || []; + let blueprints = this.jhipsterConfig.blueprints || []; + if (this.options.localBlueprint) { + blueprints = blueprints.concat({ name: '@jhipster/local' }); + } for (const blueprint of blueprints) { const blueprintGenerator = await this._composeBlueprint(blueprint.name, subGen, extraOptions); if (blueprintGenerator) { diff --git a/generators/server/templates/package.json.ejs b/generators/server/templates/package.json.ejs index cafbf6ab1cdb..ab59de7d0a9b 100644 --- a/generators/server/templates/package.json.ejs +++ b/generators/server/templates/package.json.ejs @@ -43,7 +43,7 @@ "default_environment": "prod" }, "scripts": { - "prettier:check": "prettier --check \"{,src/**/}*.{<%= getPrettierExtensions() %>}\"", - "prettier:format": "prettier --write \"{,src/**/}*.{<%= getPrettierExtensions() %>}\"" + "prettier:check": "prettier --check \"{,src/**/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"", + "prettier:format": "prettier --write \"{,src/**/,.blueprint/**/}*.{<%= getPrettierExtensions() %>}\"" } } diff --git a/test/blueprint/local-blueprint.spec.js b/test/blueprint/local-blueprint.spec.js new file mode 100644 index 000000000000..388cb6b04b7d --- /dev/null +++ b/test/blueprint/local-blueprint.spec.js @@ -0,0 +1,59 @@ +/* eslint-disable no-unused-expressions */ +const path = require('path'); +const { expect: jestExpect } = require('expect'); +const { mkdirSync, writeFileSync } = require('fs'); + +const { skipPrettierHelpers: helpers } = require('../utils/utils'); + +const BLUEPRINT_NS = 'jhipster:app'; +const BLUEPRINT_CONTENTS = `export async function createGenerator(env){ + return class extends (await env.requireGenerator('${BLUEPRINT_NS}')) { + constructor(args, opts, features) { + super(args, opts, features); + } + + get writing() { + return { + write() { + this.writeDestination('local-blueprint.txt', 'This is a local blueprint'); + } + }; + } + }; +} +`; + +describe('Local blueprint', () => { + describe('generates application', () => { + let runResult; + before(async () => { + runResult = await helpers + .run(BLUEPRINT_NS) + .inTmpDir(dir => { + // Add a local blueprint implementation + const applicationDir = path.join(dir, '.blueprint/app'); + mkdirSync(applicationDir, { recursive: true }); + writeFileSync(path.join(applicationDir, 'index.mjs'), BLUEPRINT_CONTENTS); + }) + .withOptions({ + defaults: true, + }); + }); + + it('creates expected default files', () => { + jestExpect(runResult.getStateSnapshot()).toMatchInlineSnapshot(` +Object { + ".yo-rc.json": Object { + "stateCleared": "modified", + }, + "local-blueprint.txt": Object { + "stateCleared": "modified", + }, +} +`); + }); + it('blueprint module and version are in package.json', () => { + runResult.assertFileContent('local-blueprint.txt', /This is a local blueprint/); + }); + }); +}); diff --git a/test/utils-blueprint.spec.js b/test/utils-blueprint.spec.js index 8e5297b3d245..9f103f108841 100644 --- a/test/utils-blueprint.spec.js +++ b/test/utils-blueprint.spec.js @@ -28,13 +28,17 @@ describe('JHipster Blueprint Utils', () => { const actual = utils.parseBluePrints('generator-jhipster-foo@1.0.1'); assert.deepStrictEqual(actual, expected); }); - it("doesn't modify scoped package and extracts version", () => { - const expected = [{ name: '@corp/foo', version: '1.0.1' }]; + it('adds generator-jhipster prefix to scoped package and extracts version', () => { + const expected = [{ name: '@corp/generator-jhipster-foo', version: '1.0.1' }]; const actual = utils.parseBluePrints('@corp/foo@1.0.1'); assert.deepStrictEqual(actual, expected); }); it('parses comma separated list', () => { - const expected = [{ name: 'generator-jhipster-foo' }, { name: 'generator-jhipster-bar', version: '1.0.1' }, { name: '@corp/foo' }]; + const expected = [ + { name: 'generator-jhipster-foo' }, + { name: 'generator-jhipster-bar', version: '1.0.1' }, + { name: '@corp/generator-jhipster-foo' }, + ]; const actual = utils.parseBluePrints('foo,bar@1.0.1,@corp/foo'); assert.deepStrictEqual(actual, expected); }); @@ -130,9 +134,9 @@ describe('JHipster Blueprint Utils', () => { const generatorName = utils.normalizeBlueprintName('generator-jhipster-foo'); assert.textEqual(generatorName, 'generator-jhipster-foo'); }); - it("doesn't do anything for scoped package", () => { + it('adds generator-jhipster prefix for scoped package', () => { const generatorName = utils.normalizeBlueprintName('@corp/foo'); - assert.textEqual(generatorName, '@corp/foo'); + assert.textEqual(generatorName, '@corp/generator-jhipster-foo'); }); }); }); diff --git a/utils/blueprint.js b/utils/blueprint.js index 037a0fa4ca8f..20ea3d79e7c8 100644 --- a/utils/blueprint.js +++ b/utils/blueprint.js @@ -16,6 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +const YeomanNamespace = require('yeoman-environment/lib/util/namespace'); module.exports = { mergeBlueprints, @@ -134,6 +135,15 @@ function parseBlueprintInfo(blueprint) { * @returns {string} the normalized blueprint name */ function normalizeBlueprintName(blueprint) { + try { + const parsed = YeomanNamespace.parse(blueprint); + if (parsed.unscoped.startsWith('generator-jhipster-')) { + return blueprint; + } + const namespace = new YeomanNamespace(parsed); + return namespace.with({ unscoped: `generator-jhipster-${namespace.unscoped}` }).toString(); + // eslint-disable-next-line no-empty + } catch (e) {} if (blueprint && blueprint.startsWith('@')) { return blueprint; } From b54772f0b348d1853120b5a273eabc652756e1e3 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 17 Aug 2022 10:53:05 -0300 Subject: [PATCH 03/25] generate local blueprint with generate-blueprint command --- generators/generate-blueprint/constants.mjs | 32 +++++++++++-- generators/generate-blueprint/files.mjs | 12 +++-- generators/generate-blueprint/generator.mjs | 46 ++++++++++++++----- .../generate-blueprint/generator.spec.mjs | 36 +++++++++++++++ 4 files changed, 105 insertions(+), 21 deletions(-) diff --git a/generators/generate-blueprint/constants.mjs b/generators/generate-blueprint/constants.mjs index 26a3297bb163..850550785a9d 100644 --- a/generators/generate-blueprint/constants.mjs +++ b/generators/generate-blueprint/constants.mjs @@ -28,6 +28,8 @@ export const SUB_GENERATORS = 'subGenerators'; export const ADDITIONAL_SUB_GENERATORS = 'additionalSubGenerators'; export const DYNAMIC = 'dynamic'; export const JS = 'js'; +export const LOCAL_BLUEPRINT_OPTION = 'localBlueprint'; +export const CLI_OPTION = 'cli'; export const SBS = 'sbs'; export const COMMAND = 'command'; @@ -59,6 +61,16 @@ export const options = () => ({ type: Boolean, scope: 'storage', }, + [LOCAL_BLUEPRINT_OPTION]: { + desc: 'Generate a local blueprint', + type: Boolean, + scope: 'storage', + }, + [CLI_OPTION]: { + desc: 'Generate a cli for the blueprint', + type: Boolean, + scope: 'storage', + }, [ALL_GENERATORS]: { desc: 'Use js extension', type: Boolean, @@ -74,10 +86,12 @@ export const requiredConfig = () => ({}); /** * Default config that will be used for templates */ -export const defaultConfig = () => ({ +export const defaultConfig = (config = {}) => ({ ...requiredConfig, [DYNAMIC]: false, [JS]: false, + [LOCAL_BLUEPRINT_OPTION]: false, + [CLI_OPTION]: !config[LOCAL_BLUEPRINT_OPTION], [SUB_GENERATORS]: [], [ADDITIONAL_SUB_GENERATORS]: '', }); @@ -108,8 +122,16 @@ export const allGeneratorsConfig = () => ({ ), }); +const { [LOCAL_BLUEPRINT_OPTION]: LOCAL_BLUEPRINT_OPTION_DEFAULT_VALUE, [CLI_OPTION]: CLI_OPTION_DEFAULT_VALUE } = defaultConfig(); + export const prompts = () => { return [ + { + type: 'confirm', + name: LOCAL_BLUEPRINT_OPTION, + message: 'Do you want to generate a local blueprint inside your application?', + default: LOCAL_BLUEPRINT_OPTION_DEFAULT_VALUE, + }, { type: 'checkbox', name: SUB_GENERATORS, @@ -130,15 +152,16 @@ export const prompts = () => { }, }, { + when: answers => !answers[LOCAL_BLUEPRINT_OPTION], type: 'confirm', - name: 'cli', + name: CLI_OPTION, message: 'Add a cli?', - default: true, + default: CLI_OPTION_DEFAULT_VALUE, }, ]; }; -export const subGeneratorPrompts = (subGenerator, additionalSubGenerator) => { +export const subGeneratorPrompts = ({ subGenerator, additionalSubGenerator, localBlueprint }) => { return [ { type: 'confirm', @@ -148,6 +171,7 @@ export const subGeneratorPrompts = (subGenerator, additionalSubGenerator) => { default: true, }, { + when: !localBlueprint, type: 'confirm', name: COMMAND, message: `Is ${chalk.yellow(subGenerator)} generator a cli command?`, diff --git a/generators/generate-blueprint/files.mjs b/generators/generate-blueprint/files.mjs index 6c779daa7ce4..2cd76db15beb 100644 --- a/generators/generate-blueprint/files.mjs +++ b/generators/generate-blueprint/files.mjs @@ -16,10 +16,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { LOCAL_BLUEPRINT_OPTION } from './constants.mjs'; export const files = { baseFiles: [ { + condition: ctx => !ctx[LOCAL_BLUEPRINT_OPTION], templates: [ '.github/workflows/generator.yml', '.eslintrc.json', @@ -44,18 +46,18 @@ export const generatorFiles = { generator: [ { path: 'generators/generator', - to: ctx => `generators/${ctx.generator}`, + to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`, templates: [{ file: 'generator.mjs.jhi', renameTo: ctx => (ctx.js ? 'generator.js.jhi' : 'generator.mjs.jhi') }], }, { path: 'generators/generator', - to: ctx => `generators/${ctx.generator}`, + to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`, templates: [{ file: 'index.mjs', renameTo: ctx => (ctx.js ? 'index.js' : 'index.mjs') }], }, { path: 'generators/generator', - to: ctx => `generators/${ctx.generator}`, - condition: ctx => !ctx.generator.startsWith('entity'), + to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`, + condition: ctx => !ctx.generator.startsWith('entity') && !ctx.application[LOCAL_BLUEPRINT_OPTION], templates: [ { file: 'generator.spec.mjs', @@ -65,7 +67,7 @@ export const generatorFiles = { }, { path: 'generators/generator', - to: ctx => `generators/${ctx.generator}`, + to: ctx => `${ctx.application.blueprintsPath}${ctx.generator}`, condition(ctx) { return (this.options.force || !ctx.written) && ctx.priorities.find(priority => priority.name === 'writing'); }, diff --git a/generators/generate-blueprint/generator.mjs b/generators/generate-blueprint/generator.mjs index 206fef20c7ff..f7aa3683563d 100644 --- a/generators/generate-blueprint/generator.mjs +++ b/generators/generate-blueprint/generator.mjs @@ -33,6 +33,7 @@ import { POST_WRITING_PRIORITY, INSTALL_PRIORITY, END_PRIORITY, + COMPOSING_PRIORITY, } from '../../lib/constants/priorities.mjs'; import { options, @@ -48,13 +49,14 @@ import { SUB_GENERATORS, ADDITIONAL_SUB_GENERATORS, WRITTEN, + LOCAL_BLUEPRINT_OPTION, } from './constants.mjs'; import GENERATOR_LIST from '../generator-list.js'; import { files, generatorFiles } from './files.mjs'; const { camelCase, upperFirst, snakeCase } = lodash; -const { GENERATOR_INIT, GENERATOR_GENERATE_BLUEPRINT } = GENERATOR_LIST; +const { GENERATOR_PROJECT_NAME, GENERATOR_INIT, GENERATOR_GENERATE_BLUEPRINT } = GENERATOR_LIST; export default class extends BaseBlueprintGenerator { constructor(args, opts, features) { @@ -73,7 +75,7 @@ export default class extends BaseBlueprintGenerator { this.config.set(allGeneratorsConfig()); } if (this.options.defaults) { - this.config.defaults(defaultConfig()); + this.config.defaults(defaultConfig(this.jhipsterConfig)); } this.config.defaults({ [SKIP_COMMIT_HOOK]: true, @@ -82,13 +84,12 @@ export default class extends BaseBlueprintGenerator { /** @inheritdoc */ async getPossibleDependencies() { - return [GENERATOR_INIT]; + return [GENERATOR_PROJECT_NAME, GENERATOR_INIT]; } async _beforeQueue() { if (!this.fromBlueprint) { - const configure = this.options.configure || !this.shouldComposeModular(); - await this.dependsOnJHipster(GENERATOR_INIT, [], { configure }); + await this.dependsOnJHipster(GENERATOR_PROJECT_NAME); await this.composeWithBlueprints(GENERATOR_GENERATE_BLUEPRINT); } } @@ -119,20 +120,22 @@ export default class extends BaseBlueprintGenerator { await this.prompt(prompts(this), this.config); }, async eachSubGenerator() { + const { localBlueprint } = this.jhipsterConfig; const subGenerators = this.config.get(SUB_GENERATORS) || []; for (const subGenerator of subGenerators) { const subGeneratorStorage = this.getSubGeneratorStorage(subGenerator); - await this.prompt(subGeneratorPrompts(subGenerator), subGeneratorStorage); + await this.prompt(subGeneratorPrompts({ subGenerator, localBlueprint }), subGeneratorStorage); } }, async eachAdditionalSubGenerator() { + const { localBlueprint } = this.jhipsterConfig; const additionalSubGenerators = this.config.get(ADDITIONAL_SUB_GENERATORS) || ''; for (const subGenerator of additionalSubGenerators .split(',') .map(sub => sub.trim()) .filter(Boolean)) { const subGeneratorStorage = this.getSubGeneratorStorage(subGenerator); - await this.prompt(subGeneratorPrompts(subGenerator, true), subGeneratorStorage); + await this.prompt(subGeneratorPrompts({ subGenerator, localBlueprint, additionalSubGenerator: true }), subGeneratorStorage); } }, }; @@ -156,6 +159,20 @@ export default class extends BaseBlueprintGenerator { return this.configuring; } + get composing() { + return { + async compose() { + const configure = this.options.configure || !this.shouldComposeModular() || this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]; + await this.composeWithJHipster(GENERATOR_INIT, [], { configure }); + }, + }; + } + + get [COMPOSING_PRIORITY]() { + if (this.delegateToBlueprint) return {}; + return this.composing; + } + get loading() { return { createContext() { @@ -184,6 +201,9 @@ export default class extends BaseBlueprintGenerator { } } }, + preparePath() { + this.application.blueprintsPath = this.application[LOCAL_BLUEPRINT_OPTION] ? '.blueprint/' : 'generators/'; + }, }; } @@ -240,8 +260,8 @@ export default class extends BaseBlueprintGenerator { get postWriting() { return { - postWriting() { - if (this.shouldSkipFiles()) return; + packageJsom() { + if (this.shouldSkipFiles() || this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]) return; const { packagejs } = this.application; this.packageJson.merge({ name: `generator-jhipster-${this.jhipsterConfig.baseName}`, @@ -284,7 +304,7 @@ export default class extends BaseBlueprintGenerator { }); }, addCliToPackageJson() { - if (this.shouldSkipFiles() || !this.jhipsterConfig.cli) return; + if (this.shouldSkipFiles() || !this.jhipsterConfig.cli || this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]) return; const { baseName, cliName = `jhipster-${baseName}` } = this.application; this.packageJson.merge({ bin: { @@ -294,7 +314,7 @@ export default class extends BaseBlueprintGenerator { }); }, addGeneratorJHipsterDependency() { - if (this.shouldSkipFiles()) return; + if (this.shouldSkipFiles() || this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]) return; const { packagejs } = this.application; if (this.jhipsterConfig.dynamic) { this.packageJson.merge({ @@ -324,7 +344,7 @@ export default class extends BaseBlueprintGenerator { get install() { return { async addSnapshot() { - if (this.options.skipInstall || this.options.skipGit || this.config.existed) return; + if (this.options.skipInstall || this.options.skipGit || this.config.existed || this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]) return; // Generate snapshots to add to git. this.log(` This is a new blueprint, executing '${chalk.yellow('npm run update-snapshot')}' to generate snapshots and commit to git.`); @@ -345,6 +365,8 @@ This is a new blueprint, executing '${chalk.yellow('npm run update-snapshot')}' get end() { return { end() { + if (this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]) return; + this.log(`${chalk.bold.green('##### USAGE #####')} To begin to work: - launch: ${chalk.yellow.bold('npm install')} diff --git a/generators/generate-blueprint/generator.spec.mjs b/generators/generate-blueprint/generator.spec.mjs index 6016da029697..83e0ccea47e9 100755 --- a/generators/generate-blueprint/generator.spec.mjs +++ b/generators/generate-blueprint/generator.spec.mjs @@ -66,5 +66,41 @@ describe(`JHipster ${generator} generator`, () => { expect(runResult.getStateSnapshot()).toMatchSnapshot(); }); }); + describe('local-blueprint option', () => { + let runResult; + before(async () => { + runResult = await helpers.run(generatorPath).withOptions({ localBlueprint: true }); + }); + it('should write java files with gradle build tool and match snapshot', () => { + expect(runResult.getStateSnapshot()).toMatchInlineSnapshot(` +Object { + ".yo-rc.json": Object { + "stateCleared": "modified", + }, +} +`); + }); + }); + describe('local-blueprint option and app generator', () => { + let runResult; + before(async () => { + runResult = await helpers.run(generatorPath).withOptions({ localBlueprint: true, subGenerators: ['app'] }); + }); + it('should write java files with gradle build tool and match snapshot', () => { + expect(runResult.getStateSnapshot()).toMatchInlineSnapshot(` +Object { + ".blueprint/app/generator.mjs": Object { + "stateCleared": "modified", + }, + ".blueprint/app/index.mjs": Object { + "stateCleared": "modified", + }, + ".yo-rc.json": Object { + "stateCleared": "modified", + }, +} +`); + }); + }); }); }); From 3e543b92332ddd787bae1b614e9eb67df7a6866b Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 17 Aug 2022 12:26:33 -0300 Subject: [PATCH 04/25] add --all-priorites option --- generators/generate-blueprint/constants.mjs | 15 +++++++---- generators/generate-blueprint/generator.mjs | 25 +++++++++++++++---- .../generate-blueprint/generator.spec.mjs | 5 +++- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/generators/generate-blueprint/constants.mjs b/generators/generate-blueprint/constants.mjs index 850550785a9d..f49d33766cf6 100644 --- a/generators/generate-blueprint/constants.mjs +++ b/generators/generate-blueprint/constants.mjs @@ -35,6 +35,7 @@ export const SBS = 'sbs'; export const COMMAND = 'command'; export const PRIORITIES = 'priorities'; export const ALL_GENERATORS = 'allGenerators'; +export const ALL_PRIORITIES = 'allPriorities'; export const WRITTEN = 'written'; /** @@ -72,10 +73,14 @@ export const options = () => ({ scope: 'storage', }, [ALL_GENERATORS]: { - desc: 'Use js extension', + desc: 'Generate every sub generator', type: Boolean, scope: 'generator', }, + [ALL_PRIORITIES]: { + desc: 'Generate every priority', + type: Boolean, + }, }); /** @@ -86,7 +91,7 @@ export const requiredConfig = () => ({}); /** * Default config that will be used for templates */ -export const defaultConfig = (config = {}) => ({ +export const defaultConfig = ({ config = {} } = {}) => ({ ...requiredConfig, [DYNAMIC]: false, [JS]: false, @@ -122,9 +127,8 @@ export const allGeneratorsConfig = () => ({ ), }); -const { [LOCAL_BLUEPRINT_OPTION]: LOCAL_BLUEPRINT_OPTION_DEFAULT_VALUE, [CLI_OPTION]: CLI_OPTION_DEFAULT_VALUE } = defaultConfig(); - export const prompts = () => { + const { [LOCAL_BLUEPRINT_OPTION]: LOCAL_BLUEPRINT_OPTION_DEFAULT_VALUE, [CLI_OPTION]: CLI_OPTION_DEFAULT_VALUE } = defaultConfig(); return [ { type: 'confirm', @@ -162,13 +166,14 @@ export const prompts = () => { }; export const subGeneratorPrompts = ({ subGenerator, additionalSubGenerator, localBlueprint }) => { + const { [SBS]: SBS_DEFAULT_VALUE } = defaultSubGeneratorConfig(); return [ { type: 'confirm', name: SBS, when: !additionalSubGenerator, message: `Is ${chalk.yellow(subGenerator)} generator a side-by-side blueprint?`, - default: true, + default: SBS_DEFAULT_VALUE, }, { when: !localBlueprint, diff --git a/generators/generate-blueprint/generator.mjs b/generators/generate-blueprint/generator.mjs index f7aa3683563d..49b08717cb13 100644 --- a/generators/generate-blueprint/generator.mjs +++ b/generators/generate-blueprint/generator.mjs @@ -34,7 +34,9 @@ import { INSTALL_PRIORITY, END_PRIORITY, COMPOSING_PRIORITY, + BASE_PRIORITY_NAMES, } from '../../lib/constants/priorities.mjs'; + import { options, requiredConfig, @@ -50,6 +52,7 @@ import { ADDITIONAL_SUB_GENERATORS, WRITTEN, LOCAL_BLUEPRINT_OPTION, + ALL_PRIORITIES, } from './constants.mjs'; import GENERATOR_LIST from '../generator-list.js'; @@ -75,11 +78,8 @@ export default class extends BaseBlueprintGenerator { this.config.set(allGeneratorsConfig()); } if (this.options.defaults) { - this.config.defaults(defaultConfig(this.jhipsterConfig)); + this.config.defaults(defaultConfig({ config: this.jhipsterConfig })); } - this.config.defaults({ - [SKIP_COMMIT_HOOK]: true, - }); } /** @inheritdoc */ @@ -121,20 +121,28 @@ export default class extends BaseBlueprintGenerator { }, async eachSubGenerator() { const { localBlueprint } = this.jhipsterConfig; + const { [ALL_PRIORITIES]: allPriorities } = this.options; const subGenerators = this.config.get(SUB_GENERATORS) || []; for (const subGenerator of subGenerators) { const subGeneratorStorage = this.getSubGeneratorStorage(subGenerator); - await this.prompt(subGeneratorPrompts({ subGenerator, localBlueprint }), subGeneratorStorage); + if (allPriorities) { + subGeneratorStorage.defaults({ [PRIORITIES]: BASE_PRIORITY_NAMES }); + } + await this.prompt(subGeneratorPrompts({ subGenerator, localBlueprint, options: this.options }), subGeneratorStorage); } }, async eachAdditionalSubGenerator() { const { localBlueprint } = this.jhipsterConfig; + const { [ALL_PRIORITIES]: allPriorities } = this.options; const additionalSubGenerators = this.config.get(ADDITIONAL_SUB_GENERATORS) || ''; for (const subGenerator of additionalSubGenerators .split(',') .map(sub => sub.trim()) .filter(Boolean)) { const subGeneratorStorage = this.getSubGeneratorStorage(subGenerator); + if (allPriorities) { + subGeneratorStorage.defaults({ [PRIORITIES]: BASE_PRIORITY_NAMES }); + } await this.prompt(subGeneratorPrompts({ subGenerator, localBlueprint, additionalSubGenerator: true }), subGeneratorStorage); } }, @@ -151,6 +159,13 @@ export default class extends BaseBlueprintGenerator { requiredConfig() { this.config.defaults(requiredConfig()); }, + conditionalConfig() { + if (!this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]) { + this.config.defaults({ + [SKIP_COMMIT_HOOK]: true, + }); + } + }, }; } diff --git a/generators/generate-blueprint/generator.spec.mjs b/generators/generate-blueprint/generator.spec.mjs index 83e0ccea47e9..207616f87faa 100755 --- a/generators/generate-blueprint/generator.spec.mjs +++ b/generators/generate-blueprint/generator.spec.mjs @@ -84,7 +84,7 @@ Object { describe('local-blueprint option and app generator', () => { let runResult; before(async () => { - runResult = await helpers.run(generatorPath).withOptions({ localBlueprint: true, subGenerators: ['app'] }); + runResult = await helpers.run(generatorPath).withOptions({ localBlueprint: true, subGenerators: ['app'], allPriorities: true }); }); it('should write java files with gradle build tool and match snapshot', () => { expect(runResult.getStateSnapshot()).toMatchInlineSnapshot(` @@ -95,6 +95,9 @@ Object { ".blueprint/app/index.mjs": Object { "stateCleared": "modified", }, + ".blueprint/app/templates/template-file-app.ejs": Object { + "stateCleared": "modified", + }, ".yo-rc.json": Object { "stateCleared": "modified", }, From 462844c957c84882a9e21deaa50b07d77df5e266 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 17 Aug 2022 12:30:50 -0300 Subject: [PATCH 05/25] fix test sample --- test-integration/generate-blueprint-samples/default/.yo-rc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/test-integration/generate-blueprint-samples/default/.yo-rc.json b/test-integration/generate-blueprint-samples/default/.yo-rc.json index a4b0a00f1222..7617bea188d7 100755 --- a/test-integration/generate-blueprint-samples/default/.yo-rc.json +++ b/test-integration/generate-blueprint-samples/default/.yo-rc.json @@ -3,6 +3,7 @@ "additionalSubGenerators": "", "baseName": "foo", "cli": true, + "localBlueprint": false, "generators": { "app": { "command": false, From 280c1f5fa415815a7b6e59b13e0d0f9b24d10ead Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 08:08:48 +0000 Subject: [PATCH 06/25] chore(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.35.1 to 5.36.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.36.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index d5eee84e3029..8f19ab265357 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -36,7 +36,7 @@ "@types/react-redux": "7.1.24", "@types/redux": "3.6.31", "@types/webpack-env": "1.18.0", - "@typescript-eslint/eslint-plugin": "5.35.1", + "@typescript-eslint/eslint-plugin": "5.36.0", "@typescript-eslint/parser": "5.36.0", "autoprefixer": "10.4.8", "browser-sync": "2.27.10", From 373582707b7103432f5fccc0cccae3c038f9823b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 15:19:59 +0000 Subject: [PATCH 07/25] chore(deps-dev): bump @typescript-eslint/parser Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.36.0 to 5.36.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.36.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index d3b59bfce6ec..7c66cf25d36a 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -37,7 +37,7 @@ "@types/redux": "3.6.31", "@types/webpack-env": "1.18.0", "@typescript-eslint/eslint-plugin": "5.36.0", - "@typescript-eslint/parser": "5.36.0", + "@typescript-eslint/parser": "5.36.1", "autoprefixer": "10.4.8", "browser-sync": "2.27.10", "browser-sync-webpack-plugin": "2.3.0", From 3b7099f1da6edef4d46a1791ddfc57affc93b373 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 20:11:31 +0000 Subject: [PATCH 08/25] chore(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.36.0 to 5.36.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.36.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index 7c66cf25d36a..df4e5ee0dd28 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -36,7 +36,7 @@ "@types/react-redux": "7.1.24", "@types/redux": "3.6.31", "@types/webpack-env": "1.18.0", - "@typescript-eslint/eslint-plugin": "5.36.0", + "@typescript-eslint/eslint-plugin": "5.36.1", "@typescript-eslint/parser": "5.36.1", "autoprefixer": "10.4.8", "browser-sync": "2.27.10", From 6d40cbc616ca7a9bf13ba10b0b04ababd7265502 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 23:25:22 +0000 Subject: [PATCH 09/25] chore(deps): bump @fortawesome/fontawesome-svg-core Bumps [@fortawesome/fontawesome-svg-core](https://github.com/FortAwesome/Font-Awesome) from 6.1.2 to 6.2.0. - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md) - [Commits](https://github.com/FortAwesome/Font-Awesome/commits) --- updated-dependencies: - dependency-name: "@fortawesome/fontawesome-svg-core" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index df4e5ee0dd28..b1b6b38c00da 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@fortawesome/fontawesome-svg-core": "6.1.2", + "@fortawesome/fontawesome-svg-core": "6.2.0", "@fortawesome/free-solid-svg-icons": "6.1.2", "@fortawesome/react-fontawesome": "0.2.0", "@reduxjs/toolkit": "1.8.5", From 9b7bec7c63c80ab3d7c8e0baed87518a67d4f768 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 23:26:14 +0000 Subject: [PATCH 10/25] chore(deps-dev): bump @types/react in /generators/client/templates/react Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.17 to 18.0.18. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index df4e5ee0dd28..34f7cb201da7 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -31,7 +31,7 @@ "@types/jest": "28.1.8", "@types/lodash": "4.14.184", "@types/node": "16.11.56", - "@types/react": "18.0.17", + "@types/react": "18.0.18", "@types/react-dom": "18.0.6", "@types/react-redux": "7.1.24", "@types/redux": "3.6.31", From 695cd10fecbe14826a8688613b474141f3488ee9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 02:12:59 +0000 Subject: [PATCH 11/25] chore(deps): bump @fortawesome/free-solid-svg-icons Bumps [@fortawesome/free-solid-svg-icons](https://github.com/FortAwesome/Font-Awesome) from 6.1.2 to 6.2.0. - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md) - [Commits](https://github.com/FortAwesome/Font-Awesome/commits) --- updated-dependencies: - dependency-name: "@fortawesome/free-solid-svg-icons" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index b1b6b38c00da..6f2303ecd9c1 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@fortawesome/fontawesome-svg-core": "6.2.0", - "@fortawesome/free-solid-svg-icons": "6.1.2", + "@fortawesome/free-solid-svg-icons": "6.2.0", "@fortawesome/react-fontawesome": "0.2.0", "@reduxjs/toolkit": "1.8.5", "axios": "0.27.2", From bb1df200284497176be32159171679c24e749b85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 05:04:12 +0000 Subject: [PATCH 12/25] chore(deps-dev): bump cypress in /generators/client/templates/common Bumps [cypress](https://github.com/cypress-io/cypress) from 10.6.0 to 10.7.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](https://github.com/cypress-io/cypress/compare/v10.6.0...v10.7.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/common/package.json b/generators/client/templates/common/package.json index 6e7ec70dc59a..70a2175eae9a 100644 --- a/generators/client/templates/common/package.json +++ b/generators/client/templates/common/package.json @@ -3,7 +3,7 @@ "@cypress/code-coverage": "3.10.0", "babel-loader": "8.2.5", "babel-plugin-istanbul": "6.1.1", - "cypress": "10.6.0", + "cypress": "10.7.0", "cypress-audit": "1.1.0", "eslint-plugin-cypress": "2.12.1", "lighthouse": "9.6.6", From 4adcc5f3e77ef913ba0d7542675fde255f3c30f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 05:05:04 +0000 Subject: [PATCH 13/25] chore(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.36.0 to 5.36.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.36.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/angular/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json b/generators/client/templates/angular/package.json index 3496a47e055f..166206afbbfe 100644 --- a/generators/client/templates/angular/package.json +++ b/generators/client/templates/angular/package.json @@ -24,7 +24,7 @@ "@angular-eslint/eslint-plugin": "14.0.3", "@types/node": "16.11.56", "@types/jest": "28.1.8", - "@typescript-eslint/eslint-plugin": "5.36.0", + "@typescript-eslint/eslint-plugin": "5.36.1", "browser-sync": "2.27.10", "browser-sync-webpack-plugin": "2.3.0", "copy-webpack-plugin": "11.0.0", From 7979a1256b5321088ac260be5d39be8b2f4482ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 05:05:16 +0000 Subject: [PATCH 14/25] chore(deps-dev): bump postcss-import in /generators/client/templates/vue Bumps [postcss-import](https://github.com/postcss/postcss-import) from 14.1.0 to 15.0.0. - [Release notes](https://github.com/postcss/postcss-import/releases) - [Changelog](https://github.com/postcss/postcss-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss-import/compare/14.1.0...15.0.0) --- updated-dependencies: - dependency-name: postcss-import dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- generators/client/templates/vue/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/vue/package.json b/generators/client/templates/vue/package.json index 8f3517bf2300..6063314c8ead 100644 --- a/generators/client/templates/vue/package.json +++ b/generators/client/templates/vue/package.json @@ -46,7 +46,7 @@ "merge-jsons-webpack-plugin": "2.0.1", "mini-css-extract-plugin": "2.6.1", "numeral": "2.0.6", - "postcss-import": "14.1.0", + "postcss-import": "15.0.0", "postcss-loader": "7.0.1", "postcss-url": "10.1.3", "rimraf": "3.0.2", From a2eebe12a1cf90c45ffbc3d27010e0637520e8d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 05:05:43 +0000 Subject: [PATCH 15/25] chore(deps): bump @fortawesome/fontawesome-svg-core Bumps [@fortawesome/fontawesome-svg-core](https://github.com/FortAwesome/Font-Awesome) from 6.1.2 to 6.2.0. - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md) - [Commits](https://github.com/FortAwesome/Font-Awesome/commits) --- updated-dependencies: - dependency-name: "@fortawesome/fontawesome-svg-core" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/vue/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/vue/package.json b/generators/client/templates/vue/package.json index 8f3517bf2300..f048fb06742a 100644 --- a/generators/client/templates/vue/package.json +++ b/generators/client/templates/vue/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@fortawesome/fontawesome-svg-core": "6.1.2", + "@fortawesome/fontawesome-svg-core": "6.2.0", "@fortawesome/free-solid-svg-icons": "6.1.2", "@fortawesome/vue-fontawesome": "2.0.8", "axios": "0.27.2", From ea3495b59781cbd37b6e40a000a846199c44ced8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 05:06:23 +0000 Subject: [PATCH 16/25] chore(deps-dev): bump sass in /generators/client/templates/react Bumps [sass](https://github.com/sass/dart-sass) from 1.54.6 to 1.54.7. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.54.6...1.54.7) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index 4340b1477e4f..a22cbeeb634e 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -66,7 +66,7 @@ "react-infinite-scroll-component": "6.1.0", "redux-mock-store": "1.5.4", "rimraf": "3.0.2", - "sass": "1.54.6", + "sass": "1.54.7", "sass-loader": "13.0.2", "simple-progress-webpack-plugin": "2.0.0", "sinon": "14.0.0", From 59269f2a50df353240de7d0487496ba3d51e5ed8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 13:01:59 +0000 Subject: [PATCH 17/25] chore(deps): bump @fortawesome/fontawesome-svg-core Bumps [@fortawesome/fontawesome-svg-core](https://github.com/FortAwesome/Font-Awesome) from 6.1.2 to 6.2.0. - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md) - [Commits](https://github.com/FortAwesome/Font-Awesome/commits) --- updated-dependencies: - dependency-name: "@fortawesome/fontawesome-svg-core" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/angular/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json b/generators/client/templates/angular/package.json index 3496a47e055f..6db350e46a01 100644 --- a/generators/client/templates/angular/package.json +++ b/generators/client/templates/angular/package.json @@ -2,7 +2,7 @@ "dependencies": { "@angular/common": "14.2.0", "@fortawesome/angular-fontawesome": "0.11.1", - "@fortawesome/fontawesome-svg-core": "6.1.2", + "@fortawesome/fontawesome-svg-core": "6.2.0", "@fortawesome/free-solid-svg-icons": "6.1.2", "@ng-bootstrap/ng-bootstrap": "13.0.0", "@ngx-translate/core": "14.0.0", From 49354b874246d2edc0df64a63ef6e1452f36f5b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 13:12:29 +0000 Subject: [PATCH 18/25] chore(deps-dev): bump sass in /generators/client/templates/vue Bumps [sass](https://github.com/sass/dart-sass) from 1.54.6 to 1.54.7. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.54.6...1.54.7) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/vue/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/vue/package.json b/generators/client/templates/vue/package.json index f048fb06742a..7abf1a853665 100644 --- a/generators/client/templates/vue/package.json +++ b/generators/client/templates/vue/package.json @@ -50,7 +50,7 @@ "postcss-loader": "7.0.1", "postcss-url": "10.1.3", "rimraf": "3.0.2", - "sass": "1.54.6", + "sass": "1.54.7", "sass-loader": "13.0.2", "sinon": "14.0.0", "terser-webpack-plugin": "5.3.6", From 9004465d13abe41c8d9eab838ad8846876b6f3c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 16:49:30 +0000 Subject: [PATCH 19/25] chore(deps): bump @fortawesome/free-solid-svg-icons Bumps [@fortawesome/free-solid-svg-icons](https://github.com/FortAwesome/Font-Awesome) from 6.1.2 to 6.2.0. - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md) - [Commits](https://github.com/FortAwesome/Font-Awesome/commits) --- updated-dependencies: - dependency-name: "@fortawesome/free-solid-svg-icons" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/angular/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/angular/package.json b/generators/client/templates/angular/package.json index 6db350e46a01..c21d93c6c80b 100644 --- a/generators/client/templates/angular/package.json +++ b/generators/client/templates/angular/package.json @@ -3,7 +3,7 @@ "@angular/common": "14.2.0", "@fortawesome/angular-fontawesome": "0.11.1", "@fortawesome/fontawesome-svg-core": "6.2.0", - "@fortawesome/free-solid-svg-icons": "6.1.2", + "@fortawesome/free-solid-svg-icons": "6.2.0", "@ng-bootstrap/ng-bootstrap": "13.0.0", "@ngx-translate/core": "14.0.0", "@ngx-translate/http-loader": "7.0.0", From 1cbe2b67bb82b038093d7ce787a72fae80f878a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 18:58:56 +0000 Subject: [PATCH 20/25] chore(deps): bump @fortawesome/free-solid-svg-icons Bumps [@fortawesome/free-solid-svg-icons](https://github.com/FortAwesome/Font-Awesome) from 6.1.2 to 6.2.0. - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md) - [Commits](https://github.com/FortAwesome/Font-Awesome/commits) --- updated-dependencies: - dependency-name: "@fortawesome/free-solid-svg-icons" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/client/templates/vue/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/vue/package.json b/generators/client/templates/vue/package.json index 7abf1a853665..dfba9a478e37 100644 --- a/generators/client/templates/vue/package.json +++ b/generators/client/templates/vue/package.json @@ -1,7 +1,7 @@ { "dependencies": { "@fortawesome/fontawesome-svg-core": "6.2.0", - "@fortawesome/free-solid-svg-icons": "6.1.2", + "@fortawesome/free-solid-svg-icons": "6.2.0", "@fortawesome/vue-fontawesome": "2.0.8", "axios": "0.27.2", "bootstrap": "4.6.2", From 0d82593f25d61173e540a67cd9f7cefa5788259e Mon Sep 17 00:00:00 2001 From: Quentin Monmert Date: Wed, 31 Aug 2022 22:08:08 +0200 Subject: [PATCH 21/25] [Vue] Typescript 4.8.2 --- generators/client/templates/vue/package.json | 2 +- .../vue/src/main/webapp/app/entities/entity.component.ts.ejs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generators/client/templates/vue/package.json b/generators/client/templates/vue/package.json index 7abf1a853665..7bbb9cc0e76b 100644 --- a/generators/client/templates/vue/package.json +++ b/generators/client/templates/vue/package.json @@ -59,7 +59,7 @@ "eslint": "8.23.0", "eslint-plugin-prettier": "4.2.1", "eslint-plugin-vue": "8.7.1", - "typescript": "4.7.4", + "typescript": "4.8.2", "webpack": "5.74.0", "webpack-bundle-analyzer": "4.6.1", "webpack-cli": "4.10.0", diff --git a/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs b/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs index bdb9315aa687..25d3fe823f45 100644 --- a/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +++ b/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs @@ -111,7 +111,7 @@ export default class <%= entityAngularName %> extends <% if (fieldsContainBlob | <%_ if (paginationInfiniteScroll) { _%> if ((this.$refs.infiniteLoading)) { (this.$refs.infiniteLoading).stateChanger.loaded(); - if (this.links !== {} && this.page > this.links['last']) { + if (JSON.stringify(this.links) !== JSON.stringify({}) && this.page > this.links['last']) { (this.$refs.infiniteLoading).stateChanger.complete(); } } @@ -144,7 +144,7 @@ export default class <%= entityAngularName %> extends <% if (fieldsContainBlob | <%_ if (paginationInfiniteScroll) { _%> if ((this.$refs.infiniteLoading)) { (this.$refs.infiniteLoading).stateChanger.loaded(); - if (this.links !== {} && this.page > this.links['last']) { + if (JSON.stringify(this.links) !== JSON.stringify({}) && this.page > this.links['last']) { (this.$refs.infiniteLoading).stateChanger.complete(); } } From 62e40eb3dc3afe25f06b0d49f570cdc6bda59e23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 05:07:22 +0000 Subject: [PATCH 22/25] chore(deps-dev): bump sass in /generators/client/templates/react Bumps [sass](https://github.com/sass/dart-sass) from 1.54.7 to 1.54.8. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.54.7...1.54.8) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/react/package.json b/generators/client/templates/react/package.json index a22cbeeb634e..3b73512d0a5c 100644 --- a/generators/client/templates/react/package.json +++ b/generators/client/templates/react/package.json @@ -66,7 +66,7 @@ "react-infinite-scroll-component": "6.1.0", "redux-mock-store": "1.5.4", "rimraf": "3.0.2", - "sass": "1.54.7", + "sass": "1.54.8", "sass-loader": "13.0.2", "simple-progress-webpack-plugin": "2.0.0", "sinon": "14.0.0", From cfe91892bc2fd4218024532db935fb29749621e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 05:09:50 +0000 Subject: [PATCH 23/25] chore(deps-dev): bump npm in /generators/common/templates Bumps [npm](https://github.com/npm/cli) from 8.18.0 to 8.19.0. - [Release notes](https://github.com/npm/cli/releases) - [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md) - [Commits](https://github.com/npm/cli/compare/v8.18.0...v8.19.0) --- updated-dependencies: - dependency-name: npm dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- generators/common/templates/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/common/templates/package.json b/generators/common/templates/package.json index cca65ffa6ee3..b2a4bcaa445f 100644 --- a/generators/common/templates/package.json +++ b/generators/common/templates/package.json @@ -3,7 +3,7 @@ "concurrently": "7.3.0", "husky": "7.0.4", "lint-staged": "13.0.3", - "npm": "8.18.0", + "npm": "8.19.0", "wait-on": "6.0.1" } } From a53ced561b2605ed931a34f1ab5701b2b0488c25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 05:59:47 +0000 Subject: [PATCH 24/25] chore(deps-dev): bump sass in /generators/client/templates/vue Bumps [sass](https://github.com/sass/dart-sass) from 1.54.7 to 1.54.8. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.54.7...1.54.8) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- generators/client/templates/vue/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/client/templates/vue/package.json b/generators/client/templates/vue/package.json index f250d699c20e..dce899c81a77 100644 --- a/generators/client/templates/vue/package.json +++ b/generators/client/templates/vue/package.json @@ -50,7 +50,7 @@ "postcss-loader": "7.0.1", "postcss-url": "10.1.3", "rimraf": "3.0.2", - "sass": "1.54.7", + "sass": "1.54.8", "sass-loader": "13.0.2", "sinon": "14.0.0", "terser-webpack-plugin": "5.3.6", From 79846188cc61121a0fe2a052d903184a57bfefb1 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 1 Sep 2022 12:58:18 -0300 Subject: [PATCH 25/25] fix typo Co-authored-by: Deepu K Sasidharan --- generators/generate-blueprint/generator.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/generate-blueprint/generator.mjs b/generators/generate-blueprint/generator.mjs index 49b08717cb13..65441201d968 100644 --- a/generators/generate-blueprint/generator.mjs +++ b/generators/generate-blueprint/generator.mjs @@ -275,7 +275,7 @@ export default class extends BaseBlueprintGenerator { get postWriting() { return { - packageJsom() { + packageJson() { if (this.shouldSkipFiles() || this.jhipsterConfig[LOCAL_BLUEPRINT_OPTION]) return; const { packagejs } = this.application; this.packageJson.merge({