diff --git a/README.md b/README.md index a4abbf3..5dd697e 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,45 @@ # lesspass lesspass is like keepass without the need to persist passwords -## install +## requirements + + * node v4.2.x LTS + * npm v2.14 + +## try lesspass + +clone application: + + git clone https://github.com/guillaumevincent/lesspass.git + +move inside lesspass folder + + cd lesspass + +install dependencies npm install -## run tests +start application + + npm start + +open the application in a browser: [http://localhost:5000](http://localhost:5000) + +## contribute + +### run tests + + npm run test + +### run tests in watch mode - npm tests + npm run test:watch -## build app +### start lesspass in watch mode - npm build + npm run start:watch -## run application +### build for production - npm start \ No newline at end of file + npm run build:production \ No newline at end of file diff --git a/app/app.js b/app/app.js index 4d231b5..4511570 100644 --- a/app/app.js +++ b/app/app.js @@ -1,14 +1,5 @@ import PasswordGenerator from './password-generator'; -document.getElementById("help-btn").onclick = function () { - $('body').chardinJs('start'); -}; +console.log(PasswordGenerator.make_password('t','t')); -document.getElementById('foo').focus(); -var clipboard = new Clipboard('#copy-btn',{ - text: function(trigger) { - $('body').chardinJs('stop'); - var elements = document.getElementById('foo').value.split(':'); - return PasswordGenerator.make_password(elements[0], elements[1]); - } -}); +import * as stylesheet from './styles/styles.scss'; \ No newline at end of file diff --git a/app/app.old.js b/app/app.old.js new file mode 100644 index 0000000..4d231b5 --- /dev/null +++ b/app/app.old.js @@ -0,0 +1,14 @@ +import PasswordGenerator from './password-generator'; + +document.getElementById("help-btn").onclick = function () { + $('body').chardinJs('start'); +}; + +document.getElementById('foo').focus(); +var clipboard = new Clipboard('#copy-btn',{ + text: function(trigger) { + $('body').chardinJs('stop'); + var elements = document.getElementById('foo').value.split(':'); + return PasswordGenerator.make_password(elements[0], elements[1]); + } +}); diff --git a/app/styles/styles.scss b/app/styles/styles.scss new file mode 100644 index 0000000..dfc0458 --- /dev/null +++ b/app/styles/styles.scss @@ -0,0 +1,3 @@ +body{ + background-color: red; +} \ No newline at end of file diff --git a/package.json b/package.json index c2539fb..c6a48b2 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,25 @@ { "name": "lesspass", "version": "1.0.0", - "description": "lesspass is like keepass without the need to persist password", - "main": "lesspass.js", + "description": "lesspass is like keepass without the need to persist passwords", + "main": "app/app.js", "scripts": { - "test": "mocha --compilers js:babel-core/register --ui bdd --reporter min --recursive ./tests", - "build": "npm-run-all clean copy build_app", - "build_app": "browserify -e ./app/app.js -o ./dist/app.js", - "clean": "rimraf ./dist/**/* && rimraf dist", - "copy": "mkdir dist && cp -r public/* dist/", - "serve": "static -p 5000 --gzip --host-address 0.0.0.0 dist/", - "start": "npm run serve", + "pretest": "npm install", + "test": "mocha --compilers js:babel-core/register tests", + "test:watch": "npm test -- -w", + "lint": "jshint app/**", + "build:production": "npm prune && npm install && npm run lint && npm test && npm run build", + "build": "npm-run-all clean build:html build:app", + "clean": "rimraf dist", + "build:html": "cpy '**/*.html' '../dist/' --cwd=static --parents", + "build:app": "browserify -e ./app/app.js -o ./dist/app.js", "prestart": "npm run build", - "watch": "npm-run-all --parallel serve watch_app", - "watch_app": "watchify -dv -e ./app/app.js -o ./dist/app.js" + "start": "npm run serve", + "serve": "http-server -p 5000 dist/", + "watch": "npm run start:watch", + "start:watch": "npm-run-all --parallel serve watch:html watch:app", + "watch:html": "watch 'npm run build:html' static", + "watch:app": "watchify -dv -e ./app/app.js -o ./dist/app.js" }, "repository": { "type": "git", @@ -21,8 +27,7 @@ }, "keywords": [ "keepass", - "nodejs", - "node" + "lesspass" ], "author": "Guillaume Vincent", "license": "MIT", @@ -30,25 +35,21 @@ "url": "https://github.com/guillaumevincent/lesspass/issues" }, "homepage": "https://github.com/guillaumevincent/lesspass#readme", - "dependencies": { - "bootstrap": "^4.0.0-alpha.2", - "chardinjs": "git://github.com/heelhook/chardin.js.git", - "clipboard": "^1.5.5", - "font-awesome": "^4.5.0", - "jquery": "^2.1.4" - }, - "jshintConfig": { - "esnext": true - }, "devDependencies": { - "babel-core": "^6.3.15", - "babel-preset-es2015": "^6.3.13", - "babelify": "^7.2.0", - "browserify": "^12.0.1", - "mocha": "^2.3.4", - "node-static": "^0.7.7", - "npm-run-all": "^1.4.0", - "rimraf": "^2.4.4" + "babel-core": "latest", + "babel-preset-es2015": "latest", + "babelify": "latest", + "browserify": "latest", + "cpy": "latest", + "http-server": "latest", + "jshint": "latest", + "mocha": "latest", + "nodemon": "latest", + "npm-run-all": "latest", + "rimraf": "latest", + "sassify": "latest", + "watch": "latest", + "watchify": "latest" }, "babel": { "presets": [ @@ -64,7 +65,16 @@ "es2015" ] } + ], + [ + "sassify", + { + "auto-inject": true + } ] ] + }, + "jshintConfig": { + "esnext": true } } diff --git a/package.json.old b/package.json.old new file mode 100644 index 0000000..c2539fb --- /dev/null +++ b/package.json.old @@ -0,0 +1,70 @@ +{ + "name": "lesspass", + "version": "1.0.0", + "description": "lesspass is like keepass without the need to persist password", + "main": "lesspass.js", + "scripts": { + "test": "mocha --compilers js:babel-core/register --ui bdd --reporter min --recursive ./tests", + "build": "npm-run-all clean copy build_app", + "build_app": "browserify -e ./app/app.js -o ./dist/app.js", + "clean": "rimraf ./dist/**/* && rimraf dist", + "copy": "mkdir dist && cp -r public/* dist/", + "serve": "static -p 5000 --gzip --host-address 0.0.0.0 dist/", + "start": "npm run serve", + "prestart": "npm run build", + "watch": "npm-run-all --parallel serve watch_app", + "watch_app": "watchify -dv -e ./app/app.js -o ./dist/app.js" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/guillaumevincent/lesspass.git" + }, + "keywords": [ + "keepass", + "nodejs", + "node" + ], + "author": "Guillaume Vincent", + "license": "MIT", + "bugs": { + "url": "https://github.com/guillaumevincent/lesspass/issues" + }, + "homepage": "https://github.com/guillaumevincent/lesspass#readme", + "dependencies": { + "bootstrap": "^4.0.0-alpha.2", + "chardinjs": "git://github.com/heelhook/chardin.js.git", + "clipboard": "^1.5.5", + "font-awesome": "^4.5.0", + "jquery": "^2.1.4" + }, + "jshintConfig": { + "esnext": true + }, + "devDependencies": { + "babel-core": "^6.3.15", + "babel-preset-es2015": "^6.3.13", + "babelify": "^7.2.0", + "browserify": "^12.0.1", + "mocha": "^2.3.4", + "node-static": "^0.7.7", + "npm-run-all": "^1.4.0", + "rimraf": "^2.4.4" + }, + "babel": { + "presets": [ + "es2015" + ] + }, + "browserify": { + "transform": [ + [ + "babelify", + { + "presets": [ + "es2015" + ] + } + ] + ] + } +} diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..4bbfca9 --- /dev/null +++ b/static/index.html @@ -0,0 +1,12 @@ + + + + + lesspass + + +hello world 20015 + + + + \ No newline at end of file diff --git a/static/test/test.html b/static/test/test.html new file mode 100644 index 0000000..ca37fa0 --- /dev/null +++ b/static/test/test.html @@ -0,0 +1,10 @@ + + + + + lesspass + + +test + + \ No newline at end of file