Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
Some changes were necesssary after upgrading babel deps:

 - preset-stage-3 has been removed because it is deprecated. Instead
 the separate proposals which are necessary for typescript were added
 - removed some configuration from the transform-runtime plugin that
 were already the default

Some changes were necessary after upgrading TypeScript:
 - Declarations output is now a temporary directory, after which the
 files are copied to their final destination using shx. This is
 because TypeScript adds the output directory of a build to the
 excludes array, which causes issues when the output directory is
 the root of the repository

Other updates:
 - The minimum node version was bumped from 6 to 8
  • Loading branch information
flut1 committed Jul 9, 2019
1 parent d733132 commit ed21e08
Show file tree
Hide file tree
Showing 10 changed files with 3,057 additions and 1,412 deletions.
11 changes: 5 additions & 6 deletions .babelrc
Expand Up @@ -3,21 +3,20 @@
["@babel/env", {
"targets": {
"browsers": ["last 2 versions"],
"node": "6"
"node": "8"
},
"loose": true,
"useBuiltIns": false
}],
"@babel/preset-stage-3",
"@babel/typescript"
],
"plugins": [
["@babel/plugin-transform-runtime", {
"helpers": true,
"polyfill": false,
"regenerator": false,
"moduleName": "@babel/runtime"
}]
"regenerator": false
}],
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
],
"env": {
"test": {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,6 +11,7 @@ node_modules/
/coverage/
/.nyc_output/
/tmp/
/decl/

## only ignore in git
/lib
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -10,6 +10,7 @@ node_modules/
/coverage/
/.nyc_output/
/tmp/
/decl/

# .npmignore
.babelrc
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -4,7 +4,6 @@ cache: yarn

node_js:
- 'stable'
- '6'
- '8'
- '10'

Expand Down
21 changes: 11 additions & 10 deletions package.json
Expand Up @@ -12,7 +12,7 @@
"dev:ts": "tsc --noEmit --allowJs --watch",
"build": "npm-run-all -s clean build:*",
"build:babel": "babel ./src -x \".ts\" -x \".js\" --out-dir ./",
"build:ts": "tsc -p ./tsconfig.build.json",
"build:ts": "tsc -p ./tsconfig.build.json && shx cp -Rf decl/* .",
"test": "cross-env NODE_ENV=test nyc --all mocha \"./test/**/*.spec.{ts,js}\"",
"test:dev": "mocha -w --watch-extensions ts,js \"./test/**/*.spec.{ts,js}\"",
"clean": "npm-run-all clean:*",
Expand Down Expand Up @@ -59,13 +59,14 @@
"url": "https://github.com/mediamonks/seng-boilerplate.git"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.35",
"@babel/core": "^7.0.0-beta.35",
"@babel/plugin-transform-runtime": "^7.0.0-beta.35",
"@babel/preset-env": "^7.0.0-beta.35",
"@babel/preset-stage-3": "^7.0.0-beta.35",
"@babel/preset-typescript": "^7.0.0-beta.35",
"@babel/register": "^7.0.0-beta.35",
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.0",
"@babel/plugin-proposal-class-properties": "^7.5.0",
"@babel/plugin-proposal-object-rest-spread": "^7.5.2",
"@babel/plugin-transform-runtime": "^7.5.0",
"@babel/preset-env": "^7.5.2",
"@babel/preset-typescript": "^7.3.3",
"@babel/register": "^7.4.4",
"@types/chai": "^4.0.10",
"@types/mocha": "^2.2.44",
"@types/sinon": "^4.1.2",
Expand Down Expand Up @@ -98,9 +99,9 @@
"tslint-config-airbnb": "^5.4.2",
"tslint-config-prettier": "^1.6.0",
"typedoc": "^0.9.0",
"typescript": "^2.6.2"
"typescript": "^3.5.3"
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.35"
"@babel/runtime": "^7.5.2"
}
}
2 changes: 1 addition & 1 deletion src/lib/Dummy.ts
Expand Up @@ -19,6 +19,6 @@ export default class Dummy {
if (typeof str === 'undefined') {
return 'baz';
}
return str + 'bar';
return `${str}bar`;
}
}
2 changes: 1 addition & 1 deletion src/lib/Example.ts
Expand Up @@ -15,6 +15,6 @@ export default class Example {
if (typeof str === 'undefined') {
return 'baz';
}
return str + 'bar';
return `${str}bar`;
}
}
4 changes: 2 additions & 2 deletions test/_setup/setup.js
@@ -1,5 +1,5 @@
require("@babel/register")({
require('@babel/register')({
// Setting this will remove the currently hooked extensions of .es6, `.es`, `.jsx`
// and .js so you'll have to add them back if you want them to be used again.
extensions: [".es6", ".es", ".jsx", ".js", ".ts"],
extensions: ['.es6', '.es', '.jsx', '.js', '.ts'],
});
4 changes: 3 additions & 1 deletion tsconfig.build.json
Expand Up @@ -4,6 +4,8 @@
"allowJs": false,
"outDir": "tmp",
"declaration": true,
"declarationDir": "./"
"declarationDir": "./decl",
"baseUrl": ".",
"emitDeclarationOnly": true
}
}

0 comments on commit ed21e08

Please sign in to comment.