Skip to content

Commit

Permalink
fix(generator): working generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ernscht committed Aug 1, 2018
1 parent 8e3809c commit 4e9b85c
Show file tree
Hide file tree
Showing 56 changed files with 42 additions and 20 deletions.
3 changes: 0 additions & 3 deletions packages/generator-nitro/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ atlassian-ide-plugin.xml
/generators/app/templates/frontend-defaults.zip
/generators/app/templates/.accessibilityrc
/generators/app/templates/.editorconfig
/generators/app/templates/.eslintignore
/generators/app/templates/.eslintrc.js
/generators/app/templates/.gitattributes
/generators/app/templates/.gitignore
/generators/app/templates/.htmllintrc
/generators/app/templates/.stylelintignore
/generators/app/templates/.stylelintrc

# Node
Expand Down
7 changes: 2 additions & 5 deletions packages/generator-nitro/generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,14 @@ module.exports = class extends Generator {
try {
// extract entries
zip.extractEntryTo('frontend-defaults-master/codequality/accessibility/.accessibilityrc', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/codequality/eslint/.eslintrc.js', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/codequality/eslint/nitro.eslintignore', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/codequality/htmllint/.htmllintrc', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/codequality/stylelint/.stylelintrc', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/codequality/stylelint/nitro.stylelintignore', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/editorconfig/.editorconfig', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/repo/gitignore/nitro.gitignore', this.sourceRoot(), false, true);
zip.extractEntryTo('frontend-defaults-master/repo/gitattributes/.gitattributes', this.sourceRoot(), false, true);

// rename files
fs.renameSync(this.templatePath('nitro.eslintignore'), this.templatePath('.eslintignore'));
fs.renameSync(this.templatePath('nitro.gitignore'), this.templatePath('.gitignore'));
fs.renameSync(this.templatePath('nitro.stylelintignore'), this.templatePath('.stylelintignore'));
} catch (e) {
this.log(chalk.red(e.message));
}
Expand Down Expand Up @@ -246,6 +241,7 @@ module.exports = class extends Generator {
'src/patterns/molecules/example/example.hbs',
'src/patterns/molecules/example/example.twig',
'src/patterns/molecules/example/schema.json',
'src/patterns/molecules/example/index.js',
'src/proto/js/prototype.js',
'src/views/index.hbs',
'src/views/index.twig',
Expand Down Expand Up @@ -303,6 +299,7 @@ module.exports = class extends Generator {
'src/patterns/',
'src/shared/',
'project/routes/',
'public/content/',
];
const exampleIncludeAnyway = [
// example file "parts" included for this.options.exampleCode===false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config/
node_modules/
project/
public/
src/patterns/**/test/*.test.js
src/views/
tests/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'extends': '@namics/eslint-config/configurations/es8-browser.js',
'rules': {
'require-jsdoc': 'off',
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
src/shared/base/reset/css/yui/reset.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const options = {
rules: {
js: true,
ts: false,
scss: true,
hbs: <% if (options.clientTpl) { %>true<% } else { %>false<% } %>,
Expand Down
4 changes: 2 additions & 2 deletions packages/generator-nitro/generators/app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require('@nitro/exporter')(gulp, config);<% } %>

gulp.task('copy-assets', getTask('copy-assets'));
gulp.task('minify-images', getTask('minify-images'));
gulp.task('svg-sprite', getTask('svg-sprite'));
gulp.task('assets', ['copy-assets', 'svg-sprite', 'minify-images']);
gulp.task('svg-sprites', getTask('svg-sprites'));
gulp.task('assets', ['copy-assets', 'minify-images', 'svg-sprites']);
gulp.task('watch-assets', ['assets'], getTask('watch-assets'));
gulp.task('serve', getTask('serve'));
gulp.task('watch-serve', ['serve'], getTask('watch-serve'));
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

.svg files placed in this folder will be processed automatically
and are combined into the svg sprite `public/assets/svg/icons.svg`
with the gulp task `svg-sprite`.
with the gulp task `svg-sprites`.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"icon": {
"description": "The short name of the icon",
"enum": [
"check",
"arrow",
"nitro"
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "../../../../shared/utils/colors/css/colors.scss";

.m-example {
padding: 1em 2em;
background: darken($gray, 15%);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "../../../../../shared/utils/colors/css/colors.scss";

.m-example--blue {
background: $blue;
animation: blue-background-change 10s infinite;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{#each links}}
{{> example.link}}
{{> partial/example.link}}
{{/each}}
2 changes: 1 addition & 1 deletion packages/generator-nitro/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/generator-nitro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-nitro",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"description": "Yeoman generator for the nitro frontend framework",
"license": "MIT",
"repository": "namics/generator-nitro",
Expand Down
11 changes: 8 additions & 3 deletions packages/generator-nitro/tests/jasmine/app/appDefaultsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ describe('nitro:app', () => {
]);
});

it('includes namics frontend-defaults', () => {
it('includes project config files', () => {
assert.file([
'.editorconfig',
'.eslintignore',
'.eslintrc.js',
'.stylelintignore',
]);
});

it('includes namics frontend-defaults', () => {
assert.file([
'.editorconfig',
'.gitattributes',
'.gitignore',
'.stylelintignore',
'.stylelintrc',
]);
});
Expand Down
2 changes: 0 additions & 2 deletions packages/project-nitro/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ config/
node_modules/
project/
public/
src/patterns/**/template/*.js
src/patterns/**/template/partial/*.js
src/patterns/**/test/*.test.js
src/views/
tests/
1 change: 0 additions & 1 deletion packages/project-nitro/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
'extends': '@namics/eslint-config/configurations/es8-browser.js',
// 'globals': {},
'rules': {
'require-jsdoc': 'off',
},
Expand Down

0 comments on commit 4e9b85c

Please sign in to comment.