Compare commits

..

5 Commits

Author SHA1 Message Date
Steven
e232566cbe Publish Stable
- vercel@25.0.1
 - @vercel/node@2.0.1
2022-06-05 21:38:44 -04:00
Steven
592689cad1 Publish Canary
- vercel@25.0.1-canary.0
 - @vercel/node@2.0.1-canary.0
2022-06-05 20:58:34 -04:00
Steven
9b08e72f76 [node] Skip TS compile for .d.ts assets (#7918)
Fixes an issue where `.d.ts` assets were incorrectly being compiled after a fix to nft in https://github.com/vercel/nft/pull/289

- [Repro Steps](https://github.com/cheapsteak/repro-vercel-cli-build-dts-error)
- [Incident](https://app.kintaba.com/incident/755531679765890512)
- [Slack](https://vercel.slack.com/archives/C03JNHA844R/p1654334373086879)

<img src="https://user-images.githubusercontent.com/229881/172055403-d2edfe1d-3a60-459f-bf40-506fea1d1ca4.png" height=500 />
2022-06-06 00:36:41 +00:00
Sean Massa
bd0e10cfe7 [cli] update vc env pull --help (#7911)
* update `vc env pull --help`

* update `vc env pull` help documentation

* try longer timeout

* remove dupe "env"

* remove unused --env option

* Update packages/cli/src/commands/env/index.ts

Co-authored-by: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
2022-06-05 16:22:32 -05:00
Sean Massa
28436ade60 [tests] increase test timeout; it has been failing recently (#7913) 2022-06-03 10:06:36 -05:00
10 changed files with 53 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "25.0.0",
"version": "25.0.1",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -45,7 +45,7 @@
"@vercel/build-utils": "4.0.0",
"@vercel/go": "2.0.0",
"@vercel/next": "3.0.0",
"@vercel/node": "2.0.0",
"@vercel/node": "2.0.1",
"@vercel/python": "3.0.0",
"@vercel/redwood": "1.0.0",
"@vercel/remix": "1.0.0",

View File

@@ -42,6 +42,13 @@ const help = () => {
${chalk.dim('Examples:')}
${chalk.gray(
''
)} Pull all Development Environment Variables down from the cloud
${chalk.cyan(`$ ${getPkgName()} env pull <file>`)}
${chalk.cyan(`$ ${getPkgName()} env pull .env.development.local`)}
${chalk.gray('')} Add a new variable to multiple Environments
${chalk.cyan(`$ ${getPkgName()} env add <name>`)}

View File

@@ -25,7 +25,7 @@ import {
const help = () => {
return console.log(`
${chalk.bold(`${logo} ${getPkgName()} pull`)} [path]
${chalk.bold(`${logo} ${getPkgName()} pull`)} [project-path]
${chalk.dim('Options:')}
@@ -42,25 +42,29 @@ const help = () => {
${chalk.dim('Examples:')}
${chalk.gray('')} Pull the latest Project Settings from the cloud
${chalk.gray(
''
)} Pull the latest Environment Variables and Project Settings from the cloud
and stores them in \`.vercel/.env.\${target}.local\` and \`.vercel/project.json\` respectively.
${chalk.cyan(`$ ${getPkgName()} pull`)}
${chalk.cyan(`$ ${getPkgName()} pull ./path-to-project`)}
${chalk.cyan(`$ ${getPkgName()} pull --env .env.local`)}
${chalk.cyan(`$ ${getPkgName()} pull ./path-to-project --env .env.local`)}
${chalk.gray('')} Pull specific environment's Project Settings from the cloud
${chalk.gray('')} Pull for a specific environment
${chalk.cyan(
`$ ${getPkgName()} pull --environment=${getEnvTargetPlaceholder()}`
)}
${chalk.gray(
'If you want to download environment variables to a specific file, use `vercel env pull` instead.'
)}
`);
};
function processArgs(client: Client) {
return getArgs(client.argv.slice(2), {
'--yes': Boolean,
'--env': String, // deprecated
'--environment': String,
'--debug': Boolean,
'-d': '--debug',

View File

@@ -10,7 +10,7 @@ import {
import vercelNextPkg from '@vercel/next/package.json';
import vercelNodePkg from '@vercel/node/package.json';
jest.setTimeout(ms('20 seconds'));
jest.setTimeout(ms('30 seconds'));
describe('importBuilders()', () => {
it('should import built-in Builders', async () => {

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.0.0",
"version": "2.0.1",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",

View File

@@ -187,7 +187,10 @@ async function compile(
if (cached === null) return null;
try {
let source: string | Buffer = readFileSync(fsPath);
if (fsPath.endsWith('.ts') || fsPath.endsWith('.tsx')) {
if (
(fsPath.endsWith('.ts') && !fsPath.endsWith('.d.ts')) ||
fsPath.endsWith('.tsx')
) {
source = compileTypeScript(fsPath, source.toString());
}
const { mode } = lstatSync(fsPath);

View File

@@ -0,0 +1,9 @@
import { join } from 'path';
import { readFileSync } from 'fs';
const filePath = join(__dirname, 'test.d.ts');
const fileContent = readFileSync(filePath, 'utf8');
export default function handler(_req: any, res: any) {
res.end(fileContent);
}

View File

@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"@types/node": "^16.0.0"
}
}

View File

@@ -0,0 +1,3 @@
declare namespace Test {
// example .d.ts file
}

View File

@@ -0,0 +1,10 @@
{
"version": 2,
"builds": [{ "src": "index.ts", "use": "@vercel/node" }],
"probes": [
{
"path": "/",
"mustContain": "declare namespace Test"
}
]
}