-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added temp boilerplate codes and shims.
- Loading branch information
Showing
36 changed files
with
381 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ etc/coverage/*.json | |
etc/coverage/cov_profile.lcov | ||
|
||
# hidden | ||
tmp/ | ||
tmp/_hidden/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Taken from: https://github.com/oakserver/oak/blob/main/node_shims.ts | ||
// Copyright 2018-2022 the oak authors. All rights reserved. MIT license. | ||
|
||
export class ErrorEvent extends Event { | ||
#message: string; | ||
#filename: string; | ||
#lineno: number; | ||
#colno: number; | ||
// deno-lint-ignore no-explicit-any | ||
#error: any; | ||
|
||
get message(): string { | ||
return this.#message; | ||
} | ||
get filename(): string { | ||
return this.#filename; | ||
} | ||
get lineno(): number { | ||
return this.#lineno; | ||
} | ||
get colno(): number { | ||
return this.#colno; | ||
} | ||
// deno-lint-ignore no-explicit-any | ||
get error(): any { | ||
return this.#error; | ||
} | ||
|
||
constructor(type: string, eventInitDict: ErrorEventInit = {}) { | ||
super(type, eventInitDict); | ||
const { message = "error", filename = "", lineno = 0, colno = 0, error } = | ||
eventInitDict; | ||
this.#message = message; | ||
this.#filename = filename; | ||
this.#lineno = lineno; | ||
this.#colno = colno; | ||
this.#error = error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018-2022 the oak authors | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text eol=lf | ||
|
||
*.png binary | ||
*.jpg binary | ||
*.ico binary | ||
*.jpg binary | ||
*.eot binary | ||
*.ttf binary | ||
*.woff binary | ||
*.woff2 binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# OS-specific files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Editor metadata | ||
.vscode/* | ||
!.vscode/extensions.json | ||
!.vscode/settings.json | ||
.idea/ | ||
|
||
# local API keys and secrets | ||
.env.local | ||
.env.*.local | ||
|
||
# sensitive files | ||
*.pem | ||
*.swp | ||
|
||
# typescript | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"denoland.vscode-deno" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": true, | ||
"deno.unstable": true, | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true | ||
}, | ||
"lint": { | ||
"files": { | ||
"include": [ | ||
"src/", | ||
"mod.ts", | ||
"*.md", | ||
"*.json" | ||
], | ||
"exclude": [] | ||
}, | ||
"rules": { | ||
"tags": [ | ||
"recommended" | ||
], | ||
"include": [], | ||
"exclude": [] | ||
} | ||
}, | ||
"fmt": { | ||
"files": { | ||
"include": [ | ||
"src/", | ||
"mod.ts", | ||
"*.md", | ||
"*.json" | ||
], | ||
"exclude": [] | ||
} | ||
}, | ||
"test": { | ||
"files": { | ||
"include": [ | ||
"src/" | ||
], | ||
"exclude": [] | ||
} | ||
}, | ||
"tasks": { | ||
"test": "deno test ./src/ --coverage=./etc/cov_profile", | ||
"test:coverage": "deno coverage ./etc/cov_profile", | ||
"test:generate-lcov": "deno coverage ./etc/cov_profile --lcov > ./etc/cov_profile/cov_profile.lcov", | ||
"bench": "deno bench ./src/ --unstable", | ||
"start": "deno run -A --watch=src/,public/ dev.ts" | ||
}, | ||
"importMap": "./import_map.json" | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const hexConfig = { | ||
urls: { | ||
structure: "/[lang]/[...path]", | ||
rewrites: [ | ||
// { | ||
// source: "/", | ||
// destination: "/en/" | ||
// } | ||
], | ||
}, | ||
|
||
i18n: { | ||
languages: [ | ||
"en", | ||
"tr" | ||
] | ||
}, | ||
}; | ||
|
||
export { hexConfig as default, hexConfig }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"imports": { | ||
"_@hex/": "https://deno.land/x/hex/", | ||
"@hex/": "../../src/", | ||
"@app/": "./src/" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
User-agent: * | ||
Allow: / |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const staticPage = { | ||
nameSingular: "StaticPage", | ||
namePlural: "StaticPages", | ||
filePathPattern: "./content/**/*.md", | ||
fields: { | ||
title: { | ||
type: "string", | ||
description: "The title of the static page", | ||
required: true, | ||
}, | ||
date: { | ||
type: "date", | ||
description: "The date of the static page", | ||
required: true, | ||
}, | ||
url: { | ||
type: "string", | ||
description: "The url of the static page", | ||
resolve: (item) => { | ||
const [, title, lang] = /static\/([^\.]*)\.(.*)/.exec( | ||
item.filePath, | ||
); | ||
|
||
return `/${lang}/${title}`; | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export { staticPage, staticPage as default }; |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { type Context, results } from "@hex/web/page"; | ||
import { type Language } from "@hex/i18n"; | ||
|
||
interface PageProps { | ||
lang: Language; | ||
} | ||
|
||
const Page = function HomeIndex(ctx: Context<PageProps>) { | ||
return results.reactView( | ||
<div> | ||
<h1>Homepage</h1> | ||
</div>, | ||
{ | ||
title: "Homepage", | ||
description: "This is the homepage", | ||
layout: "@app/shared/layout/layout.tsx", | ||
}, | ||
); | ||
}; | ||
|
||
export { Page, Page as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background: slategray; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from "https://jspm.dev/[email protected]"; | ||
|
||
import { | ||
dumper, | ||
dumperReact, | ||
executeFromCli, | ||
type HexFunctionInput, | ||
results, | ||
} from "@hex/functions/mod.ts"; | ||
import { type Language } from "@hex/i18n/mod.ts"; | ||
|
||
interface PageProps { | ||
lang: Language; | ||
} | ||
|
||
const Page = function HomeIndex(input: HexFunctionInput<PageProps>) { | ||
return results.reactView( | ||
<div> | ||
<h1>Homepage</h1> | ||
</div>, | ||
{ | ||
title: "Homepage", | ||
description: "This is the homepage", | ||
layout: "@app/shared/layout/layout.tsx", | ||
}, | ||
); | ||
}; | ||
|
||
const result = executeFromCli(Page); | ||
// dumper(result); | ||
dumperReact(result); | ||
|
||
export { Page, Page as default }; |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from "https://jspm.dev/[email protected]"; | ||
|
||
import { | ||
dumper, | ||
dumperReact, | ||
executeFromCli, | ||
type HexFunctionInput, | ||
results, | ||
} from "@hex/functions/mod.ts"; | ||
import { type Language } from "@hex/i18n/mod.ts"; | ||
|
||
interface PageProps { | ||
lang: Language; | ||
} | ||
|
||
const Page = function HomeIndex(input: HexFunctionInput<PageProps>) { | ||
return results.reactView( | ||
<div> | ||
<h1>Homepage</h1> | ||
</div>, | ||
{ | ||
title: "Homepage", | ||
description: "This is the homepage", | ||
layout: "@app/shared/layout/layout.tsx", | ||
}, | ||
); | ||
}; | ||
|
||
const result = executeFromCli(Page); | ||
// dumper(result); | ||
dumperReact(result); | ||
|
||
export { Page, Page as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { BodyContents, HeadContents } from "@hex/web/page"; | ||
import { type Language } from "@hex/i18n"; | ||
|
||
interface LayoutProps { | ||
lang: Language; | ||
children: JSX.Element; | ||
} | ||
|
||
const Layout = function Layout(props: LayoutProps) { | ||
return ( | ||
<html lang={props.lang.code}> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0" | ||
/> | ||
<link rel="icon" href="/favicon.ico" /> | ||
|
||
<HeadContents /> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<Routes content={props.children}> | ||
<PathBasedRoutes /> | ||
</Routes> | ||
</div> | ||
|
||
<BodyContents /> | ||
</body> | ||
</html> | ||
); | ||
}; | ||
|
||
export { Layout, Layout as default }; |
Empty file.
Empty file.
Empty file.
Oops, something went wrong.