Skip to content

Commit

Permalink
fix(build): Update dependencies and build pipeline (#51)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description
Updated all dependencies to fix error in build pipeline. 

fixes #43 
<!--- Describe your changes in detail -->

<!--- Please include the phrase "BREAKING CHANGE:" here if your require a major release -->

<!--- Don't forget to note any issues here with "fixes #<issue number>" -->

## How Has This Been Tested?
Locally, I have used node v10 to build the project. Travis will also run all check against all supported versions. 

I plan to also check against node v 11 and re-enable it in the build jobs. 

<!--- Please describe in detail how you tested your changes. -->

<!--- For bug fixes, include regression unit tests that fail without the fix -->

<!--- For new features, include unit tests for the new functionality -->

## Screenshots (if appropriate):

## Checklist:

<!--- Please mark an `x` in all the boxes that apply. -->

<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

*   [x] I have read the [**CONTRIBUTING** document](https://github.com/eventbrite/eventbrite-sdk-javascript/blob/master/CONTRIBUTING.md).
*   [ ] I have updated the documentation accordingly.
*   [x] I have added tests to cover my changes.
*   [x] I have run `yarn validate` to ensure that tests, typescript and linting are all in order.
  • Loading branch information
kwelch authored and kwelch-eb committed Dec 28, 2018
1 parent 07c5156 commit 8afff6d
Show file tree
Hide file tree
Showing 6 changed files with 2,874 additions and 2,359 deletions.
25 changes: 16 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const rollupNodeResolve = require('rollup-plugin-node-resolve');
const rollupCommonjs = require('rollup-plugin-commonjs');
const rollupJson = require('rollup-plugin-json');
const rollupReplace = require('rollup-plugin-replace');
const rollupUglify = require('rollup-plugin-uglify');
const rollupTypescript = require('rollup-plugin-typescript');
const {uglify: rollupUglify} = require('rollup-plugin-uglify');

const FORMAT_ESM = 'esm';
const FORMAT_CJS = 'cjs';
Expand Down Expand Up @@ -109,6 +110,9 @@ const _genDist = ({minify = false} = {}) =>
// convert JSON files to ES6 modules, so they can be included in Rollup bundle
rollupJson(),

// gives rollup ability to read typescript files
rollupTypescript(),

// Locate modules using the Node resolution algorithm, for using third party modules in node_modules
rollupNodeResolve({
// use "module" field for ES6 module if possible
Expand Down Expand Up @@ -186,13 +190,16 @@ gulp.task('build:dist:min', () => _genDist({minify: true}));
gulp.task('build:lib:umd', () => _genUmd());
gulp.task('build:lib:umd:min', () => _genUmd({minify: true}));

gulp.task('build:lib', [
'build:lib:esm',
'build:lib:cjs',
'build:lib:umd',
'build:lib:umd:min',
]);
gulp.task(
'build:lib',
gulp.series(
'build:lib:esm',
'build:lib:cjs',
'build:lib:umd',
'build:lib:umd:min'
)
);

gulp.task('build', ['build:lib', 'build:dist', 'build:dist:min']);
gulp.task('build', gulp.series('build:lib', 'build:dist', 'build:dist:min'));

gulp.task('default', ['build']);
gulp.task('default', gulp.series('build'));
1 change: 1 addition & 0 deletions jest-lint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ module.exports = Object.assign({}, baseConfig, {
runner: 'jest-runner-eslint',
displayName: 'lint',
testMatch: ['<rootDir>/src/**/*.(ts|js)'],
watchPlugins: ['jest-runner-eslint/watch-fix'],
});
70 changes: 39 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,49 +56,52 @@
"babel-core": "^7.0.0-bridge.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.40",
"@babel/core": "^7.0.0-beta.40",
"@babel/plugin-external-helpers": "^7.0.0-beta.40",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.40",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.40",
"@babel/plugin-transform-modules-umd": "^7.0.0-beta.40",
"@babel/preset-env": "^7.0.0-beta.40",
"@babel/preset-typescript": "^7.0.0-beta.40",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/plugin-external-helpers": "^7.2.0",
"@babel/plugin-proposal-class-properties": "^7.2.3",
"@babel/plugin-proposal-object-rest-spread": "^7.2.0",
"@babel/plugin-transform-modules-umd": "^7.2.0",
"@babel/preset-env": "^7.2.3",
"@babel/preset-typescript": "^7.1.0",
"@types/isomorphic-fetch": "^0.0.34",
"@types/jest": "^22.1.3",
"@types/node": "^9.4.6",
"babel-eslint": "^7.0.0",
"@types/jest": "^23.3.10",
"@types/node": "^10.12.18",
"babel-eslint": "^10.0.1",
"bundlesize": "^0.17.0",
"eslint": "^3.0.0",
"eslint-config-eventbrite": "^4.1.0",
"eslint": "^5.11.1",
"eslint-config-eventbrite": "^5.0.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.0.0",
"eslint-plugin-typescript": "^0.9.0",
"gulp": "^3.9.1",
"gulp-babel": "^7.0.1",
"eslint-plugin-jest": "^22.1.2",
"eslint-plugin-typescript": "^0.14.0",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
"gulp-debug": "^4.0.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
"gulp-replace": "^1.0.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.0",
"husky": "^0.14.3",
"jest": "^22.4.0",
"jest-runner-eslint": "^0.4.0",
"gulp-util": "^3.0.8",
"husky": "^1.2.1",
"jest": "^23.6.0",
"jest-runner-eslint": "^0.7.1",
"jest-runner-tsc": "^1.2.0",
"lint-staged": "^6.1.0",
"node": "^8.9.2",
"lint-staged": "^8.1.0",
"npm-run-all": "^4.1.2",
"prettier-eslint-cli": "^4.7.1",
"rollup": "^0.56.3",
"rollup-plugin-babel": "^4.0.0-beta.2",
"rollup-plugin-commonjs": "^8.3.0",
"rollup-plugin-json": "^2.3.0",
"rollup-plugin-node-resolve": "^3.0.3",
"rollup": "^0.68.2",
"rollup-plugin-babel": "^4.1.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-typescript": "^0.8.1",
"rollup-plugin-uglify": "^3.0.0",
"typescript": "^2.7.2",
"rollup-plugin-typescript": "^1.0.0",
"rollup-plugin-uglify": "^6.0.0",
"tslib": "^1.9.3",
"typescript": "~3.1.1",
"typescript-babel-jest": "^1.0.5",
"typescript-eslint-parser": "^14.0.0"
"typescript-eslint-parser": "^21.0.2"
},
"bundlesize": [
{
Expand All @@ -112,5 +115,10 @@
"jest-lint.config.js",
"jest-tsc.config.js"
]
},
"prettier": {
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
}
10 changes: 5 additions & 5 deletions src/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import eventbrite from '../';
import eventbrite from '..';
import {
mockFetch,
getMockFetch,
restoreMockFetch,
getMockResponse
getMockResponse,
} from './utils';
import {MOCK_USERS_ME_RESPONSE_DATA} from './__fixtures__';

Expand All @@ -25,7 +25,7 @@ describe('request', () => {
restoreMockFetch();
});

it('makes request to API base url default w/ no token when no configuration is specified', async () => {
it('makes request to API base url default w/ no token when no configuration is specified', async() => {
const {request} = eventbrite();

await expect(request('/users/me/')).resolves.toEqual(
Expand All @@ -39,7 +39,7 @@ describe('request', () => {
);
});

it('makes request to API base url override w/ specified token', async () => {
it('makes request to API base url override w/ specified token', async() => {
const {request} = eventbrite({
token: MOCK_TOKEN,
baseUrl: MOCK_BASE_URL,
Expand All @@ -60,7 +60,7 @@ describe('request', () => {
);
});

it('properly specifies authorization header token when other header options are already specified', async () => {
it('properly specifies authorization header token when other header options are already specified', async() => {
const {request} = eventbrite({
token: MOCK_TOKEN,
});
Expand Down
24 changes: 12 additions & 12 deletions src/__tests__/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {
mockFetch,
getMockFetch,
restoreMockFetch,
getMockResponse
getMockResponse,
} from './utils';
import {
MOCK_USERS_ME_RESPONSE_DATA,
MOCK_INTERNAL_ERROR_RESPONSE_DATA,
MOCK_ARGUMENTS_ERROR_RESPOSNE_DATA
MOCK_ARGUMENTS_ERROR_RESPOSNE_DATA,
} from './__fixtures__';

const TEST_URL = 'https://www.eventbriteapi.com/v3/users/me/';
Expand All @@ -29,7 +29,7 @@ describe('request', () => {
mockFetch(getSuccessfulCodeRes());
});

it('calls fetch and calls fetch with appropriate defaults', async () => {
it('calls fetch and calls fetch with appropriate defaults', async() => {
await request(TEST_URL);

expect(getMockFetch()).toHaveBeenCalledTimes(1);
Expand All @@ -41,7 +41,7 @@ describe('request', () => {
);
});

it('calls fetch and adds "application/json" content type when method is not GET', async () => {
it('calls fetch and adds "application/json" content type when method is not GET', async() => {
await request(TEST_URL, {method: 'POST', body: '{}'});

expect(getMockFetch()).toHaveBeenCalledTimes(1);
Expand All @@ -58,7 +58,7 @@ describe('request', () => {
);
});

it('calls should not send "application/json", if method is not passed', async () => {
it('calls should not send "application/json", if method is not passed', async() => {
await request(TEST_URL);

expect(getMockFetch()).toHaveBeenCalledTimes(1);
Expand All @@ -71,7 +71,7 @@ describe('request', () => {
);
});

it('calls fetch and respects overrides in options', async () => {
it('calls fetch and respects overrides in options', async() => {
await request(TEST_URL, {credentials: 'omit'});

expect(getMockFetch()).toHaveBeenCalledTimes(1);
Expand All @@ -83,7 +83,7 @@ describe('request', () => {
);
});

it('calls fetch and respects overrides in option headers', async () => {
it('calls fetch and respects overrides in option headers', async() => {
await request(TEST_URL, {
headers: {
'X-TEST': 'testHeader',
Expand All @@ -105,7 +105,7 @@ describe('request', () => {
);
});

it('calls fetch and merges overrides with defaults in option headers', async () => {
it('calls fetch and merges overrides with defaults in option headers', async() => {
await request(TEST_URL, {
headers: {
'X-TEST': 'testHeader',
Expand All @@ -129,7 +129,7 @@ describe('request', () => {
})
);
});
it('calls fetch and return parsed response JSON data', async () => {
it('calls fetch and return parsed response JSON data', async() => {
await expect(request(TEST_URL)).resolves.toEqual(
MOCK_USERS_ME_RESPONSE_DATA
);
Expand All @@ -139,7 +139,7 @@ describe('request', () => {
});

describe('error handling', () => {
it('should reject only with response when response is invalid JSON', async () => {
it('should reject only with response when response is invalid JSON', async() => {
const response = new Response('{sa;dfsdfi');

mockFetch(response);
Expand All @@ -149,7 +149,7 @@ describe('request', () => {
});
});

it('calls fetch and rejects with parsed error when there is a status error', async () => {
it('calls fetch and rejects with parsed error when there is a status error', async() => {
const response = getInternalErrorRes();

mockFetch(response);
Expand All @@ -166,7 +166,7 @@ describe('request', () => {
expect(getMockFetch()).toHaveBeenCalledTimes(1);
});

it('calls fetch and rejects with parsed argument errors when there is an ARGUMENT_ERROR', async () => {
it('calls fetch and rejects with parsed argument errors when there is an ARGUMENT_ERROR', async() => {
const response = getArgumentsErrorRes();

mockFetch(response);
Expand Down
Loading

0 comments on commit 8afff6d

Please sign in to comment.