Skip to content

Commit

Permalink
🔧 chore(config): update $state paths, remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlifton committed May 26, 2024
1 parent 57667d1 commit b6fba6d
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 83 deletions.
55 changes: 16 additions & 39 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export default defineConfig({
// prefetch: true,
integrations: [
customImageResizer,
expressiveCode(),
expressiveCode(
{ themes: ["dracula", "solarized-light"] },
),
mdx(),
sitemap(),
tailwind({
Expand All @@ -55,46 +57,21 @@ export default defineConfig({
remarkPlugins: [
// @ts-expect-error - This is a valid plugin that returns a Transformer,
// but the type definition is not compatible with the expected [unified.Plugin, string[]] type.
[
remarkShakuCodeAnnotate,
{
fallbackToShiki: true,
theme: "material-theme-darker",
langs: [
"bash",
"fish",
"go",
"html",
"javascript",
"json",
"jsonc",
"jsx",
"lua",
"ruby",
"sh",
"ts",
"ts",
"tsx",
"typescript",
"vim",
"yaml",
"toml",
"rb",
"yml",
],
},
],
],
rehypePlugins: [
[
rehypeAutolinkHeadings,
{
behavior: "append",
},
],
[remarkShakuCodeAnnotate, {
fallbackToShiki: true,
theme: "material-theme-darker",
// dprint-ignore
langs: [ "bash", "fish", "go", "html", "javascript", "json", "jsonc", "jsx", "lua", "ruby", "sh", "ts", "ts", "tsx", "typescript", "vim", "yaml", "toml", "rb", "yml" ],
}],
],
rehypePlugins: [[
rehypeAutolinkHeadings,
{
behavior: "append",
},
]],
shikiConfig: {
theme: "material-theme-darker",
theme: "tokyo-night",
transformers: [
transformerNotationDiff(),
transformerNotationHighlight(),
Expand Down
11 changes: 0 additions & 11 deletions bin/copy-shiki-theme.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "node ./bin/copy-shiki-theme.mjs && astro check && astro build",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"create-db": "node --env-file=.env bin/create-db",
Expand Down
2 changes: 1 addition & 1 deletion src/components/LatestCodeList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ for (const post of livePosts) {
}
</div>
<script>
import { isPaused, scrollDone, scrollLeft, currentIndex } from "$state/index";
import { isPaused, scrollDone, scrollLeft, currentIndex } from "$state";

const activeTransitionsEnabled = false
const initialDelay = 1750;
Expand Down
2 changes: 1 addition & 1 deletion src/components/LatestCodeScroller.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isPaused, scrollDone, scrollLeft } from "$state/index";
import { isPaused, scrollDone, scrollLeft } from "$state";
import { useStore } from "@nanostores/react";
import { type AnimationPlaybackControls, useAnimate } from "framer-motion";
import { type FC, useEffect, useRef } from "react";
Expand Down
2 changes: 1 addition & 1 deletion src/components/TOC.astro
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if (minimumDepth > 1) {
</script>

<script>
import { activeHeading } from "$state/index";
import { activeHeading } from "$state";
const getHeadingsInBlogPost = (blogPost: HTMLElement) => {
return blogPost?.querySelectorAll(
"h1:not(#title), h2, h3:not(#admonition-title), h4, h4, h6",
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/PlayPause.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Pause from "$/icons/tabler/pause.svg?react";
// @ts-ignore
import PauseFilled from "$/icons/tabler/pause-filled.svg?react";
import Styles from "$components/styles/PlayPause.module.css";
import { isManuallyPaused, isPaused } from "$state/index";
import { isManuallyPaused, isPaused } from "$state";
import clsx from "clsx";

interface Props extends PropsWithChildren {
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/TOCIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { activeHeading, lastActiveHeading } from "$state/index";
import { activeHeading, lastActiveHeading } from "$state";
import {
motion,
useAnimate,
Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/creating-a-notepad-in-neovim.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ a window with that buffer, and then assign keymaps local to that buffer.

## Creating a buffer

```lua
```lua {1, 4, 7-8}
local M = {}
M.notepad_loaded = false
M.notepad_buf, M.notepad_win = nil, nil
Expand Down
2 changes: 1 addition & 1 deletion src/util/useWindowSize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { windowWidth } from "$state/index";
import { windowWidth } from "$state";

const useWindowSize = () => {
const resizeObserver = new ResizeObserver((e: ResizeObserverEntry[]) => {
Expand Down
51 changes: 26 additions & 25 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": "./",
"paths": {
"$/*": ["./src/*"],
"$api/*": ["./src/pages/api/*"],
"$util/*": ["./src/util/*"],
"$components/*": ["./src/components/*"],
"$state/*": ["./src/components/state/*"],
"$layouts/*": ["./src/layouts/*"],
"$prisma/*": ["./prisma/*"],
"$services/*": ["./src/services/*"],
"$rpc/*": ["./rpc-server/*"]
},
"jsx": "react-jsx",
"esModuleInterop": true
},
"include": ["src/**/*", "plugins", "scripts", "tests"],
"exclude": [
"src/components/devicons",
"src/tmpscripts",
"src/tmp",
"src/test",
"src/tests"
]
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": "./",
"paths": {
"$/*": ["./src/*"],
"$api/*": ["./src/pages/api/*"],
"$util/*": ["./src/util/*"],
"$components/*": ["./src/components/*"],
"$state": ["./src/components/state"],
"$state/*": ["./src/components/state/*"],
"$layouts/*": ["./src/layouts/*"],
"$prisma/*": ["./prisma/*"],
"$services/*": ["./src/services/*"],
"$rpc/*": ["./rpc-server/*"]
},
"jsx": "react-jsx",
"esModuleInterop": true
},
"include": ["src/**/*", "plugins", "scripts", "tests"],
"exclude": [
"src/components/devicons",
"src/tmpscripts",
"src/tmp",
"src/test",
"src/tests"
]
}

0 comments on commit b6fba6d

Please sign in to comment.