-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4db2122
Showing
67 changed files
with
3,014 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node_version: [16] | ||
include: | ||
- os: macos-latest | ||
node_version: 16 | ||
- os: windows-latest | ||
node_version: 16 | ||
fail-fast: false | ||
name: 'Test on node-${{ matrix.node_version }}, ${{ matrix.os }}' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set node version to ${{ matrix.node_version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- name: Install & Build | ||
run: yarn test:setup | ||
|
||
- name: Run tests | ||
run: yarn test |
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,36 @@ | ||
name: Deploy Docs Website | ||
on: | ||
push: | ||
# We only run this GitHub action upon new commits to `master` | ||
branches: | ||
- master | ||
# We only run this GitHub action if there are changes in the `docs/` directory | ||
paths: | ||
- docs/** | ||
- libframe | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install | ||
# `yarn install` will checkout the git submodule `libframe/` | ||
run: | | ||
yarn install | ||
- name: Build | ||
run: | | ||
yarn docs:build | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: docs/dist/client | ||
# Remove previous build files | ||
clean: true | ||
# Do not remove the `.nojekyll` file: we have manually added an empty `.nojekyll` file at the root of the `gh-pages` branch and we don't want having to re-create it after each build. | ||
clean-exclude: | | ||
.nojekyll |
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 @@ | ||
/node_modules/ |
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 @@ | ||
[submodule "libframe"] | ||
path = libframe | ||
url = [email protected]:brillout/libframe |
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 @@ | ||
# Telefunc (new 2021 version) `0.1.0-beta.1` | ||
|
||
Initial beta release. | ||
|
||
# Telefunc (old 2020 version) `0.0.26` | ||
|
||
See [github.com/brillout/telefunc-old](https://github.com/brillout/telefunc-old). | ||
|
||
# Wildcard API `v0.5.3` | ||
|
||
See [github.com/brillout/wildcard-api](https://github.com/brillout/wildcard-api). |
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,9 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020-present Romuald Brillout | ||
|
||
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,18 @@ | ||
*Remote Functions. Instead of API.* | ||
|
||
Intro & docs: [telefunc.com](https://telefunc.com) | ||
<br/> | ||
Examples (official): [examples/](examples) | ||
<br/> | ||
Examples (community): [examples/README.md](examples#community-examples) | ||
|
||
Version history & breaking changes: [CHANGELOG.md](CHANGELOG.md) | ||
|
||
Follow: [twitter.com/brillout](https://twitter.com/brillout) | ||
<br/> | ||
Chat: [Discord - Vike Land - #telefunc](https://discord.gg/3DYWwk4xRQ) | ||
|
||
Have a question? Want a feature? A tool integration is not working? Chat on | ||
<a href="https://discord.gg/3DYWwk4xRQ">Discord</a> or open a | ||
<a href="https://github.com/brillout/telefunc/issues/new">GitHub ticket</a>. | ||
|
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 @@ | ||
import 'libframe-docs/_default.page.client' | ||
|
||
import '../icons/vue.svg' | ||
import '../icons/react.svg' | ||
import '../icons/chevron.svg' | ||
import '../icons/vite-plugin-ssr.svg' | ||
|
||
/* | ||
import { setClientFrame } from 'libframe-docs/_default.page.server' | ||
setClientFrame({assets: [ | ||
]}) | ||
*/ |
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,13 @@ | ||
export * from 'libframe-docs/_default.page.server' | ||
import logoUrl from '../icons/telefunc.svg' | ||
import { setFrame } from 'libframe-docs/_default.page.server' | ||
import { headings } from '../headings' | ||
import { projectInfo } from '../utils' | ||
|
||
setFrame({ | ||
projectVersion: projectInfo.version, | ||
projectName: projectInfo.name, | ||
repo: projectInfo.githubRepository, | ||
headings, | ||
logoUrl | ||
}) |
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,54 @@ | ||
import { Heading } from 'libframe-docs/types' | ||
|
||
export const headings: Heading[] = [ | ||
{ | ||
level: 1, | ||
title: 'Overview', | ||
titleEmoji: 'compass' | ||
}, | ||
{ | ||
level: 2, | ||
title: 'Introduction', | ||
titleDocument: 'vite-plugin-ssr', | ||
url: '/' | ||
}, | ||
{ | ||
level: 2, | ||
title: 'Tour', | ||
url: '/tour' | ||
}, | ||
{ | ||
level: 1, | ||
title: 'Get Started', | ||
titleEmoji: 'seedling' | ||
}, | ||
{ | ||
level: 2, | ||
title: 'Scaffold new app', | ||
url: '/scaffold' | ||
}, | ||
{ | ||
level: 2, | ||
title: 'Add to existing app', | ||
url: '/add' | ||
}, | ||
{ | ||
level: 1, | ||
title: 'Guides', | ||
titleEmoji: 'books' | ||
}, | ||
{ | ||
level: 4, | ||
title: 'Basics' | ||
}, | ||
{ | ||
level: 2, | ||
title: 'Permissions', | ||
url: '/permissions' | ||
}, | ||
{ | ||
level: 2, | ||
title: 'Error Handling', | ||
url: '/error-handling' | ||
}, | ||
] |
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 @@ | ||
declare module '*.mdx' { | ||
import { FunctionComponent } from 'react' | ||
const value: FunctionComponent | ||
export default value | ||
export const headings: { level: number; title: string; id: string; titleAddendum?: string }[] | ||
} |
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,19 @@ | ||
{ | ||
"scripts": { | ||
"dev": "cd ../libframe/docs/ && yarn dev", | ||
"prod": "cd ../libframe/docs/ && yarn prod", | ||
"build": "cd ../libframe/docs/ && yarn build" | ||
}, | ||
"dependencies": { | ||
"libframe-docs": "*", | ||
"@types/node": "^15.12.1", | ||
"@types/react": "^17.0.9", | ||
"@types/react-dom": "^17.0.6", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"typescript": "^4.3.2" | ||
}, | ||
"// Needed for Yarn workspaces": "", | ||
"name": "docs", | ||
"version": "0.0.1" | ||
} |
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,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"jsx": "react", | ||
"module": "ES2020", | ||
"moduleResolution": "Node", | ||
"lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
"types": ["vite/client"], | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": 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 @@ | ||
export * from './projectInfo' |
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 @@ | ||
const PROJECT_VERSION = '0.2.7' | ||
|
||
export const projectInfo = { | ||
name: 'Telefunc', | ||
version: PROJECT_VERSION, | ||
githubRepository: 'https://github.com/brillout/telefunc' | ||
} |
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 @@ | ||
# Community Examples | ||
|
||
Make a PR to add your example. |
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 @@ | ||
/node_modules/ | ||
/dist/ |
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 @@ | ||
semi: true | ||
singleQuote: false | ||
trailingComma: es5 | ||
tabWidth: 2 | ||
printWidth: 80 |
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,9 @@ | ||
import { page, run, urlBase } from "../../libframe/test/setup"; | ||
|
||
run("npm run start"); | ||
|
||
test("page content is rendered to DOM", async () => { | ||
page.goto(`${urlBase}/`); | ||
await page.click("button"); | ||
expect(await page.textContent("body")).toContain("42"); | ||
}); |
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 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<button>Message Server</button> | ||
<p> | ||
Messages: | ||
</p> | ||
<p id="messages">None</p> | ||
<script type="module" src="/main.js"></script> | ||
</body> | ||
</html> | ||
|
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,9 @@ | ||
import { msg } from './msg.telefunc' | ||
|
||
const buttonEl = document.querySelector("button") | ||
const messagesEl = document.querySelector('#messages') | ||
|
||
buttonEl.onclick = () => { | ||
const m = await msg() | ||
messagesEl.textContent = m | ||
} |
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 @@ | ||
import { getContext } from 'telefunc' | ||
|
||
export { msg } | ||
|
||
async function msg() { | ||
const context = getContext() | ||
console.log(context.headers) | ||
return { | ||
he: 42, | ||
} | ||
} |
Oops, something went wrong.