Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
don't bundle themes, and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
12944qwerty committed Aug 2, 2023
1 parent 584f0ff commit cf916a3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 290 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
themes/
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"discordID": "499400512559382538",
"github": "12944qwerty"
},
"version": "0.2.1",
"version": "0.2.2",
"updater": {
"type": "store",
"id": "dev.kingfish.BetterCodeblocks"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "better-codeblocks",
"version": "0.2.1",
"version": "0.2.2",
"description": "Improves the codeblocks",
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8.0.0"
},
"scripts": {
"build": "node scripts/creplugged.mjs build",
"watch": "node scripts/creplugged.mjs build --watch",
"bundle": "node scripts/creplugged.mjs bundle",
"build": "replugged build plugin",
"watch": "replugged build plugin --watch",
"bundle": "replugged bundle plugin",
"check": "tsc --noEmit",
"prettier:check": "prettier ./src --check",
"eslint:check": "eslint ./src",
Expand Down
277 changes: 0 additions & 277 deletions scripts/creplugged.mjs

This file was deleted.

6 changes: 2 additions & 4 deletions src/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { components, plugins } from "replugged";
import { components } from "replugged";
import { cfg } from ".";

import themes from "./themes.json";
Expand Down Expand Up @@ -33,9 +33,7 @@ export function Settings(): React.ReactElement {

const themeStylesheet = document.getElementById("hljs-theme") as HTMLLinkElement;
if (themeStylesheet)
themeStylesheet.href = `replugged://plugin/${
plugins.plugins.get("dev.kingfish.BetterCodeblocks")!.path
}/themes/${theme}.min.css`;
themeStylesheet.href = `https://cdn.jsdelivr.net/gh/qwerty-mods/better-codeblocks@master/src/themes/${theme}.min.css`;
}}
isSelected={(theme) => cfg.get("theme") === theme}>
Preferred Theme
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injector, common, components, plugins, settings } from "replugged";
import { Injector, common, components, settings } from "replugged";
import Codeblock from "./Codeblock";

const { parser, React } = common;
Expand All @@ -21,9 +21,9 @@ export function start(): void {
const themeStylesheet = document.createElement("link");
themeStylesheet.rel = "stylesheet";
themeStylesheet.id = "hljs-theme";
themeStylesheet.href = `replugged://plugin/${
plugins.plugins.get("dev.kingfish.BetterCodeblocks")!.path
}/themes/${cfg.get("theme")}.css`;
themeStylesheet.href = `https://cdn.jsdelivr.net/gh/qwerty-mods/better-codeblocks@master/src/themes/${cfg.get(
"theme",
)}.min.css`;
document.head.appendChild(themeStylesheet);

injector.after(parser.defaultRules.codeBlock, "react", (args, _) => {
Expand Down

0 comments on commit cf916a3

Please sign in to comment.