Skip to content

Commit

Permalink
13.0.0: improve site and deployment, add /robots.txt and /rss.xml
Browse files Browse the repository at this point in the history
… paths, add Nix flake
  • Loading branch information
auguwu committed Feb 4, 2024
1 parent 86f28fd commit d72b2e9
Show file tree
Hide file tree
Showing 50 changed files with 1,215 additions and 1,530 deletions.
35 changes: 35 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro
# Copyright (c) 2018-2024 Noel Towa <[email protected]>
#
# 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.

if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
fi

# make .direnv if it doesn't exist
mkdir -p "$(direnv_layout_dir)"

watch_file shell.nix
watch_file flake.nix # as outputs can change at anytime
watch_file flake.lock

# try to use flakes, if it fails use normal nix (ie. shell.nix)
use flake || use nix
eval "$shellHook"
36 changes: 0 additions & 36 deletions .eslintrc.json

This file was deleted.

21 changes: 9 additions & 12 deletions .github/workflows/ESLint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro
# Copyright (c) 2018-2023 Noel Towa <[email protected]>
# Copyright (c) 2018-2024 Noel Towa <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -54,17 +54,14 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Uses Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Setup Yarn and node-modules cache
id: yarn-cache
uses: auguwu/[email protected]
- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: yarn install --immutable
run: bun install

- name: Format project
run: bun fmt

- name: Lint project with ESLint
run: yarn lint
- name: Lint with ESLint
run: bun lint
2 changes: 1 addition & 1 deletion .github/workflows/Publish.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro
# Copyright (c) 2018-2023 Noel Towa <[email protected]>
# Copyright (c) 2018-2024 Noel Towa <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,4 @@ FodyWeavers.xsd
# Additional files built by Visual Studio

.astro/
.vercel/
server/.yarn/*.gz
server/.yarn/cache/
.yarn/cache/
!.yarn/releases/
.direnv/
12 changes: 10 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"editor.tabSize": 4,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.experimental.useFlatConfig": true,
"eslint.validate": ["javascript", "typescript", "astro"],
"css.lint.unknownAtRules": "ignore",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[astro]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.0.cjs

This file was deleted.

7 changes: 0 additions & 7 deletions .yarnrc.yml

This file was deleted.

22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro
# Copyright (c) 2018-2023 Noel Towa <[email protected]>
# Copyright (c) 2018-2024 Noel Towa <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,24 +19,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

FROM node:20.11.0-alpine3.18 AS build
FROM oven/bun:1.0-alpine AS build

RUN apk update && apk add --no-cache git ca-certificates
RUN apk update
WORKDIR /build

COPY .yarn /build/.yarn
COPY package.json .
COPY .yarnrc.yml .
COPY yarn.lock .
COPY bun.lockb .

RUN yarn install --immutable
RUN bun install --frozen-lockfile

COPY . .
RUN yarn build
RUN bun run build

FROM node:20.11.0-alpine3.18
FROM oven/bun:1.0-alpine

RUN apk update && apk add --no-cache ca-certificates bash tini curl
RUN apk update && apk add --no-cache bash tini curl
WORKDIR /app/noel/site

COPY --from=build /build/node_modules /app/noel/site/node_modules
Expand All @@ -46,8 +44,8 @@ RUN addgroup -g 1001 noel && \
adduser -DSH -u 1001 -G noel noel && \
chown -R noel:noel /app/noel/site

EXPOSE 3000
EXPOSE 4321

USER noel
ENTRYPOINT ["tini", "-s"]
CMD ["node", "dist/server/entry.mjs"]
CMD ["bun", "dist/server/entry.mjs"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT LICENSE

Copyright (c) 2018-2023 Noel Towa <[email protected]>
Copyright (c) 2018-2024 Noel Towa <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 9 additions & 13 deletions astro.config.mjs → astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro
* Copyright (c) 2018-2023 Noel Towa <[email protected]>
* Copyright (c) 2018-2024 Noel Towa <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,27 +21,23 @@
* SOFTWARE.
*/

// @ts-check

import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import sitemap from '@astrojs/sitemap';
import twemoji from 'remark-twemoji';
import node from '@astrojs/node';
import mdx from '@astrojs/mdx';

import remarkTwemoji from 'remark-twemoji';
import icon from 'astro-icon';

export default defineConfig({
integrations: [mdx(), tailwind()],
site: 'https://floofy.dev',
integrations: [tailwind(), sitemap(), icon()],
adapter: node({ mode: 'standalone' }),
output: 'server',
adapter: node({
mode: 'standalone'
}),
site: 'https://floofy.dev',
markdown: {
remarkPlugins: [remarkTwemoji],
remarkPlugins: [twemoji],
syntaxHighlight: 'shiki',
shikiConfig: {
theme: 'rose-pine',
theme: 'poimandres',
wrap: true
}
}
Expand Down
Binary file added bun.lockb
Binary file not shown.
21 changes: 21 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro
# Copyright (c) 2018-2024 Noel Towa <[email protected]>
#
# 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.
{}
77 changes: 77 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro
* Copyright (c) 2018-2024 Noel Towa <[email protected]>
*
* 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.
*/

import * as astroParser from 'astro-eslint-parser';
import astro from 'eslint-plugin-astro';
import { fileURLToPath } from 'url';

// Node (`ESLINT_FLAT_CONFIG=1 npx eslint`):
// > import('@augu/eslint-config'):
// [Module: null prototype] {
// default: {
// default: [Getter],
// javascript: [Getter],
// perfectionist: [Getter],
// typescript: [Getter],
// vue: [Getter]
// },
// javascript: [Function: javascript],
// perfectionist: [AsyncFunction: perfectionist],
// typescript: [AsyncFunction: typescript],
// vue: [AsyncFunction: vue]
// }
//
// Bun:
// > bun run lint
// Module {
// default: [Function: noel],
// javascript: [Function: javascript],
// perfectionist: [Function: perfectionist],
// typescript: [Function: typescript],
// vue: [Function: vue],
// }
const noel = await import('@augu/eslint-config').then((mod) =>
typeof Bun !== 'undefined' ? mod.default : mod.default.default
);

const configs = await noel({
perfectionist: true,
typescript: {
tsconfig: fileURLToPath(new URL('.', import.meta.url))
}
});

// TODO(@auguwu): add this in @augu/eslint-config
configs.push({
ignores: ['**/*.astro']
// languageOptions: {
// parser: astroParser,
// sourceType: 'module'
// },
// plugins: {
// astro
// },
// rules: astro.configs.recommended.rules
});

export default configs;
Loading

0 comments on commit d72b2e9

Please sign in to comment.