-
Notifications
You must be signed in to change notification settings - Fork 1
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 95d0fe7
Showing
49 changed files
with
9,521 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,7 @@ | ||
{ | ||
"separate-pull-requests": true, | ||
"packages": { | ||
"packages/odd-passkeys": {}, | ||
"packages/odd-preact": {} | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"packages/odd-passkeys": "0.0.1", | ||
"packages/odd-preact": "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,34 @@ | ||
name: odd-passkeys | ||
env: | ||
CI: true | ||
FORCE_COLOR: 1 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/odd-passkeys/**' | ||
- '.github/workflows/odd-passkeys.yml' | ||
- 'pnpm-lock.yaml' | ||
pull_request: | ||
paths: | ||
- 'packages/odd-passkeys/**' | ||
- '.github/workflows/odd-passkeys.yml' | ||
- 'pnpm-lock.yaml' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm run build | ||
- run: pnpm -r --filter @oddjs/passkeys run lint | ||
- run: pnpm -r --filter @oddjs/passkeys run test | ||
- run: pnpm -r --filter @oddjs/passkeys exec depcheck |
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: odd-preact | ||
env: | ||
CI: true | ||
FORCE_COLOR: 1 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/odd-preact/**' | ||
- '.github/workflows/odd-preact.yml' | ||
- 'pnpm-lock.yaml' | ||
pull_request: | ||
paths: | ||
- 'packages/odd-preact/**' | ||
- '.github/workflows/odd-preact.yml' | ||
- 'pnpm-lock.yaml' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm run build | ||
- run: pnpm -r --filter @oddjs/preact run lint | ||
- run: pnpm -r --filter @oddjs/preact run test | ||
- run: pnpm -r --filter @oddjs/preact exec depcheck |
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 @@ | ||
name: passkey-auth | ||
env: | ||
CI: true | ||
FORCE_COLOR: 1 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'examples/passkey-auth/**' | ||
- '.github/workflows/passkey-auth.yml' | ||
- 'pnpm-lock.yaml' | ||
pull_request: | ||
paths: | ||
- 'packages/passkey-auth/**' | ||
- '.github/workflows/passkey-auth.yml' | ||
- 'pnpm-lock.yaml' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm -r --filter passkey-auth run build | ||
# - uses: fission-suite/[email protected] | ||
# with: | ||
# machine_key: ${{ secrets.FISSION_MACHINE_KEY }} | ||
# workdir: 'examples/passkey-auth' |
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,51 @@ | ||
name: Release | ||
env: | ||
CI: true | ||
FORCE_COLOR: 1 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
paths_released: ${{ steps.release.outputs.paths_released }} | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
# needs to be personal token so release PRs can run workflows | ||
token: ${{ secrets.GH_TOKEN }} | ||
command: manifest | ||
config-file: .github/release-please-config.json | ||
manifest-file: .github/release-please-manifest.json | ||
default-branch: main | ||
release-type: node | ||
npm: | ||
needs: release | ||
if: | | ||
contains(fromJson(needs.release.outputs.paths_released), 'packages/odd-passkeys') || | ||
contains(fromJson(needs.release.outputs.paths_released), 'packages/odd-preact') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm run lint | ||
- run: pnpm -r publish --access=public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
docs: | ||
needs: release | ||
if: | | ||
contains(fromJson(needs.release.outputs.paths_released), 'packages/odd-passkeys') || | ||
contains(fromJson(needs.release.outputs.paths_released), 'packages/odd-preact') | ||
uses: './.github/workflows/reusable-docs.yml' |
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,40 @@ | ||
name: Reusable Deploy Docs | ||
on: | ||
workflow_call: | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: false | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 7 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm run lint | ||
- run: pnpm run docs | ||
- uses: actions/configure-pages@v3 | ||
- uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: './docs' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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,29 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
dev-dist | ||
kv-data | ||
.env | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
docs |
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 @@ | ||
ignore: [] | ||
url: passkeys-test2.fission.app | ||
build: ./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,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + Preact</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.jsx"></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,49 @@ | ||
{ | ||
"name": "passkey-auth", | ||
"private": true, | ||
"version": "0.0.0", | ||
"license": "apache-2.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite --force", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"lint": "tsc && eslint '**/*.{js,jsx,ts}' && prettier --check '**/*.{js,jsx,ts,yml,json}' --ignore-path ../../.gitignore", | ||
"deploy": "vite build && wrangler pages publish --project-name passkey --branch main dist" | ||
}, | ||
"dependencies": { | ||
"@acab/reset.css": "^0.5.3", | ||
"@oddjs/passkeys": "workspace:^", | ||
"@oddjs/preact": "workspace:^", | ||
"@preact/signals": "^1.1.3", | ||
"idb-keyval": "^6.2.1", | ||
"iso-base": "^0.1.5", | ||
"iso-passkeys": "^0.1.5", | ||
"p-debounce": "^4.0.0", | ||
"preact": "^10.13.2", | ||
"preact-router": "^4.1.0", | ||
"react-hook-form": "^7.43.9", | ||
"water.css": "^2.1.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.21.8", | ||
"@preact/preset-vite": "^2.5.0", | ||
"typescript": "^5.0.4", | ||
"vite": "^4.3.5", | ||
"wrangler": "^2.20.0" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"../../node_modules/hd-scripts/eslint/preact.js" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"ignorePatterns": [ | ||
"dist" | ||
] | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
} | ||
} |
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 @@ | ||
/* /index.html 200 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
# Usage | ||
|
||
```bash | ||
npx simple-git-hooks | ||
``` |
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,40 @@ | ||
/* eslint-disable unicorn/no-useless-undefined */ | ||
import { Router } from 'preact-router' | ||
import Home from './home.jsx' | ||
import Login from './login.jsx' | ||
import { OddContextProvider } from '@oddjs/preact' | ||
import Register from './register.jsx' | ||
import Test from './test.jsx' | ||
import * as OddPasskey from '@oddjs/passkeys' | ||
|
||
/** @type {import('@oddjs/odd').Configuration} */ | ||
const config = { | ||
namespace: { | ||
creator: document.location.host, | ||
name: 'Passkey auth', | ||
}, | ||
debug: true, | ||
debugging: { | ||
injectIntoGlobalContext: true, | ||
}, | ||
} | ||
|
||
export function App() { | ||
return ( | ||
<> | ||
<OddContextProvider | ||
config={config} | ||
componentsFactory={OddPasskey.createComponents} | ||
> | ||
<main className="App"> | ||
<Router> | ||
<Home path="/" /> | ||
<Test path="/test" /> | ||
<Login path="/login" /> | ||
<Register path="/register" /> | ||
</Router> | ||
</main> | ||
</OddContextProvider> | ||
</> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.