Compare commits

...

23 Commits

Author SHA1 Message Date
Vercel Release Bot
c97407da49 Version Packages (#10361)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-21 15:10:45 -05:00
Steven
37f5c62700 BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 (#10369)
https://vercel.com/changelog/node-js-14-and-16-are-being-deprecated


https://github.com/nodejs/Release/blob/main/README.md#end-of-life-releases
2023-08-21 08:51:38 -04:00
Trek Glowacki
104ab0332d [cli] Wrap description in help output (#10370)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-18 15:01:45 -05:00
Vercel Release Bot
8ed71bea65 [examples][tests] Upgrade Next.js to version 13.4.18 (#10366)
This auto-generated PR updates 3 packages to Next.js version 13.4.18
2023-08-18 13:36:13 -04:00
Chris Barber
bc7a5d38be Exclude Gatsby from default 404 error route (#10365)
All static builds (except Next.js) have a default 404 error route. This PR add the exclusion of Gatsby from being assigned a 404 error route. The error routes are now introduced by the `gatsby-plugin-vercel-builder`.

Linear: https://linear.app/vercel/issue/VCCLI-749/fix-gatsby-404500-pages-directory-listing-bug
2023-08-18 17:10:40 +00:00
Nathan Rajlich
09174df6cf [remix] Only add workspace check flag for Yarn v1 (#10364)
Yarn v2/v3 do not require this flag.
2023-08-17 19:17:28 +00:00
Trek Glowacki
6aa2dc6f51 Connecting Datadog / GH Actions / Turbo / Jest to detect flakey tests (#10334)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
Co-authored-by: Steven <steven@ceriously.com>
2023-08-17 10:31:16 -05:00
Vercel Release Bot
9db3794735 [examples][tests] Upgrade Next.js to version 13.4.17 (#10362)
This auto-generated PR updates 3 packages to Next.js version 13.4.17
2023-08-17 10:09:28 -04:00
Nathan Rajlich
ed806d8a6b [frameworks][fs-detectors] Add "supersedes" prop to Framework interface (#10345)
The `supersedes` property on the `Framework` interface may be specified by a framework in which the superseded framework should _not_ be included in the resulting framework matches during detection.

For example, a Hydrogen v2 project matches both the "remix" and "hydrogen" framework detectors, but we really only want "remix" to be selected.
2023-08-17 07:30:32 +00:00
Vercel Release Bot
de9a1dbab7 Version Packages (#10359)
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@31.4.0

### Minor Changes

- Force-publish ([#10358](https://github.com/vercel/vercel/pull/10358))

### Patch Changes

- Updated dependencies
\[[`6e44757ff`](6e44757ff5)]:
    -   @vercel/static-build@1.4.0

## @vercel/static-build@1.4.0

### Minor Changes

- Force-publish ([#10358](https://github.com/vercel/vercel/pull/10358))
2023-08-16 20:34:05 -07:00
Nathan Rajlich
ae9b33b801 Force-publish on @vercel/static-build 2023-08-16 20:12:12 -07:00
Chris Barber
6e44757ff5 v31.4.0 (#10358)
https://github.com/vercel/vercel/pull/10356 didn't publish a new CLI release, so this PR should do the trick.
2023-08-16 23:19:43 +00:00
Vercel Release Bot
8dcefe5e83 Version Packages (#10356)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-16 18:02:42 -05:00
Riz
65ab3b23e9 [frameworks] Amend Hugo default buildCommand to exclude drafts enabled flag (#7326)
### Related Issues

Reported in https://github.com/vercel/community/discussions/194

Having the `-D` flag results in all draft content to be published (docs reference [here](https://gohugo.io/getting-started/usage/)).

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2023-08-16 21:29:09 +00:00
Nathan Rajlich
8f152a5939 [build-utils] Fix Node 14.x tests (#10355) 2023-08-16 20:59:14 +00:00
Nathan Rajlich
10a6aa55f9 [tests] Fix failures due to Node 14.x being discontinued (#10346)
This PR upgrades test fixtures from Node.js 14 to 16 and also removes
the `35-puppeteer` test fixture since it doesn't support Node.js 16
unfortunately.

- See https://github.com/alixaxel/chrome-aws-lambda/pull/274

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-08-15 17:59:21 -04:00
Vercel Release Bot
936a428420 [examples][tests] Upgrade Next.js to version 13.4.16 (#10344)
This auto-generated PR updates 3 packages to Next.js version 13.4.16

Closes #10339
2023-08-15 15:21:06 +00:00
Steven
a93e1a7a64 [examples] update ember example (#10347)
This PR updates the ember example using the following:

```
npx ember new ember-quickstart --lang en
```

I also had to add `{ 'ember-welcome-page': { enabled: true } }` to the
build config because the `<WelcomePage>` only works in dev, but throws
when using the default build command:

```
ember build --environment=production
```

For posterity, the error looks like:
```
Uncaught TypeError: Cannot destructure property 'manager' of 'e' as it is null.
    at u.resolvedComponent (vendor-2e12520b7a71eead28708a24fafa7fbc.js:2094:28)
    at vendor-2e12520b7a71eead28708a24fafa7fbc.js:1999:5
    at ne (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1999:30)
    at l (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1991:18)
    at vendor-2e12520b7a71eead28708a24fafa7fbc.js:1981:836
    at _.compile (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1938:173)
    at re (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1991:61)
    at vendor-2e12520b7a71eead28708a24fafa7fbc.js:1988:30
    at ee.compile (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1989:23)
    at Object.evaluate (vendor-2e12520b7a71eead28708a24fafa7fbc.js:2431:224)
```

- Related https://github.com/emberjs/ember.js/issues/19912
- Related https://github.com/ember-cli/ember-welcome-page/issues/385
2023-08-15 11:05:31 -04:00
Trek Glowacki
4ba188ce44 [cli] fix tyops (#10338)
Followup to #10333
2023-08-15 07:33:24 +00:00
Vercel Release Bot
7682c9234c Version Packages (#10343)
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@31.3.1

### Patch Changes

- Updated dependencies
\[[`844fb6e88`](844fb6e880)]:
    -   @vercel/remix-builder@1.10.1

## @vercel/remix-builder@1.10.1

### Patch Changes

- Set default env vars for Hydrogen v2 deployments
([#10341](https://github.com/vercel/vercel/pull/10341))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-14 18:13:53 -07:00
Nathan Rajlich
844fb6e880 [remix] Set default env vars for Hydrogen v2 deployments (#10341)
In order to make the default mock shop created from `npm create @shopify/hydrogen@latest` work out-of-the-box and without additional configuration, set the necessary default environment variables to make the server not render an error.
2023-08-15 01:11:01 +00:00
Nathan Rajlich
ae20c7230f [cli] Use vercel-php@0.6.0 in e2e test fixture (#10342)
`0.5.2` uses Node 14, so this test was failing.

<img width="934" alt="Screenshot 2023-08-14 at 5 13 31 PM"
src="https://github.com/vercel/vercel/assets/71256/654c8f71-6006-4b98-9ef0-fe288651d158">
2023-08-14 17:50:52 -07:00
Nathan Rajlich
a36b8eb738 [examples] Update "hydrogen-2" template readme (#10340)
A few tweaks to the readme file for `hydrogen-2`, based on feedback from
Shopify.
2023-08-14 16:05:12 -07:00
148 changed files with 25170 additions and 12812 deletions

View File

@@ -47,7 +47,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 360
check_interval: 5
test:
timeout-minutes: 120
runs-on: ${{ matrix.runner }}
@@ -75,7 +74,6 @@ jobs:
run: npm i -g pnpm@8.3.1
- run: pnpm install
- name: fetch ssl certificate before build (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
@@ -88,6 +86,7 @@ jobs:
run: node utils/gen.js && node_modules/.bin/turbo run test --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
shell: bash
env:
JEST_JUNIT_OUTPUT_FILE: ${{github.workspace}}/.junit-reports/${{matrix.scriptName}}-${{matrix.packageName}}-${{matrix.chunkNumber}}-${{ matrix.runner }}.xml
VERCEL_CLI_VERSION: ${{ needs.setup.outputs.dplUrl }}/tarballs/vercel.tgz
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
@@ -97,6 +96,13 @@ jobs:
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: 'Upload Test Report to Datadog'
if: always()
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
env:
DATADOG_API_KEY: ${{secrets.DATADOG_API_KEY_CLI}}
DD_ENV: ci
summary:
name: Summary
runs-on: ubuntu-latest

1
.gitignore vendored
View File

@@ -31,3 +31,4 @@ __pycache__
.turbo
.eslintcache
turbo-cache-key.json
junit.xml

View File

@@ -387,7 +387,6 @@ This is an abstract enumeration type that is implemented by one of the following
- `nodejs18.x`
- `nodejs16.x`
- `nodejs14.x`
- `go1.x`
- `java11`
- `python3.9`

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2020",
"target": "ES2021",
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,

View File

@@ -4,7 +4,6 @@
root = true
[*]
end_of_line = lf
charset = utf-8

View File

@@ -5,5 +5,11 @@
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
"disableAnalytics": false,
/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}

View File

@@ -1,20 +1,13 @@
# unconventional js
/blueprints/*/files/
/vendor/
# compiled output
/dist/
/tmp/
# dependencies
/bower_components/
/node_modules/
# misc
/coverage/
!.*
.*/
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

View File

@@ -1,11 +1,24 @@
'use strict';
module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
@@ -14,14 +27,16 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js',
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
@@ -30,18 +45,12 @@ module.exports = {
browser: false,
node: true,
},
plugins: ['node'],
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
{
// add your custom rules and overrides for node files here
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
}
),
extends: ['plugin:n/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};

47
examples/ember/.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: CI
on:
push:
branches:
- main
- master
pull_request: {}
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
test:
name: "Test"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: npm test

View File

@@ -1,32 +1,32 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist/
/tmp/
# dependencies
/bower_components/
/node_modules/
# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/.eslintcache
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
# broccoli-debug
/DEBUG/
# Environment Variables
.env
.env.build
.env.local
# Vercel
.vercel

View File

@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/
# compiled output
/dist/
# misc
/coverage/
!.*
.*/
# ember-try
/.node_modules.ember-try/

View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = {
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};

View File

@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/
# compiled output
/dist/
# addons
/.node_modules.ember-try/

View File

@@ -0,0 +1,5 @@
'use strict';
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};

View File

@@ -1,24 +0,0 @@
---
language: node_js
node_js:
- "8"
sudo: false
dist: trusty
addons:
chrome: stable
cache:
directories:
- $HOME/.npm
env:
global:
# See https://github.com/ember-cli/ember-cli/blob/master/docs/build-concurrency.md
- JOBS=1
script:
- npm run lint:hbs
- npm run lint:js
- npm test

View File

@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
"ignore_dirs": ["dist"]
}

View File

@@ -14,7 +14,7 @@ _Live Example: https://ember-template.vercel.app_
### How We Created This Example
To get started with Ember for deployment with Vercel, you can use the [Ember CLI](https://ember-cli.com/) to initialize the project:
To get started with Ember for deployment with Vercel, you can use the [Ember CLI](https://cli.emberjs.com) to initialize the project:
```shell
$ npx ember-cli new ember-project

View File

@@ -1,14 +1,12 @@
import Application from '@ember/application';
import Resolver from './resolver';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import config from 'ember-quickstart/config/environment';
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver,
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}
loadInitializers(App, config.modulePrefix);
export default App;

View File

@@ -1,16 +1,15 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>HelloWorld</title>
<title>EmberQuickstart</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for "head"}}
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/hello-world.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/ember-quickstart.css">
{{content-for "head-footer"}}
</head>
@@ -18,7 +17,7 @@
{{content-for "body"}}
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/hello-world.js"></script>
<script src="{{rootURL}}assets/ember-quickstart.js"></script>
{{content-for "body-footer"}}
</body>

View File

@@ -1,3 +0,0 @@
import Resolver from 'ember-resolver';
export default Resolver;

View File

@@ -1,11 +1,9 @@
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import config from 'ember-quickstart/config/environment';
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL,
});
export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
}
Router.map(function() {});
export default Router;
Router.map(function () {});

View File

@@ -0,0 +1 @@
/* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */

View File

@@ -1,5 +1,7 @@
{{!-- The following component displays Ember's default welcome message. --}}
{{page-title "EmberQuickstart"}}
{{! The following component displays Ember's default welcome message. }}
<WelcomePage />
{{!-- Feel free to remove this! --}}
{{! Feel free to remove this! }}
{{outlet}}

View File

@@ -0,0 +1,20 @@
{
"schemaVersion": "1.0.0",
"packages": [
{
"name": "ember-cli",
"version": "5.1.0",
"blueprints": [
{
"name": "app",
"outputRepo": "https://github.com/ember-cli/ember-new-output",
"codemodsSource": "ember-app-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--ci-provider=github"
]
}
]
}
]
}

View File

@@ -1,20 +1,17 @@
'use strict';
module.exports = function(environment) {
let ENV = {
modulePrefix: 'hello-world',
module.exports = function (environment) {
const ENV = {
modulePrefix: 'ember-quickstart',
environment,
rootURL: '/',
locationType: 'auto',
locationType: 'history',
EmberENV: {
EXTEND_PROTOTYPES: false,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false,
},
},
APP: {

View File

@@ -1,3 +1,6 @@
{
"jquery-integration": true
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": false,
"template-only-glimmer-components": true
}

View File

@@ -6,13 +6,6 @@ const browsers = [
'last 1 Safari versions',
];
const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';
if (isCI || isProduction) {
browsers.push('ie 11');
}
module.exports = {
browsers,
};

View File

@@ -2,23 +2,13 @@
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
module.exports = function (defaults) {
const app = new EmberApp(defaults, {
// Add options here
'ember-welcome-page': {
enabled: true
}
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
return app.toTree();
};

22894
examples/ember/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
{
"name": "hello-world",
"name": "ember-quickstart",
"version": "0.0.0",
"private": true,
"description": "Small description for hello-world goes here",
"description": "Small description for ember-quickstart goes here",
"repository": "",
"license": "MIT",
"author": "",
@@ -11,43 +11,66 @@
"test": "tests"
},
"scripts": {
"build": "ember build",
"build": "ember build --environment=production",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:css": "stylelint \"**/*.css\"",
"lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"dev": "ember serve --port $PORT",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "ember serve",
"test": "ember test"
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "ember test"
},
"devDependencies": {
"@ember/jquery": "^0.6.0",
"@ember/optional-features": "^0.7.0",
"@babel/eslint-parser": "^7.22.5",
"@babel/plugin-proposal-decorators": "^7.22.5",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.1.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"broccoli-asset-rev": "^3.0.0",
"ember-ajax": "^5.0.0",
"ember-cli": "~3.11.0",
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.7.3",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
"ember-cli-inject-live-reload": "^1.8.2",
"concurrently": "^8.2.0",
"ember-auto-import": "^2.6.3",
"ember-cli": "~5.1.0",
"ember-cli-app-version": "^6.0.1",
"ember-cli-babel": "^7.26.11",
"ember-cli-clean-css": "^2.0.0",
"ember-cli-dependency-checker": "^3.3.2",
"ember-cli-htmlbars": "^6.2.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-data": "~3.11.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^2.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.4.1",
"ember-resolver": "^5.0.1",
"ember-source": "~3.11.1",
"ember-welcome-page": "^4.0.0",
"eslint-plugin-ember": "^6.2.0",
"eslint-plugin-node": "^9.0.1",
"ember-cli-terser": "^4.0.2",
"ember-data": "~5.1.0",
"ember-fetch": "^8.1.2",
"ember-load-initializers": "^2.1.2",
"ember-modifier": "^4.1.0",
"ember-page-title": "^7.0.0",
"ember-qunit": "^7.0.0",
"ember-resolver": "^10.1.1",
"ember-source": "~5.1.1",
"ember-template-lint": "^5.11.0",
"ember-welcome-page": "^7.0.2",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-ember": "^11.9.0",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-qunit": "^8.0.0",
"loader.js": "^4.7.0",
"qunit-dom": "^0.8.4"
"prettier": "^2.8.8",
"qunit": "^2.19.4",
"qunit-dom": "^2.0.0",
"stylelint": "^15.9.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-prettier": "^3.0.0",
"tracked-built-ins": "^3.1.1",
"webpack": "^5.88.1"
},
"engines": {
"node": "14.x"
"ember": {
"edition": "octane"
}
}

View File

@@ -1,15 +1,17 @@
'use strict';
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
browser_start_timeout: 120,
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' : null,
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-software-rasterizer',
'--mute-audio',

View File

@@ -0,0 +1,42 @@
import {
setupApplicationTest as upstreamSetupApplicationTest,
setupRenderingTest as upstreamSetupRenderingTest,
setupTest as upstreamSetupTest,
} from 'ember-qunit';
// This file exists to provide wrappers around ember-qunit's / ember-mocha's
// test setup functions. This way, you can easily extend the setup that is
// needed per test type.
function setupApplicationTest(hooks, options) {
upstreamSetupApplicationTest(hooks, options);
// Additional setup for application tests can be done here.
//
// For example, if you need an authenticated session for each
// application test, you could do:
//
// hooks.beforeEach(async function () {
// await authenticateSession(); // ember-simple-auth
// });
//
// This is also a good place to call test setup functions coming
// from other addons:
//
// setupIntl(hooks); // ember-intl
// setupMirage(hooks); // ember-cli-mirage
}
function setupRenderingTest(hooks, options) {
upstreamSetupRenderingTest(hooks, options);
// Additional setup for rendering tests can be done here.
}
function setupTest(hooks, options) {
upstreamSetupTest(hooks, options);
// Additional setup for unit tests can be done here.
}
export { setupApplicationTest, setupRenderingTest, setupTest };

View File

@@ -2,8 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>HelloWorld Tests</title>
<title>EmberQuickstart Tests</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -11,7 +10,7 @@
{{content-for "test-head"}}
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/hello-world.css">
<link rel="stylesheet" href="{{rootURL}}assets/ember-quickstart.css">
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
{{content-for "head-footer"}}
@@ -21,10 +20,17 @@
{{content-for "body"}}
{{content-for "test-body"}}
<script src="/testem.js" integrity=""></script>
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="ember-testing-container">
<div id="ember-testing"></div>
</div>
</div>
<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="{{rootURL}}assets/hello-world.js"></script>
<script src="{{rootURL}}assets/ember-quickstart.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>
{{content-for "body-footer"}}

View File

@@ -1,8 +1,12 @@
import Application from '../app';
import config from '../config/environment';
import Application from 'ember-quickstart/app';
import config from 'ember-quickstart/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { setup } from 'qunit-dom';
import { start } from 'ember-qunit';
setApplication(Application.create(config.APP));
setup(QUnit.assert);
start();

View File

File diff suppressed because it is too large Load Diff

View File

@@ -34,10 +34,15 @@ Hydrogen is Shopifys stack for headless commerce. Hydrogen is designed to dov
## Environment Variables
Using Hydrogen requires a few environment variables to be set in order to properly connect to Shopify. For this template, the minimal set of environment variables are defined in the `vercel.json` file, which will be applied to the deployment when deployed to Vercel. However, you should migrate these default environment variables to your Project's Environment Variables configuration in the Vercel dashboard (or using the `vc env` commands), and update them according to your needs (also change the `SESSION_SECRET` to your own value).
Using Hydrogen requires a few [environment variables](https://shopify.dev/docs/custom-storefronts/hydrogen/environment-variables) to be set in order to properly connect to Shopify. For this template, the minimal set of environment variables are defined in the `vercel.json` file, which will be applied to the deployment when deployed to Vercel. However, you should migrate these default environment variables to your Project's Environment Variables configuration in the Vercel dashboard (or using the `vc env` commands), and update them according to your needs (also change the `SESSION_SECRET` to your own value). Once that is done, delete the `vercel.json` file from your project to prevent the environment variables defined there from taking precedence.
## Local development
Rename the `.env.example` file to `.env` in order for the Shopify dev server to use those environment variables during local development. If you defined/modified additional environment variables based on the section above, be sure to apply those changes in your `.env` file as well.
Then run the following commands:
```bash
npm install
npm run dev
```

View File

@@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "es2020",
"target": "es2021",
"module": "esnext",
"moduleResolution": "node16",
"lib": ["dom", "dom.iterable", "scripthost", "es2020"],
"lib": ["dom", "dom.iterable", "scripthost", "es2021"],
"jsx": "react-jsx",
"types": ["vite/client", "vitest/globals"],
"strict": true,

View File

@@ -14,7 +14,7 @@ pnpm dev
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

View File

@@ -1,43 +1,11 @@
:root {
--max-width: 1100px;
--border-radius: 12px;
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
--primary-glow: conic-gradient(
from 180deg at 50% 50%,
#16abff33 0deg,
#0885ff33 55deg,
#54d6ff33 120deg,
#0071ff33 160deg,
transparent 360deg
);
--secondary-glow: radial-gradient(
rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0)
);
--tile-start-rgb: 239, 245, 249;
--tile-end-rgb: 228, 232, 233;
--tile-border: conic-gradient(
#00000080,
#00000040,
#00000030,
#00000020,
#00000010,
#00000010,
#00000080
);
--callout-rgb: 238, 240, 241;
--callout-border-rgb: 172, 175, 176;
--card-rgb: 180, 185, 188;
--card-border-rgb: 131, 134, 135;
}
@media (prefers-color-scheme: dark) {
@@ -45,46 +13,9 @@
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
--secondary-glow: linear-gradient(
to bottom right,
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0.3)
);
--tile-start-rgb: 2, 13, 46;
--tile-end-rgb: 2, 5, 19;
--tile-border: conic-gradient(
#ffffff80,
#ffffff40,
#ffffff30,
#ffffff20,
#ffffff10,
#ffffff10,
#ffffff80
);
--callout-rgb: 20, 20, 20;
--callout-border-rgb: 108, 108, 108;
--card-rgb: 100, 100, 100;
--card-border-rgb: 200, 200, 200;
}
}
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
max-width: 100vw;
overflow-x: hidden;
}
body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
@@ -94,14 +25,3 @@ body {
)
rgb(var(--background-start-rgb));
}
a {
color: inherit;
text-decoration: none;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}

View File

@@ -1,14 +1,19 @@
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
export const metadata = {
export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}
export default function RootLayout({ children }) {
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>

View File

@@ -1,95 +0,0 @@
import Image from 'next/image'
import styles from './page.module.css'
export default function Home() {
return (
<main className={styles.main}>
<div className={styles.description}>
<p>
Get started by editing&nbsp;
<code className={styles.code}>app/page.js</code>
</p>
<div>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{' '}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className={styles.vercelLogo}
width={100}
height={24}
priority
/>
</a>
</div>
</div>
<div className={styles.center}>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>
<div className={styles.grid}>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Docs <span>-&gt;</span>
</h2>
<p>Find in-depth information about Next.js features and API.</p>
</a>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Learn <span>-&gt;</span>
</h2>
<p>Learn about Next.js in an interactive course with&nbsp;quizzes!</p>
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Templates <span>-&gt;</span>
</h2>
<p>Explore the Next.js 13 playground.</p>
</a>
<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Deploy <span>-&gt;</span>
</h2>
<p>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</main>
)
}

View File

@@ -1,229 +0,0 @@
.main {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding: 6rem;
min-height: 100vh;
}
.description {
display: inherit;
justify-content: inherit;
align-items: inherit;
font-size: 0.85rem;
max-width: var(--max-width);
width: 100%;
z-index: 2;
font-family: var(--font-mono);
}
.description a {
display: flex;
justify-content: center;
align-items: center;
gap: 0.5rem;
}
.description p {
position: relative;
margin: 0;
padding: 1rem;
background-color: rgba(var(--callout-rgb), 0.5);
border: 1px solid rgba(var(--callout-border-rgb), 0.3);
border-radius: var(--border-radius);
}
.code {
font-weight: 700;
font-family: var(--font-mono);
}
.grid {
display: grid;
grid-template-columns: repeat(4, minmax(25%, auto));
max-width: 100%;
width: var(--max-width);
}
.card {
padding: 1rem 1.2rem;
border-radius: var(--border-radius);
background: rgba(var(--card-rgb), 0);
border: 1px solid rgba(var(--card-border-rgb), 0);
transition: background 200ms, border 200ms;
}
.card span {
display: inline-block;
transition: transform 200ms;
}
.card h2 {
font-weight: 600;
margin-bottom: 0.7rem;
}
.card p {
margin: 0;
opacity: 0.6;
font-size: 0.9rem;
line-height: 1.5;
max-width: 30ch;
}
.center {
display: flex;
justify-content: center;
align-items: center;
position: relative;
padding: 4rem 0;
}
.center::before {
background: var(--secondary-glow);
border-radius: 50%;
width: 480px;
height: 360px;
margin-left: -400px;
}
.center::after {
background: var(--primary-glow);
width: 240px;
height: 180px;
z-index: -1;
}
.center::before,
.center::after {
content: '';
left: 50%;
position: absolute;
filter: blur(45px);
transform: translateZ(0);
}
.logo {
position: relative;
}
/* Enable hover only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
.card:hover {
background: rgba(var(--card-rgb), 0.1);
border: 1px solid rgba(var(--card-border-rgb), 0.15);
}
.card:hover span {
transform: translateX(4px);
}
}
@media (prefers-reduced-motion) {
.card:hover span {
transform: none;
}
}
/* Mobile */
@media (max-width: 700px) {
.content {
padding: 4rem;
}
.grid {
grid-template-columns: 1fr;
margin-bottom: 120px;
max-width: 320px;
text-align: center;
}
.card {
padding: 1rem 2.5rem;
}
.card h2 {
margin-bottom: 0.5rem;
}
.center {
padding: 8rem 0 6rem;
}
.center::before {
transform: none;
height: 300px;
}
.description {
font-size: 0.8rem;
}
.description a {
padding: 1rem;
}
.description p,
.description div {
display: flex;
justify-content: center;
position: fixed;
width: 100%;
}
.description p {
align-items: center;
inset: 0 0 auto;
padding: 2rem 1rem 1.4rem;
border-radius: 0;
border: none;
border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25);
background: linear-gradient(
to bottom,
rgba(var(--background-start-rgb), 1),
rgba(var(--callout-rgb), 0.5)
);
background-clip: padding-box;
backdrop-filter: blur(24px);
}
.description div {
align-items: flex-end;
pointer-events: none;
inset: auto 0 0;
padding: 2rem;
height: 200px;
background: linear-gradient(
to bottom,
transparent 0%,
rgb(var(--background-end-rgb)) 40%
);
z-index: 1;
}
}
/* Tablet and Smaller Desktop */
@media (min-width: 701px) and (max-width: 1120px) {
.grid {
grid-template-columns: repeat(2, 50%);
}
}
@media (prefers-color-scheme: dark) {
.vercelLogo {
filter: invert(1);
}
.logo {
filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70);
}
}
@keyframes rotate {
from {
transform: rotate(360deg);
}
to {
transform: rotate(0deg);
}
}

View File

@@ -0,0 +1,113 @@
import Image from 'next/image'
export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
Get started by editing&nbsp;
<code className="font-mono font-bold">app/page.tsx</code>
</p>
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
<a
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{' '}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className="dark:invert"
width={100}
height={24}
priority
/>
</a>
</div>
</div>
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>
<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Docs{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Find in-depth information about Next.js features and API.
</p>
</a>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Learn{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Templates{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Explore the Next.js 13 playground.
</p>
</a>
<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Deploy{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</main>
)
}

View File

@@ -1,7 +0,0 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./*"]
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,10 +9,17 @@
"lint": "next lint"
},
"dependencies": {
"eslint": "8.46.0",
"eslint-config-next": "13.4.13",
"next": "13.4.13",
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"eslint": "8.47.0",
"eslint-config-next": "13.4.18",
"next": "13.4.18",
"postcss": "8.4.28",
"react": "18.2.0",
"react-dom": "18.2.0"
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
}
}

View File

@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@@ -0,0 +1,20 @@
import type { Config } from 'tailwindcss'
const config: Config = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic':
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
},
},
},
plugins: [],
}
export default config

View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -5,10 +5,10 @@
"scripts": {
"test-unit": "pnpm test __tests__/unit/",
"test-e2e": "pnpm test __tests__/integration/",
"test": "jest --env node --verbose --runInBand --bail"
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail"
},
"devDependencies": {
"@types/jest": "27.4.1",
"@vercel/frameworks": "1.5.1"
"@vercel/frameworks": "2.0.0"
}
}

View File

@@ -9,7 +9,7 @@
],
"scripts": {
"build": "tsc",
"test": "jest --env node --verbose --runInBand --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test tests/unit"
},
"devDependencies": {

View File

@@ -4,9 +4,9 @@
"declaration": true,
"allowJs": true,
"moduleResolution": "node",
"target": "ES2020",
"target": "ES2021",
"module": "commonjs",
"lib": ["ES2020"],
"lib": ["ES2021"],
"resolveJsonModule": true,
"sourceMap": true
}

View File

@@ -1,5 +1,13 @@
# @vercel-internals/types
## 1.0.7
### Patch Changes
- Updated dependencies [[`37f5c6270`](https://github.com/vercel/vercel/commit/37f5c6270058336072ca733673ea72dd6c56bd6a)]:
- @vercel/build-utils@7.0.0
- @vercel/routing-utils@3.0.0
## 1.0.6
### Patch Changes

View File

@@ -1,14 +1,14 @@
{
"private": true,
"name": "@vercel-internals/types",
"version": "1.0.6",
"version": "1.0.7",
"types": "index.d.ts",
"main": "index.d.ts",
"dependencies": {
"@types/node": "14.14.31",
"@vercel-internals/constants": "1.0.4",
"@vercel/build-utils": "6.8.3",
"@vercel/routing-utils": "2.2.1"
"@vercel/build-utils": "7.0.0",
"@vercel/routing-utils": "3.0.0"
},
"devDependencies": {
"@vercel-internals/tsconfig": "1.0.0",

View File

@@ -1,5 +1,11 @@
# @vercel/build-utils
## 7.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))
## 6.8.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "6.8.3",
"version": "7.0.0",
"license": "Apache-2.0",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
@@ -12,7 +12,7 @@
},
"scripts": {
"build": "node build",
"test": "jest --env node --verbose --runInBand --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test test/unit.*test.*",
"test-e2e": "pnpm test test/integration.test.ts"
},
@@ -32,7 +32,7 @@
"@types/node-fetch": "^2.1.6",
"@types/semver": "6.0.0",
"@types/yazl": "2.4.2",
"@vercel/error-utils": "1.0.10",
"@vercel/error-utils": "2.0.0",
"@vercel/ncc": "0.24.0",
"aggregate-error": "3.0.1",
"async-retry": "1.2.3",
@@ -44,6 +44,7 @@
"glob": "8.0.3",
"ignore": "4.0.6",
"into-stream": "5.0.0",
"jest-junit": "16.0.0",
"js-yaml": "3.13.1",
"minimatch": "3.1.2",
"multistream": "2.1.1",

View File

@@ -50,14 +50,14 @@ afterEach(() => {
});
it('should only match supported node versions, otherwise throw an error', async () => {
expect(await getSupportedNodeVersion('14.x', false)).toHaveProperty(
'major',
14
);
expect(await getSupportedNodeVersion('16.x', false)).toHaveProperty(
'major',
16
);
expect(await getSupportedNodeVersion('18.x', false)).toHaveProperty(
'major',
18
);
const autoMessage =
'Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.';
@@ -70,14 +70,14 @@ it('should only match supported node versions, otherwise throw an error', async
await expectBuilderError(getSupportedNodeVersion('foo', true), autoMessage);
await expectBuilderError(getSupportedNodeVersion('=> 10', true), autoMessage);
expect(await getSupportedNodeVersion('14.x', true)).toHaveProperty(
'major',
14
);
expect(await getSupportedNodeVersion('16.x', true)).toHaveProperty(
'major',
16
);
expect(await getSupportedNodeVersion('18.x', true)).toHaveProperty(
'major',
18
);
const foundMessage =
'Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.';
@@ -99,23 +99,23 @@ it('should only match supported node versions, otherwise throw an error', async
it('should match all semver ranges', async () => {
// See https://docs.npmjs.com/files/package.json#engines
expect(await getSupportedNodeVersion('14.0.0')).toHaveProperty('major', 14);
expect(await getSupportedNodeVersion('14.x')).toHaveProperty('major', 14);
expect(await getSupportedNodeVersion('16.0.0')).toHaveProperty('major', 16);
expect(await getSupportedNodeVersion('16.x')).toHaveProperty('major', 16);
expect(await getSupportedNodeVersion('>=10')).toHaveProperty('major', 18);
expect(await getSupportedNodeVersion('>=10.3.0')).toHaveProperty('major', 18);
expect(await getSupportedNodeVersion('16.5.0 - 16.9.0')).toHaveProperty(
'major',
16
);
expect(await getSupportedNodeVersion('>=9.5.0 <=14.5.0')).toHaveProperty(
expect(await getSupportedNodeVersion('>=9.5.0 <=16.5.0')).toHaveProperty(
'major',
14
16
);
expect(await getSupportedNodeVersion('~14.5.0')).toHaveProperty('major', 14);
expect(await getSupportedNodeVersion('^14.5.0')).toHaveProperty('major', 14);
expect(await getSupportedNodeVersion('14.5.0 - 14.20.0')).toHaveProperty(
expect(await getSupportedNodeVersion('~16.5.0')).toHaveProperty('major', 16);
expect(await getSupportedNodeVersion('^16.5.0')).toHaveProperty('major', 16);
expect(await getSupportedNodeVersion('16.5.0 - 16.20.0')).toHaveProperty(
'major',
14
16
);
});

View File

@@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
@@ -13,7 +13,7 @@
"outDir": "./dist",
"types": ["node", "jest"],
"strict": true,
"target": "ES2020"
"target": "ES2021"
},
"include": ["src/**/*"],
"exclude": ["node_modules"]

View File

@@ -1,5 +1,45 @@
# vercel
## 32.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))
### Patch Changes
- text wrap help output description ([#10370](https://github.com/vercel/vercel/pull/10370))
- Updated dependencies [[`37f5c6270`](https://github.com/vercel/vercel/commit/37f5c6270058336072ca733673ea72dd6c56bd6a), [`09174df6c`](https://github.com/vercel/vercel/commit/09174df6cfbe697ea13e75468b9cd3c6ec7ad01c)]:
- @vercel/build-utils@7.0.0
- @vercel/go@3.0.0
- @vercel/hydrogen@1.0.0
- @vercel/next@4.0.0
- @vercel/node@3.0.0
- @vercel/python@4.0.0
- @vercel/redwood@2.0.0
- @vercel/remix-builder@2.0.0
- @vercel/ruby@2.0.0
- @vercel/static-build@2.0.0
## 31.4.0
### Minor Changes
- Force-publish ([#10358](https://github.com/vercel/vercel/pull/10358))
### Patch Changes
- Updated dependencies [[`6e44757ff`](https://github.com/vercel/vercel/commit/6e44757ff5d7d80ba6db2ab5ea65213392ecf1cd)]:
- @vercel/static-build@1.4.0
## 31.3.1
### Patch Changes
- Updated dependencies [[`844fb6e88`](https://github.com/vercel/vercel/commit/844fb6e880a980f26945f15a7437b4d67bcb5394)]:
- @vercel/remix-builder@1.10.1
## 31.3.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "31.3.0",
"version": "32.0.0",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -11,7 +11,7 @@
"directory": "packages/cli"
},
"scripts": {
"test": "jest --env node --verbose --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail",
"test-unit": "pnpm test test/unit/",
"test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
"test-dev": "pnpm test test/dev/",
@@ -28,19 +28,19 @@
"scripts/preinstall.js"
],
"engines": {
"node": ">= 14"
"node": ">= 16"
},
"dependencies": {
"@vercel/build-utils": "6.8.3",
"@vercel/go": "2.5.1",
"@vercel/hydrogen": "0.0.64",
"@vercel/next": "3.9.4",
"@vercel/node": "2.15.10",
"@vercel/python": "3.1.60",
"@vercel/redwood": "1.1.15",
"@vercel/remix-builder": "1.10.0",
"@vercel/ruby": "1.3.76",
"@vercel/static-build": "1.3.46"
"@vercel/build-utils": "7.0.0",
"@vercel/go": "3.0.0",
"@vercel/hydrogen": "1.0.0",
"@vercel/next": "4.0.0",
"@vercel/node": "3.0.0",
"@vercel/python": "4.0.0",
"@vercel/redwood": "2.0.0",
"@vercel/remix-builder": "2.0.0",
"@vercel/ruby": "2.0.0",
"@vercel/static-build": "2.0.0"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -86,14 +86,14 @@
"@types/yauzl-promise": "2.1.0",
"@vercel-internals/constants": "1.0.4",
"@vercel-internals/get-package-json": "1.0.0",
"@vercel-internals/types": "1.0.6",
"@vercel/client": "12.6.6",
"@vercel/error-utils": "1.0.10",
"@vercel/frameworks": "1.5.1",
"@vercel/fs-detectors": "4.1.2",
"@vercel-internals/types": "1.0.7",
"@vercel/client": "13.0.0",
"@vercel/error-utils": "2.0.0",
"@vercel/frameworks": "2.0.0",
"@vercel/fs-detectors": "5.0.0",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.2.1",
"@vercel/routing-utils": "3.0.0",
"@zeit/source-map-support": "0.6.2",
"ajv": "6.12.2",
"alpha-sort": "2.0.1",
@@ -134,6 +134,7 @@
"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",
"jsonlines": "0.1.1",
"line-async-iterator": "3.0.0",

View File

@@ -36,6 +36,30 @@ type _CellOptions = CellOptions & {
wordWrap?: boolean;
};
const tableOptions = {
chars: {
top: '',
'top-mid': '',
'top-left': '',
'top-right': '',
bottom: '',
'bottom-mid': '',
'bottom-left': '',
'bottom-right': '',
left: '',
'left-mid': '',
mid: '',
'mid-mid': '',
right: '',
'right-mid': '',
middle: '',
},
style: {
'padding-left': 0,
'padding-right': 0,
},
};
const globalCommandOptions: CommandOption[] = [
{
name: 'help',
@@ -116,6 +140,28 @@ const globalCommandOptions: CommandOption[] = [
},
];
// Use the word wrapping ability of cli-table3
// by creating a one row, one cell, one column table.
// This allows us to avoid pulling in the word-wrap
// package which ironically seems to do a worse job.
function wordWrap(text: string, maxWidth: number) {
const _tableOptions = Object.assign({}, tableOptions, {
colWidths: [maxWidth],
style: {
'padding-left': INDENT.length,
},
});
const table = new Table(_tableOptions);
table.push([
{
content: text,
wordWrap: true,
} as _CellOptions,
]);
return table.toString();
}
// Insert spaces in between non-whitespace items only
export function lineToString(line: string[]) {
let string = '';
@@ -183,8 +229,8 @@ export function buildCommandOptionLines(
);
// word wrapping requires the wrapped cell to have a fixed width.
// We need to track cell sizes to make the final column of cells is
// equal to the remaindner of unused horizontal space.
// We need to track cell sizes to ensure the final column of cells is
// equal to the remainder of unused horizontal space.
let maxWidthOfUnwrappedColumns = 0;
const rows: (string | undefined | _CellOptions)[][] = [];
for (const option of commandOptions) {
@@ -217,30 +263,11 @@ export function buildCommandOptionLines(
const finalColumnWidth = options.columns - maxWidthOfUnwrappedColumns;
const table = new Table({
chars: {
top: '',
'top-mid': '',
'top-left': '',
'top-right': '',
bottom: '',
'bottom-mid': '',
'bottom-left': '',
'bottom-right': '',
left: '',
'left-mid': '',
mid: '',
'mid-mid': '',
right: '',
'right-mid': '',
middle: '',
},
style: {
'padding-left': 0,
'padding-right': 0,
},
colWidths: [null, null, finalColumnWidth],
});
const table = new Table(
Object.assign({}, tableOptions, {
colWidths: [null, null, finalColumnWidth],
})
);
table.push(...rows);
return [
@@ -277,9 +304,12 @@ export function buildCommandExampleLines(command: Command) {
return outputArrayToString(outputArray);
}
function buildDescriptionLine(command: Command) {
const line: string[] = [INDENT, command.description, NEWLINE];
return lineToString(line);
function buildDescriptionLine(
command: Command,
options: BuildHelpOutputOptions
) {
let wrapingText = wordWrap(command.description, options.columns);
return `${wrapingText}${NEWLINE}`;
}
interface BuildHelpOutputOptions {
@@ -293,7 +323,7 @@ export function buildHelpOutput(
const outputArray: (string | null)[] = [
'',
buildCommandSynopsisLine(command),
buildDescriptionLine(command),
buildDescriptionLine(command, options),
buildCommandOptionLines(command.options, options, 'Options'),
buildCommandOptionLines(globalCommandOptions, options, 'Global Options'),
buildCommandExampleLines(command),

View File

@@ -58,7 +58,7 @@ export async function devRouter(
): Promise<RouteResult> {
let result: RouteResult | undefined;
let { pathname: reqPathname, search: reqSearch } = url.parse(reqUrl);
reqPathname ??= '/';
reqPathname = reqPathname || '/';
const reqQuery = parseQueryString(reqSearch);
const combinedHeaders: HttpHeadersConfig = { ...previousHeaders };
let status: number | undefined;
@@ -132,7 +132,7 @@ export async function devRouter(
!isDestUrl
) {
let { pathname } = url.parse(destPath);
pathname ??= '/';
pathname = pathname || '/';
const hasDestFile = await devServer.hasFilesystem(
pathname,
vercelConfig
@@ -190,7 +190,7 @@ export async function devRouter(
}
let { pathname: destPathname, search: destSearch } =
url.parse(destPath);
destPathname ??= '/';
destPathname = destPathname || '/';
const destQuery = parseQueryString(destSearch);
Object.assign(destQuery, reqQuery);
result = {

View File

@@ -334,7 +334,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
'vercel.json': JSON.stringify({
functions: {
'api/**/*.php': {
runtime: 'vercel-php@0.5.2',
runtime: 'vercel-php@0.6.0',
},
},
}),

View File

@@ -4,7 +4,11 @@ exports[`help command help output snapshots column width 40 1`] = `
"
vercel deploy [project-path] [options]
Deploy your project to Vercel. The \`deploy\` command is the default command for the Vercel CLI, and can be omitted (\`vc deploy my-app\` equals \`vc my-app\`).
Deploy your project to Vercel. The
\`deploy\` command is the default
command for the Vercel CLI, and can
be omitted (\`vc deploy my-app\` equals
\`vc my-app\`).
Options:
@@ -166,7 +170,9 @@ exports[`help command help output snapshots column width 80 1`] = `
"
vercel deploy [project-path] [options]
Deploy your project to Vercel. The \`deploy\` command is the default command for the Vercel CLI, and can be omitted (\`vc deploy my-app\` equals \`vc my-app\`).
Deploy your project to Vercel. The \`deploy\` command is the default command
for the Vercel CLI, and can be omitted (\`vc deploy my-app\` equals \`vc
my-app\`).
Options:
@@ -234,7 +240,8 @@ exports[`help command help output snapshots column width 120 1`] = `
"
vercel deploy [project-path] [options]
Deploy your project to Vercel. The \`deploy\` command is the default command for the Vercel CLI, and can be omitted (\`vc deploy my-app\` equals \`vc my-app\`).
Deploy your project to Vercel. The \`deploy\` command is the default command for the Vercel CLI, and can be omitted
(\`vc deploy my-app\` equals \`vc my-app\`).
Options:

View File

@@ -5,10 +5,10 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"module": "commonjs",
"target": "ES2020",
"target": "ES2021",
"esModuleInterop": true,
"allowJs": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"resolveJsonModule": true,
"sourceMap": true,
"outDir": "./dist",

View File

@@ -1,5 +1,17 @@
# @vercel/client
## 13.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))
### Patch Changes
- Updated dependencies [[`37f5c6270`](https://github.com/vercel/vercel/commit/37f5c6270058336072ca733673ea72dd6c56bd6a)]:
- @vercel/build-utils@7.0.0
- @vercel/routing-utils@3.0.0
## 12.6.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "12.6.6",
"version": "13.0.0",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -16,11 +16,11 @@
"scripts": {
"build": "tsc",
"test-e2e": "pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts",
"test": "jest --env node --verbose --runInBand --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test tests/unit.*test.*"
},
"engines": {
"node": ">= 14"
"node": ">= 16"
},
"devDependencies": {
"@types/async-retry": "1.4.5",
@@ -32,11 +32,12 @@
"@types/node-fetch": "2.5.4",
"@types/recursive-readdir": "2.2.0",
"@types/tar-fs": "1.16.1",
"jest-junit": "16.0.0",
"typescript": "4.9.5"
},
"dependencies": {
"@vercel/build-utils": "6.8.3",
"@vercel/routing-utils": "2.2.1",
"@vercel/build-utils": "7.0.0",
"@vercel/routing-utils": "3.0.0",
"@zeit/fetch": "5.2.0",
"async-retry": "1.2.3",
"async-sema": "3.0.0",

View File

@@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
@@ -12,7 +12,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"target": "ES2020",
"target": "ES2021",
"skipLibCheck": true
},
"include": ["./src"]

View File

@@ -0,0 +1,7 @@
# @vercel/edge
## 1.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/edge",
"version": "0.3.4",
"version": "1.0.0",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.mjs",
@@ -16,13 +16,14 @@
},
"scripts": {
"build": "tsup src/index.ts --dts --format esm,cjs",
"test": "jest --env node --verbose --runInBand --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test",
"build:docs": "typedoc && node scripts/fix-links.js && prettier --write docs/**/*.md docs/*.md"
},
"devDependencies": {
"@edge-runtime/jest-environment": "2.2.3",
"@types/jest": "27.4.1",
"jest-junit": "16.0.0",
"ts-node": "8.9.1",
"tsup": "6.1.2",
"typedoc": "0.24.6",

View File

@@ -2,8 +2,8 @@
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"target": "ES2020",
"lib": ["ES2021", "DOM", "DOM.Iterable"],
"target": "ES2021",
"module": "commonjs",
"outDir": "dist",
"sourceMap": false,

View File

@@ -0,0 +1,7 @@
# @vercel/error-utils
## 2.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/error-utils",
"version": "1.0.10",
"version": "2.0.0",
"description": "A collection of error utilities for vercel/vercel",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -11,13 +11,14 @@
},
"scripts": {
"build": "tsc",
"test": "jest --coverage --env node --verbose",
"test": "jest --reporters=default --reporters=jest-junit --coverage --env node --verbose",
"test-unit": "pnpm test"
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "29.2.1",
"@types/node": "14.18.33",
"jest-junit": "16.0.0",
"typescript": "4.9.5"
}
}

View File

@@ -3,7 +3,7 @@
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
@@ -15,7 +15,7 @@
"types": ["node", "jest"],
"strict": true,
"sourceMap": true,
"target": "ES2020"
"target": "ES2021"
},
"include": ["src/**/*"],
"exclude": ["node_modules"]

View File

@@ -1,5 +1,21 @@
# @vercel/frameworks
## 2.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))
### Minor Changes
- Add "supersedes" prop to Framework interface ([#10345](https://github.com/vercel/vercel/pull/10345))
## 1.6.0
### Minor Changes
- [frameworks] Amend Hugo default `buildCommand` to exclude drafts enabled flag ([#7326](https://github.com/vercel/vercel/pull/7326))
## 1.5.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/frameworks",
"version": "1.5.1",
"version": "2.0.0",
"main": "./dist/frameworks.js",
"types": "./dist/frameworks.d.ts",
"files": [
@@ -14,7 +14,7 @@
"license": "Apache-2.0",
"scripts": {
"build": "tsc",
"test": "jest --env node --verbose --runInBand --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test"
},
"dependencies": {
@@ -26,9 +26,10 @@
"@types/js-yaml": "3.12.1",
"@types/node": "14.18.33",
"@types/node-fetch": "2.5.8",
"@vercel/error-utils": "1.0.10",
"@vercel/routing-utils": "2.2.1",
"@vercel/error-utils": "2.0.0",
"@vercel/routing-utils": "3.0.0",
"ajv": "6.12.2",
"jest-junit": "16.0.0",
"typescript": "4.9.5"
}
}

View File

@@ -199,6 +199,7 @@ export const frameworks = [
description: 'A new Remix app — the result of running `npx create-remix`.',
website: 'https://remix.run',
sort: 6,
supersedes: 'hydrogen',
useRuntime: { src: 'package.json', use: '@vercel/remix-builder' },
ignoreRuntimes: ['@vercel/node'],
detectors: {
@@ -1520,8 +1521,8 @@ export const frameworks = [
placeholder: 'None',
},
buildCommand: {
placeholder: '`npm run build` or `hugo -D --gc`',
value: 'hugo -D --gc',
placeholder: '`npm run build` or `hugo --gc`',
value: 'hugo --gc',
},
devCommand: {
value: 'hugo server -D -w -p $PORT',
@@ -1698,6 +1699,7 @@ export const frameworks = [
tagline: 'React framework for headless commerce',
description: 'React framework for headless commerce',
website: 'https://hydrogen.shopify.dev',
supersedes: 'vite',
useRuntime: { src: 'package.json', use: '@vercel/hydrogen' },
envPrefix: 'PUBLIC_',
detectors: {

View File

@@ -219,4 +219,8 @@ export interface Framework {
* @example "0.13.0"
*/
defaultVersion?: string;
/**
* Slug of another framework preset in which this framework supersedes.
*/
supersedes?: string;
}

View File

@@ -199,6 +199,7 @@ const Schema = {
dependency: { type: 'string' },
cachePattern: { type: 'string' },
defaultVersion: { type: 'string' },
supersedes: { type: 'string' },
},
},
};

View File

@@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
@@ -13,7 +13,7 @@
"outDir": "./dist",
"types": ["node", "jest"],
"strict": true,
"target": "ES2020"
"target": "ES2021"
},
"include": ["src/*.ts"],
"exclude": ["node_modules"]

View File

@@ -1,5 +1,29 @@
# @vercel/fs-detectors
## 5.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))
### Patch Changes
- Exclude Gatsby from default 404 error route ([#10365](https://github.com/vercel/vercel/pull/10365))
- Add "supersedes" prop to Framework interface ([#10345](https://github.com/vercel/vercel/pull/10345))
- Updated dependencies [[`37f5c6270`](https://github.com/vercel/vercel/commit/37f5c6270058336072ca733673ea72dd6c56bd6a), [`ed806d8a6`](https://github.com/vercel/vercel/commit/ed806d8a6b560b173ba80b24cbfafaa6f179d8b1)]:
- @vercel/error-utils@2.0.0
- @vercel/frameworks@2.0.0
- @vercel/routing-utils@3.0.0
## 4.1.3
### Patch Changes
- Updated dependencies [[`65ab3b23e`](https://github.com/vercel/vercel/commit/65ab3b23e9db008ecc13b425a7adcf5a6c1ef568)]:
- @vercel/frameworks@1.6.0
## 4.1.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "4.1.2",
"version": "5.0.0",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -15,14 +15,14 @@
"license": "Apache-2.0",
"scripts": {
"build": "tsc",
"test": "jest --env node --verbose --runInBand --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test test/unit.*test.*",
"test-e2e": "pnpm test test/integration.test.ts"
},
"dependencies": {
"@vercel/error-utils": "1.0.10",
"@vercel/frameworks": "1.5.1",
"@vercel/routing-utils": "2.2.1",
"@vercel/error-utils": "2.0.0",
"@vercel/frameworks": "2.0.0",
"@vercel/routing-utils": "3.0.0",
"glob": "8.0.3",
"js-yaml": "4.1.0",
"json5": "2.2.2",
@@ -36,7 +36,8 @@
"@types/minimatch": "3.0.5",
"@types/node": "14.18.33",
"@types/semver": "7.3.10",
"@vercel/build-utils": "6.8.3",
"@vercel/build-utils": "7.0.0",
"jest-junit": "16.0.0",
"typescript": "4.9.5"
}
}

View File

@@ -992,6 +992,7 @@ function getRouteResult(
const rewriteRoutes: Route[] = [];
const errorRoutes: Route[] = [];
const framework = frontendBuilder?.config?.framework || '';
const isGatsby = framework === 'gatsby';
const isNextjs =
framework === 'nextjs' || isOfficialRuntime('next', frontendBuilder?.use);
const ignoreRuntimes = slugToFramework.get(framework)?.ignoreRuntimes;
@@ -1071,8 +1072,8 @@ function getRouteResult(
});
}
if (options.featHandleMiss && !isNextjs) {
// Exclude Next.js to avoid overriding custom error page
if (options.featHandleMiss && !isNextjs && !isGatsby) {
// Exclude Next.js (and Gatsby) to avoid overriding custom error page
// https://nextjs.org/docs/advanced-features/custom-error-page
errorRoutes.push({
status: 404,

View File

@@ -135,6 +135,30 @@ async function matches(
};
}
function removeSupersededFramework(
matches: (Pick<Framework, 'supersedes' | 'slug'> | null)[],
slug: string
) {
const index = matches.findIndex(f => f?.slug === slug);
const framework = matches[index];
if (framework) {
if (framework.supersedes) {
removeSupersededFramework(matches, framework.supersedes);
}
matches.splice(index, 1);
}
}
export function removeSupersededFrameworks(
matches: (Pick<Framework, 'supersedes' | 'slug'> | null)[]
) {
for (const match of matches.slice()) {
if (match?.supersedes) {
removeSupersededFramework(matches, match.supersedes);
}
}
}
// TODO: Deprecate and replace with `detectFrameworkRecord`
export async function detectFramework({
fs,
@@ -143,12 +167,13 @@ export async function detectFramework({
const result = await Promise.all(
frameworkList.map(async frameworkMatch => {
if (await matches(fs, frameworkMatch)) {
return frameworkMatch.slug;
return frameworkMatch;
}
return null;
})
);
return result.find(res => res !== null) ?? null;
removeSupersededFrameworks(result);
return result.find(res => res !== null)?.slug ?? null;
}
/**
@@ -166,6 +191,7 @@ export async function detectFrameworks({
return null;
})
);
removeSupersededFrameworks(result);
return result.filter(res => res !== null) as Framework[];
}
@@ -194,9 +220,8 @@ export async function detectFrameworkRecord({
return null;
})
);
const frameworkRecord = result.find(res => res !== null) ?? null;
return frameworkRecord;
removeSupersededFrameworks(result);
return result.find(res => res !== null) ?? null;
}
export function detectFrameworkVersion(

View File

@@ -1,7 +1,15 @@
import { join } from 'path';
import frameworkList from '@vercel/frameworks';
import workspaceManagers from '../src/workspaces/workspace-managers';
import { detectFramework, detectFrameworks } from '../src';
import {
detectFramework,
detectFrameworks,
LocalFileSystemDetector,
} from '../src';
import VirtualFilesystem from './virtual-file-system';
import { removeSupersededFrameworks } from '../src/detect-framework';
const EXAMPLES_DIR = join(__dirname, '../../../examples');
describe('DetectorFilesystem', () => {
it('should return the directory contents relative to the cwd', async () => {
@@ -153,6 +161,35 @@ describe('DetectorFilesystem', () => {
});
});
describe('removeSupersededFrameworks()', () => {
it('should remove "vite" when "hydrogen" is present', () => {
const matches = [
{ slug: 'storybook' },
{ slug: 'vite' },
{ slug: 'hydrogen', supersedes: 'vite' },
];
removeSupersededFrameworks(matches);
expect(matches).toEqual([
{ slug: 'storybook' },
{ slug: 'hydrogen', supersedes: 'vite' },
]);
});
it('should remove "hydrogen" when "remix" is present', () => {
const matches = [
{ slug: 'storybook' },
{ slug: 'vite' },
{ slug: 'hydrogen', supersedes: 'vite' },
{ slug: 'remix', supersedes: 'hydrogen' },
];
removeSupersededFrameworks(matches);
expect(matches).toEqual([
{ slug: 'storybook' },
{ slug: 'remix', supersedes: 'hydrogen' },
]);
});
});
describe('detectFramework()', () => {
it('Do not detect anything', async () => {
const fs = new VirtualFilesystem({
@@ -418,7 +455,33 @@ describe('detectFrameworks()', () => {
expect(await detectFrameworks({ fs, frameworkList })).toEqual([]);
});
it('Detect `nextjs` and `storybook`', async () => {
it('Should detect `nextjs`', async () => {
const fs = new VirtualFilesystem({
'package.json': JSON.stringify({
dependencies: {
next: 'latest',
},
}),
});
const slugs = (await detectFrameworks({ fs, frameworkList })).map(
f => f.slug
);
expect(slugs).toEqual(['nextjs']);
});
it('Should detect `remix`', async () => {
const fs = new VirtualFilesystem({
'remix.config.js': '',
});
const slugs = (await detectFrameworks({ fs, frameworkList })).map(
f => f.slug
);
expect(slugs).toEqual(['remix']);
});
it('Should detect `nextjs` and `storybook`', async () => {
const fs = new VirtualFilesystem({
'package.json': JSON.stringify({
dependencies: {
@@ -433,4 +496,22 @@ describe('detectFrameworks()', () => {
);
expect(slugs).toEqual(['nextjs', 'storybook']);
});
it('Should detect "hydrogen" template as `hydrogen`', async () => {
const fs = new LocalFileSystemDetector(join(EXAMPLES_DIR, 'hydrogen'));
const slugs = (await detectFrameworks({ fs, frameworkList })).map(
f => f.slug
);
expect(slugs).toEqual(['hydrogen']);
});
it('Should detect "hydrogen-2" template as `remix`', async () => {
const fs = new LocalFileSystemDetector(join(EXAMPLES_DIR, 'hydrogen-2'));
const slugs = (await detectFrameworks({ fs, frameworkList })).map(
f => f.slug
);
expect(slugs).toEqual(['remix']);
});
});

View File

@@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
@@ -13,7 +13,7 @@
"outDir": "dist",
"types": ["node", "jest"],
"strict": true,
"target": "ES2020",
"target": "ES2021",
"sourceMap": true
},
"include": ["src/**/*"],

View File

@@ -34,6 +34,7 @@
"license": "Apache-2.0",
"devDependencies": {
"@babel/cli": "7.20.7",
"@babel/core": "7.5.0"
"@babel/core": "7.5.0",
"jest-junit": "16.0.0"
}
}

View File

@@ -1,5 +1,20 @@
# @vercel/gatsby-plugin-vercel-builder
## 2.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))
### Patch Changes
- Exclude Gatsby from default 404 error route ([#10365](https://github.com/vercel/vercel/pull/10365))
- Updated dependencies [[`37f5c6270`](https://github.com/vercel/vercel/commit/37f5c6270058336072ca733673ea72dd6c56bd6a)]:
- @vercel/build-utils@7.0.0
- @vercel/node@3.0.0
- @vercel/routing-utils@3.0.0
## 1.3.18
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-builder",
"version": "1.3.18",
"version": "2.0.0",
"main": "dist/index.js",
"files": [
"dist",
@@ -20,9 +20,9 @@
},
"dependencies": {
"@sinclair/typebox": "0.25.24",
"@vercel/build-utils": "6.8.3",
"@vercel/node": "2.15.10",
"@vercel/routing-utils": "2.2.1",
"@vercel/build-utils": "7.0.0",
"@vercel/node": "3.0.0",
"@vercel/routing-utils": "3.0.0",
"esbuild": "0.14.47",
"etag": "1.8.1",
"fs-extra": "11.1.0"
@@ -32,6 +32,7 @@
"@types/fs-extra": "11.0.1",
"@types/node": "14.18.33",
"@types/react": "18.0.26",
"jest-junit": "16.0.0",
"typescript": "4.9.5"
}
}

View File

@@ -6,6 +6,7 @@ import {
createAPIRoutes,
} from './helpers/functions';
import { createStaticDir } from './helpers/static';
import { join } from 'path';
import type { Config } from './types';
export interface GenerateVercelBuildOutputAPI3OutputOptions {
@@ -59,13 +60,30 @@ export async function generateVercelBuildOutputAPI3Output({
trailingSlash = false;
}
const { routes } = getTransformedRoutes({
trailingSlash,
redirects: redirects.map(({ fromPath, toPath, isPermanent }) => ({
source: fromPath,
destination: toPath,
permanent: isPermanent,
})),
const routes =
getTransformedRoutes({
trailingSlash,
redirects: redirects.map(({ fromPath, toPath, isPermanent }) => ({
source: fromPath,
destination: toPath,
permanent: isPermanent,
})),
}).routes || [];
routes.push({
handle: 'error',
});
if (pathPrefix) {
routes.push({
status: 404,
src: '^(?!/api).*$',
dest: join(pathPrefix, '404.html'),
});
}
routes.push({
status: 404,
src: '^(?!/api).*$',
dest: '404.html',
});
const config: Config = {

View File

@@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"target": "ES2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */

7
packages/go/CHANGELOG.md Normal file
View File

@@ -0,0 +1,7 @@
# @vercel/go
## 3.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/go",
"version": "2.5.1",
"version": "3.0.0",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
@@ -11,7 +11,7 @@
},
"scripts": {
"build": "node build",
"test": "jest --env node --verbose --runInBand --bail",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-e2e": "pnpm test"
},
"files": [
@@ -27,11 +27,12 @@
"@types/node-fetch": "^2.3.0",
"@types/tar": "^4.0.0",
"@types/yauzl-promise": "2.1.0",
"@vercel/build-utils": "6.8.3",
"@vercel/build-utils": "7.0.0",
"@vercel/ncc": "0.24.0",
"async-retry": "1.3.1",
"execa": "^1.0.0",
"fs-extra": "^7.0.0",
"jest-junit": "16.0.0",
"node-fetch": "^2.2.1",
"string-argv": "0.3.1",
"tar": "4.4.6",

View File

@@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": false,
"esModuleInterop": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
@@ -13,6 +13,6 @@
"noImplicitThis": false,
"types": ["node", "jest"],
"strict": true,
"target": "ES2020"
"target": "ES2021"
}
}

View File

@@ -0,0 +1,7 @@
# @vercel/hydrogen
## 1.0.0
### Major Changes
- BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 ([#10369](https://github.com/vercel/vercel/pull/10369))

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/hydrogen",
"version": "0.0.64",
"version": "1.0.0",
"license": "Apache-2.0",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -12,7 +12,7 @@
"scripts": {
"build": "node build.js",
"test-e2e": "pnpm test test/test.js",
"test": "jest --env node --verbose --bail --runInBand"
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand"
},
"files": [
"dist",
@@ -21,10 +21,11 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.8.3",
"@vercel/static-config": "2.0.17",
"@vercel/build-utils": "7.0.0",
"@vercel/static-config": "3.0.0",
"execa": "3.2.0",
"fs-extra": "11.1.0",
"jest-junit": "16.0.0",
"ts-morph": "12.0.0"
}
}

View File

@@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2020"],
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
@@ -13,7 +13,7 @@
"outDir": "./dist",
"types": ["node", "jest"],
"strict": true,
"target": "ES2020",
"target": "ES2021",
"sourceMap": true
},
"include": ["src/**/*"],

Some files were not shown because too many files have changed in this diff Show More