extension 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/extension.cjs +1 -3
- package/dist/cli.cjs +3 -3
- package/package.json +14 -7
- package/types/index.d.ts +121 -0
- package/types/polyfill.d.ts +4 -0
package/bin/extension.cjs
CHANGED
|
@@ -26,15 +26,13 @@ if (fs.existsSync(distCjsEntry)) {
|
|
|
26
26
|
{stdio: 'inherit'}
|
|
27
27
|
)
|
|
28
28
|
process.exit(result.status ?? 1)
|
|
29
|
-
} catch
|
|
30
|
-
// eslint-disable-next-line no-console
|
|
29
|
+
} catch {
|
|
31
30
|
console.error(
|
|
32
31
|
'[Extension.js] CLI not built. Run "pnpm --filter extension compile".'
|
|
33
32
|
)
|
|
34
33
|
process.exit(1)
|
|
35
34
|
}
|
|
36
35
|
} else {
|
|
37
|
-
// eslint-disable-next-line no-console
|
|
38
36
|
console.error('[Extension.js] CLI entry not found.')
|
|
39
37
|
process.exit(1)
|
|
40
38
|
}
|
package/dist/cli.cjs
CHANGED
|
@@ -785,7 +785,7 @@ Cross-Browser Compatibility
|
|
|
785
785
|
source: devOptions.source,
|
|
786
786
|
watchSource: devOptions.watchSource,
|
|
787
787
|
install: devOptions.install,
|
|
788
|
-
noRunner: devOptions.
|
|
788
|
+
noRunner: false === devOptions.runner,
|
|
789
789
|
logLevel: logsOption || devOptions.logLevel || 'off',
|
|
790
790
|
logContexts: parseLogContexts(logContextOption),
|
|
791
791
|
logFormat: devOptions.logFormat || 'pretty',
|
|
@@ -844,7 +844,7 @@ Cross-Browser Compatibility
|
|
|
844
844
|
startingUrl: startOptions.startingUrl,
|
|
845
845
|
port: startOptions.port,
|
|
846
846
|
install: startOptions.install,
|
|
847
|
-
noRunner: startOptions.
|
|
847
|
+
noRunner: false === startOptions.runner,
|
|
848
848
|
source: 'string' == typeof startOptions.source ? startOptions.source : startOptions.source,
|
|
849
849
|
watchSource: startOptions.watchSource,
|
|
850
850
|
logLevel: logsOption || startOptions.logLevel || 'off',
|
|
@@ -906,7 +906,7 @@ Cross-Browser Compatibility
|
|
|
906
906
|
geckoBinary: previewOptions.geckoBinary,
|
|
907
907
|
startingUrl: previewOptions.startingUrl,
|
|
908
908
|
port: previewOptions.port,
|
|
909
|
-
noRunner: previewOptions.
|
|
909
|
+
noRunner: false === previewOptions.runner,
|
|
910
910
|
source: 'string' == typeof previewOptions.source ? previewOptions.source : previewOptions.source,
|
|
911
911
|
watchSource: previewOptions.watchSource,
|
|
912
912
|
logLevel: logsOption || previewOptions.logLevel || 'off',
|
package/package.json
CHANGED
|
@@ -14,19 +14,26 @@
|
|
|
14
14
|
"types": "./dist/cli.d.ts",
|
|
15
15
|
"import": "./dist/cli.cjs",
|
|
16
16
|
"require": "./dist/cli.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./types": {
|
|
19
|
+
"types": "./types/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./types/polyfill": {
|
|
22
|
+
"types": "./types/polyfill.d.ts"
|
|
17
23
|
}
|
|
18
24
|
},
|
|
19
25
|
"main": "./dist/cli.cjs",
|
|
20
26
|
"types": "./dist/cli.d.ts",
|
|
21
27
|
"files": [
|
|
22
28
|
"dist",
|
|
23
|
-
"bin"
|
|
29
|
+
"bin",
|
|
30
|
+
"types"
|
|
24
31
|
],
|
|
25
32
|
"bin": {
|
|
26
33
|
"extension": "./bin/extension.cjs"
|
|
27
34
|
},
|
|
28
35
|
"name": "extension",
|
|
29
|
-
"version": "3.4.
|
|
36
|
+
"version": "3.4.1",
|
|
30
37
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
31
38
|
"homepage": "https://extension.js.org/",
|
|
32
39
|
"bugs": {
|
|
@@ -80,8 +87,11 @@
|
|
|
80
87
|
"cli"
|
|
81
88
|
],
|
|
82
89
|
"dependencies": {
|
|
83
|
-
"
|
|
84
|
-
"
|
|
90
|
+
"@types/chrome": "^0.1.33",
|
|
91
|
+
"@types/node": "^25.0.9",
|
|
92
|
+
"@types/webextension-polyfill": "0.12.4",
|
|
93
|
+
"extension-create": "^3.4.1",
|
|
94
|
+
"extension-develop": "^3.4.1",
|
|
85
95
|
"commander": "^14.0.2",
|
|
86
96
|
"pintor": "0.3.0",
|
|
87
97
|
"semver": "^7.7.3",
|
|
@@ -89,11 +99,8 @@
|
|
|
89
99
|
},
|
|
90
100
|
"devDependencies": {
|
|
91
101
|
"@rslib/core": "^0.19.2",
|
|
92
|
-
"@types/chrome": "^0.1.33",
|
|
93
|
-
"@types/node": "^25.0.9",
|
|
94
102
|
"@types/react": "^19.2.8",
|
|
95
103
|
"@types/react-dom": "^19.2.3",
|
|
96
|
-
"@types/webextension-polyfill": "0.12.4",
|
|
97
104
|
"@types/mock-fs": "^4.13.4",
|
|
98
105
|
"@types/semver": "^7.7.1",
|
|
99
106
|
"mock-fs": "^5.5.0",
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Required Extension.js types for TypeScript projects.
|
|
2
|
+
// This file is published by the extension package.
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="chrome" />
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
// Align types with Extension.js runtime: we provide the browser global via
|
|
8
|
+
// webextension-polyfill in Chromium, and it's natively available in Firefox.
|
|
9
|
+
const browser: typeof import('webextension-polyfill')
|
|
10
|
+
|
|
11
|
+
type ExtensionBrowser =
|
|
12
|
+
| 'chrome'
|
|
13
|
+
| 'edge'
|
|
14
|
+
| 'firefox'
|
|
15
|
+
| 'chromium-based'
|
|
16
|
+
| 'gecko-based'
|
|
17
|
+
|
|
18
|
+
type ExtensionMode = 'development' | 'production'
|
|
19
|
+
|
|
20
|
+
interface ExtensionEnv {
|
|
21
|
+
EXTENSION_BROWSER: ExtensionBrowser
|
|
22
|
+
EXTENSION_MODE: ExtensionMode
|
|
23
|
+
EXTENSION_PUBLIC_BROWSER: ExtensionBrowser
|
|
24
|
+
EXTENSION_PUBLIC_MODE: ExtensionMode
|
|
25
|
+
EXTENSION_PUBLIC_DESCRIPTION_TEXT: string
|
|
26
|
+
EXTENSION_PUBLIC_LLM_API_KEY: string
|
|
27
|
+
EXTENSION_AUTHOR_MODE: string
|
|
28
|
+
EXTENSION_PUBLIC_AUTHOR_MODE: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
namespace NodeJS {
|
|
32
|
+
interface ProcessEnv extends ExtensionEnv {
|
|
33
|
+
[key: string]: string | undefined
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ImportMetaEnv extends ExtensionEnv {
|
|
38
|
+
[key: string]: string | undefined
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ImportMeta {
|
|
42
|
+
readonly env: ImportMetaEnv
|
|
43
|
+
readonly webpackHot?: {
|
|
44
|
+
accept: (module?: string | string[], callback?: () => void) => void
|
|
45
|
+
dispose: (callback: () => void) => void
|
|
46
|
+
}
|
|
47
|
+
url: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface Window {
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated
|
|
53
|
+
* @description
|
|
54
|
+
* This is how Extension.js used to inject the shadow root into the window object.
|
|
55
|
+
* Use the shadowRoot reference from the content script instead.
|
|
56
|
+
*/
|
|
57
|
+
__EXTENSION_SHADOW_ROOT__: ShadowRoot
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Asset imports (CSS modules + static images)
|
|
62
|
+
type CSSContentData = Readonly<Record<string, string>>
|
|
63
|
+
type CSSModuleData = Readonly<Record<string, string>>
|
|
64
|
+
|
|
65
|
+
declare module '*.css' {
|
|
66
|
+
const content: CSSContentData
|
|
67
|
+
export default content
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare module '*.module.css' {
|
|
71
|
+
const content: CSSModuleData
|
|
72
|
+
export default content
|
|
73
|
+
}
|
|
74
|
+
declare module '*.module.scss' {
|
|
75
|
+
const content: CSSModuleData
|
|
76
|
+
export default content
|
|
77
|
+
}
|
|
78
|
+
declare module '*.module.sass' {
|
|
79
|
+
const content: CSSModuleData
|
|
80
|
+
export default content
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare module '*.png' {
|
|
84
|
+
const content: string
|
|
85
|
+
export default content
|
|
86
|
+
}
|
|
87
|
+
declare module '*.jpg' {
|
|
88
|
+
const content: string
|
|
89
|
+
export default content
|
|
90
|
+
}
|
|
91
|
+
declare module '*.jpeg' {
|
|
92
|
+
const content: string
|
|
93
|
+
export default content
|
|
94
|
+
}
|
|
95
|
+
declare module '*.gif' {
|
|
96
|
+
const content: string
|
|
97
|
+
export default content
|
|
98
|
+
}
|
|
99
|
+
declare module '*.webp' {
|
|
100
|
+
const content: string
|
|
101
|
+
export default content
|
|
102
|
+
}
|
|
103
|
+
declare module '*.avif' {
|
|
104
|
+
const content: string
|
|
105
|
+
export default content
|
|
106
|
+
}
|
|
107
|
+
declare module '*.ico' {
|
|
108
|
+
const content: string
|
|
109
|
+
export default content
|
|
110
|
+
}
|
|
111
|
+
declare module '*.bmp' {
|
|
112
|
+
const content: string
|
|
113
|
+
export default content
|
|
114
|
+
}
|
|
115
|
+
declare module '*.svg' {
|
|
116
|
+
// Use any to avoid conflicts with SVGR or other SVG loaders.
|
|
117
|
+
const content: any
|
|
118
|
+
export default content
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {}
|