Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox extension #278

Merged
merged 16 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/large-donuts-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@solid-devtools/extension': minor
---

Support firefox (minor changes to background script)
6 changes: 6 additions & 0 deletions .changeset/young-baboons-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@solid-devtools/frontend': patch
'@solid-devtools/overlay': patch
---

Add missing dependencies
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Thumbs.db
# chrome extension private key file
*.pem

packages/extension/dist.zip
**/vite.config.ts.timestamp-*.*

/test-results/
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This project uses [changesets](https://github.com/changesets/changesets) to mana

![image](https://user-images.githubusercontent.com/24491503/191084587-e53b1743-39ac-40e0-b3a6-cf6bcaca9d5d.png)

4. Click on the "Load unpacked" button and select the `packages/extension/dist` folder
4. Click on the "Load unpacked" button and select the `packages/extension/dist/chrome` directory (or `packages/extension/dist/firefox` if you are using firefox)

![image](https://user-images.githubusercontent.com/24491503/191084770-84577eb0-1c90-44a7-afa2-a2d03f728a66.png)

Expand Down
29 changes: 14 additions & 15 deletions configs/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"compilerOptions": {
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"noEmit": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"types": ["@total-typescript/ts-reset"]
}
"compilerOptions": {
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"types": ["@total-typescript/ts-reset"]
}
}
2 changes: 1 addition & 1 deletion e2e/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const test = pw.test.extend<{
return
}

const path_to_extension = path.resolve(__dirname, '../packages/extension/dist/')
const path_to_extension = path.resolve(__dirname, '../packages/extension/dist/chrome')
const context = await pw.chromium.launchPersistentContext('', {
args: [
'--headless=new',
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts → e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const is_ci = !!process.env['CI']
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './e2e',
testDir: '.',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand Down
8 changes: 4 additions & 4 deletions examples/sandbox/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
import solid from 'vite-plugin-solid'

const usingExtension = process.env['EXT'] === 'true' || process.env['EXT'] === '1'
const is_ext = process.env['EXT'] === 'true' || process.env['EXT'] === '1'

export default defineConfig(mode => {
const isBuild = mode.command === 'build'
const is_build = mode.command === 'build'

return {
plugins: [
Expand All @@ -27,8 +27,8 @@ export default defineConfig(mode => {
Inspect(),
],
define: {
'process.env.EXT': JSON.stringify(usingExtension),
'process.env.BUILD': JSON.stringify(isBuild),
'process.env.EXT': JSON.stringify(is_ext),
'process.env.BUILD': JSON.stringify(is_build),
},
mode: 'development',
build: {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"build": "turbo run build --filter=./packages/*",
"----------------------TEST----------------------": "",
"test:unit": "turbo run test --filter=./packages/*",
"test:types": "turbo run typecheck --filter=./packages/*",
"test:types": "turbo run test:types --filter=./packages/*",
"test:lint": "eslint --ignore-path .gitignore --max-warnings 0 packages/**/*.{js,ts,tsx,jsx} --rule \"@typescript-eslint/no-unnecessary-type-assertion: off\"",
"test:e2e": "cross-env PW_CHROMIUM_ATTACH_TO_OTHER=1 playwright test -c playwright.config.ts",
"test:e2e": "cross-env PW_CHROMIUM_ATTACH_TO_OTHER=1 playwright test -c e2e/playwright.config.ts",
"----------------------UTILS----------------------": "",
"build-test:packages": "turbo run build test:unit test:types --filter=./packages/*",
"build-test": "pnpm run build-test:packages && pnpm run test:lint && pnpm run test:e2e",
Expand All @@ -28,8 +28,8 @@
"publish": "pnpm run build && pnpm run changeset publish"
},
"devDependencies": {
"@solid-devtools/theme": "file:packages/theme",
"@changesets/cli": "^2.26.2",
"@nothing-but/utils": "~0.11.1",
"@playwright/test": "^1.39.0",
"@total-typescript/ts-reset": "^0.5.1",
"@types/node": "^20.8.10",
Expand All @@ -48,6 +48,7 @@
"solid-js": "^1.8.5",
"tsup": "^7.2.0",
"tsup-preset-solid": "^2.1.0",
"tsx": "^3.14.0",
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"unocss": "^0.57.1",
Expand Down
23 changes: 12 additions & 11 deletions packages/debugger/src/main/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ export const getValueItemId = <T extends ValueItemType>(
export type ValueUpdateListener = (newValue: unknown, oldValue: unknown) => void

export namespace Solid {
export type OwnerBase = import('solid-js/types/reactive/signal').Owner
export type SourceMapValue = import('solid-js/types/reactive/signal').SourceMapValue
export type Signal = import('solid-js/types/reactive/signal').SignalState<unknown>
export type Computation = import('solid-js/types/reactive/signal').Computation<unknown>
export type Memo = import('solid-js/types/reactive/signal').Memo<unknown>
export type RootFunction<T> = import('solid-js/types/reactive/signal').RootFunction<T>
export type EffectFunction = import('solid-js/types/reactive/signal').EffectFunction<unknown>
export type Component = import('solid-js/types/reactive/signal').DevComponent<{
export type OwnerBase = import('solid-js').Owner
export type SourceMapValue = import('solid-js/types/reactive/signal.d.ts').SourceMapValue
export type Signal = import('solid-js/types/reactive/signal.d.ts').SignalState<unknown>
export type Computation = import('solid-js/types/reactive/signal.d.ts').Computation<unknown>
export type Memo = import('solid-js/types/reactive/signal.d.ts').Memo<unknown>
export type RootFunction<T> = import('solid-js/types/reactive/signal.d.ts').RootFunction<T>
export type EffectFunction =
import('solid-js/types/reactive/signal.d.ts').EffectFunction<unknown>
export type Component = import('solid-js/types/reactive/signal.d.ts').DevComponent<{
[key: string]: unknown
}>

Expand Down Expand Up @@ -109,12 +110,12 @@ export namespace Solid {
//

export type StoreNode = import('solid-js/store').StoreNode
export type NotWrappable = import('solid-js/store/types/store').NotWrappable
export type OnStoreNodeUpdate = import('solid-js/store/types/store').OnStoreNodeUpdate
export type NotWrappable = import('solid-js/store').NotWrappable
export type OnStoreNodeUpdate = import('solid-js/store/types/store.d.ts').OnStoreNodeUpdate
export type Store = SourceMapValue & { value: StoreNode }
}

declare module 'solid-js/types/reactive/signal' {
declare module 'solid-js/types/reactive/signal.d.ts' {
interface Owner {
sdtType?: NodeType
sdtSubRoots?: Solid.Owner[] | null
Expand Down
Loading