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
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
3
|
+
|
|
4
|
+
import { AppRoutingModule } from './app-routing.module';
|
|
5
|
+
import { AppComponent } from './app.component';
|
|
6
|
+
|
|
7
|
+
@NgModule({
|
|
8
|
+
declarations: [
|
|
9
|
+
AppComponent
|
|
10
|
+
],
|
|
11
|
+
imports: [
|
|
12
|
+
BrowserModule,
|
|
13
|
+
AppRoutingModule
|
|
14
|
+
],
|
|
15
|
+
providers: [],
|
|
16
|
+
bootstrap: [AppComponent]
|
|
17
|
+
})
|
|
18
|
+
export class AppModule { }
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>EdgeAngularTest</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<app-root></app-root>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "./tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "./out-tsc/app",
|
|
6
|
+
"types": []
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"src/main.ts"
|
|
10
|
+
],
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"compileOnSave": false,
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"baseUrl": "./",
|
|
6
|
+
"outDir": "./dist/out-tsc",
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noImplicitOverride": true,
|
|
10
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
11
|
+
"noImplicitReturns": true,
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"declaration": false,
|
|
15
|
+
"downlevelIteration": true,
|
|
16
|
+
"experimentalDecorators": true,
|
|
17
|
+
"moduleResolution": "node",
|
|
18
|
+
"importHelpers": true,
|
|
19
|
+
"target": "ES2022",
|
|
20
|
+
"module": "ES2022",
|
|
21
|
+
"useDefineForClassFields": false,
|
|
22
|
+
"lib": [
|
|
23
|
+
"ES2022",
|
|
24
|
+
"dom"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"angularCompilerOptions": {
|
|
28
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
29
|
+
"strictInjectionParameters": true,
|
|
30
|
+
"strictInputAccessModifiers": true,
|
|
31
|
+
"strictTemplates": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "./tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "./out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"src/**/*.spec.ts",
|
|
12
|
+
"src/**/*.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Astro Starter Kit: Basics
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
npm create astro@latest -- --template basics
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
|
|
8
|
+
[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
|
|
9
|
+
[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
|
|
10
|
+
|
|
11
|
+
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 🚀 Project Structure
|
|
17
|
+
|
|
18
|
+
Inside of your Astro project, you'll see the following folders and files:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
/
|
|
22
|
+
├── public/
|
|
23
|
+
│ └── favicon.svg
|
|
24
|
+
├── src/
|
|
25
|
+
│ ├── components/
|
|
26
|
+
│ │ └── Card.astro
|
|
27
|
+
│ ├── layouts/
|
|
28
|
+
│ │ └── Layout.astro
|
|
29
|
+
│ └── pages/
|
|
30
|
+
│ └── index.astro
|
|
31
|
+
└── package.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
|
35
|
+
|
|
36
|
+
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
|
37
|
+
|
|
38
|
+
Any static assets, like images, can be placed in the `public/` directory.
|
|
39
|
+
|
|
40
|
+
## 🧞 Commands
|
|
41
|
+
|
|
42
|
+
All commands are run from the root of the project, from a terminal:
|
|
43
|
+
|
|
44
|
+
| Command | Action |
|
|
45
|
+
| :------------------------ | :----------------------------------------------- |
|
|
46
|
+
| `npm install` | Installs dependencies |
|
|
47
|
+
| `npm run dev` | Starts local dev server at `localhost:3000` |
|
|
48
|
+
| `npm run build` | Build your production site to `./dist/` |
|
|
49
|
+
| `npm run preview` | Preview your build locally, before deploying |
|
|
50
|
+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
51
|
+
| `npm run astro -- --help` | Get help using the Astro CLI |
|
|
52
|
+
|
|
53
|
+
## 👀 Want to learn more?
|
|
54
|
+
|
|
55
|
+
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opposite-osiris",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "astro dev",
|
|
7
|
+
"start": "astro dev",
|
|
8
|
+
"build": "astro build",
|
|
9
|
+
"preview": "astro preview",
|
|
10
|
+
"astro": "astro"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"astro": "^2.6.4"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
|
|
2
|
+
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
|
|
3
|
+
<style>
|
|
4
|
+
path { fill: #000; }
|
|
5
|
+
@media (prefers-color-scheme: dark) {
|
|
6
|
+
path { fill: #FFF; }
|
|
7
|
+
}
|
|
8
|
+
</style>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { href, title, body } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<li class="link-card">
|
|
12
|
+
<a href={href}>
|
|
13
|
+
<h2>
|
|
14
|
+
{title}
|
|
15
|
+
<span>→</span>
|
|
16
|
+
</h2>
|
|
17
|
+
<p>
|
|
18
|
+
{body}
|
|
19
|
+
</p>
|
|
20
|
+
</a>
|
|
21
|
+
</li>
|
|
22
|
+
<style>
|
|
23
|
+
.link-card {
|
|
24
|
+
list-style: none;
|
|
25
|
+
display: flex;
|
|
26
|
+
padding: 0.25rem;
|
|
27
|
+
background-color: white;
|
|
28
|
+
background-image: none;
|
|
29
|
+
background-size: 400%;
|
|
30
|
+
border-radius: 0.6rem;
|
|
31
|
+
background-position: 100%;
|
|
32
|
+
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
|
33
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.link-card > a {
|
|
37
|
+
width: 100%;
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
line-height: 1.4;
|
|
40
|
+
padding: 1rem 1.3rem;
|
|
41
|
+
border-radius: 0.35rem;
|
|
42
|
+
color: #111;
|
|
43
|
+
background-color: white;
|
|
44
|
+
opacity: 0.8;
|
|
45
|
+
}
|
|
46
|
+
h2 {
|
|
47
|
+
margin: 0;
|
|
48
|
+
font-size: 1.25rem;
|
|
49
|
+
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
|
50
|
+
}
|
|
51
|
+
p {
|
|
52
|
+
margin-top: 0.5rem;
|
|
53
|
+
margin-bottom: 0;
|
|
54
|
+
color: #444;
|
|
55
|
+
}
|
|
56
|
+
.link-card:is(:hover, :focus-within) {
|
|
57
|
+
background-position: 0;
|
|
58
|
+
background-image: var(--accent-gradient);
|
|
59
|
+
}
|
|
60
|
+
.link-card:is(:hover, :focus-within) h2 {
|
|
61
|
+
color: rgb(var(--accent));
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="astro/client" />
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { title } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<!DOCTYPE html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8" />
|
|
13
|
+
<meta name="description" content="Astro description">
|
|
14
|
+
<meta name="viewport" content="width=device-width" />
|
|
15
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
16
|
+
<meta name="generator" content={Astro.generator} />
|
|
17
|
+
<title>{title}</title>
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<slot />
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
23
|
+
<style is:global>
|
|
24
|
+
:root {
|
|
25
|
+
--accent: 124, 58, 237;
|
|
26
|
+
--accent-gradient: linear-gradient(45deg, rgb(var(--accent)), #da62c4 30%, white 60%);
|
|
27
|
+
}
|
|
28
|
+
html {
|
|
29
|
+
font-family: system-ui, sans-serif;
|
|
30
|
+
background-color: #F6F6F6;
|
|
31
|
+
}
|
|
32
|
+
code {
|
|
33
|
+
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
|
34
|
+
Bitstream Vera Sans Mono, Courier New, monospace;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Layout from '../../layouts/Layout.astro';
|
|
3
|
+
import Card from '../../components/Card.astro';
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Layout title="Welcome to Astro">
|
|
7
|
+
<main>
|
|
8
|
+
<h1>Welcome to <span class="text-gradient">Running in Edge.</span></h1>
|
|
9
|
+
</main>
|
|
10
|
+
</Layout>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
main {
|
|
14
|
+
margin: auto;
|
|
15
|
+
padding: 1.5rem;
|
|
16
|
+
max-width: 60ch;
|
|
17
|
+
}
|
|
18
|
+
h1 {
|
|
19
|
+
font-size: 3rem;
|
|
20
|
+
font-weight: 800;
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
23
|
+
.text-gradient {
|
|
24
|
+
background-image: var(--accent-gradient);
|
|
25
|
+
-webkit-background-clip: text;
|
|
26
|
+
-webkit-text-fill-color: transparent;
|
|
27
|
+
background-size: 400%;
|
|
28
|
+
background-position: 0%;
|
|
29
|
+
}
|
|
30
|
+
.instructions {
|
|
31
|
+
line-height: 1.6;
|
|
32
|
+
margin: 1rem 0;
|
|
33
|
+
border: 1px solid rgba(var(--accent), 25%);
|
|
34
|
+
background-color: white;
|
|
35
|
+
padding: 1rem;
|
|
36
|
+
border-radius: 0.4rem;
|
|
37
|
+
}
|
|
38
|
+
.instructions code {
|
|
39
|
+
font-size: 0.875em;
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
background: rgba(var(--accent), 12%);
|
|
42
|
+
color: rgb(var(--accent));
|
|
43
|
+
border-radius: 4px;
|
|
44
|
+
padding: 0.3em 0.45em;
|
|
45
|
+
}
|
|
46
|
+
.instructions strong {
|
|
47
|
+
color: rgb(var(--accent));
|
|
48
|
+
}
|
|
49
|
+
.link-card-grid {
|
|
50
|
+
display: grid;
|
|
51
|
+
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
|
|
52
|
+
gap: 1rem;
|
|
53
|
+
padding: 0;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Layout from '../layouts/Layout.astro';
|
|
3
|
+
import Card from '../components/Card.astro';
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Layout title="Welcome to Astro.">
|
|
7
|
+
<main>
|
|
8
|
+
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
|
|
9
|
+
<p class="instructions">
|
|
10
|
+
To get started, open the directory <code>src/pages</code> in your project.<br />
|
|
11
|
+
<strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
|
|
12
|
+
</p>
|
|
13
|
+
<ul role="list" class="link-card-grid">
|
|
14
|
+
<Card
|
|
15
|
+
href="https://docs.astro.build/"
|
|
16
|
+
title="Documentation"
|
|
17
|
+
body="Learn how Astro works and explore the official API docs."
|
|
18
|
+
/>
|
|
19
|
+
<Card
|
|
20
|
+
href="https://astro.build/integrations/"
|
|
21
|
+
title="Integrations"
|
|
22
|
+
body="Supercharge your project with new frameworks and libraries."
|
|
23
|
+
/>
|
|
24
|
+
<Card
|
|
25
|
+
href="https://astro.build/themes/"
|
|
26
|
+
title="Themes"
|
|
27
|
+
body="Explore a galaxy of community-built starter themes."
|
|
28
|
+
/>
|
|
29
|
+
<Card
|
|
30
|
+
href="https://astro.build/chat/"
|
|
31
|
+
title="Community"
|
|
32
|
+
body="Come say hi to our amazing Discord community. ❤️"
|
|
33
|
+
/>
|
|
34
|
+
</ul>
|
|
35
|
+
</main>
|
|
36
|
+
</Layout>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
main {
|
|
40
|
+
margin: auto;
|
|
41
|
+
padding: 1.5rem;
|
|
42
|
+
max-width: 60ch;
|
|
43
|
+
}
|
|
44
|
+
h1 {
|
|
45
|
+
font-size: 3rem;
|
|
46
|
+
font-weight: 800;
|
|
47
|
+
margin: 0;
|
|
48
|
+
}
|
|
49
|
+
.text-gradient {
|
|
50
|
+
background-image: var(--accent-gradient);
|
|
51
|
+
-webkit-background-clip: text;
|
|
52
|
+
-webkit-text-fill-color: transparent;
|
|
53
|
+
background-size: 400%;
|
|
54
|
+
background-position: 0%;
|
|
55
|
+
}
|
|
56
|
+
.instructions {
|
|
57
|
+
line-height: 1.6;
|
|
58
|
+
margin: 1rem 0;
|
|
59
|
+
border: 1px solid rgba(var(--accent), 25%);
|
|
60
|
+
background-color: white;
|
|
61
|
+
padding: 1rem;
|
|
62
|
+
border-radius: 0.4rem;
|
|
63
|
+
}
|
|
64
|
+
.instructions code {
|
|
65
|
+
font-size: 0.875em;
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
background: rgba(var(--accent), 12%);
|
|
68
|
+
color: rgb(var(--accent));
|
|
69
|
+
border-radius: 4px;
|
|
70
|
+
padding: 0.3em 0.45em;
|
|
71
|
+
}
|
|
72
|
+
.instructions strong {
|
|
73
|
+
color: rgb(var(--accent));
|
|
74
|
+
}
|
|
75
|
+
.link-card-grid {
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
|
|
78
|
+
gap: 1rem;
|
|
79
|
+
padding: 0;
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
File without changes
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Hexo Configuration
|
|
2
|
+
## Docs: https://hexo.io/docs/configuration.html
|
|
3
|
+
## Source: https://github.com/hexojs/hexo/
|
|
4
|
+
|
|
5
|
+
# Site
|
|
6
|
+
title: Hexo
|
|
7
|
+
subtitle: ''
|
|
8
|
+
description: ''
|
|
9
|
+
keywords:
|
|
10
|
+
author: John Doe
|
|
11
|
+
language: en
|
|
12
|
+
timezone: ''
|
|
13
|
+
|
|
14
|
+
# URL
|
|
15
|
+
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
|
|
16
|
+
url: http://example.com
|
|
17
|
+
permalink: :year/:month/:day/:title/
|
|
18
|
+
permalink_defaults:
|
|
19
|
+
pretty_urls:
|
|
20
|
+
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
|
|
21
|
+
trailing_html: true # Set to false to remove trailing '.html' from permalinks
|
|
22
|
+
|
|
23
|
+
# Directory
|
|
24
|
+
source_dir: source
|
|
25
|
+
public_dir: public
|
|
26
|
+
tag_dir: tags
|
|
27
|
+
archive_dir: archives
|
|
28
|
+
category_dir: categories
|
|
29
|
+
code_dir: downloads/code
|
|
30
|
+
i18n_dir: :lang
|
|
31
|
+
skip_render:
|
|
32
|
+
|
|
33
|
+
# Writing
|
|
34
|
+
new_post_name: :title.md # File name of new posts
|
|
35
|
+
default_layout: post
|
|
36
|
+
titlecase: false # Transform title into titlecase
|
|
37
|
+
external_link:
|
|
38
|
+
enable: true # Open external links in new tab
|
|
39
|
+
field: site # Apply to the whole site
|
|
40
|
+
exclude: ''
|
|
41
|
+
filename_case: 0
|
|
42
|
+
render_drafts: false
|
|
43
|
+
post_asset_folder: false
|
|
44
|
+
relative_link: false
|
|
45
|
+
future: true
|
|
46
|
+
highlight:
|
|
47
|
+
enable: true
|
|
48
|
+
line_number: true
|
|
49
|
+
auto_detect: false
|
|
50
|
+
tab_replace: ''
|
|
51
|
+
wrap: true
|
|
52
|
+
hljs: false
|
|
53
|
+
prismjs:
|
|
54
|
+
enable: false
|
|
55
|
+
preprocess: true
|
|
56
|
+
line_number: true
|
|
57
|
+
tab_replace: ''
|
|
58
|
+
|
|
59
|
+
# Home page setting
|
|
60
|
+
# path: Root path for your blogs index page. (default = '')
|
|
61
|
+
# per_page: Posts displayed per page. (0 = disable pagination)
|
|
62
|
+
# order_by: Posts order. (Order by date descending by default)
|
|
63
|
+
index_generator:
|
|
64
|
+
path: ''
|
|
65
|
+
per_page: 10
|
|
66
|
+
order_by: -date
|
|
67
|
+
|
|
68
|
+
# Category & Tag
|
|
69
|
+
default_category: uncategorized
|
|
70
|
+
category_map:
|
|
71
|
+
tag_map:
|
|
72
|
+
|
|
73
|
+
# Metadata elements
|
|
74
|
+
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
75
|
+
meta_generator: true
|
|
76
|
+
|
|
77
|
+
# Date / Time format
|
|
78
|
+
## Hexo uses Moment.js to parse and display date
|
|
79
|
+
## You can customize the date format as defined in
|
|
80
|
+
## http://momentjs.com/docs/#/displaying/format/
|
|
81
|
+
date_format: YYYY-MM-DD
|
|
82
|
+
time_format: HH:mm:ss
|
|
83
|
+
## updated_option supports 'mtime', 'date', 'empty'
|
|
84
|
+
updated_option: 'mtime'
|
|
85
|
+
|
|
86
|
+
# Pagination
|
|
87
|
+
## Set per_page to 0 to disable pagination
|
|
88
|
+
per_page: 10
|
|
89
|
+
pagination_dir: page
|
|
90
|
+
|
|
91
|
+
# Include / Exclude file(s)
|
|
92
|
+
## include:/exclude: options only apply to the 'source/' folder
|
|
93
|
+
include:
|
|
94
|
+
exclude:
|
|
95
|
+
ignore:
|
|
96
|
+
|
|
97
|
+
# Extensions
|
|
98
|
+
## Plugins: https://hexo.io/plugins/
|
|
99
|
+
## Themes: https://hexo.io/themes/
|
|
100
|
+
theme: landscape
|
|
101
|
+
|
|
102
|
+
# Deployment
|
|
103
|
+
## Docs: https://hexo.io/docs/one-command-deployment
|
|
104
|
+
deploy:
|
|
105
|
+
type: ''
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hexo-site",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "hexo generate",
|
|
7
|
+
"clean": "hexo clean",
|
|
8
|
+
"deploy": "hexo deploy",
|
|
9
|
+
"server": "hexo server"
|
|
10
|
+
},
|
|
11
|
+
"hexo": {
|
|
12
|
+
"version": "6.3.0"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"hexo": "^6.3.0",
|
|
16
|
+
"hexo-generator-archive": "^2.0.0",
|
|
17
|
+
"hexo-generator-category": "^2.0.0",
|
|
18
|
+
"hexo-generator-index": "^3.0.0",
|
|
19
|
+
"hexo-generator-tag": "^2.0.0",
|
|
20
|
+
"hexo-renderer-ejs": "^2.0.0",
|
|
21
|
+
"hexo-renderer-marked": "^6.0.0",
|
|
22
|
+
"hexo-renderer-stylus": "^3.0.0",
|
|
23
|
+
"hexo-server": "^3.0.0",
|
|
24
|
+
"hexo-theme-landscape": "^1.0.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hello World
|
|
3
|
+
---
|
|
4
|
+
Welcome to [Hexo](https://hexo.io/)! This is your very first post. Check [documentation](https://hexo.io/docs/) for more info. If you get any problems when using Hexo, you can find the answer in [troubleshooting](https://hexo.io/docs/troubleshooting.html) or you can ask me on [GitHub](https://github.com/hexojs/hexo/issues).
|
|
5
|
+
|
|
6
|
+
## Quick Start
|
|
7
|
+
|
|
8
|
+
### Create a new post
|
|
9
|
+
|
|
10
|
+
``` bash
|
|
11
|
+
$ hexo new "My New Post"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
More info: [Writing](https://hexo.io/docs/writing.html)
|
|
15
|
+
|
|
16
|
+
### Run server
|
|
17
|
+
|
|
18
|
+
``` bash
|
|
19
|
+
$ hexo server
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
More info: [Server](https://hexo.io/docs/server.html)
|
|
23
|
+
|
|
24
|
+
### Generate static files
|
|
25
|
+
|
|
26
|
+
``` bash
|
|
27
|
+
$ hexo generate
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
More info: [Generating](https://hexo.io/docs/generating.html)
|
|
31
|
+
|
|
32
|
+
### Deploy to remote sites
|
|
33
|
+
|
|
34
|
+
``` bash
|
|
35
|
+
$ hexo deploy
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
More info: [Deployment](https://hexo.io/docs/one-command-deployment.html)
|