Skip to content

Commit

Permalink
docs: init doc framework
Browse files Browse the repository at this point in the history
  • Loading branch information
acrazing committed Oct 23, 2024
1 parent 3d595f8 commit fe7637e
Show file tree
Hide file tree
Showing 115 changed files with 13,486 additions and 3,134 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# 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

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Change this to the node version you need
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Build Website
run: yarn workspace amos-website build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './website/build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Amos

Amos is a decentralized state management library, inspired by `redux`, `vuex` and `recoil`.
A decentralized, data structure-based, fully featured state management library.

## Highlights

Expand Down
55 changes: 0 additions & 55 deletions apps/examples/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions apps/examples/src/App.css

This file was deleted.

69 changes: 0 additions & 69 deletions apps/examples/src/App.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions apps/examples/src/TodoMVC/TodoMVC.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions apps/examples/src/WithStore/WithStore.tsx

This file was deleted.

1 change: 0 additions & 1 deletion apps/examples/src/assets/react.svg

This file was deleted.

Binary file added assets/amos.ico
Binary file not shown.
Binary file added assets/amos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions assets/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
1 change: 1 addition & 0 deletions examples/Counter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Amos - Counter
4 changes: 2 additions & 2 deletions apps/examples/index.html → examples/Counter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/amos.svg" />
<link rel="icon" type="image/svg+xml" href="../../assets/amos.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Amos - Counter</title>
</head>
<body>
<div id="root"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"name": "amos-examples",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/*
* @since 2024-10-18 23:41:18
* @author junbao <[email protected]>
*/

import { numberBox } from 'amos';
import { useDispatch, useSelector } from 'amos/react';
import React from 'react';
import React, { memo } from 'react';

const countBox = numberBox('count', 0);

export const Counter = () => {
export const App = memo(() => {
const dispatch = useDispatch();
const [count] = useSelector(countBox);
return (
Expand All @@ -13,4 +18,4 @@ export const Counter = () => {
<button onClick={() => dispatch(countBox.setState((c) => c + 1))}>Click me!</button>
</div>
);
};
});
File renamed without changes.
11 changes: 7 additions & 4 deletions apps/examples/src/main.tsx → examples/Counter/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { createStore } from 'amos-core';
import { Provider } from 'amos-react';
import React, { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { App } from './App';
import './index.css';
import App from './App';
import { WithStore } from './WithStore/WithStore';

const store = createStore();

createRoot(document.getElementById('root')!).render(
<StrictMode>
<WithStore>
<Provider store={store}>
<App />
</WithStore>
</Provider>
</StrictMode>,
);
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

// https://vitejs.dev/config/
export default defineConfig({
Expand Down
24 changes: 24 additions & 0 deletions examples/TodoMVC/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Loading

0 comments on commit fe7637e

Please sign in to comment.