Skip to content

Commit dc59213

Browse files
committed
Rename stuff to ada case
1 parent a529425 commit dc59213

File tree

7 files changed

+36
-37
lines changed

7 files changed

+36
-37
lines changed

extension/src/background.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ It has to coordinate the communication between the different scripts based on th
99
import {assert} from '@solid-devtools/shared/utils'
1010

1111
import {
12-
Place_Name, ConnectionName, type Port,
13-
type DetectionState, type Versions, type Message,
12+
Place_Name, Connection_Name, type Port,
13+
type Detection_State, type Versions, type Message,
1414
port_on_message, port_post_message, port_post_message_obj,
1515
place_error, place_log,
1616
ICONS_BLUE, ICONS_GRAY,
@@ -58,7 +58,7 @@ type Script_Devtools = {
5858
type Script_Content = {
5959
tab_id: Tab_Id
6060
port: Port
61-
detection: DetectionState | null
61+
detection: Detection_State | null
6262
versions: Versions | null
6363
}
6464

@@ -102,7 +102,7 @@ function on_connected(port: Port) {
102102
place_log(Place_Name.Background, 'Port connected', port)
103103

104104
switch (port.name) {
105-
case ConnectionName.Popup: {
105+
case Connection_Name.Popup: {
106106
popup = {port}
107107

108108
let content = script_content_map.get(active_tab_id)
@@ -113,7 +113,7 @@ function on_connected(port: Port) {
113113

114114
break
115115
}
116-
case ConnectionName.Content: {
116+
case Connection_Name.Content: {
117117
let tab_id = get_assert_tab_id(port, Place_Name.Content)
118118

119119
let content: Script_Content = {
@@ -132,7 +132,7 @@ function on_connected(port: Port) {
132132

133133
break
134134
}
135-
case ConnectionName.Devtools: {
135+
case Connection_Name.Devtools: {
136136

137137
let devtools: Script_Devtools = {port, tab_id: active_tab_id}
138138
script_devtools_map.set(active_tab_id, devtools)
@@ -144,7 +144,7 @@ function on_connected(port: Port) {
144144

145145
break
146146
}
147-
case ConnectionName.Panel: {
147+
case Connection_Name.Panel: {
148148

149149
let panel: Script_Panel = {port, tab_id: active_tab_id}
150150
script_panel_map.set(active_tab_id, panel)
@@ -167,11 +167,11 @@ function on_disconnected(port: Port) {
167167
place_log(Place_Name.Background, 'Port disconnected', port)
168168

169169
switch (port.name) {
170-
case ConnectionName.Popup: {
170+
case Connection_Name.Popup: {
171171
popup = undefined
172172
break
173173
}
174-
case ConnectionName.Content: {
174+
case Connection_Name.Content: {
175175
let tab_id = get_assert_tab_id(port, Place_Name.Content)
176176

177177
let content = script_content_map.get(tab_id)!
@@ -202,7 +202,7 @@ function on_disconnected(port: Port) {
202202

203203
break
204204
}
205-
case ConnectionName.Devtools: {
205+
case Connection_Name.Devtools: {
206206
script_devtools_map.delete(active_tab_id)
207207

208208
let content = script_content_map.get(active_tab_id)
@@ -212,7 +212,7 @@ function on_disconnected(port: Port) {
212212

213213
break
214214
}
215-
case ConnectionName.Panel: {
215+
case Connection_Name.Panel: {
216216
script_panel_map.delete(active_tab_id)
217217

218218
let content = script_content_map.get(active_tab_id)
@@ -230,10 +230,10 @@ function on_message(port: Port, e: Message) {
230230
DEV: {place_log(Place_Name.Background, 'Message', e, 'from', port)}
231231

232232
switch (port.name) {
233-
case ConnectionName.Popup: {
233+
case Connection_Name.Popup: {
234234
break
235235
}
236-
case ConnectionName.Content: {
236+
case Connection_Name.Content: {
237237
let tab_id = get_assert_tab_id(port, Place_Name.Content)
238238

239239
let content = script_content_map.get(tab_id)
@@ -282,10 +282,10 @@ function on_message(port: Port, e: Message) {
282282

283283
break
284284
}
285-
case ConnectionName.Devtools: {
285+
case Connection_Name.Devtools: {
286286
break
287287
}
288-
case ConnectionName.Panel: {
288+
case Connection_Name.Panel: {
289289

290290
// Forward all messages to Content
291291
let content = script_content_map.get(active_tab_id)

extension/src/content.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ This script is injected into every page and is responsible for:
1010
*/
1111

1212
import {
13-
Place_Name, ConnectionName,
13+
Place_Name, Connection_Name,
1414
port_on_message, port_post_message_obj, port_post_message,
1515
window_post_message_obj, window_on_message, window_post_message,
1616
place_error, place_log,
17-
type Message, type Versions, type DetectionState,
17+
type Message, type Versions, type Detection_State,
1818
} from './shared.ts'
1919

2020
// @ts-expect-error ?script&module query ensures output in ES module format and only import the script path
@@ -68,7 +68,7 @@ let versions: Versions = {
6868
extension: chrome.runtime.getManifest().version,
6969
client_expected: import.meta.env.EXPECTED_CLIENT,
7070
}
71-
let detection: DetectionState | null = null
71+
let detection: Detection_State | null = null
7272

7373
let connecting = false
7474
function connect_port() {
@@ -78,7 +78,7 @@ function connect_port() {
7878
DEV: {place_log(Place_Name.Content, 'Attempting to connect port...')}
7979

8080
try {
81-
let new_port = chrome.runtime.connect({name: ConnectionName.Content})
81+
let new_port = chrome.runtime.connect({name: Connection_Name.Content})
8282
bg_port = new_port
8383
DEV: {place_log(Place_Name.Content, 'Port connected successfully')}
8484

extension/src/devtools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It connects to the background script.
88
*/
99

1010
import {
11-
Place_Name, ConnectionName, port_on_message, ICON_OUTLINE_32,
11+
Place_Name, Connection_Name, port_on_message, ICON_OUTLINE_32,
1212
place_error, place_log,
1313
} from './shared.ts'
1414

@@ -17,7 +17,7 @@ place_log(Place_Name.Devtools, 'loaded.')
1717

1818

1919
// Create a connection to the background page
20-
const port = chrome.runtime.connect({name: ConnectionName.Devtools})
20+
const port = chrome.runtime.connect({name: Connection_Name.Devtools})
2121

2222
// Firefox requires absolute path
2323
const PATH_PREFIX = import.meta.env.BROWSER === 'firefox' ? '/' : ''

extension/src/panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as frontend from '@solid-devtools/frontend'
88
import * as debug from '@solid-devtools/debugger/types'
99

1010
import {
11-
ConnectionName, Place_Name, port_on_message, port_post_message_obj,
11+
Connection_Name, Place_Name, port_on_message, port_post_message_obj,
1212
place_log, place_error, place_warn,
1313
type Message, type Versions,
1414
} from './shared.ts'
@@ -58,7 +58,7 @@ function App() {
5858
place_log(Place_Name.Panel, 'Attempting to connect port...')
5959

6060
try {
61-
let new_port = chrome.runtime.connect({name: ConnectionName.Panel})
61+
let new_port = chrome.runtime.connect({name: Connection_Name.Panel})
6262
setPort(new_port)
6363
place_log(Place_Name.Panel, 'Port connected successfully')
6464

extension/src/popup.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import * as s from 'solid-js'
44
import {render} from 'solid-js/web'
55

66
import {
7-
ConnectionName, Place_Name, port_on_message,
7+
Connection_Name, Place_Name, port_on_message,
88
place_log,
9-
type DetectionState, type Versions,
9+
type Detection_State, type Versions,
1010
} from './shared.ts'
1111

1212
import './popup.css'
1313

1414
place_log(Place_Name.Popup, 'loaded.')
1515

1616
// Create a connection to the background page
17-
const port = chrome.runtime.connect({name: ConnectionName.Popup})
17+
const port = chrome.runtime.connect({name: Connection_Name.Popup})
1818

1919
const [versions, setVersions] = s.createSignal<Versions | null>(null)
20-
const empty_detection_state: DetectionState = {
20+
const empty_detection_state: Detection_State = {
2121
solid: false,
2222
solid_dev: false,
2323
setup: false,

extension/src/real_world.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import * as detect from '@solid-devtools/shared/detect'
1313

1414
import {
15-
Place_Name, type DetectionState,
15+
Place_Name, type Detection_State,
1616
window_post_message, window_on_message, window_post_message_obj,
1717
place_log, place_warn,
1818
} from './shared.ts'
@@ -22,7 +22,7 @@ DEV: {place_log(Place_Name.Detector_Real_World, 'loaded.')}
2222

2323
function main() {
2424

25-
const detect_state: DetectionState = {
25+
const detect_state: Detection_State = {
2626
solid: false,
2727
solid_dev: false,
2828
setup: false,
@@ -63,7 +63,7 @@ function main() {
6363
function update_detected() {
6464

6565
window_post_message('Detected', detect_state)
66-
66+
6767
if (!debugger_attached && detect_state.setup) {
6868
debugger_attached = true
6969
attach_debugger()
@@ -171,4 +171,4 @@ Expected version: ${title}@${expected_str}`)
171171
}
172172

173173

174-
main()
174+
main()

extension/src/shared.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ export const enum Place_Name {
4646
Detector_Real_World = 'Detector_Real_World',
4747
}
4848

49-
export const enum ConnectionName {
49+
export const enum Connection_Name {
5050
Content = DEVTOOLS_ID_PREFIX+Place_Name.Content,
5151
Devtools = DEVTOOLS_ID_PREFIX+Place_Name.Devtools,
5252
Popup = DEVTOOLS_ID_PREFIX+Place_Name.Popup,
5353
Panel = DEVTOOLS_ID_PREFIX+Place_Name.Panel,
5454
}
5555

56-
export type DetectionState = {
56+
export type Detection_State = {
5757
solid: boolean
5858
solid_dev: boolean
5959
setup: boolean
@@ -66,11 +66,10 @@ export type Versions = {
6666
extension: string
6767
}
6868

69-
export interface GeneralChannels {
69+
export interface General_Channels {
7070
// client -> content -> devtools.html
71-
Detected: DetectionState | null
71+
Detected: Detection_State | null
7272

73-
// the `string` payload is the main version
7473
Debugger_Connected: {
7574
solid: string | null
7675
client: string | null
@@ -85,7 +84,7 @@ export interface GeneralChannels {
8584

8685
export type Channels = debug.InputChannels
8786
& debug.OutputChannels
88-
& GeneralChannels
87+
& General_Channels
8988

9089
export type Message = utils.Union<Channels>
9190

0 commit comments

Comments
 (0)