Skip to content

Commit 06a7b82

Browse files
committed
Add astro config files.
1 parent 2c8d89e commit 06a7b82

11 files changed

+262
-4
lines changed

.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.husky
2+
.vscode
3+
node_modules
4+
public
5+
static
6+
new
7+
dist
8+
.yarn

.eslintrc.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
es2022: true,
5+
browser: true,
6+
},
7+
extends: ["eslint:recommended", "plugin:astro/recommended"],
8+
parserOptions: {
9+
ecmaVersion: "latest",
10+
sourceType: "module",
11+
},
12+
overrides: [
13+
{
14+
files: ["*.astro"],
15+
parser: "astro-eslint-parser",
16+
parserOptions: {
17+
parser: "@typescript-eslint/parser",
18+
extraFileExtensions: [".astro"],
19+
},
20+
rules: {},
21+
},
22+
],
23+
};

.gitignore

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
11
# Created by .ignore support plugin (hsz.mobi)
2+
3+
# build output
4+
dist/
5+
.output/
6+
docs/
7+
new/
8+
9+
# jetbrains
10+
.idea/*
11+
/*.iml
12+
13+
# dependencies
14+
node_modules/
15+
.husky
16+
17+
# logs
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
pnpm-debug.log*
22+
23+
# environment variables
24+
.env
25+
.env.production
26+
27+
# macOS-specific files
28+
.DS_Store
29+
30+
# ignore .astro directory
31+
.astro
32+
33+
# ignore Jampack cache files
34+
.jampack/
35+
36+
# yarn
37+
.yarn/*
38+
!.yarn/patches
39+
!.yarn/plugins
40+
!.yarn/releases
41+
!.yarn/sdks
42+
!.yarn/versions
43+
.pnp.*
44+
245
### JetBrains template
346
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
447
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
@@ -156,18 +199,15 @@ typings/
156199

157200
# gatsby files
158201
.cache/
159-
/public/
160202

161203
# Mac files
162204
.DS_Store
163205
/package-lock.json
164206
/hide/
165207
/.idea/
166-
/public/
167208
gatsby-starter-blog/
168209

169210
# hugo excludes
170211
.hugo_build.lock
171212
go.sum
172-
themes/*
173-
public/*
213+
themes/*

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD033": false,
3+
"MD013": false
4+
}

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Expose Astro dependencies for `pnpm` users
2+
shamefully-hoist=true

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Ignore everything
2+
/*
3+
4+
# Except these files & folders
5+
!/src
6+
!/publix
7+
!/.github
8+
!tsconfig.json
9+
!astro.config.ts
10+
!package.json
11+
!.prettierrc
12+
!.eslintrc.js
13+
!README.md

.prettierrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"arrowParens": "avoid",
3+
"semi": true,
4+
"tabWidth": 2,
5+
"printWidth": 80,
6+
"singleQuote": false,
7+
"jsxSingleQuote": false,
8+
"trailingComma": "es5",
9+
"bracketSpacing": true,
10+
"endOfLine": "lf",
11+
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
12+
"overrides": [
13+
{
14+
"files": "*.astro",
15+
"options": {
16+
"parser": "astro"
17+
}
18+
}
19+
]
20+
}

astro.config.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { defineConfig } from "astro/config";
2+
import tailwind from "@astrojs/tailwind";
3+
import react from "@astrojs/react";
4+
import remarkToc from "remark-toc";
5+
import remarkCollapse from "remark-collapse";
6+
import sitemap from "@astrojs/sitemap";
7+
8+
// https://astro.build/config
9+
export default defineConfig({
10+
// https://docs.astro.build/en/reference/configuration-reference/#site
11+
// see https://config.tips/c/astro/dynamic-astro-site-value/
12+
site: import.meta.env.DEV ? "http://localhost:4321" : 'https://emeraldjava.github.io/',
13+
// See https://github.com/withastro/astro/issues/5512
14+
// https://docs.astro.build/en/guides/environment-variables/
15+
// https://vitejs.dev/guide/env-and-mode.html#env-files
16+
//base: import.meta.env.DEV ? "." : "/emeraldjava-astro",
17+
//base: import.meta.env.VITE_BASE,
18+
integrations: [
19+
tailwind({
20+
applyBaseStyles: true,
21+
}),
22+
react(),
23+
sitemap(),
24+
],
25+
markdown: {
26+
remarkPlugins: [
27+
remarkToc,
28+
[
29+
remarkCollapse,
30+
{
31+
test: "Table of contents",
32+
},
33+
],
34+
],
35+
// shikiConfig: {
36+
// theme: "one-dark-pro",
37+
// wrap: true,
38+
// },
39+
},
40+
vite: {
41+
// build: {
42+
// rollupOptions: {
43+
// output: {
44+
// entryFileNames: '[name]-[hash].js',
45+
// }
46+
// }
47+
// },
48+
optimizeDeps: {
49+
exclude: ["@resvg/resvg-js"],
50+
},
51+
},
52+
scopedStyleStrategy: "where",
53+
// https://about.gitlab.com/blog/2022/10/24/publishing-an-astro-site-with-pages/
54+
// GitLab Pages requires exposed files to be located in a folder called "public".
55+
// So we're instructing Astro to put the static build output in a folder of that name.
56+
outDir: './dist'
57+
});

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3'
2+
3+
services:
4+
app:
5+
image: node:18
6+
ports:
7+
- 4321:4321
8+
working_dir: /app
9+
command: npm run dev -- --host 0.0.0.0
10+
volumes:
11+
- ./:/app

package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "emeraldjava.github.io",
3+
"version": "2024.6.6",
4+
"scripts": {
5+
"dev": "astro dev",
6+
"start": "astro dev",
7+
"build": "astro check && astro build",
8+
"preview": "astro preview",
9+
"sync": "astro sync",
10+
"astro": "astro",
11+
"format:check": "prettier --check . --plugin=prettier-plugin-astro",
12+
"format": "prettier --write . --plugin=prettier-plugin-astro",
13+
"cz": "cz",
14+
"prepare": "husky install",
15+
"lint": "eslint ."
16+
},
17+
"dependencies": {
18+
"@astrojs/check": "^0.5.10",
19+
"@astrojs/rss": "^4.0.2",
20+
"@resvg/resvg-js": "^2.6.0",
21+
"astro": "^4.2.1",
22+
"cross-env": "^7.0.3",
23+
"fuse.js": "^7.0.0",
24+
"github-slugger": "^2.0.0",
25+
"remark-collapse": "^0.1.2",
26+
"remark-toc": "^9.0.0",
27+
"satori": "^0.10.11",
28+
"tailwindcss": "^3.4.1",
29+
"typescript": "^5.4.5"
30+
},
31+
"devDependencies": {
32+
"@astrojs/react": "^3.0.9",
33+
"@astrojs/sitemap": "^3.0.5",
34+
"@astrojs/tailwind": "^5.1.0",
35+
"@divriots/jampack": "^0.23.2",
36+
"@tailwindcss/typography": "^0.5.10",
37+
"@types/github-slugger": "^1.3.0",
38+
"@types/react": "^18.2.48",
39+
"@typescript-eslint/parser": "^6.19.0",
40+
"astro-eslint-parser": "^0.16.2",
41+
"commitizen": "^4.3.0",
42+
"cz-conventional-changelog": "^3.3.0",
43+
"eslint": "^8.56.0",
44+
"eslint-plugin-astro": "^0.31.3",
45+
"husky": "^8.0.3",
46+
"lint-staged": "^15.2.0",
47+
"prettier": "^3.2.4",
48+
"prettier-plugin-astro": "^0.13.0",
49+
"prettier-plugin-tailwindcss": "^0.5.11",
50+
"react": "^18.2.0",
51+
"react-dom": "^18.2.0"
52+
},
53+
"config": {
54+
"commitizen": {
55+
"path": "./node_modules/cz-conventional-changelog"
56+
}
57+
},
58+
"lint-staged": {
59+
"*.{js,jsx,ts,tsx,md,mdx,json,astro}": [
60+
"prettier --write --plugin=prettier-plugin-astro"
61+
]
62+
}
63+
}

tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "astro/tsconfigs/strict",
3+
"compilerOptions": {
4+
"baseUrl": "src",
5+
"jsx": "react-jsx",
6+
"paths": {
7+
"@assets/*": ["assets/*"],
8+
"@config": ["config.ts"],
9+
"@components/*": ["components/*"],
10+
"@content/*": ["content/*"],
11+
"@layouts/*": ["layouts/*"],
12+
"@pages/*": ["pages/*"],
13+
"@styles/*": ["styles/*"],
14+
"@utils/*": ["utils/*"],
15+
},
16+
},
17+
}

0 commit comments

Comments
 (0)