Compare commits

..

8 Commits

Author SHA1 Message Date
Vercel Release Bot
2829d541b8 Version Packages (#10939) 2023-12-13 07:46:11 -07:00
Ethan Arrowood
6880dcb3c3 [cli] Use new deprecated query param in projects api for vc project ls --deprecated (#10938)
Uses the new `deprecated` query param for the GET /projects API instead of client-side filtering.

This enables a better UX so that results are properly paginated. 

Here are some example runs:

Pagination works as expected:
<img width="831" alt="Screenshot 2023-12-12 at 20 59 57" src="https://github.com/vercel/vercel/assets/16144158/c592752d-bf49-41a0-8dae-8b8e233052f8">

Usage without the flag results in different output (as expected!)
<img width="830" alt="Screenshot 2023-12-12 at 21 04 52" src="https://github.com/vercel/vercel/assets/16144158/c65461e0-b4a0-4725-aaae-a63739e6c8e9">
2023-12-13 07:22:10 +00:00
Trek Glowacki
832ba4b69a [tests] Add "Summary" Step to release workflow (#10936) 2023-12-12 15:08:12 -06:00
Vercel Release Bot
9a250d528c Version Packages (#10935)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@32.7.1

### Patch Changes

- [cli] double page limit for vc project ls --deprecated
([#10932](https://github.com/vercel/vercel/pull/10932))

- Updated dependencies
\[[`d09dd1794`](d09dd1794b)]:
    -   @vercel/remix-builder@2.0.14

## @vercel/remix-builder@2.0.14

### Patch Changes

- Reinstall dependencies during `prepareCache()`
([#10922](https://github.com/vercel/vercel/pull/10922))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-12 10:31:23 -07:00
Vercel Release Bot
382ff2f526 [tests] Update Gatsby fixture versions (#10931)
Automatically generated PR to update Gatsby fixture versions in
`@vercel/static-build`

---------

Co-authored-by: Ethan Arrowood <ethan.arrowood@vercel.com>
2023-12-12 09:52:07 -07:00
Ethan Arrowood
f80a59c73f [cli] double page limit for vc project ls --deprecated (#10932)
As titled. Increases api page size for `vc project ls` when
`--deprecated` is used.

This is a temporary workaround since we do the filtering "client-side".
We will eventually update the API itself to support this and then we can
remove the client-based filter and reduce the page limit back to the
ideal `20`.

---------

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-12-12 08:27:25 -07:00
Nathan Rajlich
d09dd1794b [remix] Reinstall dependencies during prepareCache() (#10922)
https://github.com/vercel/vercel/pull/10819 introduced a bug causing the `prepareCache()` function to fail (due to `@remix-run/dev` no longer being require-able). Even if it were not failing, the deps installed are not a valid representation of the user's `package.json` / lockfile. So to have more truthful cache contents, run `npm install` once again during `prepareCache()` to fix both issues at the same time.
2023-12-12 00:41:51 +00:00
Zack Tanner
ab34a26205 [tests] fix brittle next rewrite probe test (#10934)
It seems the intention of this test was to verify that the rewritten
file matches the original file, but it does so by just asserting on
arbitrary script text, which is brittle and broke as a result of
https://github.com/vercel/next.js/pull/56294

The right way to test this would be to fetch the original script and
compare the contents with the rewritten script, but this relies on
`__NEXT_SCRIPT__` magic which is only available in probe checks. For now
this just asserts on a valid status code, as a chunk that isn't properly
rewritten should 404 in this case.
2023-12-11 16:24:43 -08:00
14 changed files with 113 additions and 43 deletions

View File

@@ -76,3 +76,12 @@ jobs:
script: |
const script = require('./utils/update-latest-release.js')
await script({ github, context })
summary:
name: Summary
runs-on: ubuntu-latest
timeout-minutes: 5
needs:
- release
steps:
- name: Check All
run: echo OK

View File

@@ -1,5 +1,20 @@
# vercel
## 32.7.2
### Patch Changes
- [cli] Use new `deprecated` query param in projects api for `vc project ls --deprecated` ([#10938](https://github.com/vercel/vercel/pull/10938))
## 32.7.1
### Patch Changes
- [cli] double page limit for vc project ls --deprecated ([#10932](https://github.com/vercel/vercel/pull/10932))
- Updated dependencies [[`d09dd1794`](https://github.com/vercel/vercel/commit/d09dd1794b5ffa28c15d3ad2880b90db2f4c06f0)]:
- @vercel/remix-builder@2.0.14
## 32.7.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "32.7.0",
"version": "32.7.2",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -39,7 +39,7 @@
"@vercel/node": "3.0.12",
"@vercel/python": "4.1.0",
"@vercel/redwood": "2.0.5",
"@vercel/remix-builder": "2.0.13",
"@vercel/remix-builder": "2.0.14",
"@vercel/ruby": "2.0.4",
"@vercel/static-build": "2.0.14",
"chokidar": "3.3.1"

View File

@@ -28,15 +28,18 @@ export default async function list(
output.spinner(`Fetching projects in ${chalk.bold(contextName)}`);
let projectsUrl = '/v4/projects/?limit=20';
let projectsUrl = `/v4/projects/?limit=20`;
const deprecated = argv['--deprecated'] || false;
if (deprecated) {
projectsUrl += `&deprecated=${deprecated}`;
}
const next = argv['--next'] || false;
if (next) {
projectsUrl += `&until=${next}`;
}
const deprecated = argv['--deprecated'] || false;
let {
projects: projectList,
pagination,
@@ -52,19 +55,16 @@ export default async function list(
const elapsed = ms(Date.now() - start);
if (deprecated) {
const upcomingDeprecationVersions = NODE_VERSIONS.filter(
nodeVersion =>
const upcomingDeprecationVersionsList = [];
for (const nodeVersion of NODE_VERSIONS) {
if (
nodeVersion.discontinueDate &&
nodeVersion.discontinueDate.valueOf() > Date.now()
);
const upcomingDeprecationVersionsList = upcomingDeprecationVersions.map(
nodeVersion => nodeVersion.range
);
projectList = projectList.filter(
project =>
project.nodeVersion &&
upcomingDeprecationVersionsList.includes(project.nodeVersion)
);
) {
upcomingDeprecationVersionsList.push(nodeVersion.range);
}
}
output.warn(
`The following Node.js versions will be deprecated soon: ${upcomingDeprecationVersionsList.join(

View File

@@ -171,7 +171,7 @@
// should match /_next file after rewrite
{
"path": "/hidden/_next/__NEXT_SCRIPT__(/hello)",
"mustContain": "createElement"
"status": 200
},
// should allow redirecting to external resource
{

View File

@@ -1,5 +1,11 @@
# @vercel/remix-builder
## 2.0.14
### Patch Changes
- Reinstall dependencies during `prepareCache()` ([#10922](https://github.com/vercel/vercel/pull/10922))
## 2.0.13
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix-builder",
"version": "2.0.13",
"version": "2.0.14",
"license": "Apache-2.0",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",

View File

@@ -104,15 +104,17 @@ export const build: BuildV2 = async ({
meta
);
const { cliType, packageJsonPath, lockfileVersion } = await scanParentDirs(
entrypointFsDirname
);
const { cliType, packageJsonPath, lockfileVersion, lockfilePath } =
await scanParentDirs(entrypointFsDirname);
if (!packageJsonPath) {
throw new Error('Failed to locate `package.json` file in your project');
}
const pkgRaw = await fs.readFile(packageJsonPath, 'utf8');
const [lockfileRaw, pkgRaw] = await Promise.all([
lockfilePath ? fs.readFile(lockfilePath) : null,
fs.readFile(packageJsonPath, 'utf8'),
]);
const pkg = JSON.parse(pkgRaw);
const spawnOpts = getSpawnOptions(meta, nodeVersion);
@@ -423,9 +425,7 @@ module.exports = config;`;
cleanupOps.push(
fs
.rename(renamedRemixConfigPath, remixConfigPath)
.then(() =>
debug(`Restored original "${basename(remixConfigPath)}" file`)
)
.then(() => debug(`Restored original "${remixConfigPath}" file`))
);
}
// Restore original server entrypoint if it was modified (for Hydrogen v2)
@@ -433,11 +433,24 @@ module.exports = config;`;
cleanupOps.push(
fs
.writeFile(serverEntryPointAbs, originalServerEntryPoint)
.then(() =>
debug(`Restored original "${basename(serverEntryPointAbs!)}" file`)
)
.then(() => debug(`Restored original "${serverEntryPointAbs}" file`))
);
}
// Restore original `package.json` file and lockfile
if (depsModified) {
cleanupOps.push(
fs
.writeFile(packageJsonPath, pkgRaw)
.then(() => debug(`Restored original "${packageJsonPath}" file`))
);
if (lockfilePath && lockfileRaw) {
cleanupOps.push(
fs
.writeFile(lockfilePath, lockfileRaw)
.then(() => debug(`Restored original "${lockfilePath}" file`))
);
}
}
await Promise.all(cleanupOps);
}

View File

@@ -1,4 +1,9 @@
import { glob } from '@vercel/build-utils';
import {
getNodeVersion,
getSpawnOptions,
glob,
runNpmInstall,
} from '@vercel/build-utils';
import { dirname, join, relative } from 'path';
import { require_, chdirAndReadConfig } from './utils';
import type { PrepareCache } from '@vercel/build-utils';
@@ -7,10 +12,32 @@ export const prepareCache: PrepareCache = async ({
entrypoint,
repoRootPath,
workPath,
config,
}) => {
const root = repoRootPath || workPath;
const mountpoint = dirname(entrypoint);
const entrypointFsDirname = join(workPath, mountpoint);
// Because the `node_modules` directory was modified to install
// the forked Remix compiler, re-install to the "fresh" dependencies
// state before the cache gets created.
const nodeVersion = await getNodeVersion(
entrypointFsDirname,
undefined,
config
);
const spawnOpts = getSpawnOptions({}, nodeVersion);
await runNpmInstall(
entrypointFsDirname,
[],
{
...spawnOpts,
stdio: 'ignore',
},
undefined,
nodeVersion
);
const packageJsonPath = join(entrypointFsDirname, 'package.json');
const remixRunDevPath = dirname(
require_.resolve('@remix-run/dev/package.json', {

View File

@@ -8,7 +8,7 @@
"name": "gatsby-v5-pathprefix",
"version": "1.0.0",
"dependencies": {
"gatsby": "5.12.11",
"gatsby": "5.12.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
@@ -8609,9 +8609,9 @@
}
},
"node_modules/gatsby": {
"version": "5.12.11",
"resolved": "https://registry.npmjs.org/gatsby/-/gatsby-5.12.11.tgz",
"integrity": "sha512-4XuN4bo6W6JnIYkvaCeV+5fKTzxv78aAgOTEW4doupP8/bD0bgLwuIHFwnvhEMHQiGdALoKukLkqhkgAShUK0w==",
"version": "5.12.12",
"resolved": "https://registry.npmjs.org/gatsby/-/gatsby-5.12.12.tgz",
"integrity": "sha512-+PdcY2d4iRpMlzErNJzfCk63ucfha9ft8dYF/J70coXNp/qBirWKkho9wBe6Io1RESzVm4BxY+uVzFp8U6P0ew==",
"hasInstallScript": true,
"dependencies": {
"@babel/code-frame": "^7.18.6",

View File

@@ -15,7 +15,7 @@
"clean": "gatsby clean"
},
"dependencies": {
"gatsby": "5.12.11",
"gatsby": "5.12.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}

View File

@@ -5,7 +5,7 @@
"packages": {
"": {
"dependencies": {
"gatsby": "5.12.11",
"gatsby": "5.12.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
@@ -8606,9 +8606,9 @@
}
},
"node_modules/gatsby": {
"version": "5.12.11",
"resolved": "https://registry.npmjs.org/gatsby/-/gatsby-5.12.11.tgz",
"integrity": "sha512-4XuN4bo6W6JnIYkvaCeV+5fKTzxv78aAgOTEW4doupP8/bD0bgLwuIHFwnvhEMHQiGdALoKukLkqhkgAShUK0w==",
"version": "5.12.12",
"resolved": "https://registry.npmjs.org/gatsby/-/gatsby-5.12.12.tgz",
"integrity": "sha512-+PdcY2d4iRpMlzErNJzfCk63ucfha9ft8dYF/J70coXNp/qBirWKkho9wBe6Io1RESzVm4BxY+uVzFp8U6P0ew==",
"hasInstallScript": true,
"dependencies": {
"@babel/code-frame": "^7.18.6",
@@ -21814,9 +21814,9 @@
"integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ=="
},
"gatsby": {
"version": "5.12.11",
"resolved": "https://registry.npmjs.org/gatsby/-/gatsby-5.12.11.tgz",
"integrity": "sha512-4XuN4bo6W6JnIYkvaCeV+5fKTzxv78aAgOTEW4doupP8/bD0bgLwuIHFwnvhEMHQiGdALoKukLkqhkgAShUK0w==",
"version": "5.12.12",
"resolved": "https://registry.npmjs.org/gatsby/-/gatsby-5.12.12.tgz",
"integrity": "sha512-+PdcY2d4iRpMlzErNJzfCk63ucfha9ft8dYF/J70coXNp/qBirWKkho9wBe6Io1RESzVm4BxY+uVzFp8U6P0ew==",
"requires": {
"@babel/code-frame": "^7.18.6",
"@babel/core": "^7.20.12",

View File

@@ -8,7 +8,7 @@
"clean": "gatsby clean"
},
"dependencies": {
"gatsby": "5.12.11",
"gatsby": "5.12.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}

2
pnpm-lock.yaml generated
View File

@@ -334,7 +334,7 @@ importers:
specifier: 2.0.5
version: link:../redwood
'@vercel/remix-builder':
specifier: 2.0.13
specifier: 2.0.14
version: link:../remix
'@vercel/ruby':
specifier: 2.0.4