Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanosdev committed Dec 30, 2023
0 parents commit bea976c
Show file tree
Hide file tree
Showing 23 changed files with 12,726 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.rs]
indent_size = 4

[*.md]
max_line_length = off
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions .github/actions/setup-nodejs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Setup NodeJS
description: Setup NodeJS

runs:
using: 'composite'
steps:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'
29 changes: 29 additions & 0 deletions .github/actions/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup PNPM
description: Setup PNPM

runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store
- name: Install dependencies
shell: bash
run: pnpm i --frozen-lockfile
47 changes: 47 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Docs

on:
push:
branches:
- main

jobs:
build_docs:
name: Build Docs
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- uses: ./.github/actions/setup-nodejs

- uses: ./.github/actions/setup-pnpm

- name: Build Docs
run: pnpm build

- name: Fix permissions
run: |
chmod -c -R +rX "build/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: build/

deploy_docs:
name: Deploy Docs
runs-on: ubuntu-latest
needs: build_docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.docusaurus/
build/
node_modules/

pnpm-lock.yaml
.DS_Store
**/.DS_Store
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid"
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hadronous Labs

For all things Hadronous...
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
4 changes: 4 additions & 0 deletions docs/candid/01-style-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Candid Style Guide
description: A style guide for writing Candid interfaces for Internet Computer canisters.
---
4 changes: 4 additions & 0 deletions docs/rust/01-design-patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Rust Design Patterns
description: A collection of design patterns for building Internet Computer canisters with Rust.
---
73 changes: 73 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
title: 'Hadronous Labs',
tagline: 'Building decentralized software for the future',
favicon: 'img/favicon.ico',
url: 'https://hadronous.github.io',
baseUrl: '/',
organizationName: 'hadronous',
projectName: 'hadronous.github.io',

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],

themeConfig: {
colorMode: {
respectPrefersColorScheme: true,
},
navbar: {
title: 'Hadronous Labs',
items: [
{
type: 'docSidebar',
sidebarId: 'candidSidebar',
position: 'left',
label: 'Candid',
},
{
type: 'docSidebar',
sidebarId: 'rustSidebar',
position: 'left',
label: 'Rust',
},
{
href: 'https://github.com/hadronous/hadronous.github.io',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [],
copyright: `Copyright © ${new Date().getFullYear()} Hadronous Labs.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};

export default config;
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "hadronous-labs",
"private": true,
"packageManager": "pnpm@8.13.1",
"engines": {
"node": "^20",
"pnpm": "^8",
"npm": "please use pnpm"
},
"scripts": {
"start": "docusaurus start",
"build": "tsc && docusaurus build",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"dependencies": {
"@docusaurus/core": "3.0.1",
"@docusaurus/preset-classic": "3.0.1",
"@docusaurus/theme-classic": "3.0.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.1",
"@docusaurus/tsconfig": "3.0.1",
"@docusaurus/types": "3.0.1",
"@types/node": "^20.10.6",
"prettier": "^3.1.1",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
}
}
Loading

0 comments on commit bea976c

Please sign in to comment.