Skip to content
This repository was archived by the owner on Oct 16, 2021. It is now read-only.

Commit ee4f731

Browse files
authored
chore: Adapt changes from Baumeister 2.0.0.
BREAKING CHANGE: * **linting:** The new major version of `stylelint-config-standard` introduces some new rules which might break your build. Therefore you might need to adapt your code or disable unwanted rules in `.stylelintrc.json`. * **bundling:** The bundles are renamed (and partly removed) to: `app/polyfills.bundle.js`, `app/vendor.bundle.js` and `app/app.bundle.js` and must be included via script tags in that order. See [default.hbs](https://github.com/micromata/Baumeister/blob/e6346738f472ee57a204dbbf400f29924965abea/src/handlebars/layouts/default.hbs#L48-L61). * **settings:** Settings moved from `package.json` to the new `baumeister.json` config file in the project root. In addition the two boolean settings `useHandlebars` and `generateBanners` from `gulp/config.js` are also exposed to the `baumeister.json`. * **linting:** `eslint-plugin-filenames` will cause linting errors in case you already have JavaScript files with filenames written in camelCase. You have to rename those files or change/disable the rule `filenames/match-exported` in `.eslintrc.json` depending on your preference. See https://github.com/micromata/Baumeister/releases/edit/2.0.0 for details.
1 parent cbf61ac commit ee4f731

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5171
-2331
lines changed

__tests__/test-app.js

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,42 +53,41 @@ describe('Baumeister with default options', () => {
5353

5454
it('should create Gulp related files', () => {
5555
assert.file([
56-
'gulp/commandLineArgs.js',
56+
'gulp/command-line-args.js',
5757
'gulp/config.js',
58-
'gulp/onError.js',
59-
'gulp/tasks/appTemplates.js',
58+
'gulp/on-error.js',
59+
'gulp/tasks/app-templates.js',
6060
'gulp/tasks/banners.js',
61-
'gulp/tasks/bumpVersion.js',
62-
'gulp/tasks/bundleExternalCSS.js',
63-
'gulp/tasks/cacheBust.js',
61+
'gulp/tasks/bump-version.js',
62+
'gulp/tasks/bundle-external-css.js',
63+
'gulp/tasks/cache-bust.js',
6464
'gulp/tasks/clean.js',
65-
'gulp/tasks/clientScripts.js',
66-
'gulp/tasks/commitChanges.js',
67-
'gulp/tasks/copyStaticFiles.js',
68-
'gulp/tasks/createChangelog.js',
69-
'gulp/tasks/createTag.js',
65+
'gulp/tasks/commit-changes.js',
66+
'gulp/tasks/copy-static-files.js',
67+
'gulp/tasks/create-changelog.js',
68+
'gulp/tasks/create-tag.js',
7069
'gulp/tasks/fonts.js',
7170
'gulp/tasks/handlebars.js',
7271
'gulp/tasks/images.js',
7372
'gulp/tasks/lint.js',
74-
'gulp/tasks/lintBootstrap.js',
75-
'gulp/tasks/lintStyles.js',
76-
'gulp/tasks/processHtml.js',
73+
'gulp/tasks/lint-bootstrap.js',
74+
'gulp/tasks/lint-styles.js',
75+
'gulp/tasks/process-html.js',
7776
'gulp/tasks/security.js',
7877
'gulp/tasks/serve.js',
7978
'gulp/tasks/styles.js',
8079
'gulp/tasks/test.js',
81-
'gulp/tasks/validateHtml.js',
82-
'gulp/tasks/vendorScripts.js'
80+
'gulp/tasks/validate-html.js',
81+
'gulp/tasks/webpack.js'
8382
]);
8483
});
8584

86-
it('should have `useHandlebars` set to `true` in gulp/config.js', () => {
87-
assert.fileContent('gulp/config.js', /const useHandlebars = true;/);
85+
it('should have `useHandlebars` set to `true` in baumeister.json', () => {
86+
assert.fileContent('baumeister.json', /"useHandlebars": true,/);
8887
});
8988

90-
it('should have `generateBanners` set to `false` in gulp/config.js', () => {
91-
assert.fileContent('gulp/config.js', /const generateBanners = false;/);
89+
it('should have `generateBanners` set to `false` in baumeister.json', () => {
90+
assert.fileContent('baumeister.json', /"generateBanners": false,/);
9291
});
9392

9493
it('should create package manager files', () => {
@@ -126,7 +125,7 @@ describe('Baumeister with default options', () => {
126125
'src/stickyFooter.hbs',
127126
'src/demoElements.hbs',
128127
'src/handlebars/layouts/default.hbs',
129-
'src/handlebars/helpers/addYear.js',
128+
'src/handlebars/helpers/add-year.js',
130129
'src/handlebars/partials/footer.hbs',
131130
'src/handlebars/partials/navbar.hbs'
132131
]);
@@ -136,6 +135,8 @@ describe('Baumeister with default options', () => {
136135
assert.file([
137136
'README.md',
138137
'gulpfile.babel.js',
138+
'baumeister.json',
139+
'webpack.config.js',
139140
'humans.txt',
140141
'LICENSE',
141142
'CONTRIBUTING.md',
@@ -315,8 +316,8 @@ describe('Baumeister with Handlebars disabled', () => {
315316
.toPromise();
316317
});
317318

318-
it('should have `useHandlebars` set to `false` in gulp/config.js', () => {
319-
assert.fileContent('gulp/config.js', /const useHandlebars = false;/);
319+
it('should have `useHandlebars` set to `false` in baumeister.json', () => {
320+
assert.fileContent('baumeister.json', /"useHandlebars": false,/);
320321
});
321322

322323
it('should create no Handlebars related files', () => {
@@ -370,8 +371,8 @@ describe('Baumeister with banner', () => {
370371
.withPrompts(prompts).toPromise();
371372
});
372373

373-
it('should have `generateBanners` set to `true` in gulp/config.js', () => {
374-
assert.fileContent('gulp/config.js', /const generateBanners = true;/);
374+
it('should have `generateBanners` set to `true` in baumeister.json', () => {
375+
assert.fileContent('baumeister.json', /"generateBanners": true,/);
375376
});
376377

377378
});
@@ -621,7 +622,7 @@ describe('Baumeister with less boilerplate code and handlebars enabled', () => {
621622
assert.file([
622623
'src/index.hbs',
623624
'src/handlebars/layouts/default.hbs',
624-
'src/handlebars/helpers/addYear.js',
625+
'src/handlebars/helpers/add-year.js',
625626
'src/handlebars/partials/.gitkeep'
626627
]);
627628
assert.noFile([
@@ -834,7 +835,7 @@ describe('Baumeister using --yo-rc flag', () => {
834835
'src/stickyFooter.hbs',
835836
'src/demoElements.hbs',
836837
'src/handlebars/layouts/default.hbs',
837-
'src/handlebars/helpers/addYear.js',
838+
'src/handlebars/helpers/add-year.js',
838839
'src/handlebars/partials/footer.hbs',
839840
'src/handlebars/partials/navbar.hbs'
840841
]);

app/index.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ module.exports = class extends Generator {
255255

256256
// Gulp related files
257257
this.fs.copyTpl(
258-
this.templatePath('gulp/commandLineArgs.js'),
259-
this.destinationPath('gulp/commandLineArgs.js')
258+
this.templatePath('gulp/command-line-args.js'),
259+
this.destinationPath('gulp/command-line-args.js')
260260
);
261261
this.fs.copyTpl(
262262
this.templatePath('gulp/_config.js'),
@@ -265,8 +265,8 @@ module.exports = class extends Generator {
265265
}
266266
);
267267
this.fs.copyTpl(
268-
this.templatePath('gulp/onError.js'),
269-
this.destinationPath('gulp/onError.js')
268+
this.templatePath('gulp/on-error.js'),
269+
this.destinationPath('gulp/on-error.js')
270270
);
271271

272272
this.fs.copyTpl(
@@ -314,8 +314,8 @@ module.exports = class extends Generator {
314314
}
315315
);
316316
this.fs.copyTpl(
317-
this.templatePath('src/handlebars/helpers/addYear.js'),
318-
this.destinationPath('src/handlebars/helpers/addYear.js')
317+
this.templatePath('src/handlebars/helpers/add-year.js'),
318+
this.destinationPath('src/handlebars/helpers/add-year.js')
319319
);
320320
}
321321

@@ -435,6 +435,16 @@ module.exports = class extends Generator {
435435
break;
436436
}
437437

438+
this.fs.copyTpl(
439+
this.templatePath('_baumeister.json'),
440+
this.destinationPath('baumeister.json'), {
441+
templateProps: this.templateProps
442+
}
443+
);
444+
this.fs.copyTpl(
445+
this.templatePath('webpack.config.js'),
446+
this.destinationPath('webpack.config.js')
447+
);
438448
this.fs.copyTpl(
439449
this.templatePath('humans.txt'),
440450
this.destinationPath('humans.txt')

0 commit comments

Comments
 (0)