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

Commit cf916a3

Browse files
committed
don't bundle themes, and lint
1 parent 584f0ff commit cf916a3

File tree

6 files changed

+12
-290
lines changed

6 files changed

+12
-290
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
themes/

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"discordID": "499400512559382538",
88
"github": "12944qwerty"
99
},
10-
"version": "0.2.1",
10+
"version": "0.2.2",
1111
"updater": {
1212
"type": "store",
1313
"id": "dev.kingfish.BetterCodeblocks"

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "better-codeblocks",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Improves the codeblocks",
55
"engines": {
66
"node": ">=18.0.0",
77
"pnpm": ">=8.0.0"
88
},
99
"scripts": {
10-
"build": "node scripts/creplugged.mjs build",
11-
"watch": "node scripts/creplugged.mjs build --watch",
12-
"bundle": "node scripts/creplugged.mjs bundle",
10+
"build": "replugged build plugin",
11+
"watch": "replugged build plugin --watch",
12+
"bundle": "replugged bundle plugin",
1313
"check": "tsc --noEmit",
1414
"prettier:check": "prettier ./src --check",
1515
"eslint:check": "eslint ./src",

scripts/creplugged.mjs

Lines changed: 0 additions & 277 deletions
This file was deleted.

src/Settings.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { components, plugins } from "replugged";
1+
import { components } from "replugged";
22
import { cfg } from ".";
33

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

3434
const themeStylesheet = document.getElementById("hljs-theme") as HTMLLinkElement;
3535
if (themeStylesheet)
36-
themeStylesheet.href = `replugged://plugin/${
37-
plugins.plugins.get("dev.kingfish.BetterCodeblocks")!.path
38-
}/themes/${theme}.min.css`;
36+
themeStylesheet.href = `https://cdn.jsdelivr.net/gh/qwerty-mods/better-codeblocks@master/src/themes/${theme}.min.css`;
3937
}}
4038
isSelected={(theme) => cfg.get("theme") === theme}>
4139
Preferred Theme

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injector, common, components, plugins, settings } from "replugged";
1+
import { Injector, common, components, settings } from "replugged";
22
import Codeblock from "./Codeblock";
33

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

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

0 commit comments

Comments
 (0)