Skip to content

Commit

Permalink
chore(various): prepare gulp builds
Browse files Browse the repository at this point in the history
add inlines, template file, and test hints

see Make builder configurable eXist-db#563
supersedes eXist-db#582
  • Loading branch information
duncdrum committed Feb 10, 2021
1 parent 582ed35 commit 637d038
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
16 changes: 7 additions & 9 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ const prettyData = require('gulp-pretty-data')
const stripBom = require('gulp-stripbom')
const pjson = require('../../package.json')

// Var isodate = (new Date()).toISOString();

// Potential location for teipub defaults. see https://github.com/enquirer/enquirer/issues/15
module.exports = class extends Generator {
initializing () {
this.props = {}
Expand Down Expand Up @@ -77,10 +74,10 @@ module.exports = class extends Generator {
value: ['empty', 'library']
}]
},
// TODO: [yo] Make these options meaningful
// TODO: [gulp] line-o promp user for build system
// {
// type: 'checkbox',
// choices: ['ant', 'gulp', 'maven', 'gradle'],
// choices: ['ant', 'gulp'],
// name: 'builder',
// message: 'How would you like to build your app?',
// default: 'ant'
Expand Down Expand Up @@ -330,7 +327,7 @@ module.exports = class extends Generator {
}]

// TODO: [yo]: js, css, gulp, funcdoc,
// TODO: [gulp] https://github.com/bnjjj/generator-gulpfile-advanced
// TODO: TODO: [gulp] line-o we could also extend this module https://github.com/bnjjj/generator-gulpfile-advanced

return this.prompt(prompts).then(props => {
// To access props later use this.props.someAnswer;
Expand Down Expand Up @@ -401,10 +398,10 @@ module.exports = class extends Generator {
},
repository: ''
}
// Applies to all (without prompts)
// TODO #56 html -> xhtml

// EXPATH
// Applies to all (build, expath-pkg, repo, xqs)
// TODO #56 html -> xhtml
// TODO: [gulp] line-o here build.xml is copied for all outputs by default needs to become conditional
this.fs.copyTpl(
this.templatePath('build.xml'),
this.destinationPath('build.xml'), {
Expand Down Expand Up @@ -798,6 +795,7 @@ module.exports = class extends Generator {
this.spawnCommandSync('git', ['add', '--all'])
this.spawnCommandSync('git', ['commit', '-q', '-m', '\'initial scaffolding by Yeoman\''])
}
// TODO: [gulp] line-o make conditional on selected build tool
this.spawnCommandSync('ant', '-q')

console.log(yosay('I believe we\'re done here.'))
Expand Down
5 changes: 5 additions & 0 deletions generators/app/templates/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// TODO: line-o tell me what you want what you really really …
// see https://docs.google.com/document/d/1UdSWERC9rCSYIYjTGgCr3avce47h5OeLFR4tGKYXZlM/edit#heading=h.ei4sqy3ojpkl
// see https://github.com/line-o/gulp-exist-example/blob/main/gulpfile.js
// see https://github.com/eXist-db/documentation/blob/master/Gulpfile.js
// see #563
2 changes: 2 additions & 0 deletions test/generated-pkg/app-empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const fs = require('fs-extra')

describe('empty package', function () {
this.timeout(15000)
// TODO: #563 [gulp] line-o let's make this the test application for pure gulp build
// We should also add a app-lib-gulp.js test package.
before(async function () {
await helpers.run(path.join(__dirname, '../../generators/app'))
.withPrompts({
Expand Down

0 comments on commit 637d038

Please sign in to comment.