Update app and tooling
This commit is contained in:
parent
3046531bdd
commit
e620ec7349
4950 changed files with 2975120 additions and 10 deletions
202
node_modules/vercel/LICENSE
generated
vendored
Normal file
202
node_modules/vercel/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2017 Vercel, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
83
node_modules/vercel/README.md
generated
vendored
Normal file
83
node_modules/vercel/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<p align="center">
|
||||
<a href="https://vercel.com">
|
||||
<img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96">
|
||||
<h3 align="center">Vercel</h3>
|
||||
</a>
|
||||
<p align="center">Develop. Preview. Ship.</p>
|
||||
</p>
|
||||
|
||||
[Join the Vercel Community](https://community.vercel.com/)
|
||||
|
||||
## Usage
|
||||
|
||||
Vercel's frontend cloud gives developers frameworks, workflows, and infrastructure to build a faster, more personalized web.
|
||||
|
||||
To install the latest version of Vercel CLI, run this command:
|
||||
|
||||
```bash
|
||||
npm i -g vercel
|
||||
```
|
||||
|
||||
To quickly start a new project, run the following commands:
|
||||
|
||||
```bash
|
||||
vercel init # Pick an example project
|
||||
cd <PROJECT> # Change directory to the new project
|
||||
vercel # Deploy to the cloud
|
||||
```
|
||||
|
||||
Finally, [connect your Git repository to Vercel](https://vercel.com/docs/git) and deploy with `git push`.
|
||||
|
||||
## Documentation
|
||||
|
||||
For details on how to use Vercel CLI, check out our [documentation](https://vercel.com/docs/cli).
|
||||
|
||||
## Local Development
|
||||
|
||||
To develop Vercel CLI, first check out the source code, install dependencies, and build all packages:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/vercel/vercel.git
|
||||
cd vercel
|
||||
pnpm install
|
||||
pnpm build
|
||||
```
|
||||
|
||||
At this point you can make modifications to the CLI source code and test them out locally. The CLI source code is located in the `packages/cli` directory.
|
||||
|
||||
```bash
|
||||
cd packages/cli
|
||||
```
|
||||
|
||||
### `pnpm vercel <cli-commands...>`
|
||||
|
||||
From within the `packages/cli` directory, you can use the "vercel" script to quickly execute Vercel CLI from its TypeScript source code directly (without having to manually compile first). For example:
|
||||
|
||||
```bash
|
||||
pnpm vercel deploy
|
||||
pnpm vercel whoami
|
||||
pnpm vercel login
|
||||
pnpm vercel switch --debug
|
||||
```
|
||||
|
||||
When you are satisfied with your changes, make a commit and create a pull request!
|
||||
|
||||
### Full Testing
|
||||
|
||||
`pnpm vercel` executes a locally built dist. Because this dist lives locally in this monorepo,
|
||||
the existence of node_modules can sometimes affect the behavior of how `vercel` CLI picking
|
||||
up dependencies. To test the full user experience of downloading the CLI from the npm registry:
|
||||
|
||||
```bash
|
||||
# build the dist
|
||||
monorepo_dir=$(pwd)
|
||||
cd packages/cli && turbo build
|
||||
# use pnpm pack to create the same tarball that is uploaded to the npm registry
|
||||
# and store the tarball name in a variable
|
||||
dist=$(pnpm pack)
|
||||
|
||||
# In your test project
|
||||
cd ~/dev/test-nextjs-proj
|
||||
|
||||
npx -p $monorepo_dir/packages/cli/$dist vercel build
|
||||
```
|
||||
11
node_modules/vercel/dist/VERCEL_DIR_README.txt
generated
vendored
Normal file
11
node_modules/vercel/dist/VERCEL_DIR_README.txt
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
> Why do I have a folder named ".vercel" in my project?
|
||||
The ".vercel" folder is created when you link a directory to a Vercel project.
|
||||
|
||||
> What does the "project.json" file contain?
|
||||
The "project.json" file contains:
|
||||
- The ID of the Vercel project that you linked ("projectId")
|
||||
- The ID of the user or team your Vercel project is owned by ("orgId")
|
||||
|
||||
> Should I commit the ".vercel" folder?
|
||||
No, you should not share the ".vercel" folder with anyone.
|
||||
Upon creation, it will be automatically added to your ".gitignore" file.
|
||||
62
node_modules/vercel/dist/builder-worker.cjs
generated
vendored
Normal file
62
node_modules/vercel/dist/builder-worker.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* This file gets copied out of the `pkg` snapshot filesystem into the `vc dev`
|
||||
* builder cache directory, so it's very important that it does not rely on any
|
||||
* modules from npm that would not be available in that directory (so basically,
|
||||
* only Vercel Runtimes and `@vercel/build-utils`.
|
||||
*/
|
||||
const { FileFsRef } = require('@vercel/build-utils');
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Exiting builder due to build error:');
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('message', onMessage);
|
||||
|
||||
function onMessage(message) {
|
||||
processMessage(message).catch(err => {
|
||||
Object.defineProperty(err, 'message', { enumerable: true });
|
||||
Object.defineProperty(err, 'stack', { enumerable: true });
|
||||
process.removeListener('message', onMessage);
|
||||
process.send({ type: 'buildResult', error: err }, () => process.exit(1));
|
||||
});
|
||||
}
|
||||
|
||||
async function processMessage(message) {
|
||||
const { requirePath, buildOptions } = message;
|
||||
const builder = require(requirePath);
|
||||
|
||||
// Convert the `files` to back into `FileFsRef` instances
|
||||
for (const name of Object.keys(buildOptions.files)) {
|
||||
const ref = Object.assign(
|
||||
Object.create(FileFsRef.prototype),
|
||||
buildOptions.files[name]
|
||||
);
|
||||
buildOptions.files[name] = ref;
|
||||
}
|
||||
|
||||
const result = await builder.build(buildOptions);
|
||||
|
||||
// `@vercel/next` sets this, but it causes "Converting circular
|
||||
// structure to JSON" errors, so delete the property...
|
||||
delete result.childProcesses;
|
||||
|
||||
if (builder.version === 3) {
|
||||
if (result.output.type === 'Lambda') {
|
||||
result.output.zipBuffer = await result.output.createZip();
|
||||
}
|
||||
} else {
|
||||
for (const output of Object.values(result.output)) {
|
||||
if (output.type === 'Lambda') {
|
||||
output.zipBuffer = await output.createZip();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
process.send({ type: 'buildResult', result });
|
||||
}
|
||||
|
||||
process.send({ type: 'ready' });
|
||||
272
node_modules/vercel/dist/get-latest-worker.cjs
generated
vendored
Normal file
272
node_modules/vercel/dist/get-latest-worker.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
/**
|
||||
* This file is spawned in the background and checks npm for the latest version
|
||||
* of the CLI, then writes the version to the cache file.
|
||||
*
|
||||
* NOTE: Since this file runs asynchronously in the background, it's possible
|
||||
* for multiple instances of this file to be running at the same time leading
|
||||
* to a race condition where the most recent instance will overwrite the
|
||||
* previous cache file resetting the `notified` flag and cause the update
|
||||
* notification to appear for multiple consequetive commands. Not the end of
|
||||
* the world, but something to be aware of.
|
||||
*
|
||||
* IMPORTANT! This file must NOT depend on any 3rd party dependencies. This
|
||||
* file is NOT bundled by `esbuild` and thus any 3rd party dependencies will
|
||||
* never be available.
|
||||
*/
|
||||
|
||||
const https = require('https');
|
||||
const { mkdirSync, writeFileSync } = require('fs');
|
||||
const { access, mkdir, readFile, unlink, writeFile } = require('fs/promises');
|
||||
const path = require('path');
|
||||
const { format, inspect } = require('util');
|
||||
|
||||
/**
|
||||
* An simple output helper which accumulates error and debug log messages in
|
||||
* memory for potential persistence to disk while immediately outputting errors
|
||||
* and debug messages, when the `--debug` flag is set, to `stderr`.
|
||||
*/
|
||||
class WorkerOutput {
|
||||
debugLog = [];
|
||||
logFile = null;
|
||||
|
||||
constructor({ debug = true }) {
|
||||
this.debugOutputEnabled = debug;
|
||||
}
|
||||
|
||||
debug(...args) {
|
||||
this.print('debug', args);
|
||||
}
|
||||
|
||||
error(...args) {
|
||||
this.print('error', args);
|
||||
}
|
||||
|
||||
print(type, args) {
|
||||
// note: `args` may contain an `Error` that will be toString()'d and thus
|
||||
// no stack trace
|
||||
const str = format(
|
||||
...args.map(s => (typeof s === 'string' ? s : inspect(s)))
|
||||
);
|
||||
this.debugLog.push(`[${new Date().toISOString()}] [${type}] ${str}`);
|
||||
if (type === 'debug' && this.debugOutputEnabled) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`> '[debug] [${new Date().toISOString()}] ${str}`);
|
||||
} else if (type === 'error') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Error: ${str}`);
|
||||
}
|
||||
}
|
||||
|
||||
setLogFile(file) {
|
||||
// wire up the exit handler the first time the log file is set
|
||||
if (this.logFile === null) {
|
||||
process.on('exit', () => {
|
||||
if (this.debugLog.length) {
|
||||
mkdirSync(path.dirname(this.logFile), { recursive: true });
|
||||
writeFileSync(this.logFile, this.debugLog.join('\n'));
|
||||
}
|
||||
});
|
||||
}
|
||||
this.logFile = file;
|
||||
}
|
||||
}
|
||||
|
||||
const output = new WorkerOutput({
|
||||
// enable the debug logging if the `--debug` is set or if this worker script
|
||||
// was directly executed
|
||||
debug: process.argv.includes('--debug') || !process.connected,
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
output.error('Exiting worker due to unhandled rejection:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// this timer will prevent this worker process from running longer than 10s
|
||||
const timer = setTimeout(() => {
|
||||
output.error('Worker timed out after 10 seconds');
|
||||
process.exit(1);
|
||||
}, 10000);
|
||||
|
||||
// wait for the parent to give us the work payload
|
||||
process.once('message', async msg => {
|
||||
output.debug('Received message from parent:', msg);
|
||||
|
||||
output.debug('Disconnecting from parent');
|
||||
process.disconnect();
|
||||
|
||||
const { cacheFile, distTag, name, updateCheckInterval } = msg;
|
||||
const cacheFileParsed = path.parse(cacheFile);
|
||||
await mkdir(cacheFileParsed.dir, { recursive: true });
|
||||
|
||||
output.setLogFile(
|
||||
path.join(cacheFileParsed.dir, `${cacheFileParsed.name}.log`)
|
||||
);
|
||||
|
||||
const lockFile = path.join(
|
||||
cacheFileParsed.dir,
|
||||
`${cacheFileParsed.name}.lock`
|
||||
);
|
||||
|
||||
try {
|
||||
// check for a lock file and either bail if running or write our pid and continue
|
||||
output.debug(`Checking lock file: ${lockFile}`);
|
||||
if (await isRunning(lockFile)) {
|
||||
output.debug('Worker already running, exiting');
|
||||
process.exit(1);
|
||||
}
|
||||
output.debug(`Initializing lock file with pid ${process.pid}`);
|
||||
await writeFile(lockFile, String(process.pid), 'utf-8');
|
||||
|
||||
const tags = await fetchDistTags(name);
|
||||
const version = tags[distTag];
|
||||
const expireAt = Date.now() + updateCheckInterval;
|
||||
const notifyAt = await getNotifyAt(cacheFile, version);
|
||||
|
||||
if (version) {
|
||||
output.debug(`Found dist tag "${distTag}" with version "${version}"`);
|
||||
} else {
|
||||
output.error(`Dist tag "${distTag}" not found`);
|
||||
output.debug('Available dist tags:', Object.keys(tags));
|
||||
}
|
||||
|
||||
output.debug(`Writing cache file: ${cacheFile}`);
|
||||
await writeFile(
|
||||
cacheFile,
|
||||
JSON.stringify({
|
||||
expireAt,
|
||||
notifyAt,
|
||||
version,
|
||||
})
|
||||
);
|
||||
} catch (err) {
|
||||
output.error(`Failed to get package info:`, err);
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
|
||||
if (await fileExists(lockFile)) {
|
||||
output.debug(`Releasing lock file: ${lockFile}`);
|
||||
await unlink(lockFile);
|
||||
}
|
||||
|
||||
output.debug(`Worker finished successfully!`);
|
||||
|
||||
// force the worker to exit
|
||||
process.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
// signal the parent process we're ready
|
||||
if (process.connected) {
|
||||
output.debug("Notifying parent we're ready");
|
||||
process.send({ type: 'ready' });
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('No IPC bridge detected, exiting');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
async function fileExists(file) {
|
||||
return access(file)
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
}
|
||||
|
||||
async function isRunning(lockFile) {
|
||||
try {
|
||||
const pid = parseInt(await readFile(lockFile, 'utf-8'));
|
||||
output.debug(`Found lock file with pid: ${pid}`);
|
||||
|
||||
// checks for existence of a process; throws if not found
|
||||
process.kill(pid, 0);
|
||||
|
||||
// process is still running
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (await fileExists(lockFile)) {
|
||||
// lock file does not exist or process is not running and pid is stale
|
||||
output.debug(`Resetting lock file: ${err.toString()}`);
|
||||
await unlink(lockFile);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to load and return the previous `notifyAt` value.
|
||||
*
|
||||
* If the latest version is newer than the previous latest version, then
|
||||
* return `undefined` to invalidate `notifyAt` which forces the notification
|
||||
* to be displayed, otherwise keep the existing `notifyAt`.
|
||||
*
|
||||
* @param {string} cacheFile The path to the cache file
|
||||
* @param {string} version The latest version
|
||||
* @returns {number | undefined} The previous notifyAt
|
||||
*/
|
||||
async function getNotifyAt(cacheFile, version) {
|
||||
try {
|
||||
const old = JSON.parse(await readFile(cacheFile, 'utf-8'));
|
||||
if (old?.version && old.version === version) {
|
||||
return old.notifyAt;
|
||||
}
|
||||
} catch (err) {
|
||||
// cache does not exist or malformed
|
||||
if (err.code !== 'ENOENT') {
|
||||
output.debug(`Error reading latest package cache file: ${err}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the dist tags from npm for a given package.
|
||||
*
|
||||
* @param {string} name The package name
|
||||
* @returns A map of dist tags to versions
|
||||
*/
|
||||
async function fetchDistTags(name) {
|
||||
// fetch the latest version from npm
|
||||
const agent = new https.Agent({
|
||||
keepAlive: true,
|
||||
maxSockets: 15, // See: `npm config get maxsockets`
|
||||
});
|
||||
const headers = {
|
||||
accept:
|
||||
'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
|
||||
};
|
||||
const url = `https://registry.npmjs.org/-/package/${name}/dist-tags`;
|
||||
output.debug(`Fetching ${url}`);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const req = https.get(
|
||||
url,
|
||||
{
|
||||
agent,
|
||||
headers,
|
||||
},
|
||||
res => {
|
||||
let buf = '';
|
||||
res.on('data', chunk => {
|
||||
buf += chunk;
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
if (res.statusCode && res.statusCode >= 400) {
|
||||
return reject(
|
||||
new Error(
|
||||
`Fetch dist-tags failed ${res.statusCode} ${res.statusMessage}`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
resolve(JSON.parse(buf));
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
req.on('error', reject);
|
||||
req.end();
|
||||
});
|
||||
}
|
||||
197962
node_modules/vercel/dist/index.js
generated
vendored
Normal file
197962
node_modules/vercel/dist/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/vercel/dist/vc.js
generated
vendored
Executable file
12
node_modules/vercel/dist/vc.js
generated
vendored
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env node
|
||||
// This shim defers loading the real module until the compile cache is enabled.
|
||||
// https://nodejs.org/api/module.html#moduleenablecompilecachecachedir
|
||||
// enableCompileCache was added in Node.js 22.8.0, so we need to handle older versions.
|
||||
try {
|
||||
const { enableCompileCache } = await import('node:module');
|
||||
if (enableCompileCache) {
|
||||
enableCompileCache();
|
||||
}
|
||||
} catch {}
|
||||
|
||||
await import('./index.js');
|
||||
197
node_modules/vercel/package.json
generated
vendored
Normal file
197
node_modules/vercel/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
{
|
||||
"name": "vercel",
|
||||
"version": "50.9.5",
|
||||
"type": "module",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
"homepage": "https://vercel.com",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vercel/vercel.git",
|
||||
"directory": "packages/cli"
|
||||
},
|
||||
"bin": {
|
||||
"vc": "./dist/vc.js",
|
||||
"vercel": "./dist/vc.js"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/blob": "1.0.2",
|
||||
"@vercel/fun": "1.2.1",
|
||||
"chokidar": "4.0.0",
|
||||
"esbuild": "0.27.0",
|
||||
"form-data": "^4.0.0",
|
||||
"jose": "5.9.6",
|
||||
"@vercel/backends": "0.0.23",
|
||||
"@vercel/build-utils": "13.2.16",
|
||||
"@vercel/detect-agent": "1.1.0",
|
||||
"@vercel/elysia": "0.1.27",
|
||||
"@vercel/express": "0.1.34",
|
||||
"@vercel/fastify": "0.1.30",
|
||||
"@vercel/go": "3.3.4",
|
||||
"@vercel/h3": "0.1.36",
|
||||
"@vercel/hono": "0.2.30",
|
||||
"@vercel/hydrogen": "1.3.5",
|
||||
"@vercel/koa": "0.1.10",
|
||||
"@vercel/nestjs": "0.2.31",
|
||||
"@vercel/next": "4.15.19",
|
||||
"@vercel/node": "5.5.28",
|
||||
"@vercel/python": "6.4.1",
|
||||
"@vercel/redwood": "2.4.9",
|
||||
"@vercel/remix-builder": "5.5.9",
|
||||
"@vercel/ruby": "2.2.5",
|
||||
"@vercel/rust": "1.0.5",
|
||||
"@vercel/static-build": "2.8.28"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
"@edge-runtime/node-utils": "2.3.0",
|
||||
"@inquirer/checkbox": "2.2.2",
|
||||
"@inquirer/confirm": "3.1.2",
|
||||
"@inquirer/expand": "2.1.2",
|
||||
"@inquirer/input": "2.1.2",
|
||||
"@inquirer/password": "2.1.2",
|
||||
"@inquirer/search": "2.0.1",
|
||||
"@inquirer/select": "2.2.2",
|
||||
"@next/env": "11.1.2",
|
||||
"@sentry/node": "7.120.1",
|
||||
"@sindresorhus/slugify": "0.11.0",
|
||||
"@swc/core": "1.2.218",
|
||||
"@tootallnate/once": "1.1.2",
|
||||
"@types/async-retry": "1.2.1",
|
||||
"@types/bytes": "3.0.0",
|
||||
"@types/chance": "1.1.3",
|
||||
"@types/debug": "0.0.31",
|
||||
"@types/dotenv": "6.1.1",
|
||||
"@types/escape-html": "0.0.20",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"@types/ini": "1.3.31",
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/jest-expect-message": "1.0.3",
|
||||
"@types/json-parse-better-errors": "1.0.0",
|
||||
"@types/load-json-file": "2.0.7",
|
||||
"@types/mime-types": "2.1.0",
|
||||
"@types/minimatch": "3.0.3",
|
||||
"@types/mock-fs": "4.13.4",
|
||||
"@types/ms": "0.7.30",
|
||||
"@types/node": "20.11.0",
|
||||
"@types/node-fetch": "2.5.10",
|
||||
"@types/npm-package-arg": "6.1.0",
|
||||
"@types/pluralize": "0.0.29",
|
||||
"@types/qs": "6.9.7",
|
||||
"@types/semver": "6.0.1",
|
||||
"@types/split2": "4.2.3",
|
||||
"@types/tar-fs": "1.16.1",
|
||||
"@types/title": "3.4.1",
|
||||
"@types/update-notifier": "5.1.0",
|
||||
"@types/which": "3.0.0",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vitest/expect": "2.1.3",
|
||||
"ajv": "6.12.3",
|
||||
"alpha-sort": "2.0.1",
|
||||
"ansi-escapes": "4.3.2",
|
||||
"ansi-regex": "5.0.1",
|
||||
"arg": "5.0.0",
|
||||
"async-listen": "3.0.0",
|
||||
"async-retry": "1.1.3",
|
||||
"async-sema": "2.1.4",
|
||||
"bytes": "3.0.0",
|
||||
"chalk": "4.1.0",
|
||||
"chance": "1.1.7",
|
||||
"ci-info": "4.1.0",
|
||||
"cli-table3": "0.6.3",
|
||||
"codecov": "3.8.2",
|
||||
"date-fns": "1.29.0",
|
||||
"debug": "3.1.0",
|
||||
"dot": "1.1.3",
|
||||
"dotenv": "4.0.0",
|
||||
"email-validator": "1.1.1",
|
||||
"epipebomb": "1.0.0",
|
||||
"escape-html": "1.0.3",
|
||||
"esm": "3.1.4",
|
||||
"execa": "3.2.0",
|
||||
"expect": "29.5.0",
|
||||
"express": "4.21.1",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"find-up": "4.1.0",
|
||||
"fs-extra": "10.0.0",
|
||||
"get-port": "5.1.1",
|
||||
"git-last-commit": "1.0.1",
|
||||
"http-proxy-node16": "1.0.6",
|
||||
"ini": "3.0.0",
|
||||
"is-docker": "2.2.1",
|
||||
"is-port-reachable": "3.1.0",
|
||||
"is-url": "1.2.2",
|
||||
"jaro-winkler": "0.2.8",
|
||||
"jest-junit": "16.0.0",
|
||||
"jest-matcher-utils": "29.3.1",
|
||||
"json-parse-better-errors": "1.0.2",
|
||||
"jsonlines": "0.1.1",
|
||||
"line-async-iterator": "3.0.0",
|
||||
"load-json-file": "3.0.0",
|
||||
"memfs": "4.14.0",
|
||||
"mime-types": "2.1.24",
|
||||
"minimatch": "3.1.2",
|
||||
"mock-fs": "5.5.0",
|
||||
"ms": "2.1.2",
|
||||
"node-fetch": "2.6.7",
|
||||
"npm-package-arg": "6.1.0",
|
||||
"open": "8.4.0",
|
||||
"ora": "3.4.0",
|
||||
"pcre-to-regexp": "1.0.0",
|
||||
"pluralize": "7.0.0",
|
||||
"promisepipe": "3.0.0",
|
||||
"proxy": "2.1.1",
|
||||
"proxy-agent": "6.4.0",
|
||||
"qr-image": "3.2.0",
|
||||
"raw-body": "2.4.1",
|
||||
"rimraf": "3.0.2",
|
||||
"semver": "5.7.2",
|
||||
"serve-handler": "6.1.1",
|
||||
"split2": "4.2.0",
|
||||
"strip-ansi": "6.0.1",
|
||||
"supports-hyperlinks": "3.0.0",
|
||||
"tar-fs": "1.16.3",
|
||||
"title": "3.4.1",
|
||||
"tldts": "6.1.47",
|
||||
"tmp-promise": "1.0.3",
|
||||
"tree-kill": "1.2.2",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "4.9.5",
|
||||
"utility-types": "2.1.0",
|
||||
"vite": "^5.1.6",
|
||||
"vitest": "^2.1.3",
|
||||
"which": "3.0.0",
|
||||
"write-json-file": "2.2.0",
|
||||
"xdg-app-paths": "5.1.0",
|
||||
"yauzl-promise": "2.1.3",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel-internals/get-package-json": "1.0.0",
|
||||
"@vercel-internals/types": "3.0.6",
|
||||
"@vercel/client": "17.2.31",
|
||||
"@vercel/error-utils": "2.0.3",
|
||||
"@vercel/frameworks": "3.16.1",
|
||||
"@vercel/fs-detectors": "5.7.19",
|
||||
"@vercel/routing-utils": "5.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail",
|
||||
"vitest-run": "vitest --config ./vitest.config.mts",
|
||||
"vitest-unit": "jest test/unit/ --listTests",
|
||||
"test-e2e-node-all-versions": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts test/integration-link-env-pull.test.ts",
|
||||
"test-dev": "pnpm test test/dev/",
|
||||
"coverage": "codecov",
|
||||
"build": "node scripts/build.mjs",
|
||||
"dev": "echo \"'pnpm dev [command]' has been removed. Use 'pnpm vercel [command]' instead.\" && exit 1",
|
||||
"vercel": "pnpm build && node ./dist/vc.js",
|
||||
"vc": "pnpm vercel",
|
||||
"type-check": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue