Browse Source

Removed build step

master
Leo Lamprecht 8 years ago
parent
commit
7352306deb
  1. 1
      .gitignore
  2. 15
      build.sh
  3. 10
      package.json
  4. 2
      test/args-parsing.js
  5. 6
      test/index.js
  6. 2
      test/to-host.js

1
.gitignore

@ -6,4 +6,3 @@ node_modules
# logs
npm-debug.log
build

15
build.sh

@ -1,15 +0,0 @@
#!/usr/bin/env bash
rm -rf build
mkdir -p build/{lib,bin}
find lib/** -type d -exec mkdir -p build/{} \;
find bin/** -type d -exec mkdir -p build/{} \;
find lib/** -type f -exec node_modules/.bin/async-to-gen --out-file build/{} {} \;
find bin/** -type f -exec node_modules/.bin/async-to-gen --out-file build/{} {} \;
chmod +x build/bin/now.js
cp lib/utils/billing/*.json build/lib/utils/billing/
# CI
mkdir build/scripts
node_modules/.bin/async-to-gen --out-file build/scripts/slack.js scripts/slack.js
chmod +x build/scripts/slack.js

10
package.json

@ -5,9 +5,7 @@
"scripts": {
"precommit": "xo --quiet && lint-staged",
"lint": "xo",
"test": "npm run build && npm run lint && ava",
"prepublish": "npm run build",
"build": "./build.sh",
"test": "npm run lint && ava",
"pack": "pkg bin/now.js --config package.json --out-dir packed"
},
"pkg": {
@ -23,7 +21,7 @@
]
},
"bin": {
"now": "./build/bin/now.js"
"now": "./bin/now.js"
},
"ava": {
"failFast": true,
@ -33,8 +31,7 @@
},
"xo": {
"ignores": [
"test/_fixtures/**",
"scripts/build/**"
"test/_fixtures/**"
],
"extends": "prettier"
},
@ -52,7 +49,6 @@
"arr-flatten": "1.0.3",
"array-unique": "0.3.2",
"async-retry": "0.3.0",
"async-to-gen": "1.3.3",
"bytes": "2.5.0",
"chalk": "1.1.3",
"clipboardy": "1.1.2",

2
test/args-parsing.js

@ -71,7 +71,7 @@ test('"now alias --help" is the same as "now --help alias"', async t => {
*/
function now(...args) {
return new Promise((resolve, reject) => {
const command = path.resolve(__dirname, '../build/bin/now.js')
const command = path.resolve(__dirname, '../bin/now.js')
const now = spawn(command, args)
let stdout = ''

6
test/index.js

@ -6,12 +6,12 @@ const test = require('ava')
const { asc: alpha } = require('alpha-sort')
// Ours
const hash = require('../build/lib/hash')
const readMetadata = require('../build/lib/read-metadata')
const hash = require('../lib/hash')
const readMetadata = require('../lib/read-metadata')
const {
npm: getNpmFiles_,
docker: getDockerFiles
} = require('../build/lib/get-files')
} = require('../lib/get-files')
const prefix = join(__dirname, '_fixtures') + '/'
const base = path => path.replace(prefix, '')

2
test/to-host.js

@ -1,5 +1,5 @@
const test = require('ava')
const toHost = require('../build/lib/to-host')
const toHost = require('../lib/to-host')
test('simple', t => {
t.is(toHost('zeit.co'), 'zeit.co')

Loading…
Cancel
Save