Skip to content

Commit fd441fc

Browse files
committed
Merge branch 'release/0.1.0-alpha.16'
2 parents e807e4e + 4a88577 commit fd441fc

39 files changed

Lines changed: 2541 additions & 2328 deletions

.babelrc

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

.eslintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"root": true,
3+
"parser": "typescript-eslint-parser",
4+
"env": {
5+
"browser": true,
6+
"node": true
7+
},
8+
"extends": "@slynova",
9+
"rules": {
10+
"no-undef": 0
11+
}
12+
}

.eslintrc.js

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

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.reify-cache
21
.nyc_output
32
dist
3+
build
44
node_modules
5+
yarn-error.log

.npmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
.nyc_outpute
12
docs
3+
build
24
src
35
tests
46
.editorconfig
5-
.eslintrc.js
7+
.eslintrc
68
.gitignore
79
rollup.config.js
10+
tsconfig.json

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# FIVB Javascript SDK
2+

gulpfile.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const { exec } = require('child_process')
2+
const rimraf = require('rimraf')
3+
const gulp = require('gulp-help')(require('gulp'))
4+
const $plugins = require('gulp-load-plugins')()
5+
6+
const tsProject = $plugins.typescript.createProject('tsconfig.json')
7+
8+
gulp.task('default', ['help'])
9+
10+
gulp.task('lint', 'Lint the code.', () => (
11+
gulp.src('src/**/*.ts')
12+
.pipe($plugins.eslint())
13+
.pipe($plugins.eslint.format())
14+
.pipe($plugins.eslint.failAfterError())
15+
))
16+
17+
gulp.task('clean', 'Clean build & dist directory.', (cb) => {
18+
rimraf('./+(build|dist)', cb)
19+
})
20+
21+
gulp.task('build', 'Build the code into plain Javascript.', ['lint', 'clean'], () => (
22+
gulp.src('src/**/*.ts')
23+
.pipe(tsProject())
24+
.pipe(gulp.dest('./build'))
25+
))
26+
27+
gulp.task('bundle', 'Bundle the code using Rolllup.', ['build'], (cb) => {
28+
exec('npx rollup -c', (err, stdout, stderr) => {
29+
console.log(stdout)
30+
console.log(stderr)
31+
cb(err)
32+
})
33+
})
34+
35+
gulp.task('test', 'Run tests.', ['build'], (cb) => {
36+
exec('npx nyc japa', (err, stdout, stderr) => {
37+
console.log(stdout)
38+
console.log(stderr)
39+
cb(err)
40+
})
41+
})

index.js

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

package.json

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
11
{
22
"name": "@fivb/sdk",
3-
"version": "0.1.0-alpha.15",
3+
"version": "0.1.0-alpha.16",
44
"description": "FIVB SDK to interact with the FIVB WebService",
55
"author": "Romain Lanz <romain.lanz@fivb.com>",
66
"main": "dist/sdk.cjs.js",
77
"module": "dist/sdk.esm.js",
88
"jsnext:main": "dist/sdk.esm.js",
99
"license": "MIT",
1010
"scripts": {
11-
"prepublish": "yarn run build",
12-
"build": "yarn run lint && rollup -c",
13-
"lint": "eslint src/**/*.js",
14-
"test": "yarn run lint && nyc japa"
15-
},
16-
"dependencies": {
17-
"babel-polyfill": "^6.26.0",
18-
"isomorphic-unfetch": "^2.0.0",
19-
"resetable": "^1.0.3"
11+
"prepublish": "gulp bundle",
12+
"lint": "gulp lint",
13+
"build": "gulp build",
14+
"bundle": "gulp bundle",
15+
"test": "gulp test"
2016
},
17+
"dependencies": {},
2118
"devDependencies": {
22-
"babel-core": "^6.26.0",
23-
"babel-eslint": "^8.2.1",
24-
"babel-plugin-external-helpers": "^6.22.0",
25-
"babel-preset-env": "^1.6.1",
26-
"eslint": "^4.15.0",
27-
"eslint-config-airbnb-base": "^12.1.0",
19+
"@slynova/eslint-config": "^1.0.4",
20+
"eslint": "^4.19.1",
2821
"eslint-plugin-import": "^2.8.0",
29-
"fetch-mock": "^6.0.0-beta.7",
22+
"gulp": "^3.9.1",
23+
"gulp-eslint": "^4.0.2",
24+
"gulp-help": "^1.6.1",
25+
"gulp-load-plugins": "^1.5.0",
26+
"gulp-typescript": "^4.0.2",
3027
"japa": "^1.0.6",
3128
"japa-cli": "^1.0.1",
3229
"nyc": "^11.4.1",
33-
"reify": "^0.15.1",
30+
"rimraf": "^2.6.2",
3431
"rollup": "^0.57.1",
35-
"rollup-plugin-babel": "^3.0.3",
3632
"rollup-plugin-commonjs": "^9.1.0",
37-
"rollup-plugin-json": "^2.3.0",
38-
"rollup-plugin-node-resolve": "^3.0.2",
3933
"rollup-plugin-uglify": "^3.0.0",
40-
"sinon": "^4.1.5"
34+
"typescript": "^2.8.1",
35+
"typescript-eslint-parser": "^14.0.0"
4136
}
4237
}

rollup.config.js

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,75 @@
11
/**
2-
* fivb-sdk
2+
* @fivb/sdk
3+
*
34
* @license MIT
45
* @copyright FIVB - Romain Lanz <romain.lanz@fivb.com>
56
*/
67

7-
import babel from 'rollup-plugin-babel'
8+
import pkg from './package.json'
89
import uglify from 'rollup-plugin-uglify'
910
import commonjs from 'rollup-plugin-commonjs'
10-
import resolve from 'rollup-plugin-node-resolve'
11-
import json from 'rollup-plugin-json'
12-
import pkg from './package.json'
1311

1412
export default [
13+
// UMD Bundle
1514
{
16-
input: 'src/index.js',
15+
input: 'build/index.js',
1716
output: {
1817
file: 'dist/sdk.umd.js',
1918
format: 'umd',
2019
name: 'Fivb',
21-
globals: { 'node-fetch': 'fetch' },
2220
},
2321
plugins: [
24-
json(),
25-
babel({
26-
exclude: 'node_modules/**',
27-
}),
28-
resolve(),
2922
commonjs(),
3023
uglify(),
3124
],
32-
external: ['node-fetch'],
3325
},
26+
27+
// ES6 Module + CommonJS Bundles
3428
{
35-
input: 'src/index.js',
29+
input: 'build/index.js',
3630
output: [
3731
{ file: pkg.main, format: 'cjs' },
3832
{ file: pkg.module, format: 'es' },
3933
],
4034
plugins: [
41-
json(),
42-
babel({
43-
exclude: 'node_modules/**',
44-
}),
4535
commonjs(),
4636
],
47-
external: ['isomorphic-unfetch', 'resetable', 'babel-polyfill'],
4837
},
4938
]
39+
40+
// export default [
41+
// {
42+
// input: 'src/index.js',
43+
// output: {
44+
// file: 'dist/sdk.umd.js',
45+
// format: 'umd',
46+
// name: 'Fivb',
47+
// globals: { 'node-fetch': 'fetch' },
48+
// },
49+
// plugins: [
50+
// json(),
51+
// babel({
52+
// exclude: 'node_modules/**',
53+
// }),
54+
// resolve(),
55+
// commonjs(),
56+
// uglify(),
57+
// ],
58+
// external: ['node-fetch'],
59+
// },
60+
// {
61+
// input: 'src/index.js',
62+
// output: [
63+
// { file: pkg.main, format: 'cjs' },
64+
// { file: pkg.module, format: 'es' },
65+
// ],
66+
// plugins: [
67+
// json(),
68+
// babel({
69+
// exclude: 'node_modules/**',
70+
// }),
71+
// commonjs(),
72+
// ],
73+
// external: ['isomorphic-unfetch', 'resetable', 'babel-polyfill'],
74+
// },
75+
// ]

0 commit comments

Comments
 (0)