Skip to content

Commit

Permalink
Merge pull request #24 from mrjvs/dev
Browse files Browse the repository at this point in the history
Guider v0.1.0 - BETA
  • Loading branch information
mrjvs authored Mar 16, 2024
2 parents b06473a + 110f0d5 commit 5bed4fa
Show file tree
Hide file tree
Showing 255 changed files with 10,013 additions and 317 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docs - deploy

on:
push:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install pnpm packages
run: pnpm install

- name: Build @neato/guider
run: cd packages/guider && pnpm run build

- name: Build
run: cd apps/docs && pnpm run build

- name: Upload site
uses: actions/upload-pages-artifact@v3
with:
path: apps/docs/out

deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
50 changes: 50 additions & 0 deletions .github/workflows/guider-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Guider - publish version

on:
push:
branches:
- main

jobs:
check:
name: Check
runs-on: ubuntu-latest
outputs:
checked: ${{ steps.changed-files.outputs.any_modified }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: |
packages/guider/**
publish:
runs-on: ubuntu-latest
needs: [check]
environment:
name: npm
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install pnpm packages
run: pnpm install

- name: Build
run: cd packages/guider && pnpm run build

- name: Publish
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ dist
.idea
.DS_Store
.next
out
/test.js
/test.ts
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 NeatoJS

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.
59 changes: 59 additions & 0 deletions apps/docs/components/home-card.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.container > * {
margin-bottom: 1rem;
}

.container > *:last-child {
margin-bottom: 0;
}

.card {
display: flex;
gap: .5rem;
border: 1px solid #0F2B33;
border-radius: 15px;
padding: 1.5rem;
transition: border-color 100ms ease-in-out;
}
.card:hover {
border-color: #1e4853;
}

.body {
flex: 1;
}

.right {
display: flex;
align-items: center;
}

.title {
font-size: 1.25rem;
color: white;
margin-bottom: 0.5rem;
font-weight: bold;
display: inline-block;
}
.title:hover {
opacity: 0.75;
}

.desc {
line-height: 1.3;
max-width: 320px;
}

.icon {
font-size: 1.75rem;
margin-top: 0.2rem;
color: #50A0EA;
}

@media screen and (max-width: 740px) {
.card {
flex-direction: column;
}
.right {
margin-top: 2rem;
}
}
40 changes: 40 additions & 0 deletions apps/docs/components/home-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import type { ReactNode } from 'react';
import { Icon } from '@neato/guider/client';
import Link from 'next/link';
import styles from './home-card.module.css';

function Card(props: {
children?: ReactNode;
right?: ReactNode;
icon: string;
}) {
return (
<div className={styles.card}>
<Icon icon={props.icon} className={styles.icon} />
<div className={styles.body}>{props.children}</div>
<div className={styles.right}>{props.right}</div>
</div>
);
}

function Title(props: { children?: ReactNode; href: string }) {
return (
<Link href={props.href}>
<h1 className={styles.title}>{props.children}</h1>
</Link>
);
}

function Description(props: { children?: ReactNode }) {
return <p className={styles.desc}>{props.children}</p>;
}

export function HomeCardContainer(props: { children?: ReactNode }) {
return <div className={styles.container}>{props.children}</div>;
}

export const HomeCard = {
Card,
Title,
Description,
};
19 changes: 19 additions & 0 deletions apps/docs/components/home.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.home {
max-width: 750px;
margin: 5rem auto;
}

.title {
font-size: 2rem;
color: white;
margin-bottom: 1.5rem;
font-weight: bold;
max-width: 480px;
}

.subtitle {
font-size: 1.125rem;
line-height: 1.3;
max-width: 480px;
margin-bottom: 4rem;
}
20 changes: 20 additions & 0 deletions apps/docs/components/home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { ReactNode } from 'react';
import styles from './home.module.css';

function Container(props: { children?: ReactNode }) {
return <div className={styles.home}>{props.children}</div>;
}

function Title(props: { children?: ReactNode }) {
return <h1 className={styles.title}>{props.children}</h1>;
}

function Subtitle(props: { children?: ReactNode }) {
return <p className={styles.subtitle}>{props.children}</p>;
}

export const Home = {
Container,
Title,
Subtitle,
};
23 changes: 23 additions & 0 deletions apps/docs/components/logo.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.logo img {
height: 2rem;
margin-right: .5rem;
}

.logo {
font-weight: 700;
color: white;
display: flex;
align-items: center;
transition: background-color 100ms ease-in-out, transform 100ms ease-in-out;
border-radius: 5px;
padding: .5rem;
margin-left: -0.5rem;
}

.logo:hover {
background-color: rgb(var(--colors-bgLightest));
}

.logo:active {
transform: scale(1.05);
}
10 changes: 10 additions & 0 deletions apps/docs/components/logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Link from 'next/link';
import styles from './logo.module.css';

export function Logo() {
return (
<Link href="/" className={styles.logo}>
<img src="/logo.svg" /> NeatoJS
</Link>
);
}
9 changes: 7 additions & 2 deletions apps/docs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
const { guider } = require('@neato/guider');

const withGuider = guider();
module.exports = withGuider();
const withGuider = guider({
themeConfig: './theme.config.tsx',
});

module.exports = withGuider({
output: 'export',
});
3 changes: 3 additions & 0 deletions apps/docs/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createNotFoundPage } from '@neato/guider/client';

export default createNotFoundPage();
4 changes: 4 additions & 0 deletions apps/docs/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '@neato/guider/style.css';
import { createGuiderApp } from '@neato/guider/client';

export default createGuiderApp();
3 changes: 3 additions & 0 deletions apps/docs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"site": "main"
}
3 changes: 0 additions & 3 deletions apps/docs/pages/a/_meta.json

This file was deleted.

3 changes: 0 additions & 3 deletions apps/docs/pages/a/index.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/docs/pages/b/_meta.json

This file was deleted.

3 changes: 0 additions & 3 deletions apps/docs/pages/b/index.mdx

This file was deleted.

3 changes: 3 additions & 0 deletions apps/docs/pages/docs/config/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"site": "config"
}
9 changes: 9 additions & 0 deletions apps/docs/pages/docs/config/api/errors.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Error handling

Configuration loading has some potentionally confusing error handling.
By default, it will use the "pretty" assertion mode. This mode **will call process.exit(1)** instead of throwing errors. That means that you aren't able to catch it with a try-catch block.

## The modes
- `pretty` Log the errors in pretty formatting and colors, then exit the process.
- `plain` Log the errors in plain text, then exit the process.
- `throw` throw the errors where they occur.
Loading

0 comments on commit 5bed4fa

Please sign in to comment.