mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 21:07:47 +00:00
Compare commits
212 Commits
vercel-plu
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e8935883b | ||
|
|
1c3497dc74 | ||
|
|
9836fdb5ca | ||
|
|
d6f88f019f | ||
|
|
0f720472c4 | ||
|
|
8d0c5114e4 | ||
|
|
e3c4435606 | ||
|
|
234c4dfa84 | ||
|
|
acd756436c | ||
|
|
f26858b735 | ||
|
|
623e43f865 | ||
|
|
3e696513a2 | ||
|
|
285f62c9d0 | ||
|
|
c43db1788c | ||
|
|
fc2eb1a30d | ||
|
|
ecf194b7c1 | ||
|
|
c14e5689f1 | ||
|
|
54dfe747e2 | ||
|
|
2afc8db8e7 | ||
|
|
cc628dd9fb | ||
|
|
dfb6ef949b | ||
|
|
cd4799b5d5 | ||
|
|
5e66d4b2cc | ||
|
|
44d7473e7c | ||
|
|
fddec1286c | ||
|
|
6e5e700e8d | ||
|
|
b6e8609b83 | ||
|
|
78b7bd5ec8 | ||
|
|
4104a45c2d | ||
|
|
4c20218e05 | ||
|
|
02a0004719 | ||
|
|
123bffb776 | ||
|
|
074535f27c | ||
|
|
05243fb6e9 | ||
|
|
097725580c | ||
|
|
4b09c89e7d | ||
|
|
3a1eede63b | ||
|
|
9cee0dd5d7 | ||
|
|
b801c6e593 | ||
|
|
505050b923 | ||
|
|
15c7ad241a | ||
|
|
ec57654b5b | ||
|
|
3b9a9878bc | ||
|
|
70b7db1a15 | ||
|
|
41d6666139 | ||
|
|
2857219f89 | ||
|
|
246c2a0f5d | ||
|
|
d91bca7d6b | ||
|
|
be54fce67b | ||
|
|
7753bb8d89 | ||
|
|
ce17ac5c35 | ||
|
|
8006fc32b8 | ||
|
|
8038a90db1 | ||
|
|
f88c862e9d | ||
|
|
9170820371 | ||
|
|
c881546e0e | ||
|
|
fa21db98e4 | ||
|
|
8eabbfc666 | ||
|
|
6783f7afc9 | ||
|
|
a400b9b29d | ||
|
|
b549c37149 | ||
|
|
30d5e64291 | ||
|
|
47c2c361d2 | ||
|
|
438576fc7c | ||
|
|
b30343ef7b | ||
|
|
2dc0dfa572 | ||
|
|
9ee54b3dd6 | ||
|
|
9d67e0bc06 | ||
|
|
466135cf84 | ||
|
|
eab2e229dc | ||
|
|
698b89a2ba | ||
|
|
bae2a2e4df | ||
|
|
57916bb712 | ||
|
|
12bbd4e8eb | ||
|
|
4e4c7023dc | ||
|
|
41805790e7 | ||
|
|
6ad77ae8e1 | ||
|
|
e8daf36cd7 | ||
|
|
c319a2c499 | ||
|
|
a410baa797 | ||
|
|
625568e659 | ||
|
|
41868c1fe0 | ||
|
|
1b644f1218 | ||
|
|
29ea0fb06b | ||
|
|
b61f049f11 | ||
|
|
16e28f326b | ||
|
|
276397c940 | ||
|
|
85d7311199 | ||
|
|
b8114b8b39 | ||
|
|
d63e8d3187 | ||
|
|
11d3dd04aa | ||
|
|
46bf95ee36 | ||
|
|
92252468c2 | ||
|
|
71b83d5587 | ||
|
|
d9e5fdc5e4 | ||
|
|
58f479c603 | ||
|
|
d62461d952 | ||
|
|
e7f524defb | ||
|
|
bdefd0d05d | ||
|
|
ca522fc9f1 | ||
|
|
4a8504fc45 | ||
|
|
576217b344 | ||
|
|
f03129ac7a | ||
|
|
3eaad1fd52 | ||
|
|
4e471491d8 | ||
|
|
99395fd9fe | ||
|
|
4980fe6513 | ||
|
|
24676ae020 | ||
|
|
72ada9abd8 | ||
|
|
da893e7c57 | ||
|
|
e40eecafc9 | ||
|
|
d9e5342eba | ||
|
|
b0ab13778d | ||
|
|
c76dfbe8c9 | ||
|
|
ed6f3cc27e | ||
|
|
7b0186bffe | ||
|
|
45e22b6b60 | ||
|
|
b2bfae6e2e | ||
|
|
b6ed718f52 | ||
|
|
a84c4a37e6 | ||
|
|
d2ba06c6cb | ||
|
|
06e7753df0 | ||
|
|
235a9c3300 | ||
|
|
1b70402325 | ||
|
|
c76781fac9 | ||
|
|
451e0b0cfb | ||
|
|
cf477d45b2 | ||
|
|
cdd2d69e07 | ||
|
|
43f1f8b257 | ||
|
|
34055e3599 | ||
|
|
26abb0a85a | ||
|
|
a1e337e0dd | ||
|
|
b72ead480f | ||
|
|
77cf68105f | ||
|
|
d800f55dfa | ||
|
|
9dde99f19e | ||
|
|
fae7a083fc | ||
|
|
cbd651d6ee | ||
|
|
6077a706d1 | ||
|
|
cedc82dd9e | ||
|
|
b420006401 | ||
|
|
8ba604e8fc | ||
|
|
fadeee4568 | ||
|
|
2b15ba7f46 | ||
|
|
4cdfd0e58c | ||
|
|
b3ccb5f3ef | ||
|
|
584acc43b7 | ||
|
|
f64be93b94 | ||
|
|
9abd31769e | ||
|
|
09e3b35e74 | ||
|
|
8aa9a0ea05 | ||
|
|
b2d0ed74c6 | ||
|
|
aef936af0f | ||
|
|
501be936c0 | ||
|
|
7eba282af5 | ||
|
|
cf3e4bd726 | ||
|
|
ee5361b00e | ||
|
|
bd929dd5c5 | ||
|
|
4ee064bb61 | ||
|
|
312a2090a6 | ||
|
|
a82f117217 | ||
|
|
e908378486 | ||
|
|
8cda5263eb | ||
|
|
a24fd64bce | ||
|
|
0c515a46d5 | ||
|
|
f19690dc32 | ||
|
|
6b2a1c3866 | ||
|
|
1e54d606d7 | ||
|
|
c4ab0ebe9c | ||
|
|
321f1232a1 | ||
|
|
8a8203e149 | ||
|
|
33527165e7 | ||
|
|
db10383bc8 | ||
|
|
56960e506e | ||
|
|
a17f3a96ec | ||
|
|
9ff86a896c | ||
|
|
6ccb4354f9 | ||
|
|
82ba932447 | ||
|
|
b995618afb | ||
|
|
c897b24417 | ||
|
|
e64b2e1993 | ||
|
|
9358a5469e | ||
|
|
2a24210b7d | ||
|
|
2644a59984 | ||
|
|
4eeb8c298c | ||
|
|
0351f02dff | ||
|
|
0d7fa2f912 | ||
|
|
3b646880e7 | ||
|
|
350a0e5f36 | ||
|
|
5c21d400bd | ||
|
|
04029013a6 | ||
|
|
c65e7fa883 | ||
|
|
27b68be93f | ||
|
|
99fa729966 | ||
|
|
2bb3da80e0 | ||
|
|
b852f34a27 | ||
|
|
ce8e6e3806 | ||
|
|
983946650e | ||
|
|
59e4572e76 | ||
|
|
5c297122cb | ||
|
|
28f3bf9ef6 | ||
|
|
a936e92b8b | ||
|
|
ab1decf79d | ||
|
|
34408a7902 | ||
|
|
dc2d814d0f | ||
|
|
2402db92eb | ||
|
|
a1787c740d | ||
|
|
17fd88e044 | ||
|
|
03a8fbd3a7 | ||
|
|
8d37c1045f | ||
|
|
30c433d248 | ||
|
|
d89a79601c |
@@ -1,7 +1,12 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
examples
|
examples
|
||||||
|
|
||||||
|
packages/node/src/bridge.ts
|
||||||
|
|
||||||
packages/*/test/fixtures
|
packages/*/test/fixtures
|
||||||
|
|
||||||
|
# cli
|
||||||
packages/cli/@types
|
packages/cli/@types
|
||||||
packages/cli/download
|
packages/cli/download
|
||||||
packages/cli/dist
|
packages/cli/dist
|
||||||
@@ -9,9 +14,28 @@ packages/cli/test/dev/fixtures
|
|||||||
packages/cli/bin
|
packages/cli/bin
|
||||||
packages/cli/link
|
packages/cli/link
|
||||||
packages/cli/src/util/dev/templates/*.ts
|
packages/cli/src/util/dev/templates/*.ts
|
||||||
|
|
||||||
|
# client
|
||||||
packages/client/tests/fixtures
|
packages/client/tests/fixtures
|
||||||
packages/client/lib
|
packages/client/lib
|
||||||
packages/node/src/bridge.ts
|
|
||||||
|
# next
|
||||||
|
packages/next/test/integration/middleware
|
||||||
|
packages/next/test/integration/middleware-eval
|
||||||
|
|
||||||
|
# node-bridge
|
||||||
packages/node-bridge/bridge.js
|
packages/node-bridge/bridge.js
|
||||||
packages/node-bridge/launcher.js
|
packages/node-bridge/launcher.js
|
||||||
|
packages/node-bridge/helpers.js
|
||||||
|
packages/node-bridge/source-map-support.js
|
||||||
|
|
||||||
|
# middleware
|
||||||
packages/middleware/src/entries.js
|
packages/middleware/src/entries.js
|
||||||
|
|
||||||
|
# static-build
|
||||||
|
packages/static-build/test/fixtures
|
||||||
|
packages/static-build/test/build-fixtures
|
||||||
|
packages/static-build/test/cache-fixtures
|
||||||
|
|
||||||
|
# redwood
|
||||||
|
packages/redwood/test/fixtures
|
||||||
|
|||||||
39
.github/CODEOWNERS
vendored
39
.github/CODEOWNERS
vendored
@@ -1,29 +1,26 @@
|
|||||||
# Documentation
|
# Documentation
|
||||||
# https://help.github.com/en/articles/about-code-owners
|
# https://help.github.com/en/articles/about-code-owners
|
||||||
|
|
||||||
* @TooTallNate
|
* @TooTallNate @EndangeredMassa @styfle
|
||||||
/.github/workflows @AndyBitz @styfle
|
/.github/workflows @TooTallNate @EndangeredMassa @styfle @ijjk
|
||||||
/packages/frameworks @AndyBitz
|
/packages/frameworks @TooTallNate @EndangeredMassa @styfle @AndyBitz
|
||||||
/packages/cli/src/commands/build @TooTallNate @styfle @AndyBitz @gdborton @jaredpalmer
|
|
||||||
/packages/cli/src/commands/dev @TooTallNate @styfle @AndyBitz
|
|
||||||
/packages/cli/src/util/dev @TooTallNate @styfle @AndyBitz
|
|
||||||
/packages/cli/src/commands/domains @javivelasco @mglagola @anatrajkovska
|
/packages/cli/src/commands/domains @javivelasco @mglagola @anatrajkovska
|
||||||
/packages/cli/src/commands/certs @javivelasco @mglagola @anatrajkovska
|
/packages/cli/src/commands/certs @javivelasco @mglagola @anatrajkovska
|
||||||
/packages/cli/src/commands/env @styfle @lucleray
|
/packages/cli/src/commands/env @styfle @lucleray
|
||||||
/packages/client @styfle @TooTallNate
|
/packages/client @TooTallNate @EndangeredMassa @styfle
|
||||||
/packages/build-utils @styfle @AndyBitz @TooTallNate
|
/packages/build-utils @TooTallNate @EndangeredMassa @styfle @AndyBitz
|
||||||
/packages/middleware @gdborton @javivelasco
|
/packages/middleware @gdborton @javivelasco
|
||||||
/packages/node @styfle @TooTallNate @lucleray
|
/packages/node @TooTallNate @EndangeredMassa @styfle
|
||||||
/packages/node-bridge @styfle @TooTallNate @lucleray
|
/packages/node-bridge @TooTallNate @EndangeredMassa @styfle @ijjk
|
||||||
/packages/next @Timer @ijjk
|
/packages/next @TooTallNate @ijjk
|
||||||
/packages/go @styfle @TooTallNate
|
/packages/go @TooTallNate @EndangeredMassa @styfle
|
||||||
/packages/python @styfle @TooTallNate
|
/packages/python @TooTallNate @EndangeredMassa @styfle
|
||||||
/packages/ruby @styfle @TooTallNate
|
/packages/ruby @TooTallNate @EndangeredMassa @styfle
|
||||||
/packages/static-build @styfle @AndyBitz
|
/packages/static-build @TooTallNate @EndangeredMassa @styfle @AndyBitz
|
||||||
/packages/routing-utils @styfle @dav-is @ijjk
|
/packages/routing-utils @TooTallNate @EndangeredMassa @styfle @ijjk
|
||||||
/examples @mcsdevv
|
/examples @leerob
|
||||||
/examples/create-react-app @Timer
|
/examples/create-react-app @Timer
|
||||||
/examples/nextjs @timneutkens @Timer
|
/examples/nextjs @timneutkens @ijjk @styfle
|
||||||
/examples/hugo @mcsdevv @styfle
|
/examples/hugo @styfle
|
||||||
/examples/jekyll @mcsdevv @styfle
|
/examples/jekyll @styfle
|
||||||
/examples/zola @mcsdevv @styfle
|
/examples/zola @styfle
|
||||||
|
|||||||
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/vercel/vercel/discussions/new) with the owners of this repository before submitting a Pull Request.
|
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/vercel/vercel/discussions/new) with the owners of this repository before submitting a Pull Request.
|
||||||
|
|
||||||
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
|
Please read our [Code of Conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
|
||||||
|
|
||||||
## Local development
|
## Local development
|
||||||
|
|
||||||
This project is configured in a monorepo pattern where one repo contains multiple npm packages. Dependencies are installed and managed with `yarn`, not `npm` CLI.
|
This project is configured in a monorepo, where one repository contains multiple npm packages. Dependencies are installed and managed with `yarn`, not `npm` CLI.
|
||||||
|
|
||||||
To get started, execute the following:
|
To get started, execute the following:
|
||||||
|
|
||||||
@@ -16,17 +16,17 @@ yarn install
|
|||||||
yarn bootstrap
|
yarn bootstrap
|
||||||
yarn build
|
yarn build
|
||||||
yarn lint
|
yarn lint
|
||||||
yarn test
|
yarn test-unit
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure all the tests pass before making changes.
|
Make sure all the tests pass before making changes.
|
||||||
|
|
||||||
## Verifying your change
|
## Verifying your change
|
||||||
|
|
||||||
Once you are done with your changes (we even suggest doing it along the way ), make sure all the test still run by running
|
Once you are done with your changes (we even suggest doing it along the way), make sure all the test still pass by running:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn build && yarn test
|
yarn test-unit
|
||||||
```
|
```
|
||||||
|
|
||||||
from the root of the project.
|
from the root of the project.
|
||||||
|
|||||||
3
.github/workflows/cancel.yml
vendored
3
.github/workflows/cancel.yml
vendored
@@ -13,6 +13,5 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: styfle/cancel-workflow-action@0.9.1
|
- uses: styfle/cancel-workflow-action@0.9.1
|
||||||
with:
|
with:
|
||||||
workflow_id: 849295, 849296, 849297, 849298
|
workflow_id: test.yml, test-integration-cli.yml, test-unit.yml
|
||||||
access_token: ${{ github.token }}
|
access_token: ${{ github.token }}
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/test-integration-cli.yml
vendored
6
.github/workflows/test-integration-cli.yml
vendored
@@ -11,13 +11,17 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: CLI
|
name: CLI
|
||||||
timeout-minutes: 30
|
timeout-minutes: 40
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
node: [12]
|
node: [12]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
TURBO_REMOTE_ONLY: true
|
||||||
|
TURBO_TEAM: vercel
|
||||||
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
43
.github/workflows/test-integration-dev.yml
vendored
43
.github/workflows/test-integration-dev.yml
vendored
@@ -1,43 +0,0 @@
|
|||||||
name: Dev
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
tags:
|
|
||||||
- '!*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Dev
|
|
||||||
timeout-minutes: 75
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
node: [12]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: '1.13.15'
|
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node }}
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 100
|
|
||||||
- run: git --version
|
|
||||||
- run: git fetch origin main --depth=100
|
|
||||||
- run: git fetch origin ${{ github.ref }} --depth=100
|
|
||||||
- run: git diff origin/main...HEAD --name-only
|
|
||||||
- name: Install Hugo
|
|
||||||
if: matrix.os == 'macos-latest'
|
|
||||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/cli/test/dev/fixtures/08-hugo/
|
|
||||||
- run: yarn install --network-timeout 1000000
|
|
||||||
- run: yarn run build
|
|
||||||
- run: yarn test-integration-dev
|
|
||||||
env:
|
|
||||||
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
|
|
||||||
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}
|
|
||||||
35
.github/workflows/test-integration-once.yml
vendored
35
.github/workflows/test-integration-once.yml
vendored
@@ -1,35 +0,0 @@
|
|||||||
name: E2E
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
tags:
|
|
||||||
- '!*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: E2E
|
|
||||||
timeout-minutes: 120
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: '1.13.15'
|
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: 12
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 100
|
|
||||||
- run: git --version
|
|
||||||
- run: git fetch origin main --depth=100
|
|
||||||
- run: git fetch origin ${{ github.ref }} --depth=100
|
|
||||||
- run: git diff origin/main...HEAD --name-only
|
|
||||||
- run: yarn install --network-timeout 1000000
|
|
||||||
- run: yarn run build
|
|
||||||
- run: yarn test-integration-once
|
|
||||||
env:
|
|
||||||
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
|
|
||||||
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}
|
|
||||||
4
.github/workflows/test-unit.yml
vendored
4
.github/workflows/test-unit.yml
vendored
@@ -18,6 +18,10 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
node: [12]
|
node: [12]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
TURBO_REMOTE_ONLY: true
|
||||||
|
TURBO_TEAM: vercel
|
||||||
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
88
.github/workflows/test.yml
vendored
Normal file
88
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
name: Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- '!*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
NODE_VERSION: '14'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
setup:
|
||||||
|
name: Find Changes
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
tests: ${{ steps['set-tests'].outputs['tests'] }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: git --version
|
||||||
|
- run: git fetch origin main
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
cache: 'yarn'
|
||||||
|
- run: yarn install --network-timeout 1000000
|
||||||
|
- id: set-tests
|
||||||
|
run: |
|
||||||
|
TESTS_ARRAY=$(node utils/chunk-tests.js $SCRIPT_NAME)
|
||||||
|
echo "Files to test:"
|
||||||
|
echo "$TESTS_ARRAY"
|
||||||
|
echo "::set-output name=tests::$TESTS_ARRAY"
|
||||||
|
|
||||||
|
test:
|
||||||
|
timeout-minutes: 120
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
name: ${{matrix.scriptName}} (${{matrix.packageName}}, ${{matrix.chunkNumber}}, ${{ matrix.runner }})
|
||||||
|
if: ${{ needs.setup.outputs['tests'] != '[]' }}
|
||||||
|
env:
|
||||||
|
TURBO_REMOTE_ONLY: true
|
||||||
|
TURBO_TEAM: vercel
|
||||||
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
|
needs:
|
||||||
|
- setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include: ${{ fromJson(needs.setup.outputs['tests']) }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: '1.13.15'
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
- name: Install Hugo
|
||||||
|
if: matrix.runner == 'macos-latest'
|
||||||
|
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/cli/test/dev/fixtures/08-hugo/
|
||||||
|
|
||||||
|
- run: yarn install --network-timeout 1000000
|
||||||
|
|
||||||
|
- name: Build ${{matrix.packageName}} and all its dependencies
|
||||||
|
run: yarn turbo run build --cache-dir=".turbo" --scope=${{matrix.packageName}} --include-dependencies --no-deps
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: '1'
|
||||||
|
- name: Test ${{matrix.packageName}}
|
||||||
|
run: node_modules/.bin/turbo run test --cache-dir=".turbo" --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
|
||||||
|
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}
|
||||||
|
FORCE_COLOR: '1'
|
||||||
|
|
||||||
|
conclusion:
|
||||||
|
needs:
|
||||||
|
- test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: E2E
|
||||||
|
steps:
|
||||||
|
- name: Done
|
||||||
|
run: echo "Done."
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,5 +27,4 @@ test/lib/deployment/failed-page.txt
|
|||||||
/public
|
/public
|
||||||
__pycache__
|
__pycache__
|
||||||
.vercel
|
.vercel
|
||||||
.output
|
|
||||||
.turbo
|
.turbo
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
!.yarnrc
|
!.yarnrc
|
||||||
!yarn.lock
|
!yarn.lock
|
||||||
!package.json
|
!package.json
|
||||||
|
!turbo.json
|
||||||
|
|
||||||
# api
|
# api
|
||||||
!api/
|
!api/
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ A Runtime is an npm module that implements the following interface:
|
|||||||
interface Runtime {
|
interface Runtime {
|
||||||
version: number;
|
version: number;
|
||||||
build: (options: BuildOptions) => Promise<BuildResult>;
|
build: (options: BuildOptions) => Promise<BuildResult>;
|
||||||
analyze?: (options: AnalyzeOptions) => Promise<string>;
|
|
||||||
prepareCache?: (options: PrepareCacheOptions) => Promise<CacheOutputs>;
|
prepareCache?: (options: PrepareCacheOptions) => Promise<CacheOutputs>;
|
||||||
shouldServe?: (options: ShouldServeOptions) => Promise<boolean>;
|
shouldServe?: (options: ShouldServeOptions) => Promise<boolean>;
|
||||||
startDevServer?: (
|
startDevServer?: (
|
||||||
@@ -72,26 +71,6 @@ export async function build(options: BuildOptions) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `analyze()`
|
|
||||||
|
|
||||||
An **optional** exported function that returns a unique fingerprint used for the
|
|
||||||
purpose of [build
|
|
||||||
de-duplication](https://vercel.com/docs/v2/platform/deployments#deduplication).
|
|
||||||
If the `analyze()` function is not supplied, then a random fingerprint is
|
|
||||||
assigned to each build.
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { AnalyzeOptions } from '@vercel/build-utils';
|
|
||||||
|
|
||||||
export async function analyze(options: AnalyzeOptions) {
|
|
||||||
// Do calculations to generate a fingerprint based off the source code here…
|
|
||||||
|
|
||||||
return 'fingerprint goes here';
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `prepareCache()`
|
### `prepareCache()`
|
||||||
|
|
||||||
An **optional** exported function that is executed after [`build()`](#build) is
|
An **optional** exported function that is executed after [`build()`](#build) is
|
||||||
@@ -328,15 +307,15 @@ This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
|
|||||||
|
|
||||||
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
|
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
|
||||||
|
|
||||||
|
- `nodejs14.x`
|
||||||
- `nodejs12.x`
|
- `nodejs12.x`
|
||||||
- `nodejs10.x`
|
|
||||||
- `go1.x`
|
- `go1.x`
|
||||||
- `java11`
|
- `java11`
|
||||||
- `python3.9`
|
- `python3.9`
|
||||||
- `python3.6`
|
- `dotnet6`
|
||||||
- `dotnetcore2.1`
|
- `dotnetcore3.1`
|
||||||
- `ruby2.5`
|
- `ruby2.7`
|
||||||
- `provided`
|
- `provided.al2`
|
||||||
|
|
||||||
## `@vercel/build-utils` Helper Functions
|
## `@vercel/build-utils` Helper Functions
|
||||||
|
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -3,13 +3,21 @@
|
|||||||
<img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96">
|
<img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96">
|
||||||
<h3 align="center">Vercel</h3>
|
<h3 align="center">Vercel</h3>
|
||||||
</a>
|
</a>
|
||||||
<p align="center">Develop. Preview. Ship.</p>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://github.com/vercel/vercel/actions/workflows/test-unit.yml)
|
<p align="center">
|
||||||
[](https://github.com/vercel/vercel/discussions)
|
Develop. Preview. Ship.
|
||||||
|
</p>
|
||||||
|
|
||||||
## Usage
|
<p align="center">
|
||||||
|
<a href="https://vercel.com/docs"><strong>Documentation</strong></a> ·
|
||||||
|
<a href="https://vercel.com/changelog"><strong>Changelog</strong></a> ·
|
||||||
|
<a href="https://vercel.com/templates"><strong>Templates</strong></a> ·
|
||||||
|
<a href="https://vercel.com/cli"><strong>CLI</strong></a>
|
||||||
|
</p>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
## Vercel
|
||||||
|
|
||||||
Vercel is a platform for **static sites and frontend frameworks**, built to integrate with your headless content, commerce, or database.
|
Vercel is a platform for **static sites and frontend frameworks**, built to integrate with your headless content, commerce, or database.
|
||||||
|
|
||||||
@@ -17,22 +25,16 @@ We provide a **frictionless developer experience** to take care of the hard thin
|
|||||||
|
|
||||||
We make it easy for frontend teams to **develop, preview, and ship** delightful user experiences, where performance is the default.
|
We make it easy for frontend teams to **develop, preview, and ship** delightful user experiences, where performance is the default.
|
||||||
|
|
||||||
Get started by [Importing a Git Project](https://vercel.com/new) and use `git push` to deploy. Alternatively, you can [install Vercel CLI](https://vercel.com/cli).
|
## Deploy
|
||||||
|
|
||||||
|
Get started by [importing a project](https://vercel.com/new) or using the [Vercel CLI](https://vercel.com/cli). Then, `git push` to deploy.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
For details on how to use Vercel, check out our [documentation](https://vercel.com/docs).
|
For details on how to use Vercel, check out our [documentation](https://vercel.com/docs).
|
||||||
|
|
||||||
## Caught a Bug?
|
## Contributing
|
||||||
|
|
||||||
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
|
- [Code of Conduct](https://github.com/vercel/vercel/blob/main/.github/CODE_OF_CONDUCT.md)
|
||||||
2. Install dependencies with `yarn install`
|
- [Contributing Guidelines](https://github.com/vercel/vercel/blob/main/.github/CONTRIBUTING.md)
|
||||||
3. Compile the code: `yarn build`
|
- [MIT License](https://github.com/vercel/vercel/blob/main/LICENSE)
|
||||||
4. Link the package to the global module directory: `cd ./packages/cli && yarn link`
|
|
||||||
5. You can start using `vercel` anywhere inside the command line
|
|
||||||
|
|
||||||
As always, you should use `yarn test-unit` to run the tests and see if your changes have broken anything.
|
|
||||||
|
|
||||||
## How to Create a Release
|
|
||||||
|
|
||||||
If you have write access to this repository, you can read more about how to publish a release [here](https://github.com/vercel/vercel/wiki/Creating-a-Release).
|
|
||||||
|
|||||||
46
api/_lib/script/build.ts
Normal file
46
api/_lib/script/build.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import fs from 'fs/promises';
|
||||||
|
import { join } from 'path';
|
||||||
|
import { getExampleList } from '../examples/example-list';
|
||||||
|
import { mapOldToNew } from '../examples/map-old-to-new';
|
||||||
|
|
||||||
|
const repoRoot = join(__dirname, '..', '..', '..');
|
||||||
|
const pubDir = join(repoRoot, 'public');
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
console.log(`Building static frontend ${repoRoot}...`);
|
||||||
|
|
||||||
|
await fs.rm(pubDir, { recursive: true, force: true });
|
||||||
|
await fs.mkdir(pubDir);
|
||||||
|
|
||||||
|
const examples = await getExampleList();
|
||||||
|
const pathListAll = join(pubDir, 'list-all.json');
|
||||||
|
await fs.writeFile(pathListAll, JSON.stringify(examples));
|
||||||
|
|
||||||
|
const exampleDirs = await fs.readdir(join(repoRoot, 'examples'), {
|
||||||
|
withFileTypes: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const existingExamples = exampleDirs
|
||||||
|
.filter(dir => dir.isDirectory())
|
||||||
|
.map(dir => ({
|
||||||
|
name: dir.name,
|
||||||
|
visible: true,
|
||||||
|
suggestions: [],
|
||||||
|
}));
|
||||||
|
|
||||||
|
const oldExamples = Object.keys(mapOldToNew).map(key => ({
|
||||||
|
name: key,
|
||||||
|
visible: false,
|
||||||
|
suggestions: mapOldToNew[key],
|
||||||
|
}));
|
||||||
|
|
||||||
|
const pathList = join(pubDir, 'list.json');
|
||||||
|
await fs.writeFile(
|
||||||
|
pathList,
|
||||||
|
JSON.stringify([...existingExamples, ...oldExamples])
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('Completed building static frontend.');
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch(console.error);
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
|
||||||
import { getExampleList } from '../_lib/examples/example-list';
|
|
||||||
import { withApiHandler } from '../_lib/util/with-api-handler';
|
|
||||||
|
|
||||||
export default withApiHandler(async function (
|
|
||||||
req: VercelRequest,
|
|
||||||
res: VercelResponse
|
|
||||||
) {
|
|
||||||
res.status(200).json(await getExampleList());
|
|
||||||
});
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import { extract } from '../_lib/examples/extract';
|
|
||||||
import { summary } from '../_lib/examples/summary';
|
|
||||||
import { VercelRequest, VercelResponse } from '@vercel/node';
|
|
||||||
import { mapOldToNew } from '../_lib/examples/map-old-to-new';
|
|
||||||
import { withApiHandler } from '../_lib/util/with-api-handler';
|
|
||||||
|
|
||||||
export default withApiHandler(async function (
|
|
||||||
req: VercelRequest,
|
|
||||||
res: VercelResponse
|
|
||||||
) {
|
|
||||||
await extract('https://github.com/vercel/vercel/archive/main.zip', '/tmp');
|
|
||||||
const exampleList = summary('/tmp/vercel-main/examples');
|
|
||||||
|
|
||||||
const existingExamples = Array.from(exampleList).map(key => ({
|
|
||||||
name: key,
|
|
||||||
visible: true,
|
|
||||||
suggestions: [],
|
|
||||||
}));
|
|
||||||
|
|
||||||
const oldExamples = Object.keys(mapOldToNew).map(key => ({
|
|
||||||
name: key,
|
|
||||||
visible: false,
|
|
||||||
suggestions: mapOldToNew[key],
|
|
||||||
}));
|
|
||||||
|
|
||||||
res.status(200).json([...existingExamples, ...oldExamples]);
|
|
||||||
});
|
|
||||||
@@ -16,4 +16,4 @@ If you would not like to verify your domain, you can remove it from your account
|
|||||||
|
|
||||||
#### Resources
|
#### Resources
|
||||||
|
|
||||||
- [Vercel Custom Domains Documentation](https://vercel.com/docs/v2/custom-domains)
|
- [Vercel Custom Domains Documentation](https://vercel.com/docs/concepts/projects/custom-domains)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#### Why This Error Occurred
|
#### Why This Error Occurred
|
||||||
|
|
||||||
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/v2/build-step#environment-variables).
|
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/concepts/projects/environment-variables).
|
||||||
|
|
||||||
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
|
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
|
||||||
|
|
||||||
@@ -24,4 +24,4 @@ TEST=value
|
|||||||
|
|
||||||
In the above example, `TEST` represents the name of the environment variable and `value` its value.
|
In the above example, `TEST` represents the name of the environment variable and `value` its value.
|
||||||
|
|
||||||
For more information on Environment Variables in development, [see the documentation](https://vercel.com/docs/v2/build-step#environment-variables).
|
For more information on Environment Variables in development, [see the documentation](https://vercel.com/docs/concepts/projects/environment-variables).
|
||||||
|
|||||||
50
examples/README.md
vendored
50
examples/README.md
vendored
@@ -1,28 +1,6 @@
|
|||||||
# Vercel Examples
|
# Vercel Examples
|
||||||
|
|
||||||
This is the public list of examples for **Vercel**.
|
To get started using any of these examples as your own project, [install Vercel](https://vercel.com/cli) and use either of the following commands in your terminal:
|
||||||
|
|
||||||
All of these ready to deploy examples feature a frontend framework or static site, created with zero configuration using the CLI tools they provide.
|
|
||||||
|
|
||||||
The `+functions` examples feature an `/api` directory as well, highlighting how to use serverless functions on top of a framework, again with zero configuration required.
|
|
||||||
|
|
||||||
## What is Vercel?
|
|
||||||
|
|
||||||
Vercel is a cloud platform for static frontends and serverless functions. It enables developers to host websites and web applications that deploy instantly, scale automatically, and require no supervision.
|
|
||||||
|
|
||||||
## What Does this Repository Contain?
|
|
||||||
|
|
||||||
This repository consists of multiple examples, created for use with the [Vercel](https://vercel.com) platform. In addition to this, it also contains:
|
|
||||||
|
|
||||||
- [Code of Conduct](https://github.com/vercel/vercel/blob/main/.github/CODE_OF_CONDUCT.md) - our Code of Conduct, adapted from the [Contributor Covenant](http://contributor-covenant.org)
|
|
||||||
- [Contributing Guidelines](https://github.com/vercel/vercel/blob/main/.github/CONTRIBUTING.md) - a guide on how to contribute to the examples repository
|
|
||||||
- [License](https://github.com/vercel/vercel/blob/main/LICENSE) - the standard MIT license under which these examples are published
|
|
||||||
|
|
||||||
We recommend familiarizing yourself with the above sections, particularly if you are looking to make a contribution.
|
|
||||||
|
|
||||||
## Deploying Examples
|
|
||||||
|
|
||||||
To get started using any of these examples as your own project, [install Vercel](https://vercel.com/download) and use either of the following commands in your terminal:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
vercel init # Pick an example in the CLI
|
vercel init # Pick an example in the CLI
|
||||||
@@ -30,7 +8,7 @@ vercel init <example> # Create a new project from a specific <example>
|
|||||||
vercel init <example> <name> # Create a new project from a specific <example> with a different folder <name>
|
vercel init <example> <name> # Create a new project from a specific <example> with a different folder <name>
|
||||||
```
|
```
|
||||||
|
|
||||||
Deploying your project takes seconds and can be done with **just a single command**:
|
Deploying your project can be done with **a single command**:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
vercel # Deploy your project with the CLI
|
vercel # Deploy your project with the CLI
|
||||||
@@ -38,26 +16,6 @@ vercel # Deploy your project with the CLI
|
|||||||
|
|
||||||
With the `vercel` command, your project will be built and served by Vercel, providing you with a URL that can be shared immediately.
|
With the `vercel` command, your project will be built and served by Vercel, providing you with a URL that can be shared immediately.
|
||||||
|
|
||||||
## New Examples
|
|
||||||
|
|
||||||
We are continuously improving our examples based on best practices and feedback from the community. As a result, it is possible that example names will change and on occasion deprecated in favor of an improved implementation.
|
|
||||||
|
|
||||||
For example, the previous `nodejs` example showed a static frontend with a Node.js API. This is illustrated in the `svelte` example. Below is a table that lists some of the most popular previous examples and the equivalent replacement:
|
|
||||||
|
|
||||||
| Previous Example | New Example |
|
|
||||||
| ----------------- | ---------------------------------------------------------------------------------------- |
|
|
||||||
| **monorepo** | [gatsby-functions](https://github.com/vercel/vercel/tree/main/examples/gatsby) |
|
|
||||||
| **nodejs** | [svelte-functions](https://github.com/vercel/vercel/tree/main/examples/svelte) |
|
|
||||||
| **nextjs-static** | [nextjs](https://github.com/vercel/vercel/tree/main/examples/nextjs) |
|
|
||||||
| **vanilla-go** | [create-react-app](https://github.com/vercel/vercel/tree/main/examples/create-react-app) |
|
|
||||||
| **typescript** | [gatsby-functions](https://github.com/vercel/vercel/tree/main/examples/gatsby) |
|
|
||||||
|
|
||||||
## Migrating and Upgrading
|
|
||||||
|
|
||||||
If you have an existing project you would like to deploy with Vercel, we recommend reading our guide on [migrating to Vercel and zero configuration](https://vercel.com/guides/migrate-to-vercel). By combining the guide with this repository, you will quickly be able to understand how to deploy your application.
|
|
||||||
|
|
||||||
If you would like to upgrade a project to take advantage of zero configuration, you may find the [upgrade guide](https://vercel.com/guides/upgrade-to-zero-configuration) useful. The upgrade guide covers how to remove configuration from existing projects along with how to use the `/api` directory.
|
|
||||||
|
|
||||||
## How to Contribute
|
## How to Contribute
|
||||||
|
|
||||||
Contributing examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/vercel/vercel/blob/main/.github/CONTRIBUTING.md) to help you do so.
|
Contributing examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/vercel/vercel/blob/main/.github/CONTRIBUTING.md) to help you do so.
|
||||||
@@ -74,10 +32,6 @@ An issue can be raised by clicking the 'Issues' tab at the top of the repository
|
|||||||
|
|
||||||
When submitting an issue, please thoroughly and concisely describe the problem you are experiencing so that we may easily understand and resolve the issue in a timely manner.
|
When submitting an issue, please thoroughly and concisely describe the problem you are experiencing so that we may easily understand and resolve the issue in a timely manner.
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
This repository is an open source project. See the [License](https://github.com/vercel/vercel/blob/main/LICENSE).
|
|
||||||
|
|
||||||
## Get In Touch
|
## Get In Touch
|
||||||
|
|
||||||
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/vercel/vercel/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
|
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/vercel/vercel/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
|
||||||
|
|||||||
1
examples/amp/.gitignore
vendored
1
examples/amp/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
.env
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# AMP Example
|
|
||||||
|
|
||||||
This directory is a brief example of an [AMP](https://amp.dev/) site that can be deployed to Vercel with zero configuration.
|
|
||||||
|
|
||||||
## Deploy Your Own
|
|
||||||
|
|
||||||
Deploy your own AMP project with Vercel.
|
|
||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/amp)
|
|
||||||
|
|
||||||
_Live Example: https://amp-template.vercel.app_
|
|
||||||
|
|
||||||
### How We Created This Example
|
|
||||||
|
|
||||||
To get started deploying AMP with Vercel, you can use the [Vercel CLI](https://vercel.com/download) to initialize the project:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ vercel init amp
|
|
||||||
```
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -1,72 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html ⚡>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width,minimum-scale=1" />
|
|
||||||
<link rel="shortcut icon" href="favicon.png">
|
|
||||||
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
|
||||||
<link rel="canonical" href="index.html" />
|
|
||||||
<title>AMP Website</title>
|
|
||||||
<script async src="https://cdn.ampproject.org/v0.js"></script>
|
|
||||||
<style amp-custom>
|
|
||||||
body > * {
|
|
||||||
margin: 3rem 1rem;
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
||||||
color: #525252;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
margin-top: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.links {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.links a {
|
|
||||||
margin: 0 10px;
|
|
||||||
font-size: 1rem;
|
|
||||||
color: #005af0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<center>
|
|
||||||
<amp-img width=150 height=150 layout="fixed" class="logo" src="logo.png"></amp-img>
|
|
||||||
<h3>Welcome to your AMP page</h3>
|
|
||||||
<p>AMP is a web component framework to <br> easily create user-first websites, stories, ads and emails.</p>
|
|
||||||
|
|
||||||
<h4>Links</h4>
|
|
||||||
<div class="links">
|
|
||||||
<a href="https://amp.dev/">Homepage</a>
|
|
||||||
<a href="https://amp.dev/documentation/guides-and-tutorials/?format=websites">Tutorials</a>
|
|
||||||
<a href="https://amp.dev/documentation/examples/">Examples</a>
|
|
||||||
<a href="https://blog.amp.dev">Blog</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4>Ready to get started?</h4>
|
|
||||||
<div class="links">
|
|
||||||
<a href="https://amp.dev/documentation/guides-and-tutorials/start/create/?format=websites">Create your first AMP page</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4>Get involved</h4>
|
|
||||||
<div class="links">
|
|
||||||
<a href="https://twitter.com/amphtml">Twitter</a>
|
|
||||||
<a href="https://amphtml.slack.com">Slack</a>
|
|
||||||
<a href="https://amp.dev/events/amp-conf-2019">AMP Conf</a>
|
|
||||||
<a href="https://amp.dev/events/amp-roadshow">AMP Roadshow</a>
|
|
||||||
</div>
|
|
||||||
</center>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
1
examples/angular/.gitignore
vendored
1
examples/angular/.gitignore
vendored
@@ -41,4 +41,3 @@ testem.log
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
.vercel
|
.vercel
|
||||||
.output
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Deploy your own Angular project with Vercel.
|
|||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/angular&template=angular)
|
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/angular&template=angular)
|
||||||
|
|
||||||
_Live Example: https://angular-now-examples.vercel.app_
|
_Live Example: https://angular-template.vercel.app_
|
||||||
|
|
||||||
## Development server
|
## Development server
|
||||||
|
|
||||||
|
|||||||
20
examples/astro/.gitignore
vendored
Normal file
20
examples/astro/.gitignore
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# build output
|
||||||
|
dist/
|
||||||
|
.output/
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# logs
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
|
||||||
|
# environment variables
|
||||||
|
.env
|
||||||
|
.env.production
|
||||||
|
|
||||||
|
# macOS-specific files
|
||||||
|
.DS_Store
|
||||||
2
examples/astro/.npmrc
Normal file
2
examples/astro/.npmrc
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Expose Astro dependencies for `pnpm` users
|
||||||
|
shamefully-hoist=true
|
||||||
1
examples/astro/.vercelignore
Normal file
1
examples/astro/.vercelignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
README.md
|
||||||
42
examples/astro/README.md
Normal file
42
examples/astro/README.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Welcome to [Astro](https://astro.build)
|
||||||
|
|
||||||
|
[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/starter)
|
||||||
|
|
||||||
|
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
||||||
|
|
||||||
|
## 🚀 Project Structure
|
||||||
|
|
||||||
|
Inside of your Astro project, you'll see the following folders and files:
|
||||||
|
|
||||||
|
```
|
||||||
|
/
|
||||||
|
├── public/
|
||||||
|
│ └── favicon.ico
|
||||||
|
├── src/
|
||||||
|
│ ├── components/
|
||||||
|
│ │ └── Layout.astro
|
||||||
|
│ └── pages/
|
||||||
|
│ └── index.astro
|
||||||
|
└── package.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
||||||
|
|
||||||
|
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components or layouts.
|
||||||
|
|
||||||
|
Any static assets, like images, can be placed in the `public/` directory.
|
||||||
|
|
||||||
|
## 🧞 Commands
|
||||||
|
|
||||||
|
All commands are run from the root of the project, from a terminal:
|
||||||
|
|
||||||
|
| Command | Action |
|
||||||
|
| :---------------- | :------------------------------------------- |
|
||||||
|
| `npm install` | Installs dependencies |
|
||||||
|
| `npm run dev` | Starts local dev server at `localhost:3000` |
|
||||||
|
| `npm run build` | Build your production site to `./dist/` |
|
||||||
|
| `npm run preview` | Preview your build locally, before deploying |
|
||||||
|
|
||||||
|
## 👀 Want to learn more?
|
||||||
|
|
||||||
|
Feel free to check [our documentation](https://github.com/withastro/astro) or jump into our [Discord server](https://astro.build/chat).
|
||||||
4
examples/astro/astro.config.mjs
Normal file
4
examples/astro/astro.config.mjs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
|
// https://astro.build/config
|
||||||
|
export default defineConfig({});
|
||||||
14
examples/astro/package.json
Normal file
14
examples/astro/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "@example/basics",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "astro dev",
|
||||||
|
"start": "astro dev",
|
||||||
|
"build": "astro build",
|
||||||
|
"preview": "astro preview"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"astro": "^1.0.0-beta.20"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
examples/astro/public/favicon.ico
Normal file
BIN
examples/astro/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
55
examples/astro/src/components/Layout.astro
Normal file
55
examples/astro/src/components/Layout.astro
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
export interface Props {
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { title } = Astro.props as Props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||||
|
<title>{title}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<slot />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--font-size-base: clamp(1rem, 0.34vw + 0.91rem, 1.19rem);
|
||||||
|
--font-size-lg: clamp(1.2rem, 0.7vw + 1.2rem, 1.5rem);
|
||||||
|
--font-size-xl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
|
||||||
|
|
||||||
|
--color-text: hsl(12, 5%, 4%);
|
||||||
|
--color-bg: hsl(10, 21%, 95%);
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: system-ui, sans-serif;
|
||||||
|
font-size: var(--font-size-base);
|
||||||
|
color: var(--color-text);
|
||||||
|
background-color: var(--color-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(h1) {
|
||||||
|
font-size: var(--font-size-xl);
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(h2) {
|
||||||
|
font-size: var(--font-size-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(code) {
|
||||||
|
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||||
|
Bitstream Vera Sans Mono, Courier New, monospace;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
174
examples/astro/src/pages/index.astro
Normal file
174
examples/astro/src/pages/index.astro
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
---
|
||||||
|
import Layout from '../components/Layout.astro';
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout title="Welcome to Astro.">
|
||||||
|
<main>
|
||||||
|
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
|
||||||
|
<p class="instructions"><strong>Your first mission:</strong> tweak this message to try our hot module reloading. Check the <code>src/pages</code> directory!</p>
|
||||||
|
<ul role="list" class="link-card-grid">
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://astro.build/integrations/">
|
||||||
|
<h2>Integrations <span>→</span></h2>
|
||||||
|
<p>Add component frameworks, Tailwind, Partytown, and more!</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://astro.build/themes/">
|
||||||
|
<h2>Themes <span>→</span></h2>
|
||||||
|
<p>Explore a galaxy of community-built starters.</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://docs.astro.build/">
|
||||||
|
<h2>Docs <span>→</span></h2>
|
||||||
|
<p>Learn our complete feature set and explore the API.</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="link-card">
|
||||||
|
<a href="https://astro.build/chat/">
|
||||||
|
<h2>Chat <span>→</span></h2>
|
||||||
|
<p>
|
||||||
|
Ask, contribute, and have fun on our community Discord
|
||||||
|
<svg
|
||||||
|
class="heart"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 512 512"
|
||||||
|
width="16"
|
||||||
|
height="16"
|
||||||
|
fill="currentColor"
|
||||||
|
>
|
||||||
|
<title>heart</title>
|
||||||
|
<path d="M256 448l-30.164-27.211C118.718 322.442 48 258.61 48 179.095 48 114.221 97.918 64 162.4 64c36.399 0 70.717 16.742 93.6 43.947C278.882 80.742 313.199 64 349.6 64 414.082 64 464 114.221 464 179.095c0 79.516-70.719 143.348-177.836 241.694L256 448z" />
|
||||||
|
</svg>
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</main>
|
||||||
|
</Layout>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--color-border: hsl(17, 24%, 90%);
|
||||||
|
--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4);
|
||||||
|
--link-gradient: linear-gradient(45deg, #4F39FA, #DA62C4 30%, var(--color-border) 60%);
|
||||||
|
--night-sky-gradient: linear-gradient(0deg, #392362 -33%, #431f69 10%, #30216b 50%, #1f1638 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin: 0;
|
||||||
|
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 span {
|
||||||
|
display: inline-block;
|
||||||
|
transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-size: 0.875em;
|
||||||
|
border: 0.1em solid var(--color-border);
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 0.15em 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
margin: auto;
|
||||||
|
padding: 1em;
|
||||||
|
max-width: 60ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-gradient {
|
||||||
|
font-weight: 900;
|
||||||
|
background-image: var(--astro-gradient);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-size: 100% 200%;
|
||||||
|
background-position-y: 100%;
|
||||||
|
border-radius: 0.4rem;
|
||||||
|
animation: pulse 4s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes pulse {
|
||||||
|
0%, 100% {
|
||||||
|
background-position-y: 0%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position-y: 80%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.instructions {
|
||||||
|
line-height: 1.8;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
background-image: var(--night-sky-gradient);
|
||||||
|
padding: 1.5rem;
|
||||||
|
border-radius: 0.4rem;
|
||||||
|
color: var(--color-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card {
|
||||||
|
list-style: none;
|
||||||
|
display: flex;
|
||||||
|
padding: 0.15rem;
|
||||||
|
background-image: var(--link-gradient);
|
||||||
|
background-size: 400%;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
background-position: 100%;
|
||||||
|
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card > a {
|
||||||
|
width: 100%;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 1.4;
|
||||||
|
padding: 1em 1.3em;
|
||||||
|
border-radius: 0.35rem;
|
||||||
|
color: var(--text-color);
|
||||||
|
background-color: white;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card:is(:hover, :focus-within) {
|
||||||
|
background-position: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card:is(:hover, :focus-within) h2 {
|
||||||
|
color: #4F39FA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-card:is(:hover, :focus-within) h2 span {
|
||||||
|
transform: translateX(2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.heart {
|
||||||
|
display: inline-block;
|
||||||
|
color: #DA62C4;
|
||||||
|
animation: heartbeat 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes heartbeat {
|
||||||
|
0%,
|
||||||
|
50%,
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
5% {
|
||||||
|
transform: scale(1.125);
|
||||||
|
}
|
||||||
|
10% {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
15% {
|
||||||
|
transform: scale(1.25);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
15
examples/astro/tsconfig.json
Normal file
15
examples/astro/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
// Enable top-level await, and other modern ESM features.
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "ESNext",
|
||||||
|
// Enable node-style module resolution, for things like npm package imports.
|
||||||
|
"moduleResolution": "node",
|
||||||
|
// Enable JSON imports.
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
// Enable stricter transpilation for better output.
|
||||||
|
"isolatedModules": true,
|
||||||
|
// Add type definitions for our Vite runtime.
|
||||||
|
"types": ["vite/client"]
|
||||||
|
}
|
||||||
|
}
|
||||||
3457
examples/astro/yarn.lock
Normal file
3457
examples/astro/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ This directory is a brief example of a [Dojo](https://dojo.io) site that can be
|
|||||||
|
|
||||||
Deploy your own Dojo project with Vercel.
|
Deploy your own Dojo project with Vercel.
|
||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/dojo&template=dojo)
|
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/dojo&template=dojo)
|
||||||
|
|
||||||
### How We Created This Example
|
### How We Created This Example
|
||||||
|
|
||||||
|
|||||||
20
examples/eleventy/LICENSE.md
Normal file
20
examples/eleventy/LICENSE.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
MIT License
|
||||||
|
Copyright (c) 2022 Zach Leatherman @zachleat
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1,5 +1,19 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/11ty/eleventy-base-blog.git"
|
||||||
|
},
|
||||||
|
"author": {
|
||||||
|
"name": "Zach Leatherman",
|
||||||
|
"email": "zachleatherman@gmail.com",
|
||||||
|
"url": "https://zachleat.com/"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/11ty/eleventy-base-blog/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/11ty/eleventy-base-blog#readme",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "eleventy",
|
"build": "eleventy",
|
||||||
"watch": "eleventy --watch",
|
"watch": "eleventy --watch",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ cache:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# See https://git.io/vdao3 for details.
|
# See https://github.com/ember-cli/ember-cli/blob/master/docs/build-concurrency.md
|
||||||
- JOBS=1
|
- JOBS=1
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|||||||
@@ -48,6 +48,6 @@
|
|||||||
"qunit-dom": "^0.8.4"
|
"qunit-dom": "^0.8.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "8.* || >= 10.*"
|
"node": "14.x"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ async function main() {
|
|||||||
// if it's an empty string, just ignore it
|
// if it's an empty string, just ignore it
|
||||||
if (!formatted) return false;
|
if (!formatted) return false;
|
||||||
|
|
||||||
let type = url.substr(-3) == 'css' ? 'style' : 'script';
|
let type = url.slice(-3) == 'css' ? 'style' : 'script';
|
||||||
results += `</${formatted}>;rel=preload;as=${type},`;
|
results += `</${formatted}>;rel=preload;as=${type},`;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
1
examples/nextjs/.gitignore
vendored
1
examples/nextjs/.gitignore
vendored
@@ -23,6 +23,7 @@
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env.local
|
.env.local
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
module.exports = {
|
/** @type {import('next').NextConfig} */
|
||||||
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = nextConfig
|
||||||
|
|||||||
3145
examples/nextjs/package-lock.json
generated
3145
examples/nextjs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -7,12 +7,12 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "^12.0.8",
|
"next": "12.1.4",
|
||||||
"react": "17.0.2",
|
"react": "18.0.0",
|
||||||
"react-dom": "17.0.2"
|
"react-dom": "18.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "8.7.0",
|
"eslint": "8.12.0",
|
||||||
"eslint-config-next": "^12.0.8"
|
"eslint-config-next": "12.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default function Home() {
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
href="https://github.com/vercel/next.js/tree/master/examples"
|
href="https://github.com/vercel/next.js/tree/canary/examples"
|
||||||
className={styles.card}
|
className={styles.card}
|
||||||
>
|
>
|
||||||
<h2>Examples →</h2>
|
<h2>Examples →</h2>
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
.container {
|
.container {
|
||||||
min-height: 100vh;
|
padding: 0 2rem;
|
||||||
padding: 0 0.5rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
padding: 5rem 0;
|
min-height: 100vh;
|
||||||
|
padding: 4rem 0;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -18,10 +13,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
border-top: 1px solid #eaeaea;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
padding: 2rem 0;
|
||||||
|
border-top: 1px solid #eaeaea;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
@@ -56,6 +51,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
|
margin: 4rem 0;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
@@ -75,7 +71,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
margin-top: 3rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
@@ -87,7 +82,7 @@
|
|||||||
border: 1px solid #eaeaea;
|
border: 1px solid #eaeaea;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
transition: color 0.15s ease, border-color 0.15s ease;
|
transition: color 0.15s ease, border-color 0.15s ease;
|
||||||
width: 45%;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card:hover,
|
.card:hover,
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ README.md
|
|||||||
.nuxt
|
.nuxt
|
||||||
node_modules
|
node_modules
|
||||||
*.log
|
*.log
|
||||||
|
.output
|
||||||
|
|||||||
1
examples/remix/.gitignore
vendored
1
examples/remix/.gitignore
vendored
@@ -2,7 +2,6 @@ node_modules
|
|||||||
|
|
||||||
.cache
|
.cache
|
||||||
.vercel
|
.vercel
|
||||||
.output
|
|
||||||
|
|
||||||
public/build
|
public/build
|
||||||
api/_build
|
api/_build
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default function Index() {
|
|||||||
<p>
|
<p>
|
||||||
Wait a sec...<em>its children</em>? To understand what we mean by
|
Wait a sec...<em>its children</em>? To understand what we mean by
|
||||||
this,{" "}
|
this,{" "}
|
||||||
<a href="https://remix.run/tutorial/4-nested-routes-params">
|
<a href="https://remix.run/docs/en/v1/guides/routing">
|
||||||
read all about nested routes in the docs
|
read all about nested routes in the docs
|
||||||
</a>
|
</a>
|
||||||
.
|
.
|
||||||
|
|||||||
2
examples/remix/package-lock.json
generated
2
examples/remix/package-lock.json
generated
@@ -21,7 +21,7 @@
|
|||||||
"typescript": "^4.1.2"
|
"typescript": "^4.1.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": "14.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/code-frame": {
|
"node_modules/@babel/code-frame": {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"typescript": "^4.1.2"
|
"typescript": "^4.1.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": "14.x"
|
||||||
},
|
},
|
||||||
"sideEffects": false
|
"sideEffects": false
|
||||||
}
|
}
|
||||||
3
examples/sanity/.env.template
Normal file
3
examples/sanity/.env.template
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Run `vercel env pull` to generate a .env file from your Vercel project
|
||||||
|
SANITY_STUDIO_API_PROJECT_ID=
|
||||||
|
SANITY_STUDIO_API_DATASET=
|
||||||
12
examples/sanity/.npmignore
Normal file
12
examples/sanity/.npmignore
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Logs
|
||||||
|
/logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Compiled sanity studio
|
||||||
|
/dist
|
||||||
29
examples/sanity/README.md
Normal file
29
examples/sanity/README.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Sanity Blogging Content Studio
|
||||||
|
|
||||||
|
Congratulations, you have now installed Sanity Studio, an open source real-time content editing environment connected to the Sanity backend.
|
||||||
|
|
||||||
|
Now you can do the following things:
|
||||||
|
|
||||||
|
- [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
|
||||||
|
- Check out the example frontend: [React/Next.js](https://github.com/sanity-io/tutorial-sanity-blog-react-next)
|
||||||
|
- [Read the blog post about this template](https://www.sanity.io/blog/build-your-own-blog-with-sanity-and-next-js?utm_source=readme)
|
||||||
|
- [Join the community Slack](https://slack.sanity.io/?utm_source=readme)
|
||||||
|
- [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
|
||||||
|
|
||||||
|
## Develop locally
|
||||||
|
|
||||||
|
Install dependencies:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npx @sanity/cli install
|
||||||
|
```
|
||||||
|
|
||||||
|
Pull down environment variables from your Vercel project (requires the [Vercel CLI](https://vercel.com/cli)):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
vercel env pull
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
You can also run `npx @sanity/init` in this repo and agree to reconfigure it. You'll then be able to select from existing projects. The CLI will update `sanity.json` with the project ID and dataset name.
|
||||||
7
examples/sanity/config/.checksums
Normal file
7
examples/sanity/config/.checksums
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"#": "Used by Sanity to keep track of configuration file checksums, do not delete or modify!",
|
||||||
|
"@sanity/default-layout": "bb034f391ba508a6ca8cd971967cbedeb131c4d19b17b28a0895f32db5d568ea",
|
||||||
|
"@sanity/default-login": "6fb6d3800aa71346e1b84d95bbcaa287879456f2922372bb0294e30b968cd37f",
|
||||||
|
"@sanity/form-builder": "b38478227ba5e22c91981da4b53436df22e48ff25238a55a973ed620be5068aa",
|
||||||
|
"@sanity/data-aspects": "d199e2c199b3e26cd28b68dc84d7fc01c9186bf5089580f2e2446994d36b3cb6"
|
||||||
|
}
|
||||||
3
examples/sanity/config/@sanity/data-aspects.json
Normal file
3
examples/sanity/config/@sanity/data-aspects.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"listOptions": {}
|
||||||
|
}
|
||||||
6
examples/sanity/config/@sanity/default-layout.json
Normal file
6
examples/sanity/config/@sanity/default-layout.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"toolSwitcher": {
|
||||||
|
"order": [],
|
||||||
|
"hidden": []
|
||||||
|
}
|
||||||
|
}
|
||||||
7
examples/sanity/config/@sanity/default-login.json
Normal file
7
examples/sanity/config/@sanity/default-login.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"providers": {
|
||||||
|
"mode": "append",
|
||||||
|
"redirectOnSingle": false,
|
||||||
|
"entries": []
|
||||||
|
}
|
||||||
|
}
|
||||||
5
examples/sanity/config/@sanity/form-builder.json
Normal file
5
examples/sanity/config/@sanity/form-builder.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"images": {
|
||||||
|
"directUploads": true
|
||||||
|
}
|
||||||
|
}
|
||||||
30
examples/sanity/package.json
Normal file
30
examples/sanity/package.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "verceltemplateblogstudio",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "This is the public list of examples for **Vercel**",
|
||||||
|
"main": "package.json",
|
||||||
|
"author": "Knut Melvær <knut@sanity.io>",
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"scripts": {
|
||||||
|
"start": "sanity start",
|
||||||
|
"build": "sanity build"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"sanity"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"@sanity/core": "^2.26",
|
||||||
|
"@sanity/default-layout": "^2.26",
|
||||||
|
"@sanity/default-login": "^2.26",
|
||||||
|
"@sanity/desk-tool": "^2.26",
|
||||||
|
"@sanity/vision": "^2.26",
|
||||||
|
"prop-types": "^15.7",
|
||||||
|
"react": "^17.0",
|
||||||
|
"react-dom": "^17.0",
|
||||||
|
"styled-components": "^5.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@sanity/cli": "^2.26"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
examples/sanity/plugins/.gitkeep
Normal file
1
examples/sanity/plugins/.gitkeep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
User-specific packages can be placed here
|
||||||
29
examples/sanity/sanity.json
Normal file
29
examples/sanity/sanity.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"project": {
|
||||||
|
"name": "vercel-template-blog-studio"
|
||||||
|
},
|
||||||
|
"api": {
|
||||||
|
"projectId": "YOUR_PROJECT_ID",
|
||||||
|
"dataset": "YOUR_DATASET_NAME"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"@sanity/base",
|
||||||
|
"@sanity/default-layout",
|
||||||
|
"@sanity/default-login",
|
||||||
|
"@sanity/desk-tool"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"development": {
|
||||||
|
"plugins": [
|
||||||
|
"@sanity/vision"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parts": [
|
||||||
|
{
|
||||||
|
"name": "part:@sanity/base/schema",
|
||||||
|
"path": "./schemas/schema"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
48
examples/sanity/schemas/author.js
Normal file
48
examples/sanity/schemas/author.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
export default {
|
||||||
|
name: 'author',
|
||||||
|
title: 'Author',
|
||||||
|
type: 'document',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'name',
|
||||||
|
title: 'Name',
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'slug',
|
||||||
|
title: 'Slug',
|
||||||
|
type: 'slug',
|
||||||
|
options: {
|
||||||
|
source: 'name',
|
||||||
|
maxLength: 96,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'image',
|
||||||
|
title: 'Image',
|
||||||
|
type: 'image',
|
||||||
|
options: {
|
||||||
|
hotspot: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'bio',
|
||||||
|
title: 'Bio',
|
||||||
|
type: 'array',
|
||||||
|
of: [
|
||||||
|
{
|
||||||
|
title: 'Block',
|
||||||
|
type: 'block',
|
||||||
|
styles: [{title: 'Normal', value: 'normal'}],
|
||||||
|
lists: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
preview: {
|
||||||
|
select: {
|
||||||
|
title: 'name',
|
||||||
|
media: 'image',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
65
examples/sanity/schemas/blockContent.js
Normal file
65
examples/sanity/schemas/blockContent.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**
|
||||||
|
* This is the schema definition for the rich text fields used for
|
||||||
|
* for this blog studio. When you import it in schemas.js it can be
|
||||||
|
* reused in other parts of the studio with:
|
||||||
|
* {
|
||||||
|
* name: 'someName',
|
||||||
|
* title: 'Some title',
|
||||||
|
* type: 'blockContent'
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
title: 'Block Content',
|
||||||
|
name: 'blockContent',
|
||||||
|
type: 'array',
|
||||||
|
of: [
|
||||||
|
{
|
||||||
|
title: 'Block',
|
||||||
|
type: 'block',
|
||||||
|
// Styles let you set what your user can mark up blocks with. These
|
||||||
|
// correspond with HTML tags, but you can set any title or value
|
||||||
|
// you want and decide how you want to deal with it where you want to
|
||||||
|
// use your content.
|
||||||
|
styles: [
|
||||||
|
{title: 'Normal', value: 'normal'},
|
||||||
|
{title: 'H1', value: 'h1'},
|
||||||
|
{title: 'H2', value: 'h2'},
|
||||||
|
{title: 'H3', value: 'h3'},
|
||||||
|
{title: 'H4', value: 'h4'},
|
||||||
|
{title: 'Quote', value: 'blockquote'},
|
||||||
|
],
|
||||||
|
lists: [{title: 'Bullet', value: 'bullet'}],
|
||||||
|
// Marks let you mark up inline text in the block editor.
|
||||||
|
marks: {
|
||||||
|
// Decorators usually describe a single property – e.g. a typographic
|
||||||
|
// preference or highlighting by editors.
|
||||||
|
decorators: [
|
||||||
|
{title: 'Strong', value: 'strong'},
|
||||||
|
{title: 'Emphasis', value: 'em'},
|
||||||
|
],
|
||||||
|
// Annotations can be any object structure – e.g. a link or a footnote.
|
||||||
|
annotations: [
|
||||||
|
{
|
||||||
|
title: 'URL',
|
||||||
|
name: 'link',
|
||||||
|
type: 'object',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
title: 'URL',
|
||||||
|
name: 'href',
|
||||||
|
type: 'url',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// You can add additional types here. Note that you can't use
|
||||||
|
// primitive types such as 'string' and 'number' in the same array
|
||||||
|
// as a block type.
|
||||||
|
{
|
||||||
|
type: 'image',
|
||||||
|
options: {hotspot: true},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
17
examples/sanity/schemas/category.js
Normal file
17
examples/sanity/schemas/category.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
export default {
|
||||||
|
name: 'category',
|
||||||
|
title: 'Category',
|
||||||
|
type: 'document',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'title',
|
||||||
|
title: 'Title',
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
title: 'Description',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
65
examples/sanity/schemas/post.js
Normal file
65
examples/sanity/schemas/post.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
export default {
|
||||||
|
name: 'post',
|
||||||
|
title: 'Post',
|
||||||
|
type: 'document',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'title',
|
||||||
|
title: 'Title',
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'slug',
|
||||||
|
title: 'Slug',
|
||||||
|
type: 'slug',
|
||||||
|
options: {
|
||||||
|
source: 'title',
|
||||||
|
maxLength: 96,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'author',
|
||||||
|
title: 'Author',
|
||||||
|
type: 'reference',
|
||||||
|
to: {type: 'author'},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'mainImage',
|
||||||
|
title: 'Main image',
|
||||||
|
type: 'image',
|
||||||
|
options: {
|
||||||
|
hotspot: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'categories',
|
||||||
|
title: 'Categories',
|
||||||
|
type: 'array',
|
||||||
|
of: [{type: 'reference', to: {type: 'category'}}],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'publishedAt',
|
||||||
|
title: 'Published at',
|
||||||
|
type: 'datetime',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'body',
|
||||||
|
title: 'Body',
|
||||||
|
type: 'blockContent',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
preview: {
|
||||||
|
select: {
|
||||||
|
title: 'title',
|
||||||
|
author: 'author.name',
|
||||||
|
media: 'mainImage',
|
||||||
|
},
|
||||||
|
prepare(selection) {
|
||||||
|
const {author} = selection
|
||||||
|
return Object.assign({}, selection, {
|
||||||
|
subtitle: author && `by ${author}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
29
examples/sanity/schemas/schema.js
Normal file
29
examples/sanity/schemas/schema.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// First, we must import the schema creator
|
||||||
|
import createSchema from 'part:@sanity/base/schema-creator'
|
||||||
|
|
||||||
|
// Then import schema types from any plugins that might expose them
|
||||||
|
import schemaTypes from 'all:part:@sanity/base/schema-type'
|
||||||
|
|
||||||
|
// We import object and document schemas
|
||||||
|
import blockContent from './blockContent'
|
||||||
|
import category from './category'
|
||||||
|
import post from './post'
|
||||||
|
import author from './author'
|
||||||
|
|
||||||
|
// Then we give our schema to the builder and provide the result to Sanity
|
||||||
|
export default createSchema({
|
||||||
|
// We name our schema
|
||||||
|
name: 'default',
|
||||||
|
// Then proceed to concatenate our document type
|
||||||
|
// to the ones provided by any plugins that are installed
|
||||||
|
types: schemaTypes.concat([
|
||||||
|
// The following are document types which will appear
|
||||||
|
// in the studio.
|
||||||
|
post,
|
||||||
|
author,
|
||||||
|
category,
|
||||||
|
// When added to this list, object types can be used as
|
||||||
|
// { type: 'typename' } in other document schemas
|
||||||
|
blockContent,
|
||||||
|
]),
|
||||||
|
})
|
||||||
1
examples/sanity/static/.gitkeep
Normal file
1
examples/sanity/static/.gitkeep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Files placed here will be served by the Sanity server under the `/static`-prefix
|
||||||
BIN
examples/sanity/static/favicon.ico
Normal file
BIN
examples/sanity/static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
6
examples/sanity/tsconfig.json
Normal file
6
examples/sanity/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
// Note: This config is only used to help editors like VS Code understand/resolve
|
||||||
|
// parts, the actual transpilation is done by babel. Any compiler configuration in
|
||||||
|
// here will be ignored.
|
||||||
|
"include": ["./node_modules/@sanity/base/types/**/*.ts", "./**/*.ts", "./**/*.tsx"]
|
||||||
|
}
|
||||||
9911
examples/sanity/yarn.lock
Normal file
9911
examples/sanity/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
1
examples/solidstart/.gitignore
vendored
1
examples/solidstart/.gitignore
vendored
@@ -2,7 +2,6 @@ dist
|
|||||||
worker
|
worker
|
||||||
.solid
|
.solid
|
||||||
.vercel
|
.vercel
|
||||||
.output
|
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
/node_modules
|
/node_modules
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# SolidStart
|
# SolidStart
|
||||||
|
|
||||||
This directory is a brief example of a [SolidStart](https://github.com/ryansolid/solid-startp) site that can be deployed to Vercel with zero configuration.
|
This directory is a brief example of a [SolidStart](https://github.com/ryansolid/solid-start) site that can be deployed to Vercel with zero configuration.
|
||||||
|
|
||||||
## Deploy Your Own
|
## Deploy Your Own
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"jsx": "preserve",
|
|
||||||
"jsxImportSource": "solid-js",
|
|
||||||
"paths": {
|
|
||||||
"~/*": ["./src/*"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,14 +7,14 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"solid-app-router": "^0.1.14",
|
"solid-app-router": "^0.3.2",
|
||||||
"solid-js": "^1.2.6",
|
"solid-js": "^1.3.15",
|
||||||
"solid-meta": "^0.27.2",
|
"solid-meta": "^0.27.3",
|
||||||
"solid-start": "next",
|
"solid-start": "next",
|
||||||
"solid-start-vercel": "next",
|
"solid-start-vercel": "next",
|
||||||
"vite": "^2.7.1"
|
"vite": "^2.9.9"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": "16.x"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
examples/solidstart/src/entry-client.tsx
Normal file
4
examples/solidstart/src/entry-client.tsx
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { hydrate } from "solid-js/web";
|
||||||
|
import { StartClient } from "solid-start/entry-client";
|
||||||
|
|
||||||
|
hydrate(() => <StartClient />, document);
|
||||||
7
examples/solidstart/src/entry-server.tsx
Normal file
7
examples/solidstart/src/entry-server.tsx
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { StartServer, createHandler, renderAsync } from "solid-start/entry-server";
|
||||||
|
import { inlineServerModules } from "solid-start/server";
|
||||||
|
|
||||||
|
export default createHandler(
|
||||||
|
inlineServerModules,
|
||||||
|
renderAsync((context) => <StartServer context={context} />)
|
||||||
|
);
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
// @refresh reload
|
|
||||||
import { Links, Meta, Outlet, Scripts } from "solid-start/components";
|
|
||||||
|
|
||||||
export default function Root({ Start }) {
|
|
||||||
return (
|
|
||||||
<Start>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<Meta />
|
|
||||||
<Links />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<Outlet />
|
|
||||||
<Scripts />
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</Start>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
25
examples/solidstart/src/root.tsx
Normal file
25
examples/solidstart/src/root.tsx
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
// @refresh reload
|
||||||
|
import { Links, Meta, Routes, Scripts } from "solid-start/root";
|
||||||
|
import { ErrorBoundary } from "solid-start/error-boundary";
|
||||||
|
import { Suspense } from "solid-js";
|
||||||
|
|
||||||
|
export default function Root() {
|
||||||
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<Meta />
|
||||||
|
<Links />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ErrorBoundary>
|
||||||
|
<Suspense>
|
||||||
|
<Routes />
|
||||||
|
</Suspense>
|
||||||
|
</ErrorBoundary>
|
||||||
|
<Scripts />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
16
examples/solidstart/tsconfig.json
Normal file
16
examples/solidstart/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"jsxImportSource": "solid-js",
|
||||||
|
"jsx": "preserve",
|
||||||
|
"types": ["vite/client"],
|
||||||
|
"baseUrl": "./",
|
||||||
|
"paths": {
|
||||||
|
"~/*": ["./src/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
examples/solidstart/vercel.json
Normal file
7
examples/solidstart/vercel.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"env": {
|
||||||
|
"ENABLE_VC_BUILD": "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@ export class AppProfile {
|
|||||||
|
|
||||||
normalize(name: string): string {
|
normalize(name: string): string {
|
||||||
if (name) {
|
if (name) {
|
||||||
return name.substr(0, 1).toUpperCase() + name.substr(1).toLowerCase();
|
return name.slice(0, 1).toUpperCase() + name.slice(1).toLowerCase();
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
1
examples/sveltekit/.gitignore
vendored
1
examples/sveltekit/.gitignore
vendored
@@ -7,4 +7,3 @@ node_modules
|
|||||||
.env.*
|
.env.*
|
||||||
!.env.example
|
!.env.example
|
||||||
.vercel
|
.vercel
|
||||||
.output
|
|
||||||
|
|||||||
670
examples/sveltekit/package-lock.json
generated
670
examples/sveltekit/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"name": "sveltekit",
|
||||||
|
"version": "0.0.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "svelte-kit dev",
|
"dev": "svelte-kit dev",
|
||||||
"build": "svelte-kit build",
|
"build": "svelte-kit build",
|
||||||
@@ -9,7 +11,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-auto": "next",
|
"@sveltejs/adapter-auto": "next",
|
||||||
"@sveltejs/kit": "next",
|
"@sveltejs/kit": "next",
|
||||||
"svelte": "^3.44.0"
|
"svelte": "^3.46.0"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -8,6 +8,6 @@
|
|||||||
%svelte.head%
|
%svelte.head%
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="svelte">%svelte.body%</div>
|
<div>%svelte.body%</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
1
examples/sveltekit/src/global.d.ts
vendored
1
examples/sveltekit/src/global.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
/// <reference types="@sveltejs/kit" />
|
|
||||||
@@ -1,19 +1,22 @@
|
|||||||
import cookie from 'cookie';
|
import cookie from 'cookie';
|
||||||
import { v4 as uuid } from '@lukeed/uuid';
|
import { v4 as uuid } from '@lukeed/uuid';
|
||||||
|
|
||||||
export const handle = async ({ request, resolve }) => {
|
export const handle = async ({ event, resolve }) => {
|
||||||
const cookies = cookie.parse(request.headers.cookie || '');
|
const cookies = cookie.parse(event.request.headers.get('cookie') || '');
|
||||||
request.locals.userid = cookies.userid || uuid();
|
event.locals.userid = cookies.userid || uuid();
|
||||||
|
|
||||||
const response = await resolve(request);
|
const response = await resolve(event);
|
||||||
|
|
||||||
if (!cookies.userid) {
|
if (!cookies.userid) {
|
||||||
// if this is the first time the user has visited this app,
|
// if this is the first time the user has visited this app,
|
||||||
// set a cookie so that we recognise them when they return
|
// set a cookie so that we recognise them when they return
|
||||||
response.headers['set-cookie'] = cookie.serialize('userid', request.locals.userid, {
|
response.headers.set(
|
||||||
|
'set-cookie',
|
||||||
|
cookie.serialize('userid', event.locals.userid, {
|
||||||
path: '/',
|
path: '/',
|
||||||
httpOnly: true
|
httpOnly: true
|
||||||
});
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
<div class="counter-viewport">
|
<div class="counter-viewport">
|
||||||
<div class="counter-digits" style="transform: translate(0, {100 * offset}%)">
|
<div class="counter-digits" style="transform: translate(0, {100 * offset}%)">
|
||||||
<strong style="top: -100%" aria-hidden="true">{Math.floor($displayed_count + 1)}</strong>
|
<strong class="hidden" aria-hidden="true">{Math.floor($displayed_count + 1)}</strong>
|
||||||
<strong>{Math.floor($displayed_count)}</strong>
|
<strong>{Math.floor($displayed_count)}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -94,4 +94,9 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
top: -100%;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
import { invalidate } from '$app/navigation';
|
||||||
|
|
||||||
// this action (https://svelte.dev/tutorial/actions) allows us to
|
// this action (https://svelte.dev/tutorial/actions) allows us to
|
||||||
// progressively enhance a <form> that already works without JS
|
// progressively enhance a <form> that already works without JS
|
||||||
export function enhance(form, { pending, error, result }) {
|
export function enhance(form, { pending, error, result } = {}) {
|
||||||
let current_token;
|
let current_token;
|
||||||
|
|
||||||
async function handle_submit(e) {
|
async function handle_submit(e) {
|
||||||
@@ -8,31 +10,35 @@ export function enhance(form, { pending, error, result }) {
|
|||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const body = new FormData(form);
|
const data = new FormData(form);
|
||||||
|
|
||||||
if (pending) pending(body, form);
|
if (pending) pending({ data, form });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(form.action, {
|
const response = await fetch(form.action, {
|
||||||
method: form.method,
|
method: form.method,
|
||||||
headers: {
|
headers: {
|
||||||
accept: 'application/json'
|
accept: 'application/json'
|
||||||
},
|
},
|
||||||
body
|
body: data
|
||||||
});
|
});
|
||||||
|
|
||||||
if (token !== current_token) return;
|
if (token !== current_token) return;
|
||||||
|
|
||||||
if (res.ok) {
|
if (response.ok) {
|
||||||
result(res, form);
|
if (result) result({ data, form, response });
|
||||||
|
|
||||||
|
const url = new URL(form.action);
|
||||||
|
url.search = url.hash = '';
|
||||||
|
invalidate(url.href);
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
error(res, null, form);
|
error({ data, form, error: null, response });
|
||||||
} else {
|
} else {
|
||||||
console.error(await res.text());
|
console.error(await response.text());
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (error) {
|
if (error) {
|
||||||
error(null, e, form);
|
error({ data, form, error: e, response: null });
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
import { api } from './_api';
|
|
||||||
|
|
||||||
// PATCH /todos/:uid.json
|
|
||||||
export const patch = async (request) => {
|
|
||||||
return api(request, `todos/${request.locals.userid}/${request.params.uid}`, {
|
|
||||||
text: request.body.get('text'),
|
|
||||||
done: request.body.has('done') ? !!request.body.get('done') : undefined
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// DELETE /todos/:uid.json
|
|
||||||
export const del = async (request) => {
|
|
||||||
return api(request, `todos/${request.locals.userid}/${request.params.uid}`);
|
|
||||||
};
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
This module is used by the /todos.json and /todos/[uid].json
|
This module is used by the /todos endpoint to
|
||||||
endpoints to make calls to api.svelte.dev, which stores todos
|
make calls to api.svelte.dev, which stores todos
|
||||||
for each user. The leading underscore indicates that this is
|
for each user. The leading underscore indicates that this is
|
||||||
a private module, _not_ an endpoint — visiting /todos/_api
|
a private module, _not_ an endpoint — visiting /todos/_api
|
||||||
will net you a 404 response.
|
will net you a 404 response.
|
||||||
@@ -11,35 +11,12 @@
|
|||||||
|
|
||||||
const base = 'https://api.svelte.dev';
|
const base = 'https://api.svelte.dev';
|
||||||
|
|
||||||
export async function api(request, resource, data) {
|
export function api(method, resource, data) {
|
||||||
// user must have a cookie set
|
return fetch(`${base}/${resource}`, {
|
||||||
if (!request.locals.userid) {
|
method,
|
||||||
return { status: 401 };
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await fetch(`${base}/${resource}`, {
|
|
||||||
method: request.method,
|
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
},
|
},
|
||||||
body: data && JSON.stringify(data)
|
body: data && JSON.stringify(data)
|
||||||
});
|
});
|
||||||
|
|
||||||
// if the request came from a <form> submission, the browser's default
|
|
||||||
// behaviour is to show the URL corresponding to the form's "action"
|
|
||||||
// attribute. in those cases, we want to redirect them back to the
|
|
||||||
// /todos page, rather than showing the response
|
|
||||||
if (res.ok && request.method !== 'GET' && request.headers.accept !== 'application/json') {
|
|
||||||
return {
|
|
||||||
status: 303,
|
|
||||||
headers: {
|
|
||||||
location: '/todos'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
status: res.status,
|
|
||||||
body: await res.json()
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
66
examples/sveltekit/src/routes/todos/index.js
Normal file
66
examples/sveltekit/src/routes/todos/index.js
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import { api } from './_api';
|
||||||
|
|
||||||
|
export const get = async ({ locals }) => {
|
||||||
|
// locals.userid comes from src/hooks.js
|
||||||
|
const response = await api('get', `todos/${locals.userid}`);
|
||||||
|
|
||||||
|
if (response.status === 404) {
|
||||||
|
// user hasn't created a todo list.
|
||||||
|
// start with an empty array
|
||||||
|
return {
|
||||||
|
body: {
|
||||||
|
todos: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.status === 200) {
|
||||||
|
return {
|
||||||
|
body: {
|
||||||
|
todos: await response.json()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
status: response.status
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const post = async ({ request, locals }) => {
|
||||||
|
const form = await request.formData();
|
||||||
|
|
||||||
|
await api('post', `todos/${locals.userid}`, {
|
||||||
|
text: form.get('text')
|
||||||
|
});
|
||||||
|
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
|
||||||
|
// If the user has JavaScript disabled, the URL will change to
|
||||||
|
// include the method override unless we redirect back to /todos
|
||||||
|
const redirect = {
|
||||||
|
status: 303,
|
||||||
|
headers: {
|
||||||
|
location: '/todos'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const patch = async ({ request, locals }) => {
|
||||||
|
const form = await request.formData();
|
||||||
|
|
||||||
|
await api('patch', `todos/${locals.userid}/${form.get('uid')}`, {
|
||||||
|
text: form.has('text') ? form.get('text') : undefined,
|
||||||
|
done: form.has('done') ? !!form.get('done') : undefined
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const del = async ({ request, locals }) => {
|
||||||
|
const form = await request.formData();
|
||||||
|
|
||||||
|
await api('delete', `todos/${locals.userid}/${form.get('uid')}`);
|
||||||
|
|
||||||
|
return redirect;
|
||||||
|
};
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user