Skip to content

Commit

Permalink
Update toolchain, move towards ES6
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhammerl committed Dec 2, 2017
1 parent 25bbf7b commit 7abc152
Show file tree
Hide file tree
Showing 30 changed files with 6,346 additions and 6,421 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = null
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
node_modules/
npm-debug.log
.DS_Store
test/lib
package-lock.json

# VIM Swap Files
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
49 changes: 0 additions & 49 deletions .jshintrc

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
language: node_js
sudo: false
node_js:
- 4.1
before_install:
- npm install -g grunt-cli
- lts/*
notifications:
email:
recipients:
Expand Down
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run ES6 Tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"./src/*-unit.js",
"--require", "babel-register",
"--require", "babel-polyfill",
"testutils.js",
"--reporter", "spec",
"--no-timeouts"
],
"runtimeArgs": [
"--nolazy"
],
"sourceMaps": true
}
]
}
28 changes: 0 additions & 28 deletions Gruntfile.js

This file was deleted.

File renamed without changes.
61 changes: 43 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emailjs-imap-client",
"version": "2.1.0",
"version": "3.0.0",
"homepage": "https://github.com/emailjs/emailjs-imap-client",
"description": "JavaScript IMAP client",
"author": "Andris Reinman <[email protected]>",
Expand All @@ -9,30 +9,55 @@
],
"license": "MIT",
"scripts": {
"test": "grunt"
},
"engines": {
"node": ">=4.0.0"
"build": "./scripts/build.sh",
"release": "./scripts/release.sh",
"lint": "$(npm bin)/standard",
"test": "npm run lint && npm run unit",
"unit": "$(npm bin)/mocha './src/*-unit.js' --reporter spec --require babel-register --require babel-polyfill testutils.js",
"test-watch": "$(npm bin)/mocha './src/*-unit.js' --reporter spec --require babel-register --require babel-polyfill testutils.js --watch"
},
"repository": {
"type": "git",
"url": "git://github.com/emailjs/emailjs-imap-client.git"
},
"main": "src/emailjs-imap-client",
"main": "dist/client",
"dependencies": {
"emailjs-addressparser": "^1.0.1",
"emailjs-imap-handler": "^2.1.0",
"emailjs-mime-codec": "^1.0.1",
"emailjs-tcp-socket": "^1.0.1",
"emailjs-utf7": "^3.0.1"
"emailjs-addressparser": "^2.0.2",
"emailjs-base64": "^1.1.2",
"emailjs-imap-handler": "^3.0.2",
"emailjs-mime-codec": "^2.0.2",
"emailjs-tcp-socket": "^1.0.2",
"emailjs-utf7": "^4.0.1",
"sinon": "^4.1.2"
},
"devDependencies": {
"chai": "^3.4.1",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.3",
"grunt-mocha-test": "^0.12.7",
"hoodiecrow-imap": "^2.0.0",
"mocha": "^2.3.4",
"sinon": "^1.17.2"
"babel-cli": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-register": "^6.26.0",
"chai": "^4.1.2",
"hoodiecrow-imap": "^2.1.0",
"mocha": "^4.0.1",
"nodemon": "^1.12.1",
"pre-commit": "^1.2.2",
"standard": "^10.0.3"
},
"standard": {
"globals": [
"describe",
"it",
"before",
"beforeEach",
"afterEach",
"after",
"expect",
"sinon",
"self"
],
"ignore": [
"dist",
"lib",
"res"
]
}
}
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

rm -rf $PWD/dist
babel src --out-dir dist --ignore '**/*-unit.js' --source-maps inline
git reset
git add $PWD/dist
git commit -m 'Updating dist files' -n
20 changes: 20 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

json_value() {
KEY=$1
num=$2
awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'$KEY'\042/){print $(i+1)}}}' | tr -d '"' | sed -n ${num}p
}

# read version from package.json and trim leading/trailing whitespace
version=`less package.json | json_value version 1 | sed -e 's/^ *//' -e 's/ *$//'`
prefix="v"
# tag, push, publish
echo -e "\n> tagging $prefix$version"
git tag "$prefix$version"
echo -e "\n> pushing commits to origin"
git push
echo -e "\n> pushing tags to origin"
git push --tags
echo -e "\n> publishing on npm"
npm publish
Loading

0 comments on commit 7abc152

Please sign in to comment.