edge-functions 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +13 -0
- package/.eslintignore +3 -0
- package/.eslintrc.json +42 -0
- package/.github/workflows/major.yml +28 -0
- package/.github/workflows/minor.yml +31 -0
- package/.vscode/settings.json +20 -0
- package/CODEOWNERS +2 -0
- package/CODE_OF_CONDUCT.md +73 -0
- package/CONTRIBUTING.md +90 -0
- package/LICENSE.md +21 -0
- package/README.md +60 -0
- package/aliases.js +13 -0
- package/docs/overview.md +36 -0
- package/docs/presets.md +115 -0
- package/examples/angular-static/.editorconfig +16 -0
- package/examples/angular-static/README.md +27 -0
- package/examples/angular-static/angular.json +98 -0
- package/examples/angular-static/package.json +39 -0
- package/examples/angular-static/src/app/app-routing.module.ts +10 -0
- package/examples/angular-static/src/app/app.component.css +0 -0
- package/examples/angular-static/src/app/app.component.html +484 -0
- package/examples/angular-static/src/app/app.component.spec.ts +29 -0
- package/examples/angular-static/src/app/app.component.ts +10 -0
- package/examples/angular-static/src/app/app.module.ts +18 -0
- package/examples/angular-static/src/assets/.gitkeep +0 -0
- package/examples/angular-static/src/favicon.ico +0 -0
- package/examples/angular-static/src/index.html +13 -0
- package/examples/angular-static/src/main.ts +7 -0
- package/examples/angular-static/src/styles.css +1 -0
- package/examples/angular-static/tsconfig.app.json +14 -0
- package/examples/angular-static/tsconfig.json +33 -0
- package/examples/angular-static/tsconfig.spec.json +14 -0
- package/examples/astro-static/README.md +55 -0
- package/examples/astro-static/astro.config.mjs +5 -0
- package/examples/astro-static/package.json +15 -0
- package/examples/astro-static/public/favicon.svg +9 -0
- package/examples/astro-static/src/components/Card.astro +63 -0
- package/examples/astro-static/src/env.d.ts +1 -0
- package/examples/astro-static/src/layouts/Layout.astro +36 -0
- package/examples/astro-static/src/pages/edge/index.astro +55 -0
- package/examples/astro-static/src/pages/index.astro +81 -0
- package/examples/astro-static/tsconfig.json +3 -0
- package/examples/hexo-static/.github/dependabot.yml +7 -0
- package/examples/hexo-static/_config.landscape.yml +0 -0
- package/examples/hexo-static/_config.yml +105 -0
- package/examples/hexo-static/package.json +26 -0
- package/examples/hexo-static/scaffolds/draft.md +4 -0
- package/examples/hexo-static/scaffolds/page.md +4 -0
- package/examples/hexo-static/scaffolds/post.md +5 -0
- package/examples/hexo-static/source/_posts/hello-world.md +38 -0
- package/examples/hexo-static/source/_posts/other-page.md +62 -0
- package/examples/hexo-static/themes/.gitkeep +0 -0
- package/examples/hexo-static/yarn.lock +1625 -0
- package/examples/next-12-static/.babelrc +3 -0
- package/examples/next-12-static/README.md +21 -0
- package/examples/next-12-static/components/post.jsx +27 -0
- package/examples/next-12-static/package-lock.json +6191 -0
- package/examples/next-12-static/package.json +18 -0
- package/examples/next-12-static/pages/index.jsx +34 -0
- package/examples/next-12-static/pages/post/[id].jsx +63 -0
- package/examples/next-static/README.md +34 -0
- package/examples/next-static/jsconfig.json +7 -0
- package/examples/next-static/next.config.js +9 -0
- package/examples/next-static/package.json +16 -0
- package/examples/next-static/public/next.svg +1 -0
- package/examples/next-static/public/vercel.svg +1 -0
- package/examples/next-static/src/app/blog/[slug]/page.js +27 -0
- package/examples/next-static/src/app/favicon.ico +0 -0
- package/examples/next-static/src/app/globals.css +107 -0
- package/examples/next-static/src/app/layout.js +17 -0
- package/examples/next-static/src/app/misty-mountains/moria/page.js +15 -0
- package/examples/next-static/src/app/page.js +96 -0
- package/examples/next-static/src/app/page.module.css +229 -0
- package/examples/next-static/yarn.lock +199 -0
- package/examples/react-static/README.md +70 -0
- package/examples/react-static/package.json +38 -0
- package/examples/react-static/public/favicon.ico +0 -0
- package/examples/react-static/public/index.html +43 -0
- package/examples/react-static/public/logo192.png +0 -0
- package/examples/react-static/public/logo512.png +0 -0
- package/examples/react-static/public/manifest.json +25 -0
- package/examples/react-static/public/robots.txt +3 -0
- package/examples/react-static/src/App.css +38 -0
- package/examples/react-static/src/App.js +25 -0
- package/examples/react-static/src/App.test.js +8 -0
- package/examples/react-static/src/index.css +13 -0
- package/examples/react-static/src/index.js +17 -0
- package/examples/react-static/src/logo.svg +1 -0
- package/examples/react-static/src/reportWebVitals.js +13 -0
- package/examples/react-static/src/setupTests.js +5 -0
- package/examples/simple-js-esm/main.js +14 -0
- package/examples/simple-js-esm/messages.js +7 -0
- package/examples/simple-js-node/main.js +18 -0
- package/examples/vue-static/README.md +24 -0
- package/examples/vue-static/babel.config.js +5 -0
- package/examples/vue-static/jsconfig.json +19 -0
- package/examples/vue-static/package.json +45 -0
- package/examples/vue-static/public/favicon.ico +0 -0
- package/examples/vue-static/public/index.html +17 -0
- package/examples/vue-static/src/App.vue +16 -0
- package/examples/vue-static/src/assets/logo.png +0 -0
- package/examples/vue-static/src/components/HelloWorld.vue +58 -0
- package/examples/vue-static/src/main.js +28 -0
- package/examples/vue-static/src/views/Home.vue +14 -0
- package/examples/vue-static/vue.config.js +4 -0
- package/jest.config.js +6 -0
- package/jsconfig.json +40 -0
- package/jsdoc.json +52 -0
- package/lib/build/bundlers/index.js +4 -0
- package/lib/build/bundlers/webpack/index.js +40 -0
- package/lib/build/bundlers/webpack/webpack.config.js +38 -0
- package/lib/build/dispatcher/dispatcher.js +211 -0
- package/lib/build/dispatcher/dispatcher.test.js +0 -0
- package/lib/build/dispatcher/index.js +3 -0
- package/lib/build/polyfills/index.js +0 -0
- package/lib/constants/azion-edges.constants.js +98 -0
- package/lib/constants/index.js +5 -0
- package/lib/constants/messages/build.messages.js +23 -0
- package/lib/constants/messages/env.messages.js +38 -0
- package/lib/constants/messages/global.messages.js +19 -0
- package/lib/constants/messages/index.js +10 -0
- package/lib/constants/messages/platform.messages.js +84 -0
- package/lib/constants/runtime-apis.constants.js +118 -0
- package/lib/env/index.js +5 -0
- package/lib/env/runtime.env.js +69 -0
- package/lib/env/server.env.js +90 -0
- package/lib/env/vulcan.env.js +93 -0
- package/lib/main.js +260 -0
- package/lib/notations/namespaces.js +30 -0
- package/lib/notations/typedef.js +10 -0
- package/lib/platform/actions/application/createApplication.actions.js +33 -0
- package/lib/platform/actions/application/enableEdgeFunctions.actions.js +34 -0
- package/lib/platform/actions/application/instantiateFunction.actions.js +37 -0
- package/lib/platform/actions/application/setFunctionAsDefaultRule.actions.js +33 -0
- package/lib/platform/actions/core/auth.actions.js +67 -0
- package/lib/platform/actions/core/deploy.actions.js +73 -0
- package/lib/platform/actions/core/propagation.actions.js +75 -0
- package/lib/platform/actions/core/storage.actions.js +84 -0
- package/lib/platform/actions/domain/createDomain.actions.js +42 -0
- package/lib/platform/actions/function/createFunction.actions.js +79 -0
- package/lib/platform/actions/function/showFunctionLogs.actions.js +149 -0
- package/lib/platform/edgehooks/ErrorHTML/ErrorHTML.hooks.js +101 -0
- package/lib/platform/edgehooks/ErrorHTML/index.js +3 -0
- package/lib/platform/edgehooks/index.js +5 -0
- package/lib/platform/edgehooks/mountSPA/index.js +3 -0
- package/lib/platform/edgehooks/mountSPA/mountSPA.hooks.js +55 -0
- package/lib/platform/edgehooks/mountSPA/mountSPA.hooks.test.js +19 -0
- package/lib/platform/edgehooks/mountSSG/index.js +3 -0
- package/lib/platform/edgehooks/mountSSG/mountSSG.hooks.js +61 -0
- package/lib/platform/edgehooks/mountSSG/mountSSG.hooks.test.js +0 -0
- package/lib/platform/index.js +65 -0
- package/lib/platform/services/application.service.js +140 -0
- package/lib/platform/services/base.service.js +200 -0
- package/lib/platform/services/domain.service.js +80 -0
- package/lib/platform/services/events.service.js +65 -0
- package/lib/platform/services/function.service.js +105 -0
- package/lib/platform/services/index.js +8 -0
- package/lib/platform/services/storage.service.js +59 -0
- package/lib/platform/services/tokens.service.js +55 -0
- package/lib/presets/custom/angular/deliver/config.js +12 -0
- package/lib/presets/custom/angular/deliver/handler.js +8 -0
- package/lib/presets/custom/angular/deliver/prebuild.js +20 -0
- package/lib/presets/custom/astro/deliver/config.js +12 -0
- package/lib/presets/custom/astro/deliver/handler.js +8 -0
- package/lib/presets/custom/astro/deliver/prebuild.js +37 -0
- package/lib/presets/custom/hexo/deliver/config.js +12 -0
- package/lib/presets/custom/hexo/deliver/handler.js +8 -0
- package/lib/presets/custom/hexo/deliver/prebuild.js +37 -0
- package/lib/presets/custom/next/deliver/config.js +14 -0
- package/lib/presets/custom/next/deliver/handler.js +9 -0
- package/lib/presets/custom/next/deliver/prebuild.js +193 -0
- package/lib/presets/custom/react/deliver/config.js +12 -0
- package/lib/presets/custom/react/deliver/handler.js +8 -0
- package/lib/presets/custom/react/deliver/prebuild.js +16 -0
- package/lib/presets/custom/vue/deliver/config.js +12 -0
- package/lib/presets/custom/vue/deliver/handler.js +8 -0
- package/lib/presets/custom/vue/deliver/prebuild.js +20 -0
- package/lib/presets/default/html/deliver/config.js +13 -0
- package/lib/presets/default/html/deliver/handler.js +9 -0
- package/lib/presets/default/html/deliver/prebuild.js +15 -0
- package/lib/presets/default/javascript/compute/config.js +13 -0
- package/lib/presets/default/javascript/compute/handler.js +5 -0
- package/lib/presets/default/javascript/compute/prebuild.js +6 -0
- package/lib/presets/default/typescript/compute/config.js +0 -0
- package/lib/presets/default/typescript/compute/handler.js +0 -0
- package/lib/presets/default/typescript/compute/prebuild.js +0 -0
- package/lib/providers/azion/worker.js +12 -0
- package/lib/utils/copyDirectory/copyDirectory.utils.js +54 -0
- package/lib/utils/copyDirectory/copyDirectory.utils.test.js +43 -0
- package/lib/utils/copyDirectory/index.js +3 -0
- package/lib/utils/debug/debug.utils.js +36 -0
- package/lib/utils/debug/debug.utils.test.js +43 -0
- package/lib/utils/debug/index.js +3 -0
- package/lib/utils/exec/exec.utils.js +58 -0
- package/lib/utils/exec/exec.utils.test.js +84 -0
- package/lib/utils/exec/index.js +3 -0
- package/lib/utils/feedback/feedback.utils.js +81 -0
- package/lib/utils/feedback/feedback.utils.test.js +11 -0
- package/lib/utils/feedback/index.js +3 -0
- package/lib/utils/generateTimestamp/generateTimestamp.utils.js +25 -0
- package/lib/utils/generateTimestamp/generateTimestamp.utils.test.js +10 -0
- package/lib/utils/generateTimestamp/index.js +3 -0
- package/lib/utils/getAbsoluteLibDirPath/getAbsoluteLibDirPath.utils.js +21 -0
- package/lib/utils/getAbsoluteLibDirPath/getAbsoluteLibDirPath.utils.test.js +13 -0
- package/lib/utils/getAbsoluteLibDirPath/index.js +3 -0
- package/lib/utils/getPackageManager/getPackageManager.utils.js +118 -0
- package/lib/utils/getPackageManager/getPackageManager.utils.test.js +35 -0
- package/lib/utils/getPackageManager/index.js +3 -0
- package/lib/utils/getPackageVersion/getPackageVersion.utils.js +25 -0
- package/lib/utils/getPackageVersion/getPackageVersion.utils.test.js +48 -0
- package/lib/utils/getPackageVersion/index.js +3 -0
- package/lib/utils/getPresetsList/getPresetsList.utils.js +50 -0
- package/lib/utils/getPresetsList/getPresetsList.utils.test.js +19 -0
- package/lib/utils/getPresetsList/index.js +3 -0
- package/lib/utils/getProjectJsonFile/getProjectJsonFile.utils.js +21 -0
- package/lib/utils/getProjectJsonFile/getProjectJsonFile.utils.test.js +39 -0
- package/lib/utils/getProjectJsonFile/index.js +3 -0
- package/lib/utils/getVulcanBuildId/getVulcanBuildId.utils.js +49 -0
- package/lib/utils/getVulcanBuildId/getVulcanBuildId.utils.test.js +36 -0
- package/lib/utils/getVulcanBuildId/index.js +3 -0
- package/lib/utils/index.js +29 -0
- package/lib/utils/overrideStaticOutputPath/index.js +3 -0
- package/lib/utils/overrideStaticOutputPath/overrideStaticOutputPath.utils.js +47 -0
- package/lib/utils/overrideStaticOutputPath/overrideStaticOutputPath.utils.test.js +35 -0
- package/lib/utils/readWorkerFile/index.js +3 -0
- package/lib/utils/readWorkerFile/readWorkerFile.utils.js +36 -0
- package/lib/utils/readWorkerFile/readWorkerFile.utils.test.js +24 -0
- package/package.json +99 -0
- package/releaserc.json +87 -0
- package/tasks/sync-aliases.js +115 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "next-12-static",
|
|
3
|
+
"private": true,
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"next": "^12.3.4",
|
|
6
|
+
"react": "^17.0.2",
|
|
7
|
+
"react-dom": "^17.0.2",
|
|
8
|
+
"serve": "11.2.0"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "next",
|
|
12
|
+
"build": "next build --no-lint",
|
|
13
|
+
"preexport": "npm run build",
|
|
14
|
+
"export": "next export",
|
|
15
|
+
"prestart": "npm run export",
|
|
16
|
+
"start": "serve out"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Head from 'next/head'
|
|
2
|
+
|
|
3
|
+
import Post from '../components/post'
|
|
4
|
+
|
|
5
|
+
export async function getStaticProps() {
|
|
6
|
+
// fetch list of posts
|
|
7
|
+
const response = await fetch(
|
|
8
|
+
'https://jsonplaceholder.typicode.com/posts?_page=1'
|
|
9
|
+
)
|
|
10
|
+
const postList = await response.json()
|
|
11
|
+
return {
|
|
12
|
+
props: {
|
|
13
|
+
postList,
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function IndexPage({ postList }) {
|
|
19
|
+
return (
|
|
20
|
+
<main>
|
|
21
|
+
<Head>
|
|
22
|
+
<title>Home page</title>
|
|
23
|
+
</Head>
|
|
24
|
+
|
|
25
|
+
<h1>List of posts</h1>
|
|
26
|
+
|
|
27
|
+
<section>
|
|
28
|
+
{postList.map((post) => (
|
|
29
|
+
<Post {...post} key={post.id} />
|
|
30
|
+
))}
|
|
31
|
+
</section>
|
|
32
|
+
</main>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import Head from 'next/head';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
function Example() {
|
|
6
|
+
// Declare a new state variable, which we'll call "count"
|
|
7
|
+
const [count, setCount] = useState(0);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div>
|
|
11
|
+
<p>追加したカウンターコンポーネントだよ</p>
|
|
12
|
+
<p>You clicked {count} times</p>
|
|
13
|
+
<button onClick={() => setCount(count + 1)}>Click me</button>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function getStaticPaths() {
|
|
19
|
+
const response = await fetch(
|
|
20
|
+
'https://jsonplaceholder.typicode.com/posts?_page=1'
|
|
21
|
+
);
|
|
22
|
+
const postList = await response.json();
|
|
23
|
+
return {
|
|
24
|
+
paths: postList.map((post) => {
|
|
25
|
+
return {
|
|
26
|
+
params: {
|
|
27
|
+
id: `${post.id}`,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}),
|
|
31
|
+
fallback: false,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function getStaticProps({ params }) {
|
|
36
|
+
// fetch single post detail
|
|
37
|
+
const response = await fetch(
|
|
38
|
+
`https://jsonplaceholder.typicode.com/posts/${params.id}`
|
|
39
|
+
);
|
|
40
|
+
const post = await response.json();
|
|
41
|
+
return {
|
|
42
|
+
props: post,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default function Post({ title, body }) {
|
|
47
|
+
return (
|
|
48
|
+
<main>
|
|
49
|
+
<Head>
|
|
50
|
+
<title>{title}</title>
|
|
51
|
+
</Head>
|
|
52
|
+
|
|
53
|
+
<h1>{title}</h1>
|
|
54
|
+
|
|
55
|
+
<p>{body}</p>
|
|
56
|
+
|
|
57
|
+
<Link href="/">
|
|
58
|
+
<a>Go back to home</a>
|
|
59
|
+
</Link>
|
|
60
|
+
<Example />
|
|
61
|
+
</main>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run dev
|
|
9
|
+
# or
|
|
10
|
+
yarn dev
|
|
11
|
+
# or
|
|
12
|
+
pnpm dev
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
16
|
+
|
|
17
|
+
You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
|
|
18
|
+
|
|
19
|
+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
|
20
|
+
|
|
21
|
+
## Learn More
|
|
22
|
+
|
|
23
|
+
To learn more about Next.js, take a look at the following resources:
|
|
24
|
+
|
|
25
|
+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
26
|
+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
27
|
+
|
|
28
|
+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
|
29
|
+
|
|
30
|
+
## Deploy on Vercel
|
|
31
|
+
|
|
32
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
33
|
+
|
|
34
|
+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "next",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build --no-lint",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "13.4.5",
|
|
13
|
+
"react": "18.2.0",
|
|
14
|
+
"react-dom": "18.2.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styles from '../../page.module.css';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
|
|
4
|
+
export default function Page({ params }) {
|
|
5
|
+
return (
|
|
6
|
+
<main className={styles.main}>
|
|
7
|
+
<div className={styles.center}>
|
|
8
|
+
<div className={styles.description}>My Post slug: {params.slug}</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div className={styles.card}>
|
|
11
|
+
<Link href="/">go back</Link>
|
|
12
|
+
</div>
|
|
13
|
+
</main>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function generateStaticParams() {
|
|
18
|
+
const posts = [
|
|
19
|
+
{ slug: 'post-1' },
|
|
20
|
+
{ slug: 'post-2' },
|
|
21
|
+
{ slug: 'post-3' },
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
return posts.map((post) => ({
|
|
25
|
+
slug: post.slug,
|
|
26
|
+
}))
|
|
27
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--max-width: 1100px;
|
|
3
|
+
--border-radius: 12px;
|
|
4
|
+
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
|
|
5
|
+
'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
|
|
6
|
+
'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
|
|
7
|
+
|
|
8
|
+
--foreground-rgb: 0, 0, 0;
|
|
9
|
+
--background-start-rgb: 214, 219, 220;
|
|
10
|
+
--background-end-rgb: 255, 255, 255;
|
|
11
|
+
|
|
12
|
+
--primary-glow: conic-gradient(
|
|
13
|
+
from 180deg at 50% 50%,
|
|
14
|
+
#16abff33 0deg,
|
|
15
|
+
#0885ff33 55deg,
|
|
16
|
+
#54d6ff33 120deg,
|
|
17
|
+
#0071ff33 160deg,
|
|
18
|
+
transparent 360deg
|
|
19
|
+
);
|
|
20
|
+
--secondary-glow: radial-gradient(
|
|
21
|
+
rgba(255, 255, 255, 1),
|
|
22
|
+
rgba(255, 255, 255, 0)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
--tile-start-rgb: 239, 245, 249;
|
|
26
|
+
--tile-end-rgb: 228, 232, 233;
|
|
27
|
+
--tile-border: conic-gradient(
|
|
28
|
+
#00000080,
|
|
29
|
+
#00000040,
|
|
30
|
+
#00000030,
|
|
31
|
+
#00000020,
|
|
32
|
+
#00000010,
|
|
33
|
+
#00000010,
|
|
34
|
+
#00000080
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
--callout-rgb: 238, 240, 241;
|
|
38
|
+
--callout-border-rgb: 172, 175, 176;
|
|
39
|
+
--card-rgb: 180, 185, 188;
|
|
40
|
+
--card-border-rgb: 131, 134, 135;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@media (prefers-color-scheme: dark) {
|
|
44
|
+
:root {
|
|
45
|
+
--foreground-rgb: 255, 255, 255;
|
|
46
|
+
--background-start-rgb: 0, 0, 0;
|
|
47
|
+
--background-end-rgb: 0, 0, 0;
|
|
48
|
+
|
|
49
|
+
--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
|
|
50
|
+
--secondary-glow: linear-gradient(
|
|
51
|
+
to bottom right,
|
|
52
|
+
rgba(1, 65, 255, 0),
|
|
53
|
+
rgba(1, 65, 255, 0),
|
|
54
|
+
rgba(1, 65, 255, 0.3)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
--tile-start-rgb: 2, 13, 46;
|
|
58
|
+
--tile-end-rgb: 2, 5, 19;
|
|
59
|
+
--tile-border: conic-gradient(
|
|
60
|
+
#ffffff80,
|
|
61
|
+
#ffffff40,
|
|
62
|
+
#ffffff30,
|
|
63
|
+
#ffffff20,
|
|
64
|
+
#ffffff10,
|
|
65
|
+
#ffffff10,
|
|
66
|
+
#ffffff80
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
--callout-rgb: 20, 20, 20;
|
|
70
|
+
--callout-border-rgb: 108, 108, 108;
|
|
71
|
+
--card-rgb: 100, 100, 100;
|
|
72
|
+
--card-border-rgb: 200, 200, 200;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
* {
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
padding: 0;
|
|
79
|
+
margin: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
html,
|
|
83
|
+
body {
|
|
84
|
+
max-width: 100vw;
|
|
85
|
+
overflow-x: hidden;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
body {
|
|
89
|
+
color: rgb(var(--foreground-rgb));
|
|
90
|
+
background: linear-gradient(
|
|
91
|
+
to bottom,
|
|
92
|
+
transparent,
|
|
93
|
+
rgb(var(--background-end-rgb))
|
|
94
|
+
)
|
|
95
|
+
rgb(var(--background-start-rgb));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
a {
|
|
99
|
+
color: inherit;
|
|
100
|
+
text-decoration: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (prefers-color-scheme: dark) {
|
|
104
|
+
html {
|
|
105
|
+
color-scheme: dark;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './globals.css'
|
|
2
|
+
import { Inter } from 'next/font/google'
|
|
3
|
+
|
|
4
|
+
const inter = Inter({ subsets: ['latin'] })
|
|
5
|
+
|
|
6
|
+
export const metadata = {
|
|
7
|
+
title: 'Create Next App',
|
|
8
|
+
description: 'Generated by create next app',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function RootLayout({ children }) {
|
|
12
|
+
return (
|
|
13
|
+
<html lang="en">
|
|
14
|
+
<body className={inter.className}>{children}</body>
|
|
15
|
+
</html>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styles from "../../page.module.css";
|
|
2
|
+
import Link from 'next/link'
|
|
3
|
+
|
|
4
|
+
export default function Gandalf() {
|
|
5
|
+
return (
|
|
6
|
+
<main className={styles.main}>
|
|
7
|
+
<div className={styles.center}>
|
|
8
|
+
<div className={styles.description}>you shall not pass</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div className={styles.card}>
|
|
11
|
+
<Link href="/">go back</Link>
|
|
12
|
+
</div>
|
|
13
|
+
</main>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import Image from 'next/image'
|
|
2
|
+
import styles from './page.module.css'
|
|
3
|
+
import Link from 'next/link'
|
|
4
|
+
|
|
5
|
+
export default function Home() {
|
|
6
|
+
return (
|
|
7
|
+
<main className={styles.main}>
|
|
8
|
+
<div className={styles.description}>
|
|
9
|
+
<p>
|
|
10
|
+
Get started by editing
|
|
11
|
+
<code className={styles.code}>src/app/page.js</code>
|
|
12
|
+
</p>
|
|
13
|
+
<div>
|
|
14
|
+
<a
|
|
15
|
+
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
|
16
|
+
target="_blank"
|
|
17
|
+
rel="noopener noreferrer"
|
|
18
|
+
>
|
|
19
|
+
By{' '}
|
|
20
|
+
<Image
|
|
21
|
+
src="/vercel.svg"
|
|
22
|
+
alt="Vercel Logo"
|
|
23
|
+
className={styles.vercelLogo}
|
|
24
|
+
width={100}
|
|
25
|
+
height={24}
|
|
26
|
+
priority
|
|
27
|
+
/>
|
|
28
|
+
</a>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div className={styles.center}>
|
|
33
|
+
<Image
|
|
34
|
+
className={styles.logo}
|
|
35
|
+
src="/next.svg"
|
|
36
|
+
alt="Next.js Logo"
|
|
37
|
+
width={180}
|
|
38
|
+
height={37}
|
|
39
|
+
priority
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div className={styles.grid}>
|
|
44
|
+
<a
|
|
45
|
+
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
|
46
|
+
className={styles.card}
|
|
47
|
+
target="_blank"
|
|
48
|
+
rel="noopener noreferrer"
|
|
49
|
+
>
|
|
50
|
+
<h2>
|
|
51
|
+
Docs <span>-></span>
|
|
52
|
+
</h2>
|
|
53
|
+
<p>Find in-depth information about Next.js features and API.</p>
|
|
54
|
+
</a>
|
|
55
|
+
|
|
56
|
+
<a
|
|
57
|
+
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
|
58
|
+
className={styles.card}
|
|
59
|
+
target="_blank"
|
|
60
|
+
rel="noopener noreferrer"
|
|
61
|
+
>
|
|
62
|
+
<h2>
|
|
63
|
+
Learn <span>-></span>
|
|
64
|
+
</h2>
|
|
65
|
+
<p>Learn about Next.js in an interactive course with quizzes!</p>
|
|
66
|
+
</a>
|
|
67
|
+
|
|
68
|
+
<a
|
|
69
|
+
href="/blog/post-2/"
|
|
70
|
+
className={styles.card}
|
|
71
|
+
target="_blank"
|
|
72
|
+
rel="noopener noreferrer"
|
|
73
|
+
>
|
|
74
|
+
<h2>
|
|
75
|
+
Go to blog post 2<span>-></span>
|
|
76
|
+
</h2>
|
|
77
|
+
<p>Dynamic route example</p>
|
|
78
|
+
</a>
|
|
79
|
+
|
|
80
|
+
<a
|
|
81
|
+
href="/misty-mountains/moria"
|
|
82
|
+
className={styles.card}
|
|
83
|
+
target="_blank"
|
|
84
|
+
rel="noopener noreferrer"
|
|
85
|
+
>
|
|
86
|
+
<h2>
|
|
87
|
+
Mines of Moria <span>-></span>
|
|
88
|
+
</h2>
|
|
89
|
+
<p>
|
|
90
|
+
The dark and treacherous labyrinth of the Misty Mountains.
|
|
91
|
+
</p>
|
|
92
|
+
</a>
|
|
93
|
+
</div>
|
|
94
|
+
</main>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
.main {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: 6rem;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.description {
|
|
11
|
+
display: inherit;
|
|
12
|
+
justify-content: inherit;
|
|
13
|
+
align-items: inherit;
|
|
14
|
+
font-size: 0.85rem;
|
|
15
|
+
max-width: var(--max-width);
|
|
16
|
+
width: 100%;
|
|
17
|
+
z-index: 2;
|
|
18
|
+
font-family: var(--font-mono);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.description a {
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.description p {
|
|
29
|
+
position: relative;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 1rem;
|
|
32
|
+
background-color: rgba(var(--callout-rgb), 0.5);
|
|
33
|
+
border: 1px solid rgba(var(--callout-border-rgb), 0.3);
|
|
34
|
+
border-radius: var(--border-radius);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.code {
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
font-family: var(--font-mono);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.grid {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: repeat(4, minmax(25%, auto));
|
|
45
|
+
width: var(--max-width);
|
|
46
|
+
max-width: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.card {
|
|
50
|
+
padding: 1rem 1.2rem;
|
|
51
|
+
border-radius: var(--border-radius);
|
|
52
|
+
background: rgba(var(--card-rgb), 0);
|
|
53
|
+
border: 1px solid rgba(var(--card-border-rgb), 0);
|
|
54
|
+
transition: background 200ms, border 200ms;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.card span {
|
|
58
|
+
display: inline-block;
|
|
59
|
+
transition: transform 200ms;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.card h2 {
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
margin-bottom: 0.7rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.card p {
|
|
68
|
+
margin: 0;
|
|
69
|
+
opacity: 0.6;
|
|
70
|
+
font-size: 0.9rem;
|
|
71
|
+
line-height: 1.5;
|
|
72
|
+
max-width: 30ch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.center {
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
position: relative;
|
|
80
|
+
padding: 4rem 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.center::before {
|
|
84
|
+
background: var(--secondary-glow);
|
|
85
|
+
border-radius: 50%;
|
|
86
|
+
width: 480px;
|
|
87
|
+
height: 360px;
|
|
88
|
+
margin-left: -400px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.center::after {
|
|
92
|
+
background: var(--primary-glow);
|
|
93
|
+
width: 240px;
|
|
94
|
+
height: 180px;
|
|
95
|
+
z-index: -1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.center::before,
|
|
99
|
+
.center::after {
|
|
100
|
+
content: '';
|
|
101
|
+
left: 50%;
|
|
102
|
+
position: absolute;
|
|
103
|
+
filter: blur(45px);
|
|
104
|
+
transform: translateZ(0);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.logo {
|
|
108
|
+
position: relative;
|
|
109
|
+
}
|
|
110
|
+
/* Enable hover only on non-touch devices */
|
|
111
|
+
@media (hover: hover) and (pointer: fine) {
|
|
112
|
+
.card:hover {
|
|
113
|
+
background: rgba(var(--card-rgb), 0.1);
|
|
114
|
+
border: 1px solid rgba(var(--card-border-rgb), 0.15);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.card:hover span {
|
|
118
|
+
transform: translateX(4px);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@media (prefers-reduced-motion) {
|
|
123
|
+
.card:hover span {
|
|
124
|
+
transform: none;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Mobile */
|
|
129
|
+
@media (max-width: 700px) {
|
|
130
|
+
.content {
|
|
131
|
+
padding: 4rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.grid {
|
|
135
|
+
grid-template-columns: 1fr;
|
|
136
|
+
margin-bottom: 120px;
|
|
137
|
+
max-width: 320px;
|
|
138
|
+
text-align: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.card {
|
|
142
|
+
padding: 1rem 2.5rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.card h2 {
|
|
146
|
+
margin-bottom: 0.5rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.center {
|
|
150
|
+
padding: 8rem 0 6rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.center::before {
|
|
154
|
+
transform: none;
|
|
155
|
+
height: 300px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.description {
|
|
159
|
+
font-size: 0.8rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.description a {
|
|
163
|
+
padding: 1rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.description p,
|
|
167
|
+
.description div {
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
position: fixed;
|
|
171
|
+
width: 100%;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.description p {
|
|
175
|
+
align-items: center;
|
|
176
|
+
inset: 0 0 auto;
|
|
177
|
+
padding: 2rem 1rem 1.4rem;
|
|
178
|
+
border-radius: 0;
|
|
179
|
+
border: none;
|
|
180
|
+
border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25);
|
|
181
|
+
background: linear-gradient(
|
|
182
|
+
to bottom,
|
|
183
|
+
rgba(var(--background-start-rgb), 1),
|
|
184
|
+
rgba(var(--callout-rgb), 0.5)
|
|
185
|
+
);
|
|
186
|
+
background-clip: padding-box;
|
|
187
|
+
backdrop-filter: blur(24px);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.description div {
|
|
191
|
+
align-items: flex-end;
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
inset: auto 0 0;
|
|
194
|
+
padding: 2rem;
|
|
195
|
+
height: 200px;
|
|
196
|
+
background: linear-gradient(
|
|
197
|
+
to bottom,
|
|
198
|
+
transparent 0%,
|
|
199
|
+
rgb(var(--background-end-rgb)) 40%
|
|
200
|
+
);
|
|
201
|
+
z-index: 1;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Tablet and Smaller Desktop */
|
|
206
|
+
@media (min-width: 701px) and (max-width: 1120px) {
|
|
207
|
+
.grid {
|
|
208
|
+
grid-template-columns: repeat(2, 50%);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@media (prefers-color-scheme: dark) {
|
|
213
|
+
.vercelLogo {
|
|
214
|
+
filter: invert(1);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.logo {
|
|
218
|
+
filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@keyframes rotate {
|
|
223
|
+
from {
|
|
224
|
+
transform: rotate(360deg);
|
|
225
|
+
}
|
|
226
|
+
to {
|
|
227
|
+
transform: rotate(0deg);
|
|
228
|
+
}
|
|
229
|
+
}
|