-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
749 changed files
with
24,216 additions
and
50,937 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import chalk from 'chalk'; | ||
import ClientGenerator from 'generator-jhipster/generators/client'; | ||
import { writeFiles as writeAngularFiles } from './files-angular.js'; | ||
import _ from 'lodash'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
export default class extends ClientGenerator { | ||
constructor(args, opts, features) { | ||
super(args, opts, features); | ||
|
||
if (this.options.help) return; | ||
|
||
if (!this.options.jhipsterContext) { | ||
throw new Error(`This is a JHipster blueprint and should be used only like ${chalk.yellow('jhipster --blueprints test-blueprint')}`); | ||
} | ||
} | ||
|
||
get [ClientGenerator.INITIALIZING]() { | ||
return { | ||
...super.initializing, | ||
async initializingTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.PROMPTING]() { | ||
return { | ||
...super.prompting, | ||
async promptingTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.CONFIGURING]() { | ||
return { | ||
...super.configuring, | ||
async configuringTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.COMPOSING]() { | ||
return { | ||
...super.composing, | ||
async composingTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.LOADING]() { | ||
return { | ||
...super.loading, | ||
// copied from jhipster and replaced "this.fetchFromInstalledJHipster('client', " by path.join('__dirname', with __dirname defined as above since in module | ||
loadPackageJson() { | ||
// Load common client package.json into packageJson | ||
_.merge( | ||
this.dependabotPackageJson, | ||
this.fs.readJSON(path.join(__dirname, 'templates', 'common', 'package.json')) | ||
); | ||
// Load client package.json into packageJson | ||
const clientFramewok = this.application.clientFramework; | ||
_.merge( | ||
this.dependabotPackageJson, | ||
this.fs.readJSON(path.join(__dirname, 'templates', clientFramewok, 'package.json')) | ||
); | ||
}, | ||
}; | ||
// const loadingFromJhipster = { ...super.loading }; | ||
// return Object.fromEntries(Object.entries(loadingFromJhipster).map(([k, v]) => k === 'loadPackageJson' ? v.bind(this) : v)); | ||
// return loadingFromJhipster; | ||
} | ||
|
||
get [ClientGenerator.PREPARING]() { | ||
return { | ||
...super.preparing, | ||
async preparingTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.DEFAULT]() { | ||
return { | ||
...super.default, | ||
async defaultTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.WRITING]() { | ||
return { | ||
...super.writing, | ||
writeAngularFiles | ||
}; | ||
} | ||
|
||
get [ClientGenerator.POST_WRITING]() { | ||
return { | ||
...super.postWriting, | ||
async postWritingTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.INSTALL]() { | ||
return { | ||
...super.install, | ||
async installTemplateTask() {}, | ||
}; | ||
} | ||
|
||
get [ClientGenerator.END]() { | ||
return { | ||
...super.end, | ||
async endTemplateTask() {}, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect } from 'expect'; | ||
|
||
import { helpers, lookups } from '#test-utils'; | ||
|
||
const SUB_GENERATOR = 'client'; | ||
const BLUEPRINT_NAMESPACE = `jhipster:${SUB_GENERATOR}`; | ||
|
||
describe('SubGenerator client of test-blueprint JHipster blueprint', () => { | ||
describe('run', () => { | ||
let result; | ||
before(async function () { | ||
result = await helpers | ||
.create(BLUEPRINT_NAMESPACE) | ||
.withOptions({ | ||
reproducible: true, | ||
defaults: true, | ||
baseName: 'jhipster', | ||
blueprint: 'test-blueprint', | ||
}) | ||
.withLookups(lookups) | ||
.run(); | ||
}); | ||
|
||
it('should succeed', () => { | ||
expect(result.getStateSnapshot()).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './generator.mjs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.