mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-25 19:00:01 +00:00
Compare commits
24 Commits
@vercel/ru
...
refactor/c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
114199a0b7 | ||
|
|
b5e3d4f166 | ||
|
|
7ac796591f | ||
|
|
29585327e1 | ||
|
|
a0917206e2 | ||
|
|
f8d359b496 | ||
|
|
6c2c143c35 | ||
|
|
de7e07a90b | ||
|
|
22e1a6a9ce | ||
|
|
9a672d3b31 | ||
|
|
8391734b5e | ||
|
|
17627eee30 | ||
|
|
6a7fa1526c | ||
|
|
64b15d2409 | ||
|
|
40f73e7978 | ||
|
|
4c9ca27195 | ||
|
|
a847ef43fd | ||
|
|
3b466232a9 | ||
|
|
efdeea9db2 | ||
|
|
cd6f7a0e6f | ||
|
|
07f37454c0 | ||
|
|
2df1ae5fe6 | ||
|
|
0b7b500eb7 | ||
|
|
11cc079b69 |
1
.github/workflows/publish.yml
vendored
1
.github/workflows/publish.yml
vendored
@@ -61,6 +61,7 @@ jobs:
|
||||
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
|
||||
run: pnpm publish-from-github
|
||||
env:
|
||||
NPM_CONFIG_PROVENANCE: 'true'
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
|
||||
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -9,8 +9,8 @@ coverage.lcov
|
||||
*.swp
|
||||
*.bak
|
||||
*.tgz
|
||||
packages/cli/src/util/dev/templates/*.ts
|
||||
packages/cli/src/util/constants.ts
|
||||
internals/utils/src/dev/templates/*.ts
|
||||
internals/utils/src/constants.ts
|
||||
packages/cli/test/**/yarn.lock
|
||||
!packages/cli/test/dev/**/yarn.lock
|
||||
packages/cli/test/**/node_modules
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { RemixServer } from "@remix-run/react";
|
||||
import { handleRequest } from "@vercel/remix";
|
||||
import type { EntryContext } from "@vercel/remix";
|
||||
|
||||
export default function (
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext
|
||||
) {
|
||||
const remixServer = <RemixServer context={remixContext} url={request.url} />;
|
||||
return handleRequest(
|
||||
request,
|
||||
responseStatusCode,
|
||||
responseHeaders,
|
||||
remixServer
|
||||
);
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"dev": "remix dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/node": "^1.14.3",
|
||||
"@remix-run/react": "^1.14.3",
|
||||
"@remix-run/serve": "^1.14.3",
|
||||
"@vercel/analytics": "^0.1.11",
|
||||
|
||||
2
examples/remix/pnpm-lock.yaml
generated
2
examples/remix/pnpm-lock.yaml
generated
@@ -6,6 +6,7 @@ importers:
|
||||
specifiers:
|
||||
'@remix-run/dev': ^1.14.3
|
||||
'@remix-run/eslint-config': ^1.14.3
|
||||
'@remix-run/node': ^1.14.3
|
||||
'@remix-run/react': ^1.14.3
|
||||
'@remix-run/serve': ^1.14.3
|
||||
'@types/react': ^18.0.25
|
||||
@@ -17,6 +18,7 @@ importers:
|
||||
react-dom: ^18.2.0
|
||||
typescript: ^4.9.3
|
||||
dependencies:
|
||||
'@remix-run/node': 1.14.3
|
||||
'@remix-run/react': 1.14.3_biqbaboplfbrettd7655fr4n2y
|
||||
'@remix-run/serve': 1.14.3
|
||||
'@vercel/analytics': 0.1.11_react@18.2.0
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
"allowJs": true,
|
||||
"moduleResolution": "node",
|
||||
"module": "commonjs",
|
||||
"target": "ES2020",
|
||||
"lib": ["ES2020"],
|
||||
"resolveJsonModule": true,
|
||||
"sourceMap": true
|
||||
"sourceMap": true,
|
||||
// style-guide enables this but our repo doesn't and it causes type issues
|
||||
"noUncheckedIndexedAccess": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BuilderFunctions } from '@vercel/build-utils';
|
||||
import type { BuilderFunctions, Builder } from '@vercel/build-utils';
|
||||
import type { Readable, Writable } from 'stream';
|
||||
import type { Route } from '@vercel/routing-utils';
|
||||
|
||||
@@ -584,3 +584,21 @@ export interface Stdio {
|
||||
stdout: WritableTTY;
|
||||
stderr: WritableTTY;
|
||||
}
|
||||
|
||||
export interface SerializedBuilder extends Builder {
|
||||
error?: any;
|
||||
require?: string;
|
||||
requirePath?: string;
|
||||
apiVersion: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contents of the `builds.json` file.
|
||||
*/
|
||||
export interface BuildsManifest {
|
||||
'//': string;
|
||||
target: string;
|
||||
argv: string[];
|
||||
error?: any;
|
||||
builds?: SerializedBuilder[];
|
||||
}
|
||||
|
||||
@@ -1,17 +1,134 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/utils",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/internals/utils/src/index.d.ts",
|
||||
"main": "dist/internals/utils/src/index.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
"compile-templates": "node scripts/compile-templates.js",
|
||||
"generate-constants": "ts-node scripts/generate-constants.ts",
|
||||
"build": "pnpm generate-constants && pnpm compile-templates && tsc -p tsconfig.json",
|
||||
"test": "jest --env node --verbose --bail tests"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/node": "5.5.0",
|
||||
"@sindresorhus/slugify": "0.11.0",
|
||||
"@tootallnate/once": "1.1.2",
|
||||
"@vercel-internals/types": "*",
|
||||
"@vercel/build-utils": "*",
|
||||
"@vercel/client": "*",
|
||||
"@vercel/error-utils": "*",
|
||||
"@vercel/frameworks": "*",
|
||||
"@vercel/fs-detectors": "*",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/routing-utils": "*",
|
||||
"ajv": "6.12.2",
|
||||
"ansi-escapes": "4.3.2",
|
||||
"arg": "5.0.0",
|
||||
"async-listen": "1.2.0",
|
||||
"async-retry": "1.1.3",
|
||||
"bytes": "3.0.0",
|
||||
"chalk": "4.1.0",
|
||||
"chokidar": "3.3.1",
|
||||
"date-fns": "1.29.0",
|
||||
"dotenv": "4.0.0",
|
||||
"escape-html": "1.0.3",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"fs-extra": "10.0.0",
|
||||
"get-port": "5.1.1",
|
||||
"git-last-commit": "1.0.1",
|
||||
"http-proxy": "1.18.1",
|
||||
"ini": "3.0.0",
|
||||
"inquirer": "7.0.4",
|
||||
"is-docker": "2.2.1",
|
||||
"is-port-reachable": "3.1.0",
|
||||
"jsonlines": "0.1.1",
|
||||
"load-json-file": "3.0.0",
|
||||
"mime-types": "2.1.24",
|
||||
"minimatch": "3.0.4",
|
||||
"ms": "2.1.2",
|
||||
"node-fetch": "2.6.7",
|
||||
"npm-package-arg": "6.1.0",
|
||||
"open": "8.4.0",
|
||||
"ora": "3.4.0",
|
||||
"pcre-to-regexp": "1.0.0",
|
||||
"pluralize": "7.0.0",
|
||||
"promisepipe": "3.0.0",
|
||||
"psl": "1.1.31",
|
||||
"raw-body": "2.4.1",
|
||||
"semver": "5.5.0",
|
||||
"serve-handler": "6.1.1",
|
||||
"strip-ansi": "6.0.1",
|
||||
"supports-hyperlinks": "2.2.0",
|
||||
"text-table": "0.2.0",
|
||||
"title": "3.4.1",
|
||||
"tree-kill": "1.2.2",
|
||||
"universal-analytics": "0.4.20",
|
||||
"write-json-file": "2.2.0",
|
||||
"xdg-app-paths": "5.1.0",
|
||||
"yauzl-promise": "2.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/async-retry": "1.2.1",
|
||||
"@types/bytes": "3.0.0",
|
||||
"@types/chance": "1.1.3",
|
||||
"@types/dotenv": "6.1.1",
|
||||
"@types/escape-html": "0.0.20",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"@types/http-proxy": "1.16.2",
|
||||
"@types/ini": "1.3.31",
|
||||
"@types/inquirer": "7.3.1",
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/jsonlines": "0.1.2",
|
||||
"@types/load-json-file": "2.0.7",
|
||||
"@types/mime-types": "2.1.0",
|
||||
"@types/minimatch": "3.0.3",
|
||||
"@types/ms": "0.7.30",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/node-fetch": "2.5.10",
|
||||
"@types/npm-package-arg": "6.1.0",
|
||||
"@types/pluralize": "0.0.29",
|
||||
"@types/psl": "1.1.0",
|
||||
"@types/semver": "6.0.1",
|
||||
"@types/serve-handler": "6.1.1",
|
||||
"@types/text-table": "0.2.0",
|
||||
"@types/title": "3.4.1",
|
||||
"@types/universal-analytics": "0.4.2",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel-internals/tsconfig": "*",
|
||||
"@vercel/next": "*",
|
||||
"@vercel/node": "*",
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
"chance": "1.1.7",
|
||||
"execa": "3.2.0",
|
||||
"expect": "29.5.0",
|
||||
"express": "4.17.1",
|
||||
"find-up": "4.1.0",
|
||||
"jest-matcher-utils": "29.3.1",
|
||||
"line-async-iterator": "3.0.0",
|
||||
"tmp-promise": "1.0.3",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "4.9.4"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"globals": {
|
||||
"ts-jest": {
|
||||
"diagnostics": false,
|
||||
"isolatedModules": true
|
||||
}
|
||||
},
|
||||
"setupFilesAfterEnv": [
|
||||
"@alex_neo/jest-expect-message"
|
||||
],
|
||||
"verbose": false,
|
||||
"testEnvironment": "node",
|
||||
"testMatch": [
|
||||
"<rootDir>/tests/**/*.test.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ async function main() {
|
||||
const dirRoot = join(__dirname, '..');
|
||||
|
||||
// Compile the `doT.js` template files for `vercel dev`
|
||||
const templatesDir = join(dirRoot, 'src/util/dev/templates');
|
||||
const templatesDir = join(dirRoot, 'src/dev/templates');
|
||||
const dotPacker = join(dirRoot, '../../node_modules/dot/bin/dot-packer');
|
||||
await execa(process.execPath, [dotPacker], {
|
||||
cwd: templatesDir,
|
||||
23
internals/utils/scripts/generate-constants.ts
Normal file
23
internals/utils/scripts/generate-constants.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { join } from 'path';
|
||||
import { writeFileSync } from 'fs';
|
||||
|
||||
const dirRoot = join(__dirname, '..');
|
||||
|
||||
function envToString(key: string) {
|
||||
const value = process.env[key];
|
||||
if (!value) {
|
||||
console.log(`- Constant ${key} is not assigned`);
|
||||
}
|
||||
return JSON.stringify(value);
|
||||
}
|
||||
|
||||
console.log('Creating constants.ts');
|
||||
const filename = join(dirRoot, 'src/constants.ts');
|
||||
const contents = `// This file is auto-generated
|
||||
export const GA_TRACKING_ID: string | undefined = ${envToString(
|
||||
'GA_TRACKING_ID'
|
||||
)};
|
||||
export const SENTRY_DSN: string | undefined = ${envToString('SENTRY_DSN')};
|
||||
`;
|
||||
|
||||
writeFileSync(filename, contents, 'utf8');
|
||||
4
internals/utils/scripts/tsconfig.json
Normal file
4
internals/utils/scripts/tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"include": ["./**/*"]
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { homedir } from 'os';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import XDGAppPaths from 'xdg-app-paths';
|
||||
import getArgs from '../../util/get-args';
|
||||
import getArgs from '../get-args';
|
||||
|
||||
// Returns whether a directory exists
|
||||
export const isDirectory = (path: string): boolean => {
|
||||
@@ -2,7 +2,7 @@ import path from 'path';
|
||||
import { existsSync } from 'fs';
|
||||
import { InvalidLocalConfig } from '../errors';
|
||||
import { ConflictingConfigFiles } from '../errors-ts';
|
||||
import getArgs from '../../util/get-args';
|
||||
import getArgs from '../get-args';
|
||||
|
||||
export default function getLocalPathConfig(prefix: string) {
|
||||
let customPath: string | undefined;
|
||||
@@ -1,5 +1,5 @@
|
||||
import stripeFactory from 'stripe';
|
||||
import Now from '.';
|
||||
import Now from './now';
|
||||
|
||||
const stripe = stripeFactory('pk_live_alyEi3lN0kSwbdevK0nrGwTw');
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as ERRORS from '../errors';
|
||||
import { NowError } from '../now-error';
|
||||
import mapCertError from '../certs/map-cert-error';
|
||||
import { Org } from '@vercel-internals/types';
|
||||
import Now, { CreateOptions } from '..';
|
||||
import Now, { CreateOptions } from '../now';
|
||||
import Client from '../client';
|
||||
import { ArchiveFormat, DeploymentError } from '@vercel/client';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fs from 'fs-extra';
|
||||
import { join } from 'path';
|
||||
import { BuildsManifest } from '../../commands/build';
|
||||
import { BuildsManifest } from '@vercel-internals/types';
|
||||
|
||||
export default async function getPrebuiltJson(
|
||||
directory: string
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Output } from '../../util/output';
|
||||
import param from '../../util/output/param';
|
||||
import code from '../../util/output/code';
|
||||
import { Output } from '../output';
|
||||
import param from '../output/param';
|
||||
import code from '../output/code';
|
||||
|
||||
/**
|
||||
* Parses the environment target from the `--target` and `--prod` flags.
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '@vercel/client';
|
||||
import { Output } from '../output';
|
||||
import { progress } from '../output/progress';
|
||||
import Now from '../../util';
|
||||
import Now from '../now';
|
||||
import { Org } from '@vercel-internals/types';
|
||||
import ua from '../ua';
|
||||
import { linkFolderToProject } from '../projects/link';
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user