Skip to content

Commit

Permalink
fix build release
Browse files Browse the repository at this point in the history
  • Loading branch information
charlierudolph committed Oct 6, 2019
1 parent 288468b commit 009e5ce
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
22 changes: 0 additions & 22 deletions .babelrc

This file was deleted.

27 changes: 27 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
plugins: [
"@babel/plugin-proposal-function-bind",
"@babel/plugin-transform-shorthand-properties"
],
presets: [
["@babel/preset-env", {targets: "maintained node versions"}]
],
env: {
test_coverage: {
plugins: [
["istanbul", {exclude: ["test/*.js", "**/*_spec.js"]}]
]
},
browser: {
presets: [
["@babel/preset-env", {
targets: "last 2 versions",
useBuiltIns: "entry",
corejs: 3,
shippedProposals: true
}]
]
}
},
sourceMaps: true
}
4 changes: 4 additions & 0 deletions features/support/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import tmp from 'tmp'

const projectPath = path.join(__dirname, '..', '..')
const projectNodeModulesPath = path.join(projectPath, 'node_modules')
const projectBabelConfigPath = path.join(projectPath, 'babel.config.js')
const moduleNames = fs.readdirSync(projectNodeModulesPath)

Before('@debug', function() {
Expand All @@ -28,6 +29,9 @@ Before(function({ sourceLocation: { uri, line } }) {
'module.exports = {default: "--require-module @babel/register"}'
fsExtra.outputFileSync(tmpDirProfilePath, profileContent)

const tmpDirBabelConfigPath = path.join(this.tmpDir, 'babel.config.js')
fsExtra.createSymlinkSync(projectBabelConfigPath, tmpDirBabelConfigPath)

const tmpDirNodeModulesPath = path.join(this.tmpDir, 'node_modules')
const tmpDirCucumberPath = path.join(tmpDirNodeModulesPath, 'cucumber')
fsExtra.createSymlinkSync(projectPath, tmpDirCucumberPath)
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"chai": "^4.0.1",
"coffeescript": "^2.4.1",
"connect": "^3.4.0",
"core-js": "^3.2.1",
"coveralls": "^3.0.0",
"dependency-lint": "^6.0.0",
"eslint": "^6.3.0",
Expand All @@ -204,6 +205,7 @@
"mustache": "^3.0.1",
"nyc": "^14.0.0",
"prettier": "^1.5.2",
"regenerator-runtime": "^0.13.3",
"serve-static": "^1.10.0",
"sinon": "^7.3.1",
"sinon-chai": "^3.3.0",
Expand All @@ -214,7 +216,7 @@
"build-browser-example": "BABEL_ENV=browser browserify example/index.js -o dist/browser-example.js -t babelify",
"build-local-continuous": "babel src --watch -d lib --ignore '**/*_spec.js'",
"build-local": "babel src -d lib --ignore '**/*_spec.js'",
"build-release": "BABEL_ENV=browser browserify src/index.js -o dist/cucumber.js -t babelify --standalone Cucumber",
"build-release": "BABEL_ENV=browser browserify scripts/cucumber.js -o dist/cucumber.js -t babelify --standalone Cucumber --debug",
"feature-test": "node ./bin/cucumber-js",
"lint-autofix": "eslint --fix \"{example,features,scripts,src,test}/**/*.js\"",
"lint-code": "eslint \"{example,features,scripts,src,test}/**/*.js\"",
Expand Down
5 changes: 5 additions & 0 deletions scripts/cucumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// File to be browserified to create dist

import 'core-js/stable'
import 'regenerator-runtime/runtime'
export * from '../src/index'
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ core-js@^2.6.5:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2"
integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==

core-js@^3.0.0:
core-js@^3.0.0, core-js@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.2.1.tgz#cd41f38534da6cc59f7db050fe67307de9868b09"
integrity sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw==
Expand Down Expand Up @@ -4539,7 +4539,7 @@ regenerate@^1.4.0:
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11"
integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==

regenerator-runtime@^0.13.2:
regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.3:
version "0.13.3"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5"
integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==
Expand Down

0 comments on commit 009e5ce

Please sign in to comment.