Skip to content

Commit 786cb2b

Browse files
authored
Merge pull request #16 from crashmax-dev/gm-types
feat: added more built-in GM_* APIs
2 parents bc5ba1b + b552105 commit 786cb2b

File tree

15 files changed

+805
-39
lines changed

15 files changed

+805
-39
lines changed

examples/basic/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ import './styles/style.sass'
44

55
const div = document.querySelector('div')!
66
div.appendChild(createButton())
7-
8-
GM_addStyle('')

examples/basic/src/vite-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/// <reference types="vite/client" />
2-
/// <reference types="vite-userscript-plugin/tampermonkey" />
2+
/// <reference types="vite-userscript-plugin/types/tampermonkey" />

examples/jsx/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount, unmount } from 'redom-jsx'
22
import type { RedomComponent, RedomEl } from 'redom-jsx'
3-
import { Counter } from './Counter.jsx'
3+
import { Counter } from './Counter.js'
44

55
export class App implements RedomComponent {
66
el: RedomEl

examples/jsx/src/Toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RedomComponent, RedomEl } from 'redom-jsx'
2-
import { Heading } from './Heading.jsx'
2+
import { Heading } from './Heading.js'
33

44
export class Toggle implements RedomComponent {
55
el: RedomEl

examples/jsx/src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { mount } from 'redom-jsx'
2-
import { App } from './App.jsx'
3-
import { List } from './List.jsx'
4-
import { Toggle } from './Toggle.jsx'
2+
import { App } from './App.js'
3+
import { List } from './List.js'
4+
import { Toggle } from './Toggle.js'
55

66
mount(document.body, <App />)
77
mount(document.body, <Toggle />)

examples/jsx/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": "dist",
55
"jsx": "preserve",
66
"types": [
7-
"vite-userscript-plugin/tampermonkey"
7+
"vite-userscript-plugin/types/tampermonkey"
88
]
99
},
1010
"include": [

examples/reatom

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"files": [
1313
"dist",
14-
"tampermonkey.d.ts"
14+
"types"
1515
],
1616
"scripts": {
1717
"dev": "tsup --watch",
@@ -58,13 +58,13 @@
5858
"@types/node": "^18.7.18",
5959
"@types/serve-handler": "^6.1.1",
6060
"@types/websocket": "^1.0.5",
61-
"@vitest/ui": "^0.23.2",
61+
"@vitest/ui": "^0.23.4",
6262
"tsup": "^6.2.3",
6363
"turbo": "^1.4.7",
6464
"typescript": "^4.8.3",
6565
"vite": "^3.1.2",
6666
"vite-plugin-dts": "^1.5.0",
67-
"vitest": "^0.23.2"
67+
"vitest": "^0.23.4"
6868
},
6969
"peerDependencies": {
7070
"vite": ">=2.9.0"

pnpm-lock.yaml

Lines changed: 79 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Grants } from './types.js'
22

3-
export const regexpScripts = new RegExp(/.(t|j)sx?/)
4-
export const regexpStyles = new RegExp(/\.(s?css|sass)$/)
3+
export const regexpScripts = new RegExp(/\.(t|j)sx?$/)
4+
export const regexpStyles = new RegExp(/\.(s[ac]|c|le)ss$/)
55

66
export const GM = [
77
'setValue',

0 commit comments

Comments
 (0)