Compare commits

..

3 Commits

Author SHA1 Message Date
luc
62beb0f78d Publish Stable
- @now/frameworks@0.0.9
 - @now/build-utils@1.3.9
 - @now/cgi@1.0.3
 - now@17.0.0
 - now-client@7.0.0
 - @now/go@1.0.3
 - @now/next@2.3.13
 - @now/node@1.4.1
 - @now/python@1.1.3
 - @now/routing-utils@1.5.2
 - @now/ruby@1.0.2
 - @now/static-build@0.14.12
2020-02-05 23:03:23 +01:00
luc
5f9777f4af Publish Canary
- now@17.0.0-canary.35
2020-02-05 22:38:39 +01:00
Luc
e00db4437a [now-cli] Use npx when available to run dev command (#3749)
* use npx when available

* add --no-install

* replace $PORT and %PORT% in devCommand

* remove PORT from env variables

* replace more than one $PORT or %PORT%

* fix regex
2020-02-05 22:37:06 +01:00
14 changed files with 47 additions and 27 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@now/frameworks",
"version": "0.0.8",
"version": "0.0.9",
"main": "frameworks.json",
"license": "UNLICENSED"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@now/build-utils",
"version": "1.3.9-canary.0",
"version": "1.3.9",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/cgi",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "now",
"version": "17.0.0-canary.34",
"version": "17.0.0",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Now",
@@ -90,7 +90,7 @@
"@types/tar-fs": "1.16.1",
"@types/text-table": "0.2.0",
"@types/universal-analytics": "0.4.2",
"@types/which": "1.3.1",
"@types/which": "1.3.2",
"@types/write-json-file": "2.2.1",
"@zeit/dockerignore": "0.0.5",
"@zeit/fun": "0.11.2",
@@ -175,7 +175,7 @@
"universal-analytics": "0.4.20",
"update-check": "1.5.3",
"utility-types": "2.1.0",
"which": "1.3.1",
"which": "2.0.2",
"which-promise": "1.0.0",
"write-json-file": "2.2.0",
"xdg-app-paths": "5.1.0",

View File

@@ -17,6 +17,7 @@ import directoryTemplate from 'serve-handler/src/directory';
import getPort from 'get-port';
import { ChildProcess } from 'child_process';
import isPortReachable from 'is-port-reachable';
import which from 'which';
import {
Builder,
@@ -1651,24 +1652,36 @@ export default class DevServer {
const env: EnvConfig = {
...process.env,
...this.buildEnv,
PATH: `${yarnBinPath}${delimiter}${process.env.PATH}`,
NOW_REGION: 'dev1',
PORT: `${port}`,
};
const devCommand = this.devCommand
.replace(/\$PORT/g, `${port}`)
.replace(/%PORT%/g, `${port}`);
this.output.debug(
`Starting dev command with parameters : ${JSON.stringify({
cwd: this.cwd,
devCommand: this.devCommand,
devCommand,
port,
})}`
);
const p = spawnCommand(this.devCommand, {
stdio: 'inherit',
cwd,
env,
});
const isNpxAvailable = await which('npx')
.then(() => true)
.catch(() => false);
if (!isNpxAvailable) {
env.PATH = `${yarnBinPath}${delimiter}${env.PATH}`;
}
this.output.debug('Spawning dev command');
this.output.debug(`PATH is ${env.PATH}`);
const p = spawnCommand(
isNpxAvailable ? `npx --no-install ${devCommand}` : devCommand,
{ stdio: 'inherit', cwd, env }
);
p.on('exit', () => {
this.devProcessPort = undefined;

View File

@@ -1,6 +1,6 @@
{
"name": "now-client",
"version": "7.0.0-canary.3",
"version": "7.0.0",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://zeit.co",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/go",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://zeit.co/docs/runtimes#official-runtimes/go",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/next",
"version": "2.3.12",
"version": "2.3.13",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://zeit.co/docs/runtimes#official-runtimes/next-js",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/node",
"version": "1.4.0",
"version": "1.4.1",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://zeit.co/docs/runtimes#official-runtimes/node-js",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/python",
"version": "1.1.2",
"version": "1.1.3",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://zeit.co/docs/runtimes#official-runtimes/python",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/routing-utils",
"version": "1.5.2-canary.4",
"version": "1.5.2",
"description": "ZEIT Now routing utilities",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@@ -1,7 +1,7 @@
{
"name": "@now/ruby",
"author": "Nathan Cahill <nathan@nathancahill.com>",
"version": "1.0.2-canary.0",
"version": "1.0.2",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://zeit.co/docs/runtimes#official-runtimes/ruby",

View File

@@ -1,6 +1,6 @@
{
"name": "@now/static-build",
"version": "0.14.11",
"version": "0.14.12",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://zeit.co/docs/runtimes#official-runtimes/static-builds",

View File

@@ -1930,10 +1930,10 @@
"@types/webpack-sources" "*"
source-map "^0.6.0"
"@types/which@1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.3.1.tgz#7802c380887986ca909008afea4e08025b130f8d"
integrity sha512-ZrJDWpvg75LTGX4XwuneY9s6bF3OeZcGTpoGh3zDV9ytzcHMFsRrMIaLBRJZQMBoGyKs6unBQfVdrLZiYfb1zQ==
"@types/which@1.3.2":
version "1.3.2"
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.3.2.tgz#9c246fc0c93ded311c8512df2891fb41f6227fdf"
integrity sha512-8oDqyLC7eD4HM307boe2QWKyuzdzWBj56xI/imSl2cpL+U3tCMaTAkMJ4ee5JBZ/FsOJlvRGeIShiZDAl1qERA==
"@types/write-json-file@2.2.1":
version "2.2.1"
@@ -11121,13 +11121,20 @@ which-promise@1.0.0:
pinkie-promise "^1.0.0"
which "^1.1.2"
which@1, which@1.3.1, which@^1.1.2, which@^1.2.9, which@^1.3.0, which@^1.3.1:
which@1, which@^1.1.2, which@^1.2.9, which@^1.3.0, which@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
dependencies:
isexe "^2.0.0"
which@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
dependencies:
isexe "^2.0.0"
which@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.1.tgz#f1cf94d07a8e571b6ff006aeb91d0300c47ef0a4"