Skip to content

Commit 7abc152

Browse files
committed
Update toolchain, move towards ES6
1 parent 25bbf7b commit 7abc152

30 files changed

+6346
-6421
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["env"]
3+
}

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
max_line_length = null

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
node_modules/
22
npm-debug.log
33
.DS_Store
4-
test/lib
4+
package-lock.json
5+
6+
# VIM Swap Files
7+
[._]*.s[a-v][a-z]
8+
[._]*.sw[a-p]
9+
[._]s[a-v][a-z]
10+
[._]sw[a-p]

.jshintrc

Lines changed: 0 additions & 49 deletions
This file was deleted.

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- 4.1
5-
before_install:
6-
- npm install -g grunt-cli
4+
- lts/*
75
notifications:
86
email:
97
recipients:

.vscode/launch.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run ES6 Tests",
6+
"type": "node",
7+
"request": "launch",
8+
"cwd": "${workspaceRoot}",
9+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
10+
"stopOnEntry": false,
11+
"args": [
12+
"./src/*-unit.js",
13+
"--require", "babel-register",
14+
"--require", "babel-polyfill",
15+
"testutils.js",
16+
"--reporter", "spec",
17+
"--no-timeouts"
18+
],
19+
"runtimeArgs": [
20+
"--nolazy"
21+
],
22+
"sourceMaps": true
23+
}
24+
]
25+
}

Gruntfile.js

Lines changed: 0 additions & 28 deletions
This file was deleted.
File renamed without changes.

package.json

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emailjs-imap-client",
3-
"version": "2.1.0",
3+
"version": "3.0.0",
44
"homepage": "https://github.com/emailjs/emailjs-imap-client",
55
"description": "JavaScript IMAP client",
66
"author": "Andris Reinman <[email protected]>",
@@ -9,30 +9,55 @@
99
],
1010
"license": "MIT",
1111
"scripts": {
12-
"test": "grunt"
13-
},
14-
"engines": {
15-
"node": ">=4.0.0"
12+
"build": "./scripts/build.sh",
13+
"release": "./scripts/release.sh",
14+
"lint": "$(npm bin)/standard",
15+
"test": "npm run lint && npm run unit",
16+
"unit": "$(npm bin)/mocha './src/*-unit.js' --reporter spec --require babel-register --require babel-polyfill testutils.js",
17+
"test-watch": "$(npm bin)/mocha './src/*-unit.js' --reporter spec --require babel-register --require babel-polyfill testutils.js --watch"
1618
},
1719
"repository": {
1820
"type": "git",
1921
"url": "git://github.com/emailjs/emailjs-imap-client.git"
2022
},
21-
"main": "src/emailjs-imap-client",
23+
"main": "dist/client",
2224
"dependencies": {
23-
"emailjs-addressparser": "^1.0.1",
24-
"emailjs-imap-handler": "^2.1.0",
25-
"emailjs-mime-codec": "^1.0.1",
26-
"emailjs-tcp-socket": "^1.0.1",
27-
"emailjs-utf7": "^3.0.1"
25+
"emailjs-addressparser": "^2.0.2",
26+
"emailjs-base64": "^1.1.2",
27+
"emailjs-imap-handler": "^3.0.2",
28+
"emailjs-mime-codec": "^2.0.2",
29+
"emailjs-tcp-socket": "^1.0.2",
30+
"emailjs-utf7": "^4.0.1",
31+
"sinon": "^4.1.2"
2832
},
2933
"devDependencies": {
30-
"chai": "^3.4.1",
31-
"grunt": "^0.4.5",
32-
"grunt-contrib-jshint": "^0.11.3",
33-
"grunt-mocha-test": "^0.12.7",
34-
"hoodiecrow-imap": "^2.0.0",
35-
"mocha": "^2.3.4",
36-
"sinon": "^1.17.2"
34+
"babel-cli": "^6.26.0",
35+
"babel-polyfill": "^6.26.0",
36+
"babel-preset-env": "^1.6.1",
37+
"babel-register": "^6.26.0",
38+
"chai": "^4.1.2",
39+
"hoodiecrow-imap": "^2.1.0",
40+
"mocha": "^4.0.1",
41+
"nodemon": "^1.12.1",
42+
"pre-commit": "^1.2.2",
43+
"standard": "^10.0.3"
44+
},
45+
"standard": {
46+
"globals": [
47+
"describe",
48+
"it",
49+
"before",
50+
"beforeEach",
51+
"afterEach",
52+
"after",
53+
"expect",
54+
"sinon",
55+
"self"
56+
],
57+
"ignore": [
58+
"dist",
59+
"lib",
60+
"res"
61+
]
3762
}
3863
}
File renamed without changes.

scripts/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
rm -rf $PWD/dist
4+
babel src --out-dir dist --ignore '**/*-unit.js' --source-maps inline
5+
git reset
6+
git add $PWD/dist
7+
git commit -m 'Updating dist files' -n

scripts/release.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
json_value() {
4+
KEY=$1
5+
num=$2
6+
awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'$KEY'\042/){print $(i+1)}}}' | tr -d '"' | sed -n ${num}p
7+
}
8+
9+
# read version from package.json and trim leading/trailing whitespace
10+
version=`less package.json | json_value version 1 | sed -e 's/^ *//' -e 's/ *$//'`
11+
prefix="v"
12+
# tag, push, publish
13+
echo -e "\n> tagging $prefix$version"
14+
git tag "$prefix$version"
15+
echo -e "\n> pushing commits to origin"
16+
git push
17+
echo -e "\n> pushing tags to origin"
18+
git push --tags
19+
echo -e "\n> publishing on npm"
20+
npm publish

0 commit comments

Comments
 (0)