Compare commits

..

10 Commits

Author SHA1 Message Date
Tim Neutkens
6caba97183 Publish
- @now/build-utils@0.4.27
 - @now/go@0.2.7
 - @now/html-minifier@1.0.3
 - @now/lambda@0.4.4
 - @now/md@0.4.4
 - @now/mdx-deck@0.4.13
 - @now/next@0.0.76
 - @now/node-bridge@0.1.6
 - @now/node-server@0.4.21
 - @now/node@0.4.23
 - @now/optipng@0.4.4
 - @now/php@0.4.8
 - @now/python@0.0.37
 - @now/static-build@0.4.12
2018-11-14 16:09:42 +01:00
Tim Neutkens
5d35de8908 Temporarily disable publish-canary 2018-11-14 16:06:34 +01:00
Tim Neutkens
551a29dd13 Use build instead of upload 2018-11-14 15:54:19 +01:00
Tim Neutkens
f63f48e1e9 Revert "Publish"
This reverts commit 7d7f0adfb3.
2018-11-14 15:53:18 +01:00
Tim Neutkens
7d7f0adfb3 Publish
- @now/build-utils@0.4.27
 - @now/go@0.2.7
 - @now/html-minifier@1.0.3
 - @now/lambda@0.4.4
 - @now/md@0.4.4
 - @now/mdx-deck@0.4.13
 - @now/next@0.0.76
 - @now/node-bridge@0.1.6
 - @now/node-server@0.4.21
 - @now/node@0.4.23
 - @now/optipng@0.4.4
 - @now/php@0.4.8
 - @now/python@0.0.37
 - @now/static-build@0.4.12
2018-11-14 15:30:51 +01:00
Tim Neutkens
5538e97bb8 Add publish-stable script 2018-11-14 15:20:25 +01:00
Tim Neutkens
f8c260353c Add stable publish 2018-11-14 15:14:02 +01:00
Tim Neutkens
9123356d23 Publish
- @now/node-bridge@0.1.6-canary.6
 - @now/node-server@0.4.21-canary.6
 - @now/node@0.4.23-canary.6
2018-11-14 13:59:58 +01:00
Tim Neutkens
d85eee5571 Add publish-canary for tag releases 2018-11-14 13:58:32 +01:00
Tim Neutkens
0f59d568e5 Fix linting 2018-11-14 13:45:48 +01:00
17 changed files with 51 additions and 49 deletions

View File

@@ -24,7 +24,21 @@ jobs:
- run:
name: Tests
command: yarn test
publish-canary:
# publish-canary:
# docker:
# - image: circleci/node:10
# working_directory: ~/repo
# steps:
# - checkout
# - run: yarn install
# - run: yarn bootstrap
# - run:
# name: Saving Authentication Information
# command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
# - run:
# name: Publishing to Canary Channel
# command: yarn run lerna publish from-git --npm-tag canary --yes
publish-stable:
docker:
- image: circleci/node:10
working_directory: ~/repo
@@ -36,8 +50,8 @@ jobs:
name: Saving Authentication Information
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Publishing to Canary Channel
command: yarn run lerna publish from-git --npm-tag canary --yes
name: Publishing to Stable Channel
command: yarn run lerna publish from-git --yes
workflows:
version: 2
unscheduled:
@@ -46,17 +60,15 @@ workflows:
filters:
tags:
only: /.*/
- publish-canary:
- publish-stable:
requires:
- build
filters:
tags:
only: /.*/
branches:
ignore: /.*/
# - publish-stable:
only: /^.*(\d+\.)(\d+\.)(\*|\d+)$/
# - publish-canary:
# requires:
# - build
# filters:
# tags:
# only: /^(\d+\.)?(\d+\.)?(\*|\d+)$/
# branches:
# ignore: /.*/
# only: /^.*canary.*($|\b)/

View File

@@ -11,6 +11,7 @@
"scripts": {
"lerna": "lerna",
"bootstrap": "lerna bootstrap",
"publish-stable": "lerna version",
"publish-canary": "lerna version prerelease --preid canary",
"lint": "eslint .",
"test": "jest",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/build-utils",
"version": "0.4.27-canary.4",
"version": "0.4.27",
"dependencies": {
"async-retry": "1.2.3",
"async-sema": "2.1.4",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/go",
"version": "0.2.7-canary.4",
"version": "0.2.7",
"scripts": {
"test": "best -I test/*.js",
"prepublish": "./build.sh"

View File

@@ -1,6 +1,6 @@
{
"name": "@now/html-minifier",
"version": "1.0.3-canary.4",
"version": "1.0.3",
"dependencies": {
"html-minifier": "3.5.21"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@now/lambda",
"version": "0.4.4-canary.5",
"version": "0.4.4",
"peerDependencies": {
"@now/build-utils": ">=0.0.1"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@now/md",
"version": "0.4.4-canary.4",
"version": "0.4.4",
"dependencies": {
"rehype-document": "^2.2.0",
"rehype-format": "^2.3.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/mdx-deck",
"version": "0.4.13-canary.4",
"version": "0.4.13",
"peerDependencies": {
"@now/build-utils": ">=0.0.1"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@now/next",
"version": "0.0.76-canary.0",
"version": "0.0.76",
"dependencies": {
"@now/node-bridge": "0.1.4",
"execa": "^1.0.0",

View File

@@ -1,24 +1,20 @@
const assert = require('assert');
const http = require('http');
function normalizeEvent(event) {
if (event.Action === 'Invoke') {
const invokeEvent = JSON.parse(event.body);
const {
method, path, headers, encoding,
} = invokeEvent;
const { method, path, headers, encoding } = invokeEvent;
let { body } = invokeEvent;
if (body) {
if (encoding === 'base64') {
body = Buffer.from(body, encoding);
} else
if (encoding === undefined) {
} else if (encoding === undefined) {
body = Buffer.from(body);
} else {
throw new Error('Unsupported encoding: ' + encoding);
throw new Error(`Unsupported encoding: ${encoding}`);
}
}
@@ -26,22 +22,17 @@ function normalizeEvent(event) {
method,
path,
headers,
body,
body
};
}
const {
httpMethod: method,
path,
headers,
body,
} = event;
const { httpMethod: method, path, headers, body } = event;
return {
method,
path,
headers,
body,
body
};
}
@@ -62,19 +53,17 @@ class Bridge {
return resolve({ statusCode: 504, body: '' });
}
const {
method, path, headers, body,
} = normalizeEvent(event);
const { method, path, headers, body } = normalizeEvent(event);
const opts = {
hostname: '127.0.0.1',
port: this.port,
path,
method,
headers,
headers
};
const req = http.request(opts, (res) => {
const req = http.request(opts, res => {
const response = res;
const respBodyChunks = [];
response.on('data', chunk => respBodyChunks.push(Buffer.from(chunk)));
@@ -87,7 +76,7 @@ class Bridge {
statusCode: response.statusCode,
headers: response.headers,
body: Buffer.concat(respBodyChunks).toString('base64'),
encoding: 'base64',
encoding: 'base64'
});
});
});
@@ -99,5 +88,5 @@ class Bridge {
}
module.exports = {
Bridge,
Bridge
};

View File

@@ -1,6 +1,6 @@
{
"name": "@now/node-bridge",
"version": "0.1.6-canary.5",
"version": "0.1.6",
"peerDependencies": {
"@now/build-utils": ">=0.0.1"
}

View File

@@ -1,8 +1,8 @@
{
"name": "@now/node-server",
"version": "0.4.21-canary.5",
"version": "0.4.21",
"dependencies": {
"@now/node-bridge": "^0.1.6-canary.5"
"@now/node-bridge": "^0.1.6"
},
"peerDependencies": {
"@now/build-utils": ">=0.0.1"

View File

@@ -1,8 +1,8 @@
{
"name": "@now/node",
"version": "0.4.23-canary.5",
"version": "0.4.23",
"dependencies": {
"@now/node-bridge": "^0.1.6-canary.5"
"@now/node-bridge": "^0.1.6"
},
"peerDependencies": {
"@now/build-utils": ">=0.0.1"

View File

@@ -1,6 +1,6 @@
{
"name": "@now/optipng",
"version": "0.4.4-canary.4",
"version": "0.4.4",
"dependencies": {
"multipipe": "2.0.3",
"optipng": "1.1.0"

View File

@@ -1,6 +1,6 @@
{
"name": "@now/php",
"version": "0.4.8-canary.4",
"version": "0.4.8",
"peerDependencies": {
"@now/build-utils": ">=0.0.1"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@now/python",
"version": "0.0.37-canary.4",
"version": "0.0.37",
"main": "index.js",
"license": "MIT",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@now/static-build",
"version": "0.4.12-canary.5",
"version": "0.4.12",
"peerDependencies": {
"@now/build-utils": ">=0.0.1"
}