mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-12 12:57:47 +00:00
Compare commits
145 Commits
@vercel/py
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15c7ad241a | ||
|
|
ec57654b5b | ||
|
|
3b9a9878bc | ||
|
|
70b7db1a15 | ||
|
|
41d6666139 | ||
|
|
2857219f89 | ||
|
|
246c2a0f5d | ||
|
|
d91bca7d6b | ||
|
|
be54fce67b | ||
|
|
7753bb8d89 | ||
|
|
ce17ac5c35 | ||
|
|
8006fc32b8 | ||
|
|
8038a90db1 | ||
|
|
f88c862e9d | ||
|
|
9170820371 | ||
|
|
c881546e0e | ||
|
|
fa21db98e4 | ||
|
|
8eabbfc666 | ||
|
|
6783f7afc9 | ||
|
|
a400b9b29d | ||
|
|
b549c37149 | ||
|
|
30d5e64291 | ||
|
|
47c2c361d2 | ||
|
|
438576fc7c | ||
|
|
b30343ef7b | ||
|
|
2dc0dfa572 | ||
|
|
9ee54b3dd6 | ||
|
|
9d67e0bc06 | ||
|
|
466135cf84 | ||
|
|
eab2e229dc | ||
|
|
698b89a2ba | ||
|
|
bae2a2e4df | ||
|
|
57916bb712 | ||
|
|
12bbd4e8eb | ||
|
|
4e4c7023dc | ||
|
|
41805790e7 | ||
|
|
6ad77ae8e1 | ||
|
|
e8daf36cd7 | ||
|
|
c319a2c499 | ||
|
|
a410baa797 | ||
|
|
625568e659 | ||
|
|
41868c1fe0 | ||
|
|
1b644f1218 | ||
|
|
29ea0fb06b | ||
|
|
b61f049f11 | ||
|
|
16e28f326b | ||
|
|
276397c940 | ||
|
|
85d7311199 | ||
|
|
b8114b8b39 | ||
|
|
d63e8d3187 | ||
|
|
11d3dd04aa | ||
|
|
46bf95ee36 | ||
|
|
92252468c2 | ||
|
|
71b83d5587 | ||
|
|
d9e5fdc5e4 | ||
|
|
58f479c603 | ||
|
|
d62461d952 | ||
|
|
e7f524defb | ||
|
|
bdefd0d05d | ||
|
|
ca522fc9f1 | ||
|
|
4a8504fc45 | ||
|
|
576217b344 | ||
|
|
f03129ac7a | ||
|
|
3eaad1fd52 | ||
|
|
4e471491d8 | ||
|
|
99395fd9fe | ||
|
|
4980fe6513 | ||
|
|
24676ae020 | ||
|
|
72ada9abd8 | ||
|
|
da893e7c57 | ||
|
|
e40eecafc9 | ||
|
|
d9e5342eba | ||
|
|
b0ab13778d | ||
|
|
c76dfbe8c9 | ||
|
|
ed6f3cc27e | ||
|
|
7b0186bffe | ||
|
|
45e22b6b60 | ||
|
|
b2bfae6e2e | ||
|
|
b6ed718f52 | ||
|
|
a84c4a37e6 | ||
|
|
d2ba06c6cb | ||
|
|
06e7753df0 | ||
|
|
235a9c3300 | ||
|
|
1b70402325 | ||
|
|
c76781fac9 | ||
|
|
451e0b0cfb | ||
|
|
cf477d45b2 | ||
|
|
cdd2d69e07 | ||
|
|
43f1f8b257 | ||
|
|
34055e3599 | ||
|
|
26abb0a85a | ||
|
|
a1e337e0dd | ||
|
|
b72ead480f | ||
|
|
77cf68105f | ||
|
|
d800f55dfa | ||
|
|
9dde99f19e | ||
|
|
fae7a083fc | ||
|
|
cbd651d6ee | ||
|
|
6077a706d1 | ||
|
|
cedc82dd9e | ||
|
|
b420006401 | ||
|
|
8ba604e8fc | ||
|
|
fadeee4568 | ||
|
|
2b15ba7f46 | ||
|
|
4cdfd0e58c | ||
|
|
b3ccb5f3ef | ||
|
|
584acc43b7 | ||
|
|
f64be93b94 | ||
|
|
9abd31769e | ||
|
|
09e3b35e74 | ||
|
|
8aa9a0ea05 | ||
|
|
b2d0ed74c6 | ||
|
|
aef936af0f | ||
|
|
501be936c0 | ||
|
|
7eba282af5 | ||
|
|
cf3e4bd726 | ||
|
|
ee5361b00e | ||
|
|
bd929dd5c5 | ||
|
|
4ee064bb61 | ||
|
|
312a2090a6 | ||
|
|
a82f117217 | ||
|
|
e908378486 | ||
|
|
8cda5263eb | ||
|
|
a24fd64bce | ||
|
|
0c515a46d5 | ||
|
|
f19690dc32 | ||
|
|
6b2a1c3866 | ||
|
|
1e54d606d7 | ||
|
|
c4ab0ebe9c | ||
|
|
321f1232a1 | ||
|
|
8a8203e149 | ||
|
|
33527165e7 | ||
|
|
db10383bc8 | ||
|
|
56960e506e | ||
|
|
a17f3a96ec | ||
|
|
9ff86a896c | ||
|
|
6ccb4354f9 | ||
|
|
82ba932447 | ||
|
|
b995618afb | ||
|
|
c897b24417 | ||
|
|
e64b2e1993 | ||
|
|
9358a5469e | ||
|
|
2a24210b7d | ||
|
|
2644a59984 | ||
|
|
4eeb8c298c |
@@ -1,7 +1,12 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
examples
|
examples
|
||||||
|
|
||||||
|
packages/node/src/bridge.ts
|
||||||
|
|
||||||
packages/*/test/fixtures
|
packages/*/test/fixtures
|
||||||
|
|
||||||
|
# cli
|
||||||
packages/cli/@types
|
packages/cli/@types
|
||||||
packages/cli/download
|
packages/cli/download
|
||||||
packages/cli/dist
|
packages/cli/dist
|
||||||
@@ -9,11 +14,24 @@ packages/cli/test/dev/fixtures
|
|||||||
packages/cli/bin
|
packages/cli/bin
|
||||||
packages/cli/link
|
packages/cli/link
|
||||||
packages/cli/src/util/dev/templates/*.ts
|
packages/cli/src/util/dev/templates/*.ts
|
||||||
|
|
||||||
|
# client
|
||||||
packages/client/tests/fixtures
|
packages/client/tests/fixtures
|
||||||
packages/client/lib
|
packages/client/lib
|
||||||
packages/node/src/bridge.ts
|
|
||||||
|
# node-bridge
|
||||||
packages/node-bridge/bridge.js
|
packages/node-bridge/bridge.js
|
||||||
packages/node-bridge/launcher.js
|
packages/node-bridge/launcher.js
|
||||||
packages/node-bridge/helpers.js
|
packages/node-bridge/helpers.js
|
||||||
packages/node-bridge/source-map-support.js
|
packages/node-bridge/source-map-support.js
|
||||||
|
|
||||||
|
# middleware
|
||||||
packages/middleware/src/entries.js
|
packages/middleware/src/entries.js
|
||||||
|
|
||||||
|
# static-build
|
||||||
|
packages/static-build/test/fixtures
|
||||||
|
packages/static-build/test/build-fixtures
|
||||||
|
packages/static-build/test/cache-fixtures
|
||||||
|
|
||||||
|
# redwood
|
||||||
|
packages/redwood/test/fixtures
|
||||||
|
|||||||
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
@@ -16,17 +16,17 @@ yarn install
|
|||||||
yarn bootstrap
|
yarn bootstrap
|
||||||
yarn build
|
yarn build
|
||||||
yarn lint
|
yarn lint
|
||||||
yarn test
|
yarn test-unit
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure all the tests pass before making changes.
|
Make sure all the tests pass before making changes.
|
||||||
|
|
||||||
## Verifying your change
|
## Verifying your change
|
||||||
|
|
||||||
Once you are done with your changes (we even suggest doing it along the way), make sure all the test still run by running:
|
Once you are done with your changes (we even suggest doing it along the way), make sure all the test still pass by running:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn build && yarn test
|
yarn test-unit
|
||||||
```
|
```
|
||||||
|
|
||||||
from the root of the project.
|
from the root of the project.
|
||||||
|
|||||||
2
.github/workflows/test-integration-cli.yml
vendored
2
.github/workflows/test-integration-cli.yml
vendored
@@ -11,7 +11,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: CLI
|
name: CLI
|
||||||
timeout-minutes: 30
|
timeout-minutes: 40
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
!.yarnrc
|
!.yarnrc
|
||||||
!yarn.lock
|
!yarn.lock
|
||||||
!package.json
|
!package.json
|
||||||
|
!turbo.json
|
||||||
|
|
||||||
# api
|
# api
|
||||||
!api/
|
!api/
|
||||||
@@ -14,4 +15,4 @@
|
|||||||
# packages
|
# packages
|
||||||
!packages/
|
!packages/
|
||||||
!packages/frameworks
|
!packages/frameworks
|
||||||
!packages/frameworks/**
|
!packages/frameworks/**
|
||||||
@@ -9,7 +9,6 @@ A Runtime is an npm module that implements the following interface:
|
|||||||
interface Runtime {
|
interface Runtime {
|
||||||
version: number;
|
version: number;
|
||||||
build: (options: BuildOptions) => Promise<BuildResult>;
|
build: (options: BuildOptions) => Promise<BuildResult>;
|
||||||
analyze?: (options: AnalyzeOptions) => Promise<string>;
|
|
||||||
prepareCache?: (options: PrepareCacheOptions) => Promise<CacheOutputs>;
|
prepareCache?: (options: PrepareCacheOptions) => Promise<CacheOutputs>;
|
||||||
shouldServe?: (options: ShouldServeOptions) => Promise<boolean>;
|
shouldServe?: (options: ShouldServeOptions) => Promise<boolean>;
|
||||||
startDevServer?: (
|
startDevServer?: (
|
||||||
@@ -72,26 +71,6 @@ export async function build(options: BuildOptions) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `analyze()`
|
|
||||||
|
|
||||||
An **optional** exported function that returns a unique fingerprint used for the
|
|
||||||
purpose of [build
|
|
||||||
de-duplication](https://vercel.com/docs/v2/platform/deployments#deduplication).
|
|
||||||
If the `analyze()` function is not supplied, then a random fingerprint is
|
|
||||||
assigned to each build.
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { AnalyzeOptions } from '@vercel/build-utils';
|
|
||||||
|
|
||||||
export async function analyze(options: AnalyzeOptions) {
|
|
||||||
// Do calculations to generate a fingerprint based off the source code here…
|
|
||||||
|
|
||||||
return 'fingerprint goes here';
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `prepareCache()`
|
### `prepareCache()`
|
||||||
|
|
||||||
An **optional** exported function that is executed after [`build()`](#build) is
|
An **optional** exported function that is executed after [`build()`](#build) is
|
||||||
@@ -328,15 +307,15 @@ This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
|
|||||||
|
|
||||||
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
|
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
|
||||||
|
|
||||||
|
- `nodejs14.x`
|
||||||
- `nodejs12.x`
|
- `nodejs12.x`
|
||||||
- `nodejs10.x`
|
|
||||||
- `go1.x`
|
- `go1.x`
|
||||||
- `java11`
|
- `java11`
|
||||||
- `python3.9`
|
- `python3.9`
|
||||||
- `python3.6`
|
- `dotnet6`
|
||||||
- `dotnetcore2.1`
|
- `dotnetcore3.1`
|
||||||
- `ruby2.5`
|
- `ruby2.7`
|
||||||
- `provided`
|
- `provided.al2`
|
||||||
|
|
||||||
## `@vercel/build-utils` Helper Functions
|
## `@vercel/build-utils` Helper Functions
|
||||||
|
|
||||||
|
|||||||
46
api/_lib/script/build.ts
Normal file
46
api/_lib/script/build.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import fs from 'fs/promises';
|
||||||
|
import { join } from 'path';
|
||||||
|
import { getExampleList } from '../examples/example-list';
|
||||||
|
import { mapOldToNew } from '../examples/map-old-to-new';
|
||||||
|
|
||||||
|
const repoRoot = join(__dirname, '..', '..', '..');
|
||||||
|
const pubDir = join(repoRoot, 'public');
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
console.log(`Building static frontend ${repoRoot}...`);
|
||||||
|
|
||||||
|
await fs.rm(pubDir, { recursive: true, force: true });
|
||||||
|
await fs.mkdir(pubDir);
|
||||||
|
|
||||||
|
const examples = await getExampleList();
|
||||||
|
const pathListAll = join(pubDir, 'list-all.json');
|
||||||
|
await fs.writeFile(pathListAll, JSON.stringify(examples));
|
||||||
|
|
||||||
|
const exampleDirs = await fs.readdir(join(repoRoot, 'examples'), {
|
||||||
|
withFileTypes: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const existingExamples = exampleDirs
|
||||||
|
.filter(dir => dir.isDirectory())
|
||||||
|
.map(dir => ({
|
||||||
|
name: dir.name,
|
||||||
|
visible: true,
|
||||||
|
suggestions: [],
|
||||||
|
}));
|
||||||
|
|
||||||
|
const oldExamples = Object.keys(mapOldToNew).map(key => ({
|
||||||
|
name: key,
|
||||||
|
visible: false,
|
||||||
|
suggestions: mapOldToNew[key],
|
||||||
|
}));
|
||||||
|
|
||||||
|
const pathList = join(pubDir, 'list.json');
|
||||||
|
await fs.writeFile(
|
||||||
|
pathList,
|
||||||
|
JSON.stringify([...existingExamples, ...oldExamples])
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('Completed building static frontend.');
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch(console.error);
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
|
||||||
import { getExampleList } from '../_lib/examples/example-list';
|
|
||||||
import { withApiHandler } from '../_lib/util/with-api-handler';
|
|
||||||
|
|
||||||
export default withApiHandler(async function (
|
|
||||||
req: VercelRequest,
|
|
||||||
res: VercelResponse
|
|
||||||
) {
|
|
||||||
res.status(200).json(await getExampleList());
|
|
||||||
});
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import { extract } from '../_lib/examples/extract';
|
|
||||||
import { summary } from '../_lib/examples/summary';
|
|
||||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
|
||||||
import { mapOldToNew } from '../_lib/examples/map-old-to-new';
|
|
||||||
import { withApiHandler } from '../_lib/util/with-api-handler';
|
|
||||||
|
|
||||||
export default withApiHandler(async function (
|
|
||||||
req: VercelRequest,
|
|
||||||
res: VercelResponse
|
|
||||||
) {
|
|
||||||
await extract('https://github.com/vercel/vercel/archive/main.zip', '/tmp');
|
|
||||||
const exampleList = summary('/tmp/vercel-main/examples');
|
|
||||||
|
|
||||||
const existingExamples = Array.from(exampleList).map(key => ({
|
|
||||||
name: key,
|
|
||||||
visible: true,
|
|
||||||
suggestions: [],
|
|
||||||
}));
|
|
||||||
|
|
||||||
const oldExamples = Object.keys(mapOldToNew).map(key => ({
|
|
||||||
name: key,
|
|
||||||
visible: false,
|
|
||||||
suggestions: mapOldToNew[key],
|
|
||||||
}));
|
|
||||||
|
|
||||||
res.status(200).json([...existingExamples, ...oldExamples]);
|
|
||||||
});
|
|
||||||
@@ -16,4 +16,4 @@ If you would not like to verify your domain, you can remove it from your account
|
|||||||
|
|
||||||
#### Resources
|
#### Resources
|
||||||
|
|
||||||
- [Vercel Custom Domains Documentation](https://vercel.com/docs/v2/custom-domains)
|
- [Vercel Custom Domains Documentation](https://vercel.com/docs/concepts/projects/custom-domains)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#### Why This Error Occurred
|
#### Why This Error Occurred
|
||||||
|
|
||||||
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/v2/build-step#environment-variables).
|
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/concepts/projects/environment-variables).
|
||||||
|
|
||||||
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
|
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
|
||||||
|
|
||||||
@@ -24,4 +24,4 @@ TEST=value
|
|||||||
|
|
||||||
In the above example, `TEST` represents the name of the environment variable and `value` its value.
|
In the above example, `TEST` represents the name of the environment variable and `value` its value.
|
||||||
|
|
||||||
For more information on Environment Variables in development, [see the documentation](https://vercel.com/docs/v2/build-step#environment-variables).
|
For more information on Environment Variables in development, [see the documentation](https://vercel.com/docs/concepts/projects/environment-variables).
|
||||||
|
|||||||
1
examples/amp/.gitignore
vendored
1
examples/amp/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
.env
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# AMP Example
|
|
||||||
|
|
||||||
This directory is a brief example of an [AMP](https://amp.dev/) site that can be deployed to Vercel with zero configuration.
|
|
||||||
|
|
||||||
## Deploy Your Own
|
|
||||||
|
|
||||||
Deploy your own AMP project with Vercel.
|
|
||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/amp)
|
|
||||||
|
|
||||||
_Live Example: https://amp-template.vercel.app_
|
|
||||||
|
|
||||||
### How We Created This Example
|
|
||||||
|
|
||||||
To get started deploying AMP with Vercel, you can use the [Vercel CLI](https://vercel.com/download) to initialize the project:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ vercel init amp
|
|
||||||
```
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -1,72 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html ⚡>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width,minimum-scale=1" />
|
|
||||||
<link rel="shortcut icon" href="favicon.png">
|
|
||||||
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
|
||||||
<link rel="canonical" href="index.html" />
|
|
||||||
<title>AMP Website</title>
|
|
||||||
<script async src="https://cdn.ampproject.org/v0.js"></script>
|
|
||||||
<style amp-custom>
|
|
||||||
body > * {
|
|
||||||
margin: 3rem 1rem;
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
||||||
color: #525252;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
margin-top: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.links {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.links a {
|
|
||||||
margin: 0 10px;
|
|
||||||
font-size: 1rem;
|
|
||||||
color: #005af0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<center>
|
|
||||||
<amp-img width=150 height=150 layout="fixed" class="logo" src="logo.png"></amp-img>
|
|
||||||
<h3>Welcome to your AMP page</h3>
|
|
||||||
<p>AMP is a web component framework to <br> easily create user-first websites, stories, ads and emails.</p>
|
|
||||||
|
|
||||||
<h4>Links</h4>
|
|
||||||
<div class="links">
|
|
||||||
<a href="https://amp.dev/">Homepage</a>
|
|
||||||
<a href="https://amp.dev/documentation/guides-and-tutorials/?format=websites">Tutorials</a>
|
|
||||||
<a href="https://amp.dev/documentation/examples/">Examples</a>
|
|
||||||
<a href="https://blog.amp.dev">Blog</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4>Ready to get started?</h4>
|
|
||||||
<div class="links">
|
|
||||||
<a href="https://amp.dev/documentation/guides-and-tutorials/start/create/?format=websites">Create your first AMP page</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4>Get involved</h4>
|
|
||||||
<div class="links">
|
|
||||||
<a href="https://twitter.com/amphtml">Twitter</a>
|
|
||||||
<a href="https://amphtml.slack.com">Slack</a>
|
|
||||||
<a href="https://amp.dev/events/amp-conf-2019">AMP Conf</a>
|
|
||||||
<a href="https://amp.dev/events/amp-roadshow">AMP Roadshow</a>
|
|
||||||
</div>
|
|
||||||
</center>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
@@ -10,7 +10,7 @@ Deploy your own Angular project with Vercel.
|
|||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/angular&template=angular)
|
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/angular&template=angular)
|
||||||
|
|
||||||
_Live Example: https://angular-now-examples.vercel.app_
|
_Live Example: https://angular-template.vercel.app_
|
||||||
|
|
||||||
## Development server
|
## Development server
|
||||||
|
|
||||||
|
|||||||
20
examples/astro/.gitignore
vendored
Normal file
20
examples/astro/.gitignore
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# build output
|
||||||
|
dist/
|
||||||
|
.output/
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# logs
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
|
||||||
|
# environment variables
|
||||||
|
.env
|
||||||
|
.env.production
|
||||||
|
|
||||||
|
# macOS-specific files
|
||||||
|
.DS_Store
|
||||||
2
examples/astro/.npmrc
Normal file
2
examples/astro/.npmrc
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Expose Astro dependencies for `pnpm` users
|
||||||
|
shamefully-hoist=true
|
||||||
1
examples/astro/.vercelignore
Normal file
1
examples/astro/.vercelignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
README.md
|
||||||
42
examples/astro/README.md
Normal file
42
examples/astro/README.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Welcome to [Astro](https://astro.build)
|
||||||
|
|
||||||
|
[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/starter)
|
||||||
|
|
||||||
|
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
||||||
|
|
||||||
|
## 🚀 Project Structure
|
||||||
|
|
||||||
|
Inside of your Astro project, you'll see the following folders and files:
|
||||||
|
|
||||||
|
```
|
||||||
|
/
|
||||||
|
├── public/
|
||||||
|
│ └── favicon.ico
|
||||||
|
├── src/
|
||||||
|
│ ├── components/
|
||||||
|
│ │ └── Layout.astro
|
||||||
|
│ └── pages/
|
||||||
|
│ └── index.astro
|
||||||
|
└── package.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
||||||
|
|
||||||
|
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components or layouts.
|
||||||
|
|
||||||
|
Any static assets, like images, can be placed in the `public/` directory.
|
||||||
|
|
||||||
|
## 🧞 Commands
|
||||||
|
|
||||||
|
All commands are run from the root of the project, from a terminal:
|
||||||
|
|
||||||
|
| Command | Action |
|
||||||
|
| :---------------- | :------------------------------------------- |
|
||||||
|
| `npm install` | Installs dependencies |
|
||||||
|
| `npm run dev` | Starts local dev server at `localhost:3000` |
|
||||||
|
| `npm run build` | Build your production site to `./dist/` |
|
||||||
|
| `npm run preview` | Preview your build locally, before deploying |
|
||||||
|
|
||||||
|
## 👀 Want to learn more?
|
||||||
|
|
||||||
|
Feel free to check [our documentation](https://github.com/withastro/astro) or jump into our [Discord server](https://astro.build/chat).
|
||||||
4
examples/astro/astro.config.mjs
Normal file
4
examples/astro/astro.config.mjs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
|
// https://astro.build/config
|
||||||
|
export default defineConfig({});
|
||||||
14
examples/astro/package.json
Normal file
14
examples/astro/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "@example/basics",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "astro dev",
|
||||||
|
"start": "astro dev",
|
||||||
|
"build": "astro build",
|
||||||
|
"preview": "astro preview"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"astro": "^1.0.0-beta.20"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
examples/astro/public/favicon.ico
Normal file
BIN
examples/astro/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
55
examples/astro/src/components/Layout.astro
Normal file
55
examples/astro/src/components/Layout.astro
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
export interface Props {
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { title } = Astro.props as Props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||||
|
<title>{title}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<slot />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--font-size-base: clamp(1rem, 0.34vw + 0.91rem, 1.19rem);
|
||||||
|
--font-size-lg: clamp(1.2rem, 0.7vw + 1.2rem, 1.5rem);
|
||||||
|
--font-size-xl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
|
||||||
|
|
||||||
|
--color-text: hsl(12, 5%, 4%);
|
||||||
|
--color-bg: hsl(10, 21%, 95%);
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: system-ui, sans-serif;
|
||||||
|
font-size: var(--font-size-base);
|
||||||
|
color: var(--color-text);
|
||||||
|
background-color: var(--color-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(h1) {
|
||||||
|
font-size: var(--font-size-xl);
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(h2) {
|
||||||
|
font-size: var(--font-size-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(code) {
|
||||||
|
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||||
|
Bitstream Vera Sans Mono, Courier New, monospace;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
174
examples/astro/src/pages/index.astro
Normal file
174
examples/astro/src/pages/index.astro
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
---
|
||||||
|
import Layout from '../components/Layout.astro';
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout title="Welcome to Astro.">
|
||||||
|
<main>
|
||||||
|
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
|
||||||
|
<p class="instructions"><strong>Your first mission:</strong> tweak this message to try our hot module reloading. Check the <code>src/pages</code> directory!</p>
|
||||||
|
<ul role="list" class="link-card-grid">
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://astro.build/integrations/">
|
||||||
|
<h2>Integrations <span>→</span></h2>
|
||||||
|
<p>Add component frameworks, Tailwind, Partytown, and more!</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://astro.build/themes/">
|
||||||
|
<h2>Themes <span>→</span></h2>
|
||||||
|
<p>Explore a galaxy of community-built starters.</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://docs.astro.build/">
|
||||||
|
<h2>Docs <span>→</span></h2>
|
||||||
|
<p>Learn our complete feature set and explore the API.</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://astro.build/chat/">
|
||||||
|
<h2>Chat <span>→</span></h2>
|
||||||
|
<p>
|
||||||
|
Ask, contribute, and have fun on our community Discord
|
||||||
|
<svg
|
||||||
|
class="heart"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 512 512"
|
||||||
|
width="16"
|
||||||
|
height="16"
|
||||||
|
fill="currentColor"
|
||||||
|
>
|
||||||
|
<title>heart</title>
|
||||||
|
<path d="M256 448l-30.164-27.211C118.718 322.442 48 258.61 48 179.095 48 114.221 97.918 64 162.4 64c36.399 0 70.717 16.742 93.6 43.947C278.882 80.742 313.199 64 349.6 64 414.082 64 464 114.221 464 179.095c0 79.516-70.719 143.348-177.836 241.694L256 448z" />
|
||||||
|
</svg>
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</main>
|
||||||
|
</Layout>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--color-border: hsl(17, 24%, 90%);
|
||||||
|
--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4);
|
||||||
|
--link-gradient: linear-gradient(45deg, #4F39FA, #DA62C4 30%, var(--color-border) 60%);
|
||||||
|
--night-sky-gradient: linear-gradient(0deg, #392362 -33%, #431f69 10%, #30216b 50%, #1f1638 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin: 0;
|
||||||
|
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 span {
|
||||||
|
display: inline-block;
|
||||||
|
transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-size: 0.875em;
|
||||||
|
border: 0.1em solid var(--color-border);
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0.15em 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
margin: auto;
|
||||||
|
padding: 1em;
|
||||||
|
max-width: 60ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-gradient {
|
||||||
|
font-weight: 900;
|
||||||
|
background-image: var(--astro-gradient);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-size: 100% 200%;
|
||||||
|
background-position-y: 100%;
|
||||||
|
border-radius: 0.4rem;
|
||||||
|
animation: pulse 4s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes pulse {
|
||||||
|
0%, 100% {
|
||||||
|
background-position-y: 0%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position-y: 80%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.instructions {
|
||||||
|
line-height: 1.8;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
background-image: var(--night-sky-gradient);
|
||||||
|
padding: 1.5rem;
|
||||||
|
border-radius: 0.4rem;
|
||||||
|
color: var(--color-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card {
|
||||||
|
list-style: none;
|
||||||
|
display: flex;
|
||||||
|
padding: 0.15rem;
|
||||||
|
background-image: var(--link-gradient);
|
||||||
|
background-size: 400%;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
background-position: 100%;
|
||||||
|
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card > a {
|
||||||
|
width: 100%;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 1.4;
|
||||||
|
padding: 1em 1.3em;
|
||||||
|
border-radius: 0.35rem;
|
||||||
|
color: var(--text-color);
|
||||||
|
background-color: white;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card:is(:hover, :focus-within) {
|
||||||
|
background-position: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card:is(:hover, :focus-within) h2 {
|
||||||
|
color: #4F39FA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card:is(:hover, :focus-within) h2 span {
|
||||||
|
transform: translateX(2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.heart {
|
||||||
|
display: inline-block;
|
||||||
|
color: #DA62C4;
|
||||||
|
animation: heartbeat 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes heartbeat {
|
||||||
|
0%,
|
||||||
|
50%,
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
5% {
|
||||||
|
transform: scale(1.125);
|
||||||
|
}
|
||||||
|
10% {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
15% {
|
||||||
|
transform: scale(1.25);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
15
examples/astro/tsconfig.json
Normal file
15
examples/astro/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
// Enable top-level await, and other modern ESM features.
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "ESNext",
|
||||||
|
// Enable node-style module resolution, for things like npm package imports.
|
||||||
|
"moduleResolution": "node",
|
||||||
|
// Enable JSON imports.
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
// Enable stricter transpilation for better output.
|
||||||
|
"isolatedModules": true,
|
||||||
|
// Add type definitions for our Vite runtime.
|
||||||
|
"types": ["vite/client"]
|
||||||
|
}
|
||||||
|
}
|
||||||
3457
examples/astro/yarn.lock
Normal file
3457
examples/astro/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ This directory is a brief example of a [Dojo](https://dojo.io) site that can be
|
|||||||
|
|
||||||
Deploy your own Dojo project with Vercel.
|
Deploy your own Dojo project with Vercel.
|
||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/dojo&template=dojo)
|
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/dojo&template=dojo)
|
||||||
|
|
||||||
### How We Created This Example
|
### How We Created This Example
|
||||||
|
|
||||||
|
|||||||
20
examples/eleventy/LICENSE.md
Normal file
20
examples/eleventy/LICENSE.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
MIT License
|
||||||
|
Copyright (c) 2022 Zach Leatherman @zachleat
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1,5 +1,19 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/11ty/eleventy-base-blog.git"
|
||||||
|
},
|
||||||
|
"author": {
|
||||||
|
"name": "Zach Leatherman",
|
||||||
|
"email": "zachleatherman@gmail.com",
|
||||||
|
"url": "https://zachleat.com/"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/11ty/eleventy-base-blog/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/11ty/eleventy-base-blog#readme",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "eleventy",
|
"build": "eleventy",
|
||||||
"watch": "eleventy --watch",
|
"watch": "eleventy --watch",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ cache:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# See https://git.io/vdao3 for details.
|
# See https://github.com/ember-cli/ember-cli/blob/master/docs/build-concurrency.md
|
||||||
- JOBS=1
|
- JOBS=1
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ async function main() {
|
|||||||
// if it's an empty string, just ignore it
|
// if it's an empty string, just ignore it
|
||||||
if (!formatted) return false;
|
if (!formatted) return false;
|
||||||
|
|
||||||
let type = url.substr(-3) == 'css' ? 'style' : 'script';
|
let type = url.slice(-3) == 'css' ? 'style' : 'script';
|
||||||
results += `</${formatted}>;rel=preload;as=${type},`;
|
results += `</${formatted}>;rel=preload;as=${type},`;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
4882
examples/nextjs/package-lock.json
generated
Normal file
4882
examples/nextjs/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -7,12 +7,12 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "12.1.0",
|
"next": "12.1.4",
|
||||||
"react": "17.0.2",
|
"react": "18.0.0",
|
||||||
"react-dom": "17.0.2"
|
"react-dom": "18.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "8.9.0",
|
"eslint": "8.12.0",
|
||||||
"eslint-config-next": "12.1.0"
|
"eslint-config-next": "12.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@ export default function Index() {
|
|||||||
<p>
|
<p>
|
||||||
Wait a sec...<em>its children</em>? To understand what we mean by
|
Wait a sec...<em>its children</em>? To understand what we mean by
|
||||||
this,{" "}
|
this,{" "}
|
||||||
<a href="https://remix.run/tutorial/4-nested-routes-params">
|
<a href="https://remix.run/docs/en/v1/guides/routing">
|
||||||
read all about nested routes in the docs
|
read all about nested routes in the docs
|
||||||
</a>
|
</a>
|
||||||
.
|
.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class AppProfile {
|
|||||||
|
|
||||||
normalize(name: string): string {
|
normalize(name: string): string {
|
||||||
if (name) {
|
if (name) {
|
||||||
return name.substr(0, 1).toUpperCase() + name.substr(1).toLowerCase();
|
return name.slice(0, 1).toUpperCase() + name.slice(1).toLowerCase();
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
670
examples/sveltekit/package-lock.json
generated
670
examples/sveltekit/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"name": "sveltekit",
|
||||||
|
"version": "0.0.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "svelte-kit dev",
|
"dev": "svelte-kit dev",
|
||||||
"build": "svelte-kit build",
|
"build": "svelte-kit build",
|
||||||
@@ -9,7 +11,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-auto": "next",
|
"@sveltejs/adapter-auto": "next",
|
||||||
"@sveltejs/kit": "next",
|
"@sveltejs/kit": "next",
|
||||||
"svelte": "^3.44.0"
|
"svelte": "^3.46.0"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -8,6 +8,6 @@
|
|||||||
%svelte.head%
|
%svelte.head%
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="svelte">%svelte.body%</div>
|
<div>%svelte.body%</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
1
examples/sveltekit/src/global.d.ts
vendored
1
examples/sveltekit/src/global.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
/// <reference types="@sveltejs/kit" />
|
|
||||||
@@ -1,19 +1,22 @@
|
|||||||
import cookie from 'cookie';
|
import cookie from 'cookie';
|
||||||
import { v4 as uuid } from '@lukeed/uuid';
|
import { v4 as uuid } from '@lukeed/uuid';
|
||||||
|
|
||||||
export const handle = async ({ request, resolve }) => {
|
export const handle = async ({ event, resolve }) => {
|
||||||
const cookies = cookie.parse(request.headers.cookie || '');
|
const cookies = cookie.parse(event.request.headers.get('cookie') || '');
|
||||||
request.locals.userid = cookies.userid || uuid();
|
event.locals.userid = cookies.userid || uuid();
|
||||||
|
|
||||||
const response = await resolve(request);
|
const response = await resolve(event);
|
||||||
|
|
||||||
if (!cookies.userid) {
|
if (!cookies.userid) {
|
||||||
// if this is the first time the user has visited this app,
|
// if this is the first time the user has visited this app,
|
||||||
// set a cookie so that we recognise them when they return
|
// set a cookie so that we recognise them when they return
|
||||||
response.headers['set-cookie'] = cookie.serialize('userid', request.locals.userid, {
|
response.headers.set(
|
||||||
path: '/',
|
'set-cookie',
|
||||||
httpOnly: true
|
cookie.serialize('userid', event.locals.userid, {
|
||||||
});
|
path: '/',
|
||||||
|
httpOnly: true
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
<div class="counter-viewport">
|
<div class="counter-viewport">
|
||||||
<div class="counter-digits" style="transform: translate(0, {100 * offset}%)">
|
<div class="counter-digits" style="transform: translate(0, {100 * offset}%)">
|
||||||
<strong style="top: -100%" aria-hidden="true">{Math.floor($displayed_count + 1)}</strong>
|
<strong class="hidden" aria-hidden="true">{Math.floor($displayed_count + 1)}</strong>
|
||||||
<strong>{Math.floor($displayed_count)}</strong>
|
<strong>{Math.floor($displayed_count)}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,4 +94,9 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
top: -100%;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
import { invalidate } from '$app/navigation';
|
||||||
|
|
||||||
// this action (https://svelte.dev/tutorial/actions) allows us to
|
// this action (https://svelte.dev/tutorial/actions) allows us to
|
||||||
// progressively enhance a <form> that already works without JS
|
// progressively enhance a <form> that already works without JS
|
||||||
export function enhance(form, { pending, error, result }) {
|
export function enhance(form, { pending, error, result } = {}) {
|
||||||
let current_token;
|
let current_token;
|
||||||
|
|
||||||
async function handle_submit(e) {
|
async function handle_submit(e) {
|
||||||
@@ -8,31 +10,35 @@ export function enhance(form, { pending, error, result }) {
|
|||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const body = new FormData(form);
|
const data = new FormData(form);
|
||||||
|
|
||||||
if (pending) pending(body, form);
|
if (pending) pending({ data, form });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(form.action, {
|
const response = await fetch(form.action, {
|
||||||
method: form.method,
|
method: form.method,
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/json'
|
accept: 'application/json'
|
||||||
},
|
},
|
||||||
body
|
body: data
|
||||||
});
|
});
|
||||||
|
|
||||||
if (token !== current_token) return;
|
if (token !== current_token) return;
|
||||||
|
|
||||||
if (res.ok) {
|
if (response.ok) {
|
||||||
result(res, form);
|
if (result) result({ data, form, response });
|
||||||
|
|
||||||
|
const url = new URL(form.action);
|
||||||
|
url.search = url.hash = '';
|
||||||
|
invalidate(url.href);
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
error(res, null, form);
|
error({ data, form, error: null, response });
|
||||||
} else {
|
} else {
|
||||||
console.error(await res.text());
|
console.error(await response.text());
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (error) {
|
if (error) {
|
||||||
error(null, e, form);
|
error({ data, form, error: e, response: null });
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
import { api } from './_api';
|
|
||||||
|
|
||||||
// PATCH /todos/:uid.json
|
|
||||||
export const patch = async (request) => {
|
|
||||||
return api(request, `todos/${request.locals.userid}/${request.params.uid}`, {
|
|
||||||
text: request.body.get('text'),
|
|
||||||
done: request.body.has('done') ? !!request.body.get('done') : undefined
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// DELETE /todos/:uid.json
|
|
||||||
export const del = async (request) => {
|
|
||||||
return api(request, `todos/${request.locals.userid}/${request.params.uid}`);
|
|
||||||
};
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
This module is used by the /todos.json and /todos/[uid].json
|
This module is used by the /todos endpoint to
|
||||||
endpoints to make calls to api.svelte.dev, which stores todos
|
make calls to api.svelte.dev, which stores todos
|
||||||
for each user. The leading underscore indicates that this is
|
for each user. The leading underscore indicates that this is
|
||||||
a private module, _not_ an endpoint — visiting /todos/_api
|
a private module, _not_ an endpoint — visiting /todos/_api
|
||||||
will net you a 404 response.
|
will net you a 404 response.
|
||||||
@@ -11,35 +11,12 @@
|
|||||||
|
|
||||||
const base = 'https://api.svelte.dev';
|
const base = 'https://api.svelte.dev';
|
||||||
|
|
||||||
export async function api(request, resource, data) {
|
export function api(method, resource, data) {
|
||||||
// user must have a cookie set
|
return fetch(`${base}/${resource}`, {
|
||||||
if (!request.locals.userid) {
|
method,
|
||||||
return { status: 401 };
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await fetch(`${base}/${resource}`, {
|
|
||||||
method: request.method,
|
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
},
|
},
|
||||||
body: data && JSON.stringify(data)
|
body: data && JSON.stringify(data)
|
||||||
});
|
});
|
||||||
|
|
||||||
// if the request came from a <form> submission, the browser's default
|
|
||||||
// behaviour is to show the URL corresponding to the form's "action"
|
|
||||||
// attribute. in those cases, we want to redirect them back to the
|
|
||||||
// /todos page, rather than showing the response
|
|
||||||
if (res.ok && request.method !== 'GET' && request.headers.accept !== 'application/json') {
|
|
||||||
return {
|
|
||||||
status: 303,
|
|
||||||
headers: {
|
|
||||||
location: '/todos'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
status: res.status,
|
|
||||||
body: await res.json()
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
66
examples/sveltekit/src/routes/todos/index.js
Normal file
66
examples/sveltekit/src/routes/todos/index.js
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import { api } from './_api';
|
||||||
|
|
||||||
|
export const get = async ({ locals }) => {
|
||||||
|
// locals.userid comes from src/hooks.js
|
||||||
|
const response = await api('get', `todos/${locals.userid}`);
|
||||||
|
|
||||||
|
if (response.status === 404) {
|
||||||
|
// user hasn't created a todo list.
|
||||||
|
// start with an empty array
|
||||||
|
return {
|
||||||
|
body: {
|
||||||
|
todos: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.status === 200) {
|
||||||
|
return {
|
||||||
|
body: {
|
||||||
|
todos: await response.json()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
status: response.status
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const post = async ({ request, locals }) => {
|
||||||
|
const form = await request.formData();
|
||||||
|
|
||||||
|
await api('post', `todos/${locals.userid}`, {
|
||||||
|
text: form.get('text')
|
||||||
|
});
|
||||||
|
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
|
||||||
|
// If the user has JavaScript disabled, the URL will change to
|
||||||
|
// include the method override unless we redirect back to /todos
|
||||||
|
const redirect = {
|
||||||
|
status: 303,
|
||||||
|
headers: {
|
||||||
|
location: '/todos'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const patch = async ({ request, locals }) => {
|
||||||
|
const form = await request.formData();
|
||||||
|
|
||||||
|
await api('patch', `todos/${locals.userid}/${form.get('uid')}`, {
|
||||||
|
text: form.has('text') ? form.get('text') : undefined,
|
||||||
|
done: form.has('done') ? !!form.get('done') : undefined
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const del = async ({ request, locals }) => {
|
||||||
|
const form = await request.formData();
|
||||||
|
|
||||||
|
await api('delete', `todos/${locals.userid}/${form.get('uid')}`);
|
||||||
|
|
||||||
|
return redirect;
|
||||||
|
};
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import { api } from './_api';
|
|
||||||
|
|
||||||
// GET /todos.json
|
|
||||||
export const get = async (request) => {
|
|
||||||
// request.locals.userid comes from src/hooks.js
|
|
||||||
const response = await api(request, `todos/${request.locals.userid}`);
|
|
||||||
|
|
||||||
if (response.status === 404) {
|
|
||||||
// user hasn't created a todo list.
|
|
||||||
// start with an empty array
|
|
||||||
return { body: [] };
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
};
|
|
||||||
|
|
||||||
// POST /todos.json
|
|
||||||
export const post = async (request) => {
|
|
||||||
const response = await api(request, `todos/${request.locals.userid}`, {
|
|
||||||
// because index.svelte posts a FormData object,
|
|
||||||
// request.body is _also_ a (readonly) FormData
|
|
||||||
// object, which allows us to get form data
|
|
||||||
// with the `body.get(key)` method
|
|
||||||
text: request.body.get('text')
|
|
||||||
});
|
|
||||||
|
|
||||||
return response;
|
|
||||||
};
|
|
||||||
@@ -1,40 +1,9 @@
|
|||||||
<script context="module">
|
|
||||||
import { enhance } from '$lib/form';
|
|
||||||
|
|
||||||
// see https://kit.svelte.dev/docs#loading
|
|
||||||
export const load = async ({ fetch }) => {
|
|
||||||
const res = await fetch('/todos.json');
|
|
||||||
|
|
||||||
if (res.ok) {
|
|
||||||
const todos = await res.json();
|
|
||||||
|
|
||||||
return {
|
|
||||||
props: { todos }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const { message } = await res.json();
|
|
||||||
|
|
||||||
return {
|
|
||||||
error: new Error(message)
|
|
||||||
};
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { enhance } from '$lib/form';
|
||||||
import { scale } from 'svelte/transition';
|
import { scale } from 'svelte/transition';
|
||||||
import { flip } from 'svelte/animate';
|
import { flip } from 'svelte/animate';
|
||||||
|
|
||||||
export let todos;
|
export let todos;
|
||||||
|
|
||||||
async function patch(res) {
|
|
||||||
const todo = await res.json();
|
|
||||||
|
|
||||||
todos = todos.map((t) => {
|
|
||||||
if (t.uid === todo.uid) return todo;
|
|
||||||
return t;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -46,13 +15,10 @@
|
|||||||
|
|
||||||
<form
|
<form
|
||||||
class="new"
|
class="new"
|
||||||
action="/todos.json"
|
action="/todos"
|
||||||
method="post"
|
method="post"
|
||||||
use:enhance={{
|
use:enhance={{
|
||||||
result: async (res, form) => {
|
result: async ({ form }) => {
|
||||||
const created = await res.json();
|
|
||||||
todos = [...todos, created];
|
|
||||||
|
|
||||||
form.reset();
|
form.reset();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -68,41 +34,33 @@
|
|||||||
animate:flip={{ duration: 200 }}
|
animate:flip={{ duration: 200 }}
|
||||||
>
|
>
|
||||||
<form
|
<form
|
||||||
action="/todos/{todo.uid}.json?_method=PATCH"
|
action="/todos?_method=PATCH"
|
||||||
method="post"
|
method="post"
|
||||||
use:enhance={{
|
use:enhance={{
|
||||||
pending: (data) => {
|
pending: ({ data }) => {
|
||||||
todo.done = !!data.get('done');
|
todo.done = !!data.get('done');
|
||||||
},
|
}
|
||||||
result: patch
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<input type="hidden" name="uid" value={todo.uid} />
|
||||||
<input type="hidden" name="done" value={todo.done ? '' : 'true'} />
|
<input type="hidden" name="done" value={todo.done ? '' : 'true'} />
|
||||||
<button class="toggle" aria-label="Mark todo as {todo.done ? 'not done' : 'done'}" />
|
<button class="toggle" aria-label="Mark todo as {todo.done ? 'not done' : 'done'}" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form
|
<form class="text" action="/todos?_method=PATCH" method="post" use:enhance>
|
||||||
class="text"
|
<input type="hidden" name="uid" value={todo.uid} />
|
||||||
action="/todos/{todo.uid}.json?_method=PATCH"
|
|
||||||
method="post"
|
|
||||||
use:enhance={{
|
|
||||||
result: patch
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<input aria-label="Edit todo" type="text" name="text" value={todo.text} />
|
<input aria-label="Edit todo" type="text" name="text" value={todo.text} />
|
||||||
<button class="save" aria-label="Save todo" />
|
<button class="save" aria-label="Save todo" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
action="/todos/{todo.uid}.json?_method=DELETE"
|
action="/todos?_method=DELETE"
|
||||||
method="post"
|
method="post"
|
||||||
use:enhance={{
|
use:enhance={{
|
||||||
pending: () => (todo.pending_delete = true),
|
pending: () => (todo.pending_delete = true)
|
||||||
result: () => {
|
|
||||||
todos = todos.filter((t) => t.uid !== todo.uid);
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<input type="hidden" name="uid" value={todo.uid} />
|
||||||
<button class="delete" aria-label="Delete todo" disabled={todo.pending_delete} />
|
<button class="delete" aria-label="Delete todo" disabled={todo.pending_delete} />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -158,7 +116,7 @@
|
|||||||
.done {
|
.done {
|
||||||
transform: none;
|
transform: none;
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
filter: drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.1));
|
filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.1));
|
||||||
}
|
}
|
||||||
|
|
||||||
form.text {
|
form.text {
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ const config = {
|
|||||||
kit: {
|
kit: {
|
||||||
adapter: adapter(),
|
adapter: adapter(),
|
||||||
|
|
||||||
// hydrate the <div id="svelte"> element in src/app.html
|
// Override http methods in the Todo forms
|
||||||
target: '#svelte'
|
methodOverride: {
|
||||||
|
allowed: ['PATCH', 'DELETE']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
48
package.json
48
package.json
@@ -14,37 +14,24 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lerna": "3.16.4"
|
"lerna": "3.16.4"
|
||||||
},
|
},
|
||||||
"turbo": {
|
|
||||||
"baseBranch": "origin/main",
|
|
||||||
"pipeline": {
|
|
||||||
"build": {
|
|
||||||
"dependsOn": [
|
|
||||||
"^build"
|
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
"dist/**"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "4.28.0",
|
"@typescript-eslint/eslint-plugin": "5.21.0",
|
||||||
"@typescript-eslint/parser": "4.28.0",
|
"@typescript-eslint/parser": "5.21.0",
|
||||||
"async-retry": "1.2.3",
|
"async-retry": "1.2.3",
|
||||||
"buffer-replace": "1.0.0",
|
"buffer-replace": "1.0.0",
|
||||||
"cheerio": "1.0.0-rc.3",
|
"eslint": "8.14.0",
|
||||||
"eslint": "7.29.0",
|
"eslint-config-prettier": "8.5.0",
|
||||||
"eslint-config-prettier": "8.3.0",
|
"eslint-plugin-jest": "26.1.5",
|
||||||
"eslint-plugin-jest": "24.3.6",
|
"husky": "7.0.4",
|
||||||
"husky": "6.0.0",
|
"jest": "28.0.2",
|
||||||
"jest": "27.3.1",
|
|
||||||
"json5": "2.1.1",
|
"json5": "2.1.1",
|
||||||
"lint-staged": "9.2.5",
|
"lint-staged": "9.2.5",
|
||||||
"node-fetch": "2.6.1",
|
"node-fetch": "2.6.1",
|
||||||
"npm-package-arg": "6.1.0",
|
"npm-package-arg": "6.1.0",
|
||||||
"prettier": "2.3.1",
|
"prettier": "2.6.2",
|
||||||
"ts-jest": "27.0.4",
|
"ts-eager": "2.0.2",
|
||||||
"turbo": "1.0.18"
|
"ts-jest": "28.0.0-next.1",
|
||||||
|
"turbo": "1.2.5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lerna": "lerna",
|
"lerna": "lerna",
|
||||||
@@ -54,9 +41,10 @@
|
|||||||
"publish-from-github": "./utils/publish.sh",
|
"publish-from-github": "./utils/publish.sh",
|
||||||
"changelog": "node utils/changelog.js",
|
"changelog": "node utils/changelog.js",
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"vercel-build": "mkdir -p public && echo '<a href=\"https://vercel.com/import\">Import</a>' > public/output.html",
|
"vercel-build": "yarn build && cd api && node -r ts-eager/register ./_lib/script/build.ts",
|
||||||
"pre-commit": "lint-staged",
|
"pre-commit": "lint-staged",
|
||||||
"test-unit": "node utils/run.js test-unit",
|
"test": "jest --rootDir=\"test\" --testPathPattern=\"\\.test.js\"",
|
||||||
|
"test-unit": "yarn test && node utils/run.js test-unit",
|
||||||
"test-integration-cli": "node utils/run.js test-integration-cli",
|
"test-integration-cli": "node utils/run.js test-integration-cli",
|
||||||
"test-integration-once": "node utils/run.js test-integration-once",
|
"test-integration-once": "node utils/run.js test-integration-once",
|
||||||
"test-integration-dev": "node utils/run.js test-integration-dev",
|
"test-integration-dev": "node utils/run.js test-integration-dev",
|
||||||
@@ -102,6 +90,14 @@
|
|||||||
"es6": true
|
"es6": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"no-restricted-syntax": [
|
||||||
|
"warn",
|
||||||
|
"WithStatement",
|
||||||
|
{
|
||||||
|
"message": "substr() is deprecated, use slice() or substring() instead",
|
||||||
|
"selector": "MemberExpression > Identifier[name='substr']"
|
||||||
|
}
|
||||||
|
],
|
||||||
"require-atomic-updates": 0,
|
"require-atomic-updates": 0,
|
||||||
"@typescript-eslint/ban-ts-comment": 0,
|
"@typescript-eslint/ban-ts-comment": 0,
|
||||||
"@typescript-eslint/camelcase": 0,
|
"@typescript-eslint/camelcase": 0,
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
/src
|
/src
|
||||||
/test
|
/test
|
||||||
tmp
|
/tsconfig.json
|
||||||
|
/.turbo
|
||||||
|
/jest.config.js
|
||||||
|
tmp
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vercel/build-utils",
|
"name": "@vercel/build-utils",
|
||||||
"version": "2.14.1-canary.1",
|
"version": "2.17.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.js",
|
"types": "./dist/index.d.js",
|
||||||
@@ -23,14 +23,14 @@
|
|||||||
"@types/end-of-stream": "^1.4.0",
|
"@types/end-of-stream": "^1.4.0",
|
||||||
"@types/fs-extra": "9.0.13",
|
"@types/fs-extra": "9.0.13",
|
||||||
"@types/glob": "^7.1.1",
|
"@types/glob": "^7.1.1",
|
||||||
"@types/jest": "27.0.1",
|
"@types/jest": "27.4.1",
|
||||||
"@types/js-yaml": "3.12.1",
|
"@types/js-yaml": "3.12.1",
|
||||||
"@types/ms": "0.7.31",
|
"@types/ms": "0.7.31",
|
||||||
"@types/multistream": "2.1.1",
|
"@types/multistream": "2.1.1",
|
||||||
"@types/node-fetch": "^2.1.6",
|
"@types/node-fetch": "^2.1.6",
|
||||||
"@types/semver": "6.0.0",
|
"@types/semver": "6.0.0",
|
||||||
"@types/yazl": "^2.4.1",
|
"@types/yazl": "2.4.2",
|
||||||
"@vercel/frameworks": "0.6.1-canary.1",
|
"@vercel/frameworks": "0.9.0",
|
||||||
"@vercel/ncc": "0.24.0",
|
"@vercel/ncc": "0.24.0",
|
||||||
"aggregate-error": "3.0.1",
|
"aggregate-error": "3.0.1",
|
||||||
"async-retry": "1.2.3",
|
"async-retry": "1.2.3",
|
||||||
@@ -47,6 +47,6 @@
|
|||||||
"node-fetch": "2.6.1",
|
"node-fetch": "2.6.1",
|
||||||
"semver": "6.1.1",
|
"semver": "6.1.1",
|
||||||
"typescript": "4.3.4",
|
"typescript": "4.3.4",
|
||||||
"yazl": "2.4.3"
|
"yazl": "2.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,8 +67,7 @@ function getPublicBuilder(
|
|||||||
typeof builder.src === 'string' &&
|
typeof builder.src === 'string' &&
|
||||||
isOfficialRuntime('static', builder.use) &&
|
isOfficialRuntime('static', builder.use) &&
|
||||||
/^.*\/\*\*\/\*$/.test(builder.src) &&
|
/^.*\/\*\*\/\*$/.test(builder.src) &&
|
||||||
builder.config &&
|
builder.config?.zeroConfig === true
|
||||||
builder.config.zeroConfig === true
|
|
||||||
) {
|
) {
|
||||||
return builder as Builder & { src: string };
|
return builder as Builder & { src: string };
|
||||||
}
|
}
|
||||||
@@ -539,7 +538,7 @@ function getMissingBuildScriptError() {
|
|||||||
code: 'missing_build_script',
|
code: 'missing_build_script',
|
||||||
message:
|
message:
|
||||||
'Your `package.json` file is missing a `build` property inside the `scripts` property.' +
|
'Your `package.json` file is missing a `build` property inside the `scripts` property.' +
|
||||||
'\nLearn More: https://vercel.com/docs/v2/platform/frequently-asked-questions#missing-build-script',
|
'\nLearn More: https://vercel.link/missing-build-script',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
44
packages/build-utils/src/edge-function.ts
Normal file
44
packages/build-utils/src/edge-function.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import type { Files } from './types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An Edge Functions output
|
||||||
|
*/
|
||||||
|
export class EdgeFunction {
|
||||||
|
type: 'EdgeFunction';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A display name for the edge function.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The deployment target.
|
||||||
|
* Only v8-worker is currently supported.
|
||||||
|
*/
|
||||||
|
deploymentTarget: 'v8-worker';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The entrypoint for the edge function.
|
||||||
|
*/
|
||||||
|
entrypoint: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list of files to be included in the edge function bundle.
|
||||||
|
*/
|
||||||
|
files: Files;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra environment variables in use for the user code, to be
|
||||||
|
* assigned to the edge function.
|
||||||
|
*/
|
||||||
|
envVarsInUse?: string[];
|
||||||
|
|
||||||
|
constructor(params: Omit<EdgeFunction, 'type'>) {
|
||||||
|
this.type = 'EdgeFunction';
|
||||||
|
this.name = params.name;
|
||||||
|
this.deploymentTarget = params.deploymentTarget;
|
||||||
|
this.entrypoint = params.entrypoint;
|
||||||
|
this.files = params.files;
|
||||||
|
this.envVarsInUse = params.envVarsInUse;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import intoStream from 'into-stream';
|
import intoStream from 'into-stream';
|
||||||
import { File } from './types';
|
import { FileBase } from './types';
|
||||||
|
|
||||||
interface FileBlobOptions {
|
interface FileBlobOptions {
|
||||||
mode?: number;
|
mode?: number;
|
||||||
@@ -14,7 +14,7 @@ interface FromStreamOptions {
|
|||||||
stream: NodeJS.ReadableStream;
|
stream: NodeJS.ReadableStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class FileBlob implements File {
|
export default class FileBlob implements FileBase {
|
||||||
public type: 'FileBlob';
|
public type: 'FileBlob';
|
||||||
public mode: number;
|
public mode: number;
|
||||||
public data: string | Buffer;
|
public data: string | Buffer;
|
||||||
@@ -48,6 +48,10 @@ export default class FileBlob implements File {
|
|||||||
return new FileBlob({ mode, contentType, data });
|
return new FileBlob({ mode, contentType, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async toStreamAsync(): Promise<NodeJS.ReadableStream> {
|
||||||
|
return this.toStream();
|
||||||
|
}
|
||||||
|
|
||||||
toStream(): NodeJS.ReadableStream {
|
toStream(): NodeJS.ReadableStream {
|
||||||
return intoStream(this.data);
|
return intoStream(this.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import fs from 'fs-extra';
|
|||||||
import multiStream from 'multistream';
|
import multiStream from 'multistream';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import Sema from 'async-sema';
|
import Sema from 'async-sema';
|
||||||
import { File } from './types';
|
import { FileBase } from './types';
|
||||||
|
|
||||||
const semaToPreventEMFILE = new Sema(20);
|
const semaToPreventEMFILE = new Sema(20);
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ interface FromStreamOptions {
|
|||||||
fsPath: string;
|
fsPath: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class FileFsRef implements File {
|
class FileFsRef implements FileBase {
|
||||||
public type: 'FileFsRef';
|
public type: 'FileFsRef';
|
||||||
public mode: number;
|
public mode: number;
|
||||||
public fsPath: string;
|
public fsPath: string;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import fetch from 'node-fetch';
|
|||||||
import multiStream from 'multistream';
|
import multiStream from 'multistream';
|
||||||
import retry from 'async-retry';
|
import retry from 'async-retry';
|
||||||
import Sema from 'async-sema';
|
import Sema from 'async-sema';
|
||||||
import { File } from './types';
|
import { FileBase } from './types';
|
||||||
|
|
||||||
interface FileRefOptions {
|
interface FileRefOptions {
|
||||||
mode?: number;
|
mode?: number;
|
||||||
@@ -23,7 +23,7 @@ class BailableError extends Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class FileRef implements File {
|
export default class FileRef implements FileBase {
|
||||||
public type: 'FileRef';
|
public type: 'FileRef';
|
||||||
public mode: number;
|
public mode: number;
|
||||||
public digest: string;
|
public digest: string;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import debug from '../debug';
|
|||||||
import FileFsRef from '../file-fs-ref';
|
import FileFsRef from '../file-fs-ref';
|
||||||
import { File, Files, Meta } from '../types';
|
import { File, Files, Meta } from '../types';
|
||||||
import { remove, mkdirp, readlink, symlink } from 'fs-extra';
|
import { remove, mkdirp, readlink, symlink } from 'fs-extra';
|
||||||
|
import streamToBuffer from './stream-to-buffer';
|
||||||
|
|
||||||
export interface DownloadedFiles {
|
export interface DownloadedFiles {
|
||||||
[filePath: string]: FileFsRef;
|
[filePath: string]: FileFsRef;
|
||||||
@@ -15,19 +16,44 @@ export function isSymbolicLink(mode: number): boolean {
|
|||||||
return (mode & S_IFMT) === S_IFLNK;
|
return (mode & S_IFMT) === S_IFLNK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function prepareSymlinkTarget(
|
||||||
|
file: File,
|
||||||
|
fsPath: string
|
||||||
|
): Promise<string> {
|
||||||
|
const mkdirPromise = mkdirp(path.dirname(fsPath));
|
||||||
|
if (file.type === 'FileFsRef') {
|
||||||
|
const [target] = await Promise.all([readlink(file.fsPath), mkdirPromise]);
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file.type === 'FileRef' || file.type === 'FileBlob') {
|
||||||
|
const targetPathBufferPromise = await streamToBuffer(
|
||||||
|
await file.toStreamAsync()
|
||||||
|
);
|
||||||
|
const [targetPathBuffer] = await Promise.all([
|
||||||
|
targetPathBufferPromise,
|
||||||
|
mkdirPromise,
|
||||||
|
]);
|
||||||
|
return targetPathBuffer.toString('utf8');
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error(
|
||||||
|
`file.type "${(file as any).type}" not supported for symlink`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
async function downloadFile(file: File, fsPath: string): Promise<FileFsRef> {
|
async function downloadFile(file: File, fsPath: string): Promise<FileFsRef> {
|
||||||
const { mode } = file;
|
const { mode } = file;
|
||||||
if (mode && isSymbolicLink(mode) && file.type === 'FileFsRef') {
|
|
||||||
const [target] = await Promise.all([
|
if (isSymbolicLink(mode)) {
|
||||||
readlink((file as FileFsRef).fsPath),
|
const target = await prepareSymlinkTarget(file, fsPath);
|
||||||
mkdirp(path.dirname(fsPath)),
|
|
||||||
]);
|
|
||||||
await symlink(target, fsPath);
|
await symlink(target, fsPath);
|
||||||
return FileFsRef.fromFsPath({ mode, fsPath });
|
return FileFsRef.fromFsPath({ mode, fsPath });
|
||||||
} else {
|
|
||||||
const stream = file.toStream();
|
|
||||||
return FileFsRef.fromStream({ mode, stream, fsPath });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const stream = file.toStream();
|
||||||
|
return FileFsRef.fromStream({ mode, stream, fsPath });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function removeFile(basePath: string, fileMatched: string) {
|
async function removeFile(basePath: string, fileMatched: string) {
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ export default async function glob(
|
|||||||
const files = await vanillaGlob(pattern, options);
|
const files = await vanillaGlob(pattern, options);
|
||||||
|
|
||||||
for (const relativePath of files) {
|
for (const relativePath of files) {
|
||||||
const fsPath = normalizePath(path.join(options.cwd!, relativePath));
|
const fsPath = normalizePath(path.join(options.cwd, relativePath));
|
||||||
let stat: Stats = options.statCache![fsPath] as Stats;
|
let stat: Stats = options.statCache[fsPath] as Stats;
|
||||||
assert(
|
assert(
|
||||||
stat,
|
stat,
|
||||||
`statCache does not contain value for ${relativePath} (resolved to ${fsPath})`
|
`statCache does not contain value for ${relativePath} (resolved to ${fsPath})`
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { NowBuildError } from '../errors';
|
|||||||
import debug from '../debug';
|
import debug from '../debug';
|
||||||
|
|
||||||
const allOptions = [
|
const allOptions = [
|
||||||
|
{ major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||||
{ major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
{ major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
||||||
{ major: 12, range: '12.x', runtime: 'nodejs12.x' },
|
{ major: 12, range: '12.x', runtime: 'nodejs12.x' },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,21 +1,31 @@
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import debug from '../debug';
|
import Sema from 'async-sema';
|
||||||
import spawn from 'cross-spawn';
|
import spawn from 'cross-spawn';
|
||||||
import { SpawnOptions } from 'child_process';
|
import { SpawnOptions } from 'child_process';
|
||||||
import { deprecate } from 'util';
|
import { deprecate } from 'util';
|
||||||
|
import debug from '../debug';
|
||||||
import { NowBuildError } from '../errors';
|
import { NowBuildError } from '../errors';
|
||||||
import { Meta, PackageJson, NodeVersion, Config } from '../types';
|
import { Meta, PackageJson, NodeVersion, Config } from '../types';
|
||||||
import { getSupportedNodeVersion, getLatestNodeVersion } from './node-version';
|
import { getSupportedNodeVersion, getLatestNodeVersion } from './node-version';
|
||||||
|
import { readConfigFile } from './read-config-file';
|
||||||
|
|
||||||
export type CliType = 'yarn' | 'npm';
|
// Only allow one `runNpmInstall()` invocation to run concurrently
|
||||||
|
const runNpmInstallSema = new Sema(1);
|
||||||
|
|
||||||
|
export type CliType = 'yarn' | 'npm' | 'pnpm';
|
||||||
|
|
||||||
export interface ScanParentDirsResult {
|
export interface ScanParentDirsResult {
|
||||||
/**
|
/**
|
||||||
* "yarn" or "npm", depending on the presence of lockfiles.
|
* "yarn", "npm", or "pnpm" depending on the presence of lockfiles.
|
||||||
*/
|
*/
|
||||||
cliType: CliType;
|
cliType: CliType;
|
||||||
|
/**
|
||||||
|
* The file path of found `package.json` file, or `undefined` if none was
|
||||||
|
* found.
|
||||||
|
*/
|
||||||
|
packageJsonPath?: string;
|
||||||
/**
|
/**
|
||||||
* The contents of found `package.json` file, when the `readPackageJson`
|
* The contents of found `package.json` file, when the `readPackageJson`
|
||||||
* option is enabled.
|
* option is enabled.
|
||||||
@@ -236,12 +246,13 @@ export async function scanParentDirs(
|
|||||||
|
|
||||||
let cliType: CliType = 'yarn';
|
let cliType: CliType = 'yarn';
|
||||||
let packageJson: PackageJson | undefined;
|
let packageJson: PackageJson | undefined;
|
||||||
|
let packageJsonPath: string | undefined;
|
||||||
let currentDestPath = destPath;
|
let currentDestPath = destPath;
|
||||||
let lockfileVersion: number | undefined;
|
let lockfileVersion: number | undefined;
|
||||||
|
|
||||||
// eslint-disable-next-line no-constant-condition
|
// eslint-disable-next-line no-constant-condition
|
||||||
while (true) {
|
while (true) {
|
||||||
const packageJsonPath = path.join(currentDestPath, 'package.json');
|
packageJsonPath = path.join(currentDestPath, 'package.json');
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
if (await fs.pathExists(packageJsonPath)) {
|
if (await fs.pathExists(packageJsonPath)) {
|
||||||
// Only read the contents of the *first* `package.json` file found,
|
// Only read the contents of the *first* `package.json` file found,
|
||||||
@@ -252,7 +263,7 @@ export async function scanParentDirs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
const [packageLockJson, hasYarnLock] = await Promise.all([
|
const [packageLockJson, hasYarnLock, pnpmLockYaml] = await Promise.all([
|
||||||
fs
|
fs
|
||||||
.readJson(path.join(currentDestPath, 'package-lock.json'))
|
.readJson(path.join(currentDestPath, 'package-lock.json'))
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@@ -263,9 +274,20 @@ export async function scanParentDirs(
|
|||||||
throw error;
|
throw error;
|
||||||
}),
|
}),
|
||||||
fs.pathExists(path.join(currentDestPath, 'yarn.lock')),
|
fs.pathExists(path.join(currentDestPath, 'yarn.lock')),
|
||||||
|
readConfigFile<{ lockfileVersion: number }>(
|
||||||
|
path.join(currentDestPath, 'pnpm-lock.yaml')
|
||||||
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (packageLockJson && !hasYarnLock) {
|
// Priority order is Yarn > pnpm > npm
|
||||||
|
// - find highest priority lock file and use that
|
||||||
|
if (hasYarnLock) {
|
||||||
|
cliType = 'yarn';
|
||||||
|
} else if (pnpmLockYaml) {
|
||||||
|
cliType = 'pnpm';
|
||||||
|
// just ensure that it is read as a number and not a string
|
||||||
|
lockfileVersion = Number(pnpmLockYaml.lockfileVersion);
|
||||||
|
} else if (packageLockJson) {
|
||||||
cliType = 'npm';
|
cliType = 'npm';
|
||||||
lockfileVersion = packageLockJson.lockfileVersion;
|
lockfileVersion = packageLockJson.lockfileVersion;
|
||||||
}
|
}
|
||||||
@@ -273,7 +295,7 @@ export async function scanParentDirs(
|
|||||||
// Only stop iterating if a lockfile was found, because it's possible
|
// Only stop iterating if a lockfile was found, because it's possible
|
||||||
// that the lockfile is in a higher path than where the `package.json`
|
// that the lockfile is in a higher path than where the `package.json`
|
||||||
// file was found.
|
// file was found.
|
||||||
if (packageLockJson || hasYarnLock) {
|
if (packageLockJson || hasYarnLock || pnpmLockYaml) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,7 +305,7 @@ export async function scanParentDirs(
|
|||||||
currentDestPath = newDestPath;
|
currentDestPath = newDestPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { cliType, packageJson, lockfileVersion };
|
return { cliType, packageJson, lockfileVersion, packageJsonPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function walkParentDirs({
|
export async function walkParentDirs({
|
||||||
@@ -309,48 +331,87 @@ export async function walkParentDirs({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSet<T>(v: any): v is Set<T> {
|
||||||
|
return v?.constructor?.name === 'Set';
|
||||||
|
}
|
||||||
|
|
||||||
export async function runNpmInstall(
|
export async function runNpmInstall(
|
||||||
destPath: string,
|
destPath: string,
|
||||||
args: string[] = [],
|
args: string[] = [],
|
||||||
spawnOpts?: SpawnOptions,
|
spawnOpts?: SpawnOptions,
|
||||||
meta?: Meta,
|
meta?: Meta,
|
||||||
nodeVersion?: NodeVersion
|
nodeVersion?: NodeVersion
|
||||||
) {
|
): Promise<boolean> {
|
||||||
if (meta?.isDev) {
|
if (meta?.isDev) {
|
||||||
debug('Skipping dependency installation because dev mode is enabled');
|
debug('Skipping dependency installation because dev mode is enabled');
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(path.isAbsolute(destPath));
|
assert(path.isAbsolute(destPath));
|
||||||
debug(`Installing to ${destPath}`);
|
|
||||||
|
|
||||||
const { cliType, lockfileVersion } = await scanParentDirs(destPath);
|
try {
|
||||||
const opts: SpawnOptionsExtended = { cwd: destPath, ...spawnOpts };
|
await runNpmInstallSema.acquire();
|
||||||
const env = opts.env ? { ...opts.env } : { ...process.env };
|
const { cliType, packageJsonPath, lockfileVersion } = await scanParentDirs(
|
||||||
delete env.NODE_ENV;
|
destPath
|
||||||
opts.env = getEnvForPackageManager({
|
);
|
||||||
cliType,
|
|
||||||
lockfileVersion,
|
|
||||||
nodeVersion,
|
|
||||||
env,
|
|
||||||
});
|
|
||||||
let commandArgs: string[];
|
|
||||||
|
|
||||||
if (cliType === 'npm') {
|
// Only allow `runNpmInstall()` to run once per `package.json`
|
||||||
opts.prettyCommand = 'npm install';
|
// when doing a default install (no additional args)
|
||||||
commandArgs = args
|
if (meta && packageJsonPath && args.length === 0) {
|
||||||
.filter(a => a !== '--prefer-offline')
|
if (!isSet<string>(meta.runNpmInstallSet)) {
|
||||||
.concat(['install', '--no-audit', '--unsafe-perm']);
|
meta.runNpmInstallSet = new Set<string>();
|
||||||
} else {
|
}
|
||||||
opts.prettyCommand = 'yarn install';
|
if (isSet<string>(meta.runNpmInstallSet)) {
|
||||||
commandArgs = ['install', ...args];
|
if (meta.runNpmInstallSet.has(packageJsonPath)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
meta.runNpmInstallSet.add(packageJsonPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const installTime = Date.now();
|
||||||
|
console.log('Installing dependencies...');
|
||||||
|
debug(`Installing to ${destPath}`);
|
||||||
|
|
||||||
|
const opts: SpawnOptionsExtended = { cwd: destPath, ...spawnOpts };
|
||||||
|
const env = opts.env ? { ...opts.env } : { ...process.env };
|
||||||
|
delete env.NODE_ENV;
|
||||||
|
opts.env = getEnvForPackageManager({
|
||||||
|
cliType,
|
||||||
|
lockfileVersion,
|
||||||
|
nodeVersion,
|
||||||
|
env,
|
||||||
|
});
|
||||||
|
let commandArgs: string[];
|
||||||
|
|
||||||
|
if (cliType === 'npm') {
|
||||||
|
opts.prettyCommand = 'npm install';
|
||||||
|
commandArgs = args
|
||||||
|
.filter(a => a !== '--prefer-offline')
|
||||||
|
.concat(['install', '--no-audit', '--unsafe-perm']);
|
||||||
|
} else if (cliType === 'pnpm') {
|
||||||
|
// PNPM's install command is similar to NPM's but without the audit nonsense
|
||||||
|
// @see options https://pnpm.io/cli/install
|
||||||
|
opts.prettyCommand = 'pnpm install';
|
||||||
|
commandArgs = args
|
||||||
|
.filter(a => a !== '--prefer-offline')
|
||||||
|
.concat(['install', '--unsafe-perm']);
|
||||||
|
} else {
|
||||||
|
opts.prettyCommand = 'yarn install';
|
||||||
|
commandArgs = ['install', ...args];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.NPM_ONLY_PRODUCTION) {
|
||||||
|
commandArgs.push('--production');
|
||||||
|
}
|
||||||
|
|
||||||
|
await spawnAsync(cliType, commandArgs, opts);
|
||||||
|
debug(`Install complete [${Date.now() - installTime}ms]`);
|
||||||
|
return true;
|
||||||
|
} finally {
|
||||||
|
runNpmInstallSema.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.NPM_ONLY_PRODUCTION) {
|
|
||||||
commandArgs.push('--production');
|
|
||||||
}
|
|
||||||
|
|
||||||
return spawnAsync(cliType, commandArgs, opts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getEnvForPackageManager({
|
export function getEnvForPackageManager({
|
||||||
@@ -375,6 +436,16 @@ export function getEnvForPackageManager({
|
|||||||
newEnv.PATH = `/node16/bin-npm7:${env.PATH}`;
|
newEnv.PATH = `/node16/bin-npm7:${env.PATH}`;
|
||||||
console.log('Detected `package-lock.json` generated by npm 7...');
|
console.log('Detected `package-lock.json` generated by npm 7...');
|
||||||
}
|
}
|
||||||
|
} else if (cliType === 'pnpm') {
|
||||||
|
if (
|
||||||
|
typeof lockfileVersion === 'number' &&
|
||||||
|
lockfileVersion === 5.4 &&
|
||||||
|
(nodeVersion?.major || 0) > 12
|
||||||
|
) {
|
||||||
|
// Ensure that pnpm 7 is at the beginning of the `$PATH`
|
||||||
|
newEnv.PATH = `/pnpm7/pnpm:${env.PATH}`;
|
||||||
|
console.log('Detected `pnpm-lock.yaml` generated by pnpm 7...');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Yarn v2 PnP mode may be activated, so force "node-modules" linker style
|
// Yarn v2 PnP mode may be activated, so force "node-modules" linker style
|
||||||
if (!env.YARN_NODE_LINKER) {
|
if (!env.YARN_NODE_LINKER) {
|
||||||
@@ -448,6 +519,8 @@ export async function runPackageJsonScript(
|
|||||||
|
|
||||||
if (cliType === 'npm') {
|
if (cliType === 'npm') {
|
||||||
opts.prettyCommand = `npm run ${scriptName}`;
|
opts.prettyCommand = `npm run ${scriptName}`;
|
||||||
|
} else if (cliType === 'pnpm') {
|
||||||
|
opts.prettyCommand = `pnpm run ${scriptName}`;
|
||||||
} else {
|
} else {
|
||||||
opts.prettyCommand = `yarn run ${scriptName}`;
|
opts.prettyCommand = `yarn run ${scriptName}`;
|
||||||
}
|
}
|
||||||
@@ -483,7 +556,7 @@ export async function runPipInstall(
|
|||||||
meta?: Meta
|
meta?: Meta
|
||||||
) {
|
) {
|
||||||
if (meta && meta.isDev) {
|
if (meta && meta.isDev) {
|
||||||
debug('Skipping dependency installation because dev mode is enabled');
|
debug('Skipping dependency installation because dev mode is enabled');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import {
|
|||||||
getDiscontinuedNodeVersions,
|
getDiscontinuedNodeVersions,
|
||||||
} from './fs/node-version';
|
} from './fs/node-version';
|
||||||
import streamToBuffer from './fs/stream-to-buffer';
|
import streamToBuffer from './fs/stream-to-buffer';
|
||||||
import shouldServe from './should-serve';
|
|
||||||
import debug from './debug';
|
import debug from './debug';
|
||||||
import getIgnoreFilter from './get-ignore-filter';
|
import getIgnoreFilter from './get-ignore-filter';
|
||||||
import { getPlatformEnv } from './get-platform-env';
|
import { getPlatformEnv } from './get-platform-env';
|
||||||
@@ -73,7 +72,6 @@ export {
|
|||||||
getSpawnOptions,
|
getSpawnOptions,
|
||||||
getPlatformEnv,
|
getPlatformEnv,
|
||||||
streamToBuffer,
|
streamToBuffer,
|
||||||
shouldServe,
|
|
||||||
debug,
|
debug,
|
||||||
isSymbolicLink,
|
isSymbolicLink,
|
||||||
getLambdaOptionsFromFunction,
|
getLambdaOptionsFromFunction,
|
||||||
@@ -81,6 +79,7 @@ export {
|
|||||||
getIgnoreFilter,
|
getIgnoreFilter,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { EdgeFunction } from './edge-function';
|
||||||
export {
|
export {
|
||||||
detectBuilders,
|
detectBuilders,
|
||||||
detectOutputDirectory,
|
detectOutputDirectory,
|
||||||
@@ -93,6 +92,7 @@ export { DetectorFilesystem } from './detectors/filesystem';
|
|||||||
export { readConfigFile } from './fs/read-config-file';
|
export { readConfigFile } from './fs/read-config-file';
|
||||||
export { normalizePath } from './fs/normalize-path';
|
export { normalizePath } from './fs/normalize-path';
|
||||||
|
|
||||||
|
export * from './should-serve';
|
||||||
export * from './schemas';
|
export * from './schemas';
|
||||||
export * from './types';
|
export * from './types';
|
||||||
export * from './errors';
|
export * from './errors';
|
||||||
@@ -115,3 +115,5 @@ export const isOfficialRuntime = (desired: string, name?: string): boolean => {
|
|||||||
export const isStaticRuntime = (name?: string): boolean => {
|
export const isStaticRuntime = (name?: string): boolean => {
|
||||||
return isOfficialRuntime('static', name);
|
return isOfficialRuntime('static', name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { workspaceManagers } from './workspaces/workspace-managers';
|
||||||
|
|||||||
@@ -3,17 +3,17 @@ import Sema from 'async-sema';
|
|||||||
import { ZipFile } from 'yazl';
|
import { ZipFile } from 'yazl';
|
||||||
import minimatch from 'minimatch';
|
import minimatch from 'minimatch';
|
||||||
import { readlink } from 'fs-extra';
|
import { readlink } from 'fs-extra';
|
||||||
import { Files, Config } from './types';
|
|
||||||
import FileFsRef from './file-fs-ref';
|
|
||||||
import { isSymbolicLink } from './fs/download';
|
import { isSymbolicLink } from './fs/download';
|
||||||
import streamToBuffer from './fs/stream-to-buffer';
|
import streamToBuffer from './fs/stream-to-buffer';
|
||||||
|
import type { Files, Config } from './types';
|
||||||
|
|
||||||
interface Environment {
|
interface Environment {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LambdaOptions {
|
export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
|
||||||
files: Files;
|
|
||||||
|
export interface LambdaOptionsBase {
|
||||||
handler: string;
|
handler: string;
|
||||||
runtime: string;
|
runtime: string;
|
||||||
memory?: number;
|
memory?: number;
|
||||||
@@ -21,10 +21,21 @@ export interface LambdaOptions {
|
|||||||
environment?: Environment;
|
environment?: Environment;
|
||||||
allowQuery?: string[];
|
allowQuery?: string[];
|
||||||
regions?: string[];
|
regions?: string[];
|
||||||
|
supportsMultiPayloads?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
|
||||||
|
files: Files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use `LambdaOptionsWithFiles` instead.
|
||||||
|
*/
|
||||||
|
export interface LambdaOptionsWithZipBuffer extends LambdaOptionsBase {
|
||||||
/**
|
/**
|
||||||
* @deprecated Use `files` property instead.
|
* @deprecated Use `files` property instead.
|
||||||
*/
|
*/
|
||||||
zipBuffer?: Buffer;
|
zipBuffer: Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface GetLambdaOptionsFromFunctionOptions {
|
interface GetLambdaOptionsFromFunctionOptions {
|
||||||
@@ -34,7 +45,7 @@ interface GetLambdaOptionsFromFunctionOptions {
|
|||||||
|
|
||||||
export class Lambda {
|
export class Lambda {
|
||||||
type: 'Lambda';
|
type: 'Lambda';
|
||||||
files: Files;
|
files?: Files;
|
||||||
handler: string;
|
handler: string;
|
||||||
runtime: string;
|
runtime: string;
|
||||||
memory?: number;
|
memory?: number;
|
||||||
@@ -46,20 +57,24 @@ export class Lambda {
|
|||||||
* @deprecated Use `await lambda.createZip()` instead.
|
* @deprecated Use `await lambda.createZip()` instead.
|
||||||
*/
|
*/
|
||||||
zipBuffer?: Buffer;
|
zipBuffer?: Buffer;
|
||||||
|
supportsMultiPayloads?: boolean;
|
||||||
|
|
||||||
constructor({
|
constructor(opts: LambdaOptions) {
|
||||||
files,
|
const {
|
||||||
handler,
|
handler,
|
||||||
runtime,
|
runtime,
|
||||||
maxDuration,
|
maxDuration,
|
||||||
memory,
|
memory,
|
||||||
environment = {},
|
environment = {},
|
||||||
allowQuery,
|
allowQuery,
|
||||||
regions,
|
regions,
|
||||||
zipBuffer,
|
supportsMultiPayloads,
|
||||||
}: LambdaOptions) {
|
} = opts;
|
||||||
if (!zipBuffer) {
|
if ('files' in opts) {
|
||||||
assert(typeof files === 'object', '"files" must be an object');
|
assert(typeof opts.files === 'object', '"files" must be an object');
|
||||||
|
}
|
||||||
|
if ('zipBuffer' in opts) {
|
||||||
|
assert(Buffer.isBuffer(opts.zipBuffer), '"zipBuffer" must be a Buffer');
|
||||||
}
|
}
|
||||||
assert(typeof handler === 'string', '"handler" is not a string');
|
assert(typeof handler === 'string', '"handler" is not a string');
|
||||||
assert(typeof runtime === 'string', '"runtime" is not a string');
|
assert(typeof runtime === 'string', '"runtime" is not a string');
|
||||||
@@ -81,6 +96,13 @@ export class Lambda {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (supportsMultiPayloads !== undefined) {
|
||||||
|
assert(
|
||||||
|
typeof supportsMultiPayloads === 'boolean',
|
||||||
|
'"supportsMultiPayloads" is not a boolean'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (regions !== undefined) {
|
if (regions !== undefined) {
|
||||||
assert(Array.isArray(regions), '"regions" is not an Array');
|
assert(Array.isArray(regions), '"regions" is not an Array');
|
||||||
assert(
|
assert(
|
||||||
@@ -89,7 +111,7 @@ export class Lambda {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.type = 'Lambda';
|
this.type = 'Lambda';
|
||||||
this.files = files;
|
this.files = 'files' in opts ? opts.files : undefined;
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
this.runtime = runtime;
|
this.runtime = runtime;
|
||||||
this.memory = memory;
|
this.memory = memory;
|
||||||
@@ -97,12 +119,16 @@ export class Lambda {
|
|||||||
this.environment = environment;
|
this.environment = environment;
|
||||||
this.allowQuery = allowQuery;
|
this.allowQuery = allowQuery;
|
||||||
this.regions = regions;
|
this.regions = regions;
|
||||||
this.zipBuffer = zipBuffer;
|
this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
|
||||||
|
this.supportsMultiPayloads = supportsMultiPayloads;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createZip(): Promise<Buffer> {
|
async createZip(): Promise<Buffer> {
|
||||||
let { zipBuffer } = this;
|
let { zipBuffer } = this;
|
||||||
if (!zipBuffer) {
|
if (!zipBuffer) {
|
||||||
|
if (!this.files) {
|
||||||
|
throw new Error('`files` is not defined');
|
||||||
|
}
|
||||||
await sema.acquire();
|
await sema.acquire();
|
||||||
try {
|
try {
|
||||||
zipBuffer = await createZip(this.files);
|
zipBuffer = await createZip(this.files);
|
||||||
@@ -136,7 +162,7 @@ export async function createZip(files: Files): Promise<Buffer> {
|
|||||||
for (const name of names) {
|
for (const name of names) {
|
||||||
const file = files[name];
|
const file = files[name];
|
||||||
if (file.mode && isSymbolicLink(file.mode) && file.type === 'FileFsRef') {
|
if (file.mode && isSymbolicLink(file.mode) && file.type === 'FileFsRef') {
|
||||||
const symlinkTarget = await readlink((file as FileFsRef).fsPath);
|
const symlinkTarget = await readlink(file.fsPath);
|
||||||
symlinkTargets.set(name, symlinkTarget);
|
symlinkTargets.set(name, symlinkTarget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +176,7 @@ export async function createZip(files: Files): Promise<Buffer> {
|
|||||||
if (typeof symlinkTarget === 'string') {
|
if (typeof symlinkTarget === 'string') {
|
||||||
zipFile.addBuffer(Buffer.from(symlinkTarget, 'utf8'), name, opts);
|
zipFile.addBuffer(Buffer.from(symlinkTarget, 'utf8'), name, opts);
|
||||||
} else {
|
} else {
|
||||||
const stream = file.toStream() as import('stream').Readable;
|
const stream = file.toStream();
|
||||||
stream.on('error', reject);
|
stream.on('error', reject);
|
||||||
zipFile.addReadStream(stream, name, opts);
|
zipFile.addReadStream(stream, name, opts);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Lambda, LambdaOptions } from './lambda';
|
import { Lambda, LambdaOptionsWithFiles } from './lambda';
|
||||||
|
|
||||||
interface NodejsLambdaOptions extends LambdaOptions {
|
interface NodejsLambdaOptions extends LambdaOptionsWithFiles {
|
||||||
shouldAddHelpers: boolean;
|
shouldAddHelpers: boolean;
|
||||||
shouldAddSourcemapSupport: boolean;
|
shouldAddSourcemapSupport: boolean;
|
||||||
awsLambdaHandler?: string;
|
awsLambdaHandler?: string;
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import FileBlob from './file-blob';
|
import { File } from './types';
|
||||||
import FileFsRef from './file-fs-ref';
|
|
||||||
import FileRef from './file-ref';
|
|
||||||
import { Lambda } from './lambda';
|
import { Lambda } from './lambda';
|
||||||
|
|
||||||
interface PrerenderOptions {
|
interface PrerenderOptions {
|
||||||
expiration: number | false;
|
expiration: number | false;
|
||||||
lambda: Lambda;
|
lambda: Lambda;
|
||||||
fallback: FileBlob | FileFsRef | FileRef | null;
|
fallback: File | null;
|
||||||
group?: number;
|
group?: number;
|
||||||
bypassToken?: string | null /* optional to be non-breaking change */;
|
bypassToken?: string | null /* optional to be non-breaking change */;
|
||||||
allowQuery?: string[];
|
allowQuery?: string[];
|
||||||
@@ -16,7 +14,7 @@ export class Prerender {
|
|||||||
public type: 'Prerender';
|
public type: 'Prerender';
|
||||||
public expiration: number | false;
|
public expiration: number | false;
|
||||||
public lambda: Lambda;
|
public lambda: Lambda;
|
||||||
public fallback: FileBlob | FileFsRef | FileRef | null;
|
public fallback: File | null;
|
||||||
public group?: number;
|
public group?: number;
|
||||||
public bypassToken: string | null;
|
public bypassToken: string | null;
|
||||||
public allowQuery?: string[];
|
public allowQuery?: string[];
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { parse } from 'path';
|
import { parse } from 'path';
|
||||||
import { ShouldServeOptions } from './types';
|
import type FileFsRef from './file-fs-ref';
|
||||||
import FileFsRef from './file-fs-ref';
|
import type { ShouldServe } from './types';
|
||||||
|
|
||||||
export default function shouldServe({
|
export const shouldServe: ShouldServe = ({
|
||||||
entrypoint,
|
entrypoint,
|
||||||
files,
|
files,
|
||||||
requestPath,
|
requestPath,
|
||||||
}: ShouldServeOptions): boolean {
|
}) => {
|
||||||
requestPath = requestPath.replace(/\/$/, ''); // sanitize trailing '/'
|
requestPath = requestPath.replace(/\/$/, ''); // sanitize trailing '/'
|
||||||
entrypoint = entrypoint.replace(/\\/, '/'); // windows compatibility
|
entrypoint = entrypoint.replace(/\\/, '/'); // windows compatibility
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ export default function shouldServe({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
function hasProp(obj: { [path: string]: FileFsRef }, key: string): boolean {
|
function hasProp(obj: { [path: string]: FileFsRef }, key: string): boolean {
|
||||||
return Object.hasOwnProperty.call(obj, key);
|
return Object.hasOwnProperty.call(obj, key);
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
import FileRef from './file-ref';
|
import type FileRef from './file-ref';
|
||||||
import FileFsRef from './file-fs-ref';
|
import type FileFsRef from './file-fs-ref';
|
||||||
import { Lambda } from './lambda';
|
import type FileBlob from './file-blob';
|
||||||
|
import type { Lambda } from './lambda';
|
||||||
|
import type { Prerender } from './prerender';
|
||||||
|
import type { EdgeFunction } from './edge-function';
|
||||||
|
|
||||||
export interface Env {
|
export interface Env {
|
||||||
[name: string]: string | undefined;
|
[name: string]: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface File {
|
export type File = FileRef | FileFsRef | FileBlob;
|
||||||
|
export interface FileBase {
|
||||||
type: string;
|
type: string;
|
||||||
mode: number;
|
mode: number;
|
||||||
contentType?: string;
|
contentType?: string;
|
||||||
toStream: () => NodeJS.ReadableStream;
|
toStream: () => NodeJS.ReadableStream;
|
||||||
toStreamAsync?: () => Promise<NodeJS.ReadableStream>;
|
toStreamAsync?: () => Promise<NodeJS.ReadableStream>;
|
||||||
/**
|
|
||||||
* The absolute path to the file in the filesystem
|
|
||||||
*/
|
|
||||||
fsPath?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Files {
|
export interface Files {
|
||||||
@@ -23,16 +23,6 @@ export interface Files {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Config {
|
export interface Config {
|
||||||
[key: string]:
|
|
||||||
| string
|
|
||||||
| string[]
|
|
||||||
| boolean
|
|
||||||
| number
|
|
||||||
| { [key: string]: string }
|
|
||||||
| BuilderFunctions
|
|
||||||
| ProjectSettings
|
|
||||||
| undefined
|
|
||||||
| null;
|
|
||||||
maxLambdaSize?: string;
|
maxLambdaSize?: string;
|
||||||
includeFiles?: string | string[];
|
includeFiles?: string | string[];
|
||||||
excludeFiles?: string | string[];
|
excludeFiles?: string | string[];
|
||||||
@@ -51,6 +41,7 @@ export interface Config {
|
|||||||
devCommand?: string;
|
devCommand?: string;
|
||||||
framework?: string | null;
|
framework?: string | null;
|
||||||
nodeVersion?: string;
|
nodeVersion?: string;
|
||||||
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Meta {
|
export interface Meta {
|
||||||
@@ -63,35 +54,7 @@ export interface Meta {
|
|||||||
env?: Env;
|
env?: Env;
|
||||||
buildEnv?: Env;
|
buildEnv?: Env;
|
||||||
avoidTopLevelInstall?: boolean;
|
avoidTopLevelInstall?: boolean;
|
||||||
}
|
[key: string]: unknown;
|
||||||
|
|
||||||
export interface AnalyzeOptions {
|
|
||||||
/**
|
|
||||||
* All source files of the project
|
|
||||||
*/
|
|
||||||
files: {
|
|
||||||
[filePath: string]: FileRef;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Name of entrypoint file for this particular build job. Value
|
|
||||||
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
|
|
||||||
* `entrypoint` is always a discrete file and never a glob, since globs are
|
|
||||||
* expanded into separate builds at deployment time.
|
|
||||||
*/
|
|
||||||
entrypoint: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A writable temporary directory where you are encouraged to perform your
|
|
||||||
* build process. This directory will be populated with the restored cache.
|
|
||||||
*/
|
|
||||||
workPath: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An arbitrary object passed by the user in the build definition defined
|
|
||||||
* in `vercel.json`.
|
|
||||||
*/
|
|
||||||
config: Config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BuildOptions {
|
export interface BuildOptions {
|
||||||
@@ -156,10 +119,11 @@ export interface PrepareCacheOptions {
|
|||||||
workPath: string;
|
workPath: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A writable temporary directory where you can build a cache to use for
|
* The "Root Directory" is assigned to the `workPath` so the `repoRootPath`
|
||||||
* the next run.
|
* is the Git Repository Root. This is only relevant for Monorepos.
|
||||||
|
* See https://vercel.com/blog/monorepos
|
||||||
*/
|
*/
|
||||||
cachePath: string;
|
repoRootPath?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An arbitrary object passed by the user in the build definition defined
|
* An arbitrary object passed by the user in the build definition defined
|
||||||
@@ -368,6 +332,7 @@ export interface ProjectSettings {
|
|||||||
sourceFilesOutsideRootDirectory?: boolean;
|
sourceFilesOutsideRootDirectory?: boolean;
|
||||||
directoryListing?: boolean;
|
directoryListing?: boolean;
|
||||||
gitForkProtection?: boolean;
|
gitForkProtection?: boolean;
|
||||||
|
commandForIgnoringBuildStep?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BuilderV2 {
|
export interface BuilderV2 {
|
||||||
@@ -380,6 +345,7 @@ export interface BuilderV3 {
|
|||||||
version: 3;
|
version: 3;
|
||||||
build: BuildV3;
|
build: BuildV3;
|
||||||
prepareCache?: PrepareCache;
|
prepareCache?: PrepareCache;
|
||||||
|
shouldServe?: ShouldServe;
|
||||||
startDevServer?: StartDevServer;
|
startDevServer?: StartDevServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,12 +358,34 @@ export interface Images {
|
|||||||
formats?: ImageFormat[];
|
formats?: ImageFormat[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BuildResultV2 {
|
/**
|
||||||
|
* If a Builder ends up creating filesystem outputs conforming to
|
||||||
|
* the Build Output API, then the Builder should return this type.
|
||||||
|
*/
|
||||||
|
export interface BuildResultBuildOutput {
|
||||||
|
/**
|
||||||
|
* Version number of the Build Output API that was created.
|
||||||
|
* Currently only `3` is a valid value.
|
||||||
|
* @example 3
|
||||||
|
*/
|
||||||
|
buildOutputVersion: 3;
|
||||||
|
/**
|
||||||
|
* Filesystem path to the Build Output directory.
|
||||||
|
* @example "/path/to/.vercel/output"
|
||||||
|
*/
|
||||||
|
buildOutputPath: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When a Builder implements `version: 2`, the `build()` function is expected
|
||||||
|
* to return this type.
|
||||||
|
*/
|
||||||
|
export interface BuildResultV2Typical {
|
||||||
// TODO: use proper `Route` type from `routing-utils` (perhaps move types to a common package)
|
// TODO: use proper `Route` type from `routing-utils` (perhaps move types to a common package)
|
||||||
routes: any[];
|
routes?: any[];
|
||||||
images?: Images;
|
images?: Images;
|
||||||
output: {
|
output: {
|
||||||
[key: string]: File | Lambda;
|
[key: string]: File | Lambda | Prerender | EdgeFunction;
|
||||||
};
|
};
|
||||||
wildcard?: Array<{
|
wildcard?: Array<{
|
||||||
domain: string;
|
domain: string;
|
||||||
@@ -405,6 +393,8 @@ export interface BuildResultV2 {
|
|||||||
}>;
|
}>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type BuildResultV2 = BuildResultV2Typical | BuildResultBuildOutput;
|
||||||
|
|
||||||
export interface BuildResultV3 {
|
export interface BuildResultV3 {
|
||||||
output: Lambda;
|
output: Lambda;
|
||||||
}
|
}
|
||||||
@@ -412,6 +402,9 @@ export interface BuildResultV3 {
|
|||||||
export type BuildV2 = (options: BuildOptions) => Promise<BuildResultV2>;
|
export type BuildV2 = (options: BuildOptions) => Promise<BuildResultV2>;
|
||||||
export type BuildV3 = (options: BuildOptions) => Promise<BuildResultV3>;
|
export type BuildV3 = (options: BuildOptions) => Promise<BuildResultV3>;
|
||||||
export type PrepareCache = (options: PrepareCacheOptions) => Promise<Files>;
|
export type PrepareCache = (options: PrepareCacheOptions) => Promise<Files>;
|
||||||
|
export type ShouldServe = (
|
||||||
|
options: ShouldServeOptions
|
||||||
|
) => boolean | Promise<boolean>;
|
||||||
export type StartDevServer = (
|
export type StartDevServer = (
|
||||||
options: StartDevServerOptions
|
options: StartDevServerOptions
|
||||||
) => Promise<StartDevServerResult>;
|
) => Promise<StartDevServerResult>;
|
||||||
|
|||||||
129
packages/build-utils/src/workspaces/workspace-managers.ts
Normal file
129
packages/build-utils/src/workspaces/workspace-managers.ts
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
import type { Framework } from '@vercel/frameworks';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The supported list of workspace managers.
|
||||||
|
*
|
||||||
|
* This list is designed to work with the @see {@link detectFramework} function.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* import { workspaceManagers as frameworkList } from '@vercel/build-utils/workspaces'
|
||||||
|
* import { detectFramework } from '@vercel/build-utils'
|
||||||
|
*
|
||||||
|
* const fs = new GitDetectorFilesystem(...)
|
||||||
|
* detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
|
||||||
|
*
|
||||||
|
* @todo Will be used by the detect-eligible-projects API endpoint for a given git url.
|
||||||
|
*/
|
||||||
|
export const workspaceManagers: Array<Framework> = [
|
||||||
|
{
|
||||||
|
name: 'Yarn',
|
||||||
|
slug: 'yarn',
|
||||||
|
detectors: {
|
||||||
|
every: [
|
||||||
|
{
|
||||||
|
path: 'package.json',
|
||||||
|
matchContent:
|
||||||
|
'"workspaces":\\s*(?:\\[[^\\]]*]|{[^}]*"packages":[^}]*})',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'yarn.lock',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// unused props - needed for typescript
|
||||||
|
description: '',
|
||||||
|
logo: '',
|
||||||
|
settings: {
|
||||||
|
buildCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
devCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
installCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
outputDirectory: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
getOutputDirName: () => Promise.resolve(''),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'pnpm',
|
||||||
|
slug: 'pnpm',
|
||||||
|
detectors: {
|
||||||
|
every: [
|
||||||
|
{
|
||||||
|
path: 'pnpm-workspace.yaml',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// unused props - needed for typescript
|
||||||
|
description: '',
|
||||||
|
logo: '',
|
||||||
|
settings: {
|
||||||
|
buildCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
devCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
installCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
outputDirectory: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
getOutputDirName: () => Promise.resolve(''),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'npm',
|
||||||
|
slug: 'npm',
|
||||||
|
detectors: {
|
||||||
|
every: [
|
||||||
|
{
|
||||||
|
path: 'package.json',
|
||||||
|
matchContent:
|
||||||
|
'"workspaces":\\s*(?:\\[[^\\]]*]|{[^}]*"packages":[^}]*})',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'package-lock.json',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// unused props - needed for typescript
|
||||||
|
description: '',
|
||||||
|
logo: '',
|
||||||
|
settings: {
|
||||||
|
buildCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
devCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
installCommand: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
outputDirectory: {
|
||||||
|
value: '',
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
getOutputDirName: () => Promise.resolve(''),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default workspaceManagers;
|
||||||
4
packages/build-utils/test/fixtures/02-zero-config-api/yarn.lock
vendored
Normal file
4
packages/build-utils/test/fixtures/02-zero-config-api/yarn.lock
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
15
packages/build-utils/test/fixtures/22-pnpm/package.json
vendored
Normal file
15
packages/build-utils/test/fixtures/22-pnpm/package.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "22-pnpm",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "mkdir -p public && (printf \"pnpm version: \" && pnpm -v) > public/index.txt"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
19
packages/build-utils/test/fixtures/22-pnpm/pnpm-lock.yaml
generated
vendored
Normal file
19
packages/build-utils/test/fixtures/22-pnpm/pnpm-lock.yaml
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
|
specifiers:
|
||||||
|
once: ^1.4.0
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
once: 1.4.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/once/1.4.0:
|
||||||
|
resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}
|
||||||
|
dependencies:
|
||||||
|
wrappy: 1.0.2
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/wrappy/1.0.2:
|
||||||
|
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
|
||||||
|
dev: false
|
||||||
11
packages/build-utils/test/fixtures/22-pnpm/vercel.json
vendored
Normal file
11
packages/build-utils/test/fixtures/22-pnpm/vercel.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
|
||||||
|
"probes": [
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"mustContain": "pnpm version: 6",
|
||||||
|
"logMustContain": "pnpm run build"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
5
packages/build-utils/test/fixtures/23-pnpm-workspaces/c/package.json
vendored
Normal file
5
packages/build-utils/test/fixtures/23-pnpm-workspaces/c/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "c",
|
||||||
|
"license": "MIT",
|
||||||
|
"version": "0.1.0"
|
||||||
|
}
|
||||||
8
packages/build-utils/test/fixtures/23-pnpm-workspaces/d/package.json
vendored
Normal file
8
packages/build-utils/test/fixtures/23-pnpm-workspaces/d/package.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "d",
|
||||||
|
"license": "MIT",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"devDependencies": {
|
||||||
|
"once": "1.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
packages/build-utils/test/fixtures/23-pnpm-workspaces/package.json
vendored
Normal file
6
packages/build-utils/test/fixtures/23-pnpm-workspaces/package.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"name": "23-pnpm-workspaces",
|
||||||
|
"license": "MIT",
|
||||||
|
"version": "1.0.0"
|
||||||
|
}
|
||||||
27
packages/build-utils/test/fixtures/23-pnpm-workspaces/pnpm-lock.yaml
generated
vendored
Normal file
27
packages/build-utils/test/fixtures/23-pnpm-workspaces/pnpm-lock.yaml
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
|
importers:
|
||||||
|
|
||||||
|
.:
|
||||||
|
specifiers: {}
|
||||||
|
|
||||||
|
c:
|
||||||
|
specifiers: {}
|
||||||
|
|
||||||
|
d:
|
||||||
|
specifiers:
|
||||||
|
once: 1.4.0
|
||||||
|
devDependencies:
|
||||||
|
once: 1.4.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/once/1.4.0:
|
||||||
|
resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}
|
||||||
|
dependencies:
|
||||||
|
wrappy: 1.0.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/wrappy/1.0.2:
|
||||||
|
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
|
||||||
|
dev: true
|
||||||
3
packages/build-utils/test/fixtures/23-pnpm-workspaces/pnpm-workspace.yaml
vendored
Normal file
3
packages/build-utils/test/fixtures/23-pnpm-workspaces/pnpm-workspace.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
packages:
|
||||||
|
- 'c'
|
||||||
|
- 'd'
|
||||||
1
packages/build-utils/test/fixtures/24-pnpm-hoisted/.gitignore
vendored
Normal file
1
packages/build-utils/test/fixtures/24-pnpm-hoisted/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.vercel
|
||||||
1
packages/build-utils/test/fixtures/24-pnpm-hoisted/.npmrc
vendored
Normal file
1
packages/build-utils/test/fixtures/24-pnpm-hoisted/.npmrc
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
node-linker=hoisted
|
||||||
5
packages/build-utils/test/fixtures/24-pnpm-hoisted/a/index.js
vendored
Normal file
5
packages/build-utils/test/fixtures/24-pnpm-hoisted/a/index.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
const once = require('once');
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
once(() => {});
|
||||||
|
};
|
||||||
5
packages/build-utils/test/fixtures/24-pnpm-hoisted/b/index.js
vendored
Normal file
5
packages/build-utils/test/fixtures/24-pnpm-hoisted/b/index.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
const once = require('once');
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
once(() => {});
|
||||||
|
};
|
||||||
10
packages/build-utils/test/fixtures/24-pnpm-hoisted/index.js
vendored
Normal file
10
packages/build-utils/test/fixtures/24-pnpm-hoisted/index.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
const { exec } = require('exeggcute');
|
||||||
|
|
||||||
|
const a = require('./a');
|
||||||
|
const b = require('./b');
|
||||||
|
|
||||||
|
a();
|
||||||
|
b();
|
||||||
|
|
||||||
|
exec('mkdir public', __dirname);
|
||||||
|
exec('echo "Hello, World!" > public/index.html', __dirname);
|
||||||
11
packages/build-utils/test/fixtures/24-pnpm-hoisted/package.json
vendored
Normal file
11
packages/build-utils/test/fixtures/24-pnpm-hoisted/package.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"private": "true",
|
||||||
|
"name": "24-pnpm-hoisted",
|
||||||
|
"scripts": {
|
||||||
|
"build": "ls -Al node_modules && node index.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"exeggcute": "^1.0.0",
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
25
packages/build-utils/test/fixtures/24-pnpm-hoisted/pnpm-lock.yaml
generated
vendored
Normal file
25
packages/build-utils/test/fixtures/24-pnpm-hoisted/pnpm-lock.yaml
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
|
specifiers:
|
||||||
|
exeggcute: ^1.0.0
|
||||||
|
once: ^1.4.0
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
exeggcute: 1.0.0
|
||||||
|
once: 1.4.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/exeggcute/1.0.0:
|
||||||
|
resolution: {integrity: sha1-qLXakIhjGCDm9ggx4CvEc5mnbBU=}
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/once/1.4.0:
|
||||||
|
resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}
|
||||||
|
dependencies:
|
||||||
|
wrappy: 1.0.2
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/wrappy/1.0.2:
|
||||||
|
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
|
||||||
|
dev: false
|
||||||
20
packages/build-utils/test/fixtures/24-pnpm-hoisted/vercel.json
vendored
Normal file
20
packages/build-utils/test/fixtures/24-pnpm-hoisted/vercel.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"probes": [
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"mustContain": "Hello, World!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"logMustContain": "once"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"logMustContain": "exeggcute"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"logMustContain": "wrappy"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
7789
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/package-lock.json
generated
vendored
Normal file
7789
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/package-lock.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
14
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/package.json
vendored
Normal file
14
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/package.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"private": "true",
|
||||||
|
"name": "25-multiple-lock-files-yarn",
|
||||||
|
"workspaces": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "mkdir -p public && (printf \"yarn version: \" && yarn -v) > public/index.txt"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
19
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/pnpm-lock.yaml
generated
vendored
Normal file
19
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/pnpm-lock.yaml
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
|
specifiers:
|
||||||
|
once: ^1.4.0
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
once: 1.4.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/once/1.4.0:
|
||||||
|
resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}
|
||||||
|
dependencies:
|
||||||
|
wrappy: 1.0.2
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/wrappy/1.0.2:
|
||||||
|
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
|
||||||
|
dev: false
|
||||||
11
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/vercel.json
vendored
Normal file
11
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/vercel.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
|
||||||
|
"probes": [
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"mustContain": "yarn version: 1",
|
||||||
|
"logMustContain": "yarn run build"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
15
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/yarn.lock
vendored
Normal file
15
packages/build-utils/test/fixtures/25-multiple-lock-files-yarn/yarn.lock
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
once@^1.4.0:
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||||
|
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||||
|
dependencies:
|
||||||
|
wrappy "1"
|
||||||
|
|
||||||
|
wrappy@1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||||
|
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||||
44
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/package-lock.json
generated
vendored
Normal file
44
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"name": "26-multiple-lock-files-pnpm",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "26-multiple-lock-files-pnpm",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/once": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
|
"dependencies": {
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"once": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
|
"requires": {
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/package.json
vendored
Normal file
14
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/package.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"private": "true",
|
||||||
|
"name": "26-multiple-lock-files-pnpm",
|
||||||
|
"workspaces": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "mkdir -p public && (printf \"pnpm version: \" && pnpm -v) > public/index.txt"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
19
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/pnpm-lock.yaml
generated
vendored
Normal file
19
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/pnpm-lock.yaml
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
|
specifiers:
|
||||||
|
once: ^1.4.0
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
once: 1.4.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/once/1.4.0:
|
||||||
|
resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}
|
||||||
|
dependencies:
|
||||||
|
wrappy: 1.0.2
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/wrappy/1.0.2:
|
||||||
|
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
|
||||||
|
dev: false
|
||||||
3
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/pnpm-workspace.yaml
vendored
Normal file
3
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/pnpm-workspace.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
packages:
|
||||||
|
- 'a'
|
||||||
|
- 'b'
|
||||||
11
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/vercel.json
vendored
Normal file
11
packages/build-utils/test/fixtures/26-multiple-lock-files-pnpm/vercel.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
|
||||||
|
"probes": [
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"mustContain": "pnpm version: 6",
|
||||||
|
"logMustContain": "pnpm run build"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
15
packages/build-utils/test/fixtures/27-yarn-workspaces/a/package.json
vendored
Normal file
15
packages/build-utils/test/fixtures/27-yarn-workspaces/a/package.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "a",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"debug": "^4.3.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
15
packages/build-utils/test/fixtures/27-yarn-workspaces/b/package.json
vendored
Normal file
15
packages/build-utils/test/fixtures/27-yarn-workspaces/b/package.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"cowsay": "^1.5.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
9
packages/build-utils/test/fixtures/27-yarn-workspaces/package.json
vendored
Normal file
9
packages/build-utils/test/fixtures/27-yarn-workspaces/package.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "21-npm-workspaces",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"workspaces": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
232
packages/build-utils/test/fixtures/27-yarn-workspaces/yarn.lock
vendored
Normal file
232
packages/build-utils/test/fixtures/27-yarn-workspaces/yarn.lock
vendored
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
ansi-regex@^3.0.0:
|
||||||
|
version "3.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1"
|
||||||
|
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
|
||||||
|
|
||||||
|
ansi-regex@^5.0.1:
|
||||||
|
version "5.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||||
|
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||||
|
|
||||||
|
ansi-styles@^4.0.0:
|
||||||
|
version "4.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
||||||
|
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||||
|
dependencies:
|
||||||
|
color-convert "^2.0.1"
|
||||||
|
|
||||||
|
camelcase@^5.0.0:
|
||||||
|
version "5.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
|
||||||
|
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
|
||||||
|
|
||||||
|
cliui@^6.0.0:
|
||||||
|
version "6.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1"
|
||||||
|
integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==
|
||||||
|
dependencies:
|
||||||
|
string-width "^4.2.0"
|
||||||
|
strip-ansi "^6.0.0"
|
||||||
|
wrap-ansi "^6.2.0"
|
||||||
|
|
||||||
|
color-convert@^2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||||
|
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||||
|
dependencies:
|
||||||
|
color-name "~1.1.4"
|
||||||
|
|
||||||
|
color-name@~1.1.4:
|
||||||
|
version "1.1.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||||
|
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||||
|
|
||||||
|
cowsay@^1.5.0:
|
||||||
|
version "1.5.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/cowsay/-/cowsay-1.5.0.tgz#4a2a453b8b59383c7d7a50e44d765c5de0bf615f"
|
||||||
|
integrity sha512-8Ipzr54Z8zROr/62C8f0PdhQcDusS05gKTS87xxdji8VbWefWly0k8BwGK7+VqamOrkv3eGsCkPtvlHzrhWsCA==
|
||||||
|
dependencies:
|
||||||
|
get-stdin "8.0.0"
|
||||||
|
string-width "~2.1.1"
|
||||||
|
strip-final-newline "2.0.0"
|
||||||
|
yargs "15.4.1"
|
||||||
|
|
||||||
|
debug@^4.3.2:
|
||||||
|
version "4.3.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
||||||
|
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
||||||
|
dependencies:
|
||||||
|
ms "2.1.2"
|
||||||
|
|
||||||
|
decamelize@^1.2.0:
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||||
|
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
||||||
|
|
||||||
|
emoji-regex@^8.0.0:
|
||||||
|
version "8.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
|
||||||
|
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||||
|
|
||||||
|
find-up@^4.1.0:
|
||||||
|
version "4.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"
|
||||||
|
integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
|
||||||
|
dependencies:
|
||||||
|
locate-path "^5.0.0"
|
||||||
|
path-exists "^4.0.0"
|
||||||
|
|
||||||
|
get-caller-file@^2.0.1:
|
||||||
|
version "2.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||||
|
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||||
|
|
||||||
|
get-stdin@8.0.0:
|
||||||
|
version "8.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53"
|
||||||
|
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==
|
||||||
|
|
||||||
|
is-fullwidth-code-point@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
||||||
|
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
|
||||||
|
|
||||||
|
is-fullwidth-code-point@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
|
||||||
|
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||||
|
|
||||||
|
locate-path@^5.0.0:
|
||||||
|
version "5.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
|
||||||
|
integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==
|
||||||
|
dependencies:
|
||||||
|
p-locate "^4.1.0"
|
||||||
|
|
||||||
|
ms@2.1.2:
|
||||||
|
version "2.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
||||||
|
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||||
|
|
||||||
|
p-limit@^2.2.0:
|
||||||
|
version "2.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
|
||||||
|
integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==
|
||||||
|
dependencies:
|
||||||
|
p-try "^2.0.0"
|
||||||
|
|
||||||
|
p-locate@^4.1.0:
|
||||||
|
version "4.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07"
|
||||||
|
integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==
|
||||||
|
dependencies:
|
||||||
|
p-limit "^2.2.0"
|
||||||
|
|
||||||
|
p-try@^2.0.0:
|
||||||
|
version "2.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
|
||||||
|
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
|
||||||
|
|
||||||
|
path-exists@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
|
||||||
|
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
|
||||||
|
|
||||||
|
require-directory@^2.1.1:
|
||||||
|
version "2.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||||
|
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
|
||||||
|
|
||||||
|
require-main-filename@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
|
||||||
|
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
|
||||||
|
|
||||||
|
set-blocking@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
|
||||||
|
integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
|
||||||
|
|
||||||
|
string-width@^4.1.0, string-width@^4.2.0:
|
||||||
|
version "4.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||||
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||||
|
dependencies:
|
||||||
|
emoji-regex "^8.0.0"
|
||||||
|
is-fullwidth-code-point "^3.0.0"
|
||||||
|
strip-ansi "^6.0.1"
|
||||||
|
|
||||||
|
string-width@~2.1.1:
|
||||||
|
version "2.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
|
||||||
|
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
|
||||||
|
dependencies:
|
||||||
|
is-fullwidth-code-point "^2.0.0"
|
||||||
|
strip-ansi "^4.0.0"
|
||||||
|
|
||||||
|
strip-ansi@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
|
||||||
|
integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
|
||||||
|
dependencies:
|
||||||
|
ansi-regex "^3.0.0"
|
||||||
|
|
||||||
|
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||||
|
version "6.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||||
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||||
|
dependencies:
|
||||||
|
ansi-regex "^5.0.1"
|
||||||
|
|
||||||
|
strip-final-newline@2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
|
||||||
|
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
|
||||||
|
|
||||||
|
which-module@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
|
||||||
|
integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=
|
||||||
|
|
||||||
|
wrap-ansi@^6.2.0:
|
||||||
|
version "6.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53"
|
||||||
|
integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
|
||||||
|
dependencies:
|
||||||
|
ansi-styles "^4.0.0"
|
||||||
|
string-width "^4.1.0"
|
||||||
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
|
y18n@^4.0.0:
|
||||||
|
version "4.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf"
|
||||||
|
integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==
|
||||||
|
|
||||||
|
yargs-parser@^18.1.2:
|
||||||
|
version "18.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"
|
||||||
|
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
|
||||||
|
dependencies:
|
||||||
|
camelcase "^5.0.0"
|
||||||
|
decamelize "^1.2.0"
|
||||||
|
|
||||||
|
yargs@15.4.1:
|
||||||
|
version "15.4.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
|
||||||
|
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
|
||||||
|
dependencies:
|
||||||
|
cliui "^6.0.0"
|
||||||
|
decamelize "^1.2.0"
|
||||||
|
find-up "^4.1.0"
|
||||||
|
get-caller-file "^2.0.1"
|
||||||
|
require-directory "^2.1.1"
|
||||||
|
require-main-filename "^2.0.0"
|
||||||
|
set-blocking "^2.0.0"
|
||||||
|
string-width "^4.2.0"
|
||||||
|
which-module "^2.0.0"
|
||||||
|
y18n "^4.0.0"
|
||||||
|
yargs-parser "^18.1.2"
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user