Skip to content

Commit 79718f9

Browse files
committed
use new toolchain
1 parent 5ab00b7 commit 79718f9

12 files changed

+107
-116
lines changed

.babelrc

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

.editorconfig

+10
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

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
node_modules/
22
npm-debug.log
3-
.DS_Store
3+
.DS_Store
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

-36
This file was deleted.

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

+1-3
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

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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", "testutils.js",
14+
"--reporter", "spec",
15+
"--no-timeouts"
16+
],
17+
"runtimeArgs": [
18+
"--nolazy"
19+
],
20+
"sourceMaps": true
21+
}
22+
]
23+
}

Gruntfile.js

-59
This file was deleted.

package.json

+31-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emailjs-mime-builder",
3-
"version": "1.0.1",
3+
"version": "2.0.0",
44
"homepage": "https://github.com/emailjs/emailjs-mime-builder",
55
"description": "emailjs-mime-builder is a low level rfc2822 message composer. Define your own mime tree, no magic included.",
66
"author": "Andris Reinman <[email protected]>",
@@ -10,30 +10,44 @@
1010
],
1111
"license": "MIT",
1212
"scripts": {
13-
"test": "grunt"
13+
"build": "./scripts/build.sh",
14+
"release": "./scripts/release.sh",
15+
"lint": "$(npm bin)/standard",
16+
"test": "npm run lint && npm run unit",
17+
"unit": "$(npm bin)/mocha './src/*-unit.js' --reporter spec --require babel-register testutils.js"
1418
},
1519
"repository": {
1620
"type": "git",
1721
"url": "git://github.com/emailjs/emailjs-mime-builder.git"
1822
},
19-
"main": "src/emailjs-mime-builder",
23+
"main": "dist/builder",
2024
"dependencies": {
21-
"emailjs-addressparser": "^1.0.1",
22-
"emailjs-mime-codec": "^1.0.1",
25+
"emailjs-addressparser": "^2.0.2",
26+
"emailjs-mime-codec": "^2.0.3",
2327
"emailjs-mime-types": "^1.0.0",
24-
"punycode": "^1.4.0"
28+
"punycode": "^2.1.0"
2529
},
2630
"devDependencies": {
27-
"amdefine": "^1.0.0",
28-
"chai": "^3.4.1",
29-
"grunt": "^0.4.5",
30-
"grunt-contrib-connect": "^0.11.2",
31-
"grunt-contrib-jshint": "^0.11.3",
32-
"grunt-mocha-phantomjs": "^2.0.1",
33-
"grunt-mocha-test": "^0.12.7",
34-
"mocha": "^2.3.4",
35-
"phantomjs": "^1.9.19",
36-
"requirejs": "^2.1.22",
37-
"sinon": "^1.17.2"
31+
"babel-cli": "^6.26.0",
32+
"babel-preset-env": "^1.6.1",
33+
"babel-register": "^6.26.0",
34+
"chai": "^4.1.2",
35+
"mocha": "^4.0.1",
36+
"pre-commit": "^1.2.2",
37+
"standard": "^10.0.3"
38+
},
39+
"standard": {
40+
"globals": [
41+
"describe",
42+
"it",
43+
"before",
44+
"beforeAll",
45+
"afterAll",
46+
"after",
47+
"expect"
48+
],
49+
"ignore": [
50+
"dist"
51+
]
3852
}
3953
}

scripts/build.sh

+7
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

+20
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

testutils.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { expect } from 'chai'
2+
3+
global.expect = expect

0 commit comments

Comments
 (0)