vite-userscript-plugin 0.5.0 → 0.6.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/dist/types.d.ts DELETED
@@ -1,217 +0,0 @@
1
- import { grants } from './constants.js';
2
- export interface Transform {
3
- file: string;
4
- name: string;
5
- loader: 'js' | 'css';
6
- }
7
- export declare type RunAt = 'document-start' | 'document-body' | 'document-end' | 'document-idle' | 'context-menu';
8
- export declare type Grants = typeof grants[number];
9
- export declare type MetadataConfig = {
10
- [property: string]: string | boolean | number | string[] | undefined;
11
- /**
12
- * The name of the script.
13
- * Internationalization is done by adding an appendix naming the locale.
14
- */
15
- name: string;
16
- /**
17
- * Version of the script,
18
- * it can be used to check if a script has new versions. It is composed
19
- * of several parts, joined by `.` Each part must start with numbers,
20
- * and can be followed by alphabetic characters.
21
- */
22
- version: string;
23
- /**
24
- * A brief summary to describe the script.
25
- */
26
- description?: string;
27
- /**
28
- * The scripts author.
29
- */
30
- author?: string;
31
- /**
32
- * The script license.
33
- */
34
- license?: string;
35
- /**
36
- * The combination of `@namespace` and `@name` is the unique identifier for
37
- * a userscript. `@namespace` can be any string, for example the homepage
38
- * of a group of userscripts by the same author. If not provided
39
- * the `@namespace` falls back to an empty string ('').
40
- */
41
- namespace?: string;
42
- /**
43
- * The authors homepage that is used at the options page to link from
44
- * the scripts name to the given page. Please note that if the `@namespace`
45
- * tag starts with `https://` its content will be used for this too.
46
- */
47
- homepage?: string;
48
- /**
49
- * An update URL for the userscript.
50
- * Note:
51
- * - a `@version` tag is required to make update checks work.
52
- */
53
- updateURL?: string;
54
- /**
55
- * Defines the URL where the script will be downloaded from when an update was
56
- * detected. If the value none is used, then no update check will be done.
57
- */
58
- downloadURL?: string;
59
- /**
60
- * Defines the URL where the user can report issues and get personal support.
61
- */
62
- supportURL?: string;
63
- /**
64
- * Specify an icon for the script. Almost any image will work,
65
- * but a 32x32 pixel size is best. This value may be specified relative
66
- * to the URL the script itself is downloaded from.
67
- */
68
- icon?: string;
69
- icon64?: string;
70
- /**
71
- * Each `@include` and `@exclude` rule can be one of the following:
72
- * - a normal string
73
- * > If the string does not start or end with a slash (/),
74
- * > it will be used as a normal string.
75
- * > If there are wildcards (*), each of them matches any characters.
76
- * > e.g. https://www.google.com/* matches the following:
77
- * - https://www.google.com/
78
- * - https://www.google.com/any/subview
79
- * > but not the following:
80
- * - http://www.google.com/
81
- * - https://www.google.com.hk/
82
- * > If there is no wildcard in the string, the rule matches the entire URL.
83
- * > e.g. https://www.google.com/ matches only https://www.google.com/
84
- * > but not https://www.google.com/any/subview.
85
- * > The host part accepts .tld to match top level domain suffix.
86
- * > e.g. https://www.google.tld/ matches both https://www.google.com/
87
- * > and https://www.google.co.jp/.
88
- *
89
- * - a regular expression
90
- * > If the string starts and ends with a slash (/),
91
- * > it will be compiled as a regular expression.
92
- * > e.g. /\.google\.com[\.\/]/ matches the following:
93
- * - https://www.google.com/,
94
- * - https://www.google.com/any/subview
95
- * - http://www.google.com/
96
- * - https://www.google.com.hk/
97
- */
98
- include?: string[] | string;
99
- exclude?: string[] | string;
100
- /**
101
- * More or less equal to the `@include` tag.
102
- * You can get more information
103
- * [here](https://developer.chrome.com/docs/extensions/mv2/match_patterns/).
104
- *
105
- * Note:
106
- * - The `<all_urls>` statement is not yet supported and the scheme part also
107
- * accepts `http*://`.
108
- */
109
- match: string[] | string;
110
- /**
111
- * Points to a JavaScript file that is loaded and executed before the script
112
- * itself starts running.
113
- *
114
- * Note:
115
- * - The scripts loaded via `@require` and their "use strict" statements
116
- * might influence the userscript's strict mode!
117
- */
118
- require?: string[] | string;
119
- /**
120
- * Preloads resources that can by accessed
121
- * via `GM_getResourceURL` and `GM_getResourceText` by the script.
122
- */
123
- resource?: string[] | string;
124
- /**
125
- * This tag defines the domains (no top-level domains) including subdomains
126
- * which are allowed to be retrieved by `GM_xmlhttpRequest`
127
- *
128
- * - domains like tampermonkey.net (this will also allow all sub-domains)
129
- * - sub-domains i.e. safari.tampermonkey.net
130
- * - self to whitelist the domain the script is currently running at
131
- * - localhost to access the localhost
132
- * - 1.2.3.4 to connect to an IP address
133
- *
134
- * If it's not possible to declare all domains a userscript might connect
135
- * to then it's a good practice to do the following: ***Declare all known or
136
- * at least all common domains*** that might be connected by the script.
137
- * This way the confirmation dialog can be avoided for most of the users.
138
- *
139
- * Additionally add `@connect *` to the script. By doing so Tampermonkey will
140
- * still ask the user whether the next connection to a not mentioned domain
141
- * is allowed, but also ***offer a "Always allow all domains" button***.
142
- * If the user clicks at this button then all future requestswill
143
- * be permitted automatically.
144
- */
145
- connect?: string[] | string;
146
- /**
147
- * This tag makes the script running on the main pages, but not at iframes.
148
- * @default false
149
- */
150
- noframes?: boolean;
151
- /**
152
- * `@grant` is used to whitelist GM_* functions, the `unsafeWindow` object and
153
- * some powerful window functions. If no `@grant` tag is given TM guesses
154
- * the scripts needs.
155
- */
156
- grant?: Exclude<Grants, 'GM_addStyle' | 'GM_info'>[];
157
- /**
158
- * Defines the moment the script is injected. In opposition to other script
159
- * handlers, `@run-at` defines the first possible moment a script wants to
160
- * run. This means it may happen, that a script that uses the `@require` tag
161
- * may be executed after the document is already loaded, cause fetching the
162
- * required script took that long. Anyhow, all `DOMNodeInserted` and
163
- * `DOMContentLoaded` events that happended after the given injection
164
- * moment are cached and delivered to the script when it is injected.
165
- *
166
- * - `document-start`
167
- * The script will be injected as fast as possible.
168
- *
169
- * - `document-body`
170
- * The script will be injected if the body element exists.
171
- *
172
- * - `document-end`
173
- * The script will be injected when or after the `DOMContentLoaded` event
174
- * was dispatched.
175
- *
176
- * - `document-idle`
177
- * The script will be injected after the DOMContentLoaded event was
178
- * dispatched. This is the default value if no `@run-at` tag is given.
179
- *
180
- * - `context-menu`
181
- * The script will be injected if it is clicked at the browser context menu
182
- * (desktop Chrome-based browsers only).
183
- *
184
- * Note:
185
- * - all `@include` and `@exclude` statements will be ignored if this value
186
- * is used, but this may change in the future.
187
- *
188
- * @default 'document-idle'
189
- */
190
- 'run-at'?: RunAt;
191
- };
192
- export interface ServerConfig {
193
- /**
194
- * Server port.
195
- * @default 8000
196
- */
197
- port?: number;
198
- }
199
- export interface UserscriptPluginConfig {
200
- /**
201
- * Path of userscript entry.
202
- */
203
- entry: string;
204
- /**
205
- * Userscript header config.
206
- */
207
- metadata: MetadataConfig;
208
- /**
209
- * Import all `@grant` in development mode.
210
- * @default true
211
- */
212
- autoGrants?: boolean;
213
- /**
214
- * Server config (used in development mode for hot reloading).
215
- */
216
- server?: ServerConfig;
217
- }
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export {};