diff --git a/.travis.yml b/.travis.yml index 793b6ff..ca916d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,30 @@ language: node_js -node_js: - - 6 - - 8 + notifications: email: false + cache: yarn: true directories: - node_modules + - /home/travis/.pnpm-store + before_install: - - npm install -g npm@5 - npm install -g yarn - - npm install -g greenkeeper-lockfile@1 - npm install -g create-cycle-app -before_script: greenkeeper-lockfile-update -after_script: greenkeeper-lockfile-upload -script: - - create-cycle-app test-app --flavor $(pwd) --yarn - - cd test-app - - yarn run build - - yarn test - - cd .. + - npm install -g pnpm@^2.17.0 + +matrix: + include: + - script: ./runCI.sh yarn + node_js: 6 + install: yarn install + - script: ./runCI.sh yarn + node_js: 8 + install: yarn install +# - script: ./runCI.sh pnpm +# node_js: 6 +# install: pnpm install +# - script: ./runCI.sh pnpm +# node_js: 8 +# install: pnpm install diff --git a/configs/webpack.config.js b/configs/webpack.config.js index e316980..ddfc568 100644 --- a/configs/webpack.config.js +++ b/configs/webpack.config.js @@ -35,7 +35,7 @@ const appPath = (...names) => path.join(process.cwd(), ...names); const userConfig = require(appPath('webpack.config.js')); const packageJson = require(appPath('package.json')); -const PORT = process.env.PORT || 8080 +const PORT = process.env.PORT || 8080; module.exports = webpackMerge( createConfig([ diff --git a/runCI.sh b/runCI.sh new file mode 100755 index 0000000..0b6855c --- /dev/null +++ b/runCI.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cli=$1 + +set -eu + +create-cycle-app test-app --flavor $(pwd) "--$cli" +cd test-app +"$cli" run build +"$cli" test +echo "y\n" | "$cli" run eject +"$cli" run build +"$cli" test diff --git a/scripts/test.js b/scripts/test.js index ead79e7..a3f1358 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -8,11 +8,7 @@ let env = Object.create(process.env); env.NODE_ENV = 'test'; const nycAPI = require.resolve('nyc'); -const nyc = path.resolve( - path.dirname(nycAPI), - 'bin', - 'nyc.js' -); +const nyc = path.resolve(path.dirname(nycAPI), 'bin', 'nyc.js'); const args = [ 'mocha-webpack', diff --git a/template/pnpmfile.js b/template/pnpmfile.js index 7cea0d0..93c3db6 100644 --- a/template/pnpmfile.js +++ b/template/pnpmfile.js @@ -7,8 +7,7 @@ module.exports = { function readPackage(pkg, context) { if (pkg['one-fits-all']) { - pkg.devDependencies = { - ...pkg.devDependencies, + pkg.devDependencies = Object.assign({}, pkg.devDependencies, { tslint: '*', jsverify: '*', webpack: '*', @@ -24,12 +23,11 @@ function readPackage(pkg, context) { '@types/history': '*', 'cross-env': '*', 'mocha-webpack': '2.0.0-beta.0' - }; - pkg.dependencies = { - ...pkg.dependencies, + }); + pkg.dependencies = Object.assign({}, pkg.dependencies, { snabbdom: '*', history: '*' - }; + }); } return pkg;