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 # logs
npm-debug.log 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": { "scripts": {
"precommit": "xo --quiet && lint-staged", "precommit": "xo --quiet && lint-staged",
"lint": "xo", "lint": "xo",
"test": "npm run build && npm run lint && ava", "test": "npm run lint && ava",
"prepublish": "npm run build",
"build": "./build.sh",
"pack": "pkg bin/now.js --config package.json --out-dir packed" "pack": "pkg bin/now.js --config package.json --out-dir packed"
}, },
"pkg": { "pkg": {
@ -23,7 +21,7 @@
] ]
}, },
"bin": { "bin": {
"now": "./build/bin/now.js" "now": "./bin/now.js"
}, },
"ava": { "ava": {
"failFast": true, "failFast": true,
@ -33,8 +31,7 @@
}, },
"xo": { "xo": {
"ignores": [ "ignores": [
"test/_fixtures/**", "test/_fixtures/**"
"scripts/build/**"
], ],
"extends": "prettier" "extends": "prettier"
}, },
@ -52,7 +49,6 @@
"arr-flatten": "1.0.3", "arr-flatten": "1.0.3",
"array-unique": "0.3.2", "array-unique": "0.3.2",
"async-retry": "0.3.0", "async-retry": "0.3.0",
"async-to-gen": "1.3.3",
"bytes": "2.5.0", "bytes": "2.5.0",
"chalk": "1.1.3", "chalk": "1.1.3",
"clipboardy": "1.1.2", "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) { function now(...args) {
return new Promise((resolve, reject) => { 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) const now = spawn(command, args)
let stdout = '' let stdout = ''

6
test/index.js

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

2
test/to-host.js

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

Loading…
Cancel
Save