-
Notifications
You must be signed in to change notification settings - Fork 58
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
50 changed files
with
3,820 additions
and
2,065 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gulpfile.js |
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,12 @@ | ||
--- | ||
"extends": | ||
- "airbnb" | ||
"rules": | ||
"indent": ["error", 4] | ||
"max-len": ["error", 120, { | ||
ignoreUrls: true, | ||
ignoreComments: false, | ||
ignoreRegExpLiterals: true, | ||
ignoreStrings: true, | ||
ignoreTemplateLiterals: true, | ||
}] |
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 |
---|---|---|
|
@@ -8,4 +8,5 @@ dist | |
.DS_Store | ||
*.zip | ||
.atom | ||
.docker | ||
node_modules | ||
package-lock.json |
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,18 @@ | ||
# Development environment | ||
All files in the `octoprint_filamentmanager/static/{css,js}` directory will be build with [Gulp](https://gulpjs.com/), from the source in `static/{css,js}`, and not modified directly. The build process includes: | ||
- Static code analysis with [ESLint](https://eslint.org/) | ||
- Transcompiling to ES5 with [Babel](https://babeljs.io/) | ||
- Concatinating all JS files into one file `filamentmanager.bundled.js` | ||
- Concatinating and minifying all CSS file into one file `filamentmanager.min.css` | ||
|
||
|
||
## Prerequisites | ||
1. Install [NodeJS](http://www.nodejs.org/) and [NPM](https://www.npmjs.com/) with your package manager | ||
|
||
1. Install development dependencies with `npm install` | ||
|
||
|
||
## Build | ||
1. Check the source code with `npx gulp lint` | ||
|
||
1. Start the build process with `npx gulp build` |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[python: */**.py] | ||
[jinja2: */**.jinja2] | ||
[python: octoprint_filamentmanager/**.py] | ||
[jinja2: octoprint_filamentmanager/**.jinja2] | ||
extensions=jinja2.ext.autoescape, jinja2.ext.with_ | ||
|
||
[javascript: */**.js] | ||
[javascript: octoprint_filamentmanager/**.js] | ||
extract_messages = gettext, ngettext |
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,36 @@ | ||
var gulp = require('gulp'); | ||
var concat = require('gulp-concat'); | ||
var eslint = require('gulp-eslint'); | ||
var babel = require('gulp-babel'); | ||
let cleanCSS = require('gulp-clean-css'); | ||
|
||
gulp.task('lint', () => { | ||
return gulp.src(['static/js/**/*.js']) | ||
.pipe(eslint()) | ||
.pipe(eslint.format()); | ||
}); | ||
|
||
gulp.task('build', ['js', 'css']) | ||
|
||
gulp.task('js', () => { | ||
return gulp.src([ | ||
'static/js/constructor.js', | ||
'static/js/**/!(bootstrap)*.js', | ||
'static/js/bootstrap.js', | ||
]) | ||
.pipe(babel({ | ||
presets: ['env'], | ||
plugins: ['transform-remove-strict-mode'] | ||
})) | ||
.pipe(concat('filamentmanager.bundled.js')) | ||
.pipe(gulp.dest('octoprint_filamentmanager/static/js/')); | ||
}); | ||
|
||
gulp.task('css', () => { | ||
return gulp.src([ | ||
'static/css/*.css', | ||
]) | ||
.pipe(concat('filamentmanager.min.css')) | ||
.pipe(cleanCSS()) | ||
.pipe(gulp.dest('octoprint_filamentmanager/static/css/')); | ||
}); |
Oops, something went wrong.