Skip to content

Commit

Permalink
Finish 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
malnvenshorn committed Dec 12, 2017
2 parents 2347d38 + 7704882 commit de90b4c
Show file tree
Hide file tree
Showing 50 changed files with 3,820 additions and 2,065 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gulpfile.js
12 changes: 12 additions & 0 deletions .eslintrc
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,
}]
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dist
.DS_Store
*.zip
.atom
.docker
node_modules
package-lock.json
18 changes: 18 additions & 0 deletions DEVELOPMENT.md
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`
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include LICENSE
include README.md
recursive-include octoprint_filamentmanager/templates *
recursive-include octoprint_filamentmanager/translations *
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ This OctoPrint plugin helps to manage your filament spools. The project is still

If you have questions or encounter issues please take a look at the [Frequently Asked Questions](https://github.com/malnvenshorn/OctoPrint-FilamentManager/wiki#faq) first. There might be already an answer. In case you haven't found what you are looking for, feel free to open a [ticket](https://github.com/malnvenshorn/OctoPrint-FilamentManager/issues/new) and I'll try to help.

## Additional features
## Features

* Replacing filament volume with weight in sidebar
* Filament odometer to keep track of remaining filament on spool
* Software odometer to measure used filament
* Warn if print exceeds remaining filament on spool
* Assign temperature offset to spools
* Automatically pause print if filament runs out
* Import & export of spool inventory
* Support for PostgreSQL as database for multiple instances

## Setup
Install via the bundled [Plugin Manager](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager)
or manually using this URL:

https://github.com/malnvenshorn/OctoPrint-FilamentManager/archive/master.zip

## Screenshots

Expand Down
6 changes: 3 additions & 3 deletions babel.cfg
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
36 changes: 36 additions & 0 deletions gulpfile.js
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/'));
});
Loading

0 comments on commit de90b4c

Please sign in to comment.