@makoojs/cli 0.3.2 → 0.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/README.md CHANGED
@@ -1,49 +1,58 @@
1
- # @makoojs/cli
1
+ # CLI API Reference
2
2
 
3
- `@makoojs/cli` is the main entry point for Makoo projects. It provides the Vite plugin, CLI commands, manifest type helpers, injection scanning, virtual entry generation, and connects userscript development, build, and install flows to [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey).
3
+ ## API Index
4
4
 
5
- If you are building a regular Makoo userscript project, you should usually start from this package. `@makoojs/core` provides the low-level injection runtime, `@makoojs/vue` and `@makoojs/react` provide component mounting adapters, and `@makoojs/cli` organizes them into the Vite and userscript build flow.
5
+ ### `@makoojs/cli`
6
6
 
7
- ## Use Cases
7
+ - [`makoo()`](#makoo): creates the Makoo and userscript Vite plugins
8
+ - [`cdn`](#cdn): creates CDN configuration for external dependencies
9
+ - [Configuration types](#configuration-types): `MakooOptions`, `CliConfig`, and monkey configuration
8
10
 
9
- - Develop Makoo userscript projects with Vite.
10
- - Scan injection modules from the `injections` directory and generate runtime code.
11
- - Write `injections/manifest.ts` and module-level `manifest.ts` files.
12
- - Generate userscript metadata, dev entries, and build output through [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey).
13
- - Use commands such as `makoo dev`, `makoo build`, `makoo add`, and `makoo inspect`.
14
- - Use Makoo's stable GM API entry through `@makoojs/cli/monkey`.
11
+ ### `@makoojs/cli/manifest`
15
12
 
16
- ## Installation
13
+ - [`defineInjections()`](#defineinjections): declares a top-level manifest
14
+ - [`defineInjection()`](#defineinjection): declares a module manifest
15
+ - [Manifest types](#manifest-types)
17
16
 
18
- ```bash
19
- // npm install @makoojs/cli
20
- // yarn add @makoojs/cli
21
- pnpm add @makoojs/cli
22
- ```
17
+ ### `@makoojs/cli/monkey`
18
+
19
+ - [GM APIs](#gm-apis): userscript API wrappers
20
+ - [GM types](#gm-types)
21
+
22
+ ### Command line
23
+
24
+ - [CLI commands](#cli-commands)
23
25
 
24
- If you create a project with `@makoojs/create-makoo`, `@makoojs/cli` is usually configured for you.
26
+ ## `makoo()`
25
27
 
26
- ## Minimal Vite Config
28
+ Creates Vite plugins from Makoo configuration.
27
29
 
28
- `makoo()` returns an array of Vite plugins, so it is usually spread into `plugins` with `...makoo(...)`.
30
+ ### Type
29
31
 
30
32
  ```ts
31
- import { defineConfig } from 'vite';
32
- import { makoo } from '@makoojs/cli';
33
- import vue from '@vitejs/plugin-vue';
33
+ function makoo(options: MakooOptions): Plugin[];
34
+ ```
35
+
36
+ ### Parameters
37
+
38
+ `options` uses `MakooOptions`. Its `app` field is required.
34
39
 
40
+ ### Returns
41
+
42
+ Returns `Plugin[]`. Use spread syntax in the Vite configuration.
43
+
44
+ ### Example
45
+
46
+ ```ts
35
47
  export default defineConfig({
36
48
  plugins: [
37
- vue(),
38
49
  ...makoo({
39
50
  app: {
40
- name: 'my-userscript',
41
- version: '0.0.1',
42
- description: 'My first Makoo script'
51
+ name: 'my-script',
52
+ version: '0.0.1'
43
53
  },
44
54
  monkey: {
45
55
  userscript: {
46
- namespace: 'https://example.com',
47
56
  match: ['https://example.com/*']
48
57
  }
49
58
  }
@@ -52,318 +61,352 @@ export default defineConfig({
52
61
  });
53
62
  ```
54
63
 
55
- `makoo()` first injects Makoo's own scanning and virtual entry plugin, then connects to [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) for userscript development and build behavior.
64
+ ## `cdn`
56
65
 
57
- ## Recommended Project Structure
66
+ CDN configuration factories re-exported from `vite-plugin-monkey`.
58
67
 
59
- Makoo scans the `injections` directory under the project root by default.
68
+ ### Type
60
69
 
61
- ```txt
62
- .
63
- ├─ vite.config.ts
64
- └─ injections
65
- ├─ manifest.ts
66
- ├─ profile-card
67
- │ ├─ app.vue
68
- │ └─ manifest.ts
69
- └─ react-badge
70
- ├─ app.tsx
71
- └─ manifest.ts
70
+ ```ts
71
+ type CdnFactory = (
72
+ exportVarName?: string,
73
+ pathname?: string
74
+ ) => [string, ModuleToUrlFc];
75
+
76
+ const cdn: {
77
+ jsdelivr: CdnFactory;
78
+ jsdelivrFastly: CdnFactory;
79
+ unpkg: CdnFactory;
80
+ cdnjs: CdnFactory;
81
+ zhimg: CdnFactory;
82
+ elemecdn: CdnFactory;
83
+ bdstatic: CdnFactory;
84
+ npmmirror: CdnFactory;
85
+ bootcdn: CdnFactory;
86
+ staticfile: CdnFactory;
87
+ };
72
88
  ```
73
89
 
74
- The top-level `injections/manifest.ts` declares manifest-scoped injection defaults and the module list. A module-level `injections/<module>/manifest.ts` can override or add config for a single module, which is useful when a module should own fields such as `injectAt`, `component`, `framework`, `match`, or lifecycle hooks.
90
+ `bootcdn` and `staticfile` are marked as deprecated by `vite-plugin-monkey`.
75
91
 
76
- ## Manifest Basics
92
+ ## Configuration types
77
93
 
78
- `@makoojs/cli` exports `defineInjections()` and `defineInjection()` to provide type constraints for manifests.
94
+ ### `MakooOptions`
79
95
 
80
- `injectionDefaults` defines shared injection runtime defaults for the current manifest. Modules inherit `alive`, `scope`, `timeout`, and `hooks` from it unless they override those fields themselves.
96
+ ```ts
97
+ type MakooOptions = CliConfig & {
98
+ root?: string;
99
+ };
100
+ ```
81
101
 
82
- Object form is suitable for most projects:
102
+ ### `CliConfig`
83
103
 
84
104
  ```ts
85
- import { defineInjections } from '@makoojs/cli';
86
-
87
- export default defineInjections({
88
- injectionDefaults: {
89
- alive: false,
90
- scope: 'local',
91
- timeout: 5000
92
- },
93
- injections: {
94
- profile: {
95
- injectAt: '#app',
96
- component: './profile-card/app.vue',
97
- framework: 'Vue',
98
- match: {
99
- include: ['https://example.com/users/*'],
100
- exclude: ['https://example.com/users/settings']
101
- }
102
- },
103
- badge: {
104
- injectAt: 'body',
105
- component: './react-badge/app.tsx',
106
- framework: 'React'
107
- }
108
- }
109
- });
105
+ type CliConfig = {
106
+ app: AppConfig;
107
+ monkey?: MonkeyConfig;
108
+ source?: SourceConfig;
109
+ runtime?: {
110
+ setup?: string | string[];
111
+ };
112
+ };
110
113
  ```
111
114
 
112
- Array form is useful for generated entries or cases where you need to declare `name` explicitly:
115
+ ### `AppConfig`
113
116
 
114
117
  ```ts
115
- import { defineInjections } from '@makoojs/cli';
116
-
117
- export default defineInjections({
118
- injections: [
119
- {
120
- name: 'profile',
121
- injectAt: '#app',
122
- component: './profile-card/app.vue',
123
- framework: 'Vue'
124
- }
125
- ]
126
- });
118
+ type AppConfig = {
119
+ name: string;
120
+ version: string;
121
+ description?: string;
122
+ };
127
123
  ```
128
124
 
129
- Module-level manifests can use `defineInjection()`:
125
+ ### `SourceConfig`
130
126
 
131
127
  ```ts
132
- import { defineInjection } from '@makoojs/cli';
133
-
134
- export default defineInjection({
135
- injectAt: '#app',
136
- component: './app.vue',
137
- framework: 'Vue',
138
- alive: true
139
- });
128
+ type SourceConfig = {
129
+ include?: string[];
130
+ exclude?: string[];
131
+ };
140
132
  ```
141
133
 
142
- Common fields:
134
+ `include` and `exclude` match injection module directory names.
143
135
 
144
- | Field | Description |
145
- | --- | --- |
146
- | `injectAt` | Target DOM selector |
147
- | `component` | Component path, relative to the top-level manifest or the module directory |
148
- | `framework` | `Vue`, `React`, or `auto`; when omitted, Makoo infers it from the file extension |
149
- | `enabled` | Whether the module is enabled, defaults to `true` |
150
- | `match` | Module-level URL matching rule |
151
- | `alive` | Whether to retry injection after the target DOM is removed |
152
- | `scope` | Alive observation scope, supports `local` and `global` |
153
- | `timeout` | Timeout for waiting for the target DOM |
154
- | `hooks` | Lifecycle observation hooks passed to `@makoojs/core` |
155
-
156
- `match` supports array shorthand:
136
+ ### `MonkeyConfig`
157
137
 
158
138
  ```ts
159
- match: ['https://example.com/*']
139
+ type MonkeyConfig = {
140
+ userscript?: MonkeyUserScript;
141
+ align?: number | false;
142
+ generate?: (options: {
143
+ userscript: string;
144
+ mode: 'serve' | 'build' | 'meta';
145
+ }) => string | Promise<string>;
146
+ styleImport?: boolean;
147
+ server?: MonkeyServerConfig;
148
+ build?: MonkeyBuildConfig;
149
+ };
160
150
  ```
161
151
 
162
- It also supports an include/exclude object:
152
+ ### `MonkeyServerConfig`
163
153
 
164
154
  ```ts
165
- match: {
166
- include: ['https://example.com/*'],
167
- exclude: ['https://example.com/admin/*']
168
- }
155
+ type MonkeyServerConfig = {
156
+ open?: boolean;
157
+ prefix?: string | ((name: string) => string) | false;
158
+ };
169
159
  ```
170
160
 
171
- `match` is a module-level filter. Which pages the userscript itself runs on is still controlled by userscript metadata such as `monkey.userscript.match`.
172
-
173
- ## Configuration Overview
174
-
175
- `makoo()` has four main config areas:
161
+ ### `MonkeyBuildConfig`
176
162
 
177
163
  ```ts
178
- makoo({
179
- app: {
180
- name: 'my-script',
181
- version: '0.0.1',
182
- description: 'demo script'
183
- },
184
- source: {
185
- include: ['*'],
186
- exclude: []
187
- },
188
- runtime: {
189
- setup: ['./injections/vue-setup.ts']
190
- },
191
- monkey: {
192
- userscript: {
193
- match: ['https://example.com/*']
194
- }
195
- }
196
- });
164
+ type MonkeyBuildConfig = {
165
+ fileName?: string;
166
+ metaFileName?: string | boolean | ((fileName: string) => string);
167
+ externalGlobals?: ExternalGlobals;
168
+ autoGrant?: boolean;
169
+ externalResource?: ExternalResource;
170
+ systemjs?: 'inline' | ((
171
+ version: string,
172
+ packageName: string,
173
+ importName?: string,
174
+ resolveName?: string
175
+ ) => string);
176
+ cssSideEffects?: string | ((css: string) => void);
177
+ };
197
178
  ```
198
179
 
199
- | Config | Description |
200
- | --- | --- |
201
- | `app` | Generates userscript `name`, `version`, and `description` |
202
- | `source` | Controls which injection module directories are scanned |
203
- | `runtime` | Controls runtime setup imports in the Makoo-generated entry |
204
- | `monkey` | Most options are passed through to [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) |
180
+ ## `defineInjections()`
205
181
 
206
- `source.include` and `source.exclude` filter module directory names under `injections`, not page URLs. The default include is `['*']`, and the default exclude is `[]`.
182
+ Declares a top-level `InjectionManifest` while preserving the specific type of the provided object.
207
183
 
208
- Most `monkey` options are passed through to [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) for userscript metadata, dev server behavior, and build behavior. However, Makoo manages these fields internally:
184
+ ### Type
209
185
 
210
- - `entry`: fixed to the virtual entry generated by Makoo.
211
- - `clientAlias`: fixed to the GM API alias used internally by Makoo.
212
- - `server.mountGmApi`: managed by Makoo and not user-configurable.
186
+ ```ts
187
+ function defineInjections<T extends InjectionManifest>(
188
+ manifest: StrictShape<InjectionManifest, T>
189
+ ): T;
190
+ ```
213
191
 
214
- By default, `monkey.build.autoGrant` is `true`, so [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) generates `@grant` from the final code.
192
+ ### Returns
215
193
 
216
- ## CLI Commands
194
+ Returns `manifest` unchanged.
217
195
 
218
- After installation, you can use the `makoo` command:
196
+ ### Example
219
197
 
220
- | Command | Description |
221
- | --- | --- |
222
- | `makoo dev` | Starts the Vite dev server and prints the local URL |
223
- | `makoo build` | Runs Vite build and generates userscript output |
224
- | `makoo add <name>` | Creates a new injection module and updates the manifest |
225
- | `makoo add <name> --framework Vue` | Creates a Vue injection module |
226
- | `makoo add <name> --framework React` | Creates a React injection module |
227
- | `makoo inspect` | Prints the resolved Makoo config and scanner result |
198
+ ```ts
199
+ export default defineInjections({
200
+ injectionDefaults: {
201
+ alive: true
202
+ },
203
+ injections: {
204
+ panel: {
205
+ injectAt: 'body',
206
+ component: './panel/App.vue'
207
+ }
208
+ },
209
+ listeners: {
210
+ escape: {
211
+ listenAt: 'body',
212
+ type: 'keydown',
213
+ capture: true,
214
+ callback: onEscape
215
+ }
216
+ }
217
+ });
218
+ ```
228
219
 
229
- `makoo add` uses React by default. It creates a component file under `injections/<name>` and writes the module record to `injections/manifest.ts`.
220
+ ## `defineInjection()`
230
221
 
231
- ## Scanning And Generation Flow
222
+ Declares one `InjectionModuleConfig` while preserving the specific type of the provided object.
232
223
 
233
- Makoo's Vite plugin runs this flow during dev startup and build:
224
+ ### Type
234
225
 
235
- 1. Load `injections/manifest.ts`.
236
- 2. Scan module directories under `injections` that match `source.include` / `source.exclude`.
237
- 3. Read module-level `manifest.ts` files and merge them with the top-level manifest.
238
- 4. Resolve component paths, module IDs, framework, match, alive, scope, timeout, and related config.
239
- 5. Generate adapter imports based on the frameworks actually used.
240
- 6. Generate a virtual entry, create a Makoo runtime, declare tasks, and call `start()`.
241
- 7. Hand the virtual entry to [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) so it can be bundled as a userscript.
226
+ ```ts
227
+ function defineInjection<T extends InjectionModuleConfig>(
228
+ config: StrictShape<InjectionModuleConfig, T>
229
+ ): T;
230
+ ```
242
231
 
243
- If the top-level manifest is missing, no enabled injection modules are found, or the framework cannot be inferred, the CLI throws Makoo's own error types to make the issue easier to locate.
232
+ ### Returns
244
233
 
245
- ## HMR Behavior
234
+ Returns `config` unchanged.
246
235
 
247
- In dev mode, Makoo separates structural changes from normal component updates.
236
+ ### Example
248
237
 
249
- | Change | Behavior |
250
- | --- | --- |
251
- | Top-level `injections/manifest.ts` changes | Rescan and update the virtual entry |
252
- | Module-level `injections/<module>/manifest.ts` changes | Rescan and update the virtual entry |
253
- | Local helpers statically imported by a manifest change | Track dependencies, rescan, and update the virtual entry |
254
- | Module directory is added or removed | Rescan and update the virtual entry |
255
- | Regular component files change | Let Vite handle native HMR |
256
- | Third-party dependencies change | Not tracked as Makoo structural scan dependencies |
238
+ ```ts
239
+ export default defineInjection({
240
+ name: 'panel',
241
+ injectAt: 'body',
242
+ component: './App.vue',
243
+ hooks: {
244
+ 'artifact:mountSuccess': onMounted
245
+ },
246
+ on: {
247
+ listenAt: 'body',
248
+ type: 'click',
249
+ capture: true,
250
+ callback: onClick
251
+ }
252
+ });
253
+ ```
257
254
 
258
- Structural changes update the virtual entry. Changes inside regular components keep Vite's own hot update experience.
255
+ ## Manifest types
259
256
 
260
- ## Runtime Setup
257
+ ### `InjectionManifest`
261
258
 
262
- `runtime.setup` imports side-effect-only runtime files before Makoo initializes adapters, declares injections, and calls `makoo.start(...)`.
259
+ ```ts
260
+ type InjectionManifest = {
261
+ injectionDefaults?: InjectionDefaults;
262
+ injections?: InjectionModuleConfig[] | Record<
263
+ string,
264
+ Omit<InjectionModuleConfig, 'name'>
265
+ >;
266
+ listeners?: InjectionListenerConfig[] | Record<
267
+ string,
268
+ Omit<InjectionListenerConfig, 'name'>
269
+ >;
270
+ };
271
+ ```
263
272
 
264
- Use it to register Vue plugins, initialize GM helpers, import global styles, or run analytics setup.
273
+ ### `InjectionDefaults`
265
274
 
266
275
  ```ts
267
- // vite.config.ts
268
- import { defineConfig } from 'vite';
269
- import { makoo } from '@makoojs/cli';
270
-
271
- export default defineConfig({
272
- plugins: [
273
- ...makoo({
274
- app: {
275
- name: 'my-script',
276
- version: '0.0.1'
277
- },
278
- runtime: {
279
- setup: ['./injections/vue-setup.ts']
280
- },
281
- monkey: {
282
- userscript: {
283
- match: ['https://example.com/*']
284
- }
285
- }
286
- })
287
- ]
288
- });
276
+ type InjectionDefaults = {
277
+ alive?: boolean;
278
+ scope?: 'local' | 'global';
279
+ timeout?: number;
280
+ hooks?: LifecycleHookMap;
281
+ };
289
282
  ```
290
283
 
291
- ```ts
292
- // injections/vue-setup.ts
293
- import { VuePlugin } from '@makoojs/vue';
294
- import router from './router';
295
- import i18n from './i18n';
284
+ ### `InjectionModuleConfig`
296
285
 
297
- VuePlugin.usePlugins(router, i18n);
286
+ ```ts
287
+ type InjectionModuleConfig = {
288
+ name?: string;
289
+ injectAt: string;
290
+ component: string;
291
+ framework?: InjectionFramework;
292
+ enabled?: boolean;
293
+ match?: InjectionMatchConfig;
294
+ alive?: boolean;
295
+ scope?: 'local' | 'global';
296
+ timeout?: number;
297
+ hooks?: LifecycleHookMap;
298
+ on?: InjectionModuleListenerConfig;
299
+ };
298
300
  ```
299
301
 
300
- `runtime.setup` supports a string or an array of strings. Relative paths are resolved from the project root:
302
+ ### `InjectionListenerConfig`
301
303
 
302
304
  ```ts
303
- runtime: {
304
- setup: [
305
- './injections/vue-setup.ts',
306
- './injections/gm-setup.ts'
307
- ]
308
- }
305
+ type InjectionModuleListenerConfig = {
306
+ listenAt: string;
307
+ type: string;
308
+ callback: EventListener;
309
+ capture?: boolean;
310
+ activitySignal?: () => ActivitySignalSource<boolean>;
311
+ };
312
+
313
+ type InjectionListenerConfig = InjectionModuleListenerConfig & {
314
+ name?: string;
315
+ enabled?: boolean;
316
+ match?: InjectionMatchConfig;
317
+ };
309
318
  ```
310
319
 
311
- In dev mode, setup files and their statically imported local dependencies participate in structural updates. When these files change, Makoo rescans and updates the virtual entry.
312
-
313
- ## Use GM APIs
320
+ Set `capture: true` to listen during the DOM capture phase. It defaults to `false`, so listeners
321
+ use the bubbling phase unless explicitly configured. Makoo manages the event listener signal.
314
322
 
315
- `@makoojs/cli` provides the `@makoojs/cli/monkey` subpath as Makoo's stable wrapper around [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) GM APIs.
323
+ ### `InjectionFramework`
316
324
 
317
325
  ```ts
318
- import { gmStorage, gmStyle } from '@makoojs/cli/monkey';
319
-
320
- gmStyle.add('.makoo-panel { z-index: 999999; }');
321
- gmStorage.set('enabled', true);
326
+ type InjectionFramework = 'auto' | 'Vue' | 'React';
322
327
  ```
323
328
 
324
- You can also use the grouped entry:
329
+ ### `InjectionMatchConfig`
325
330
 
326
331
  ```ts
327
- import { GMapi } from '@makoojs/cli/monkey';
328
-
329
- GMapi.storage.set('enabled', true);
332
+ type InjectionMatchConfig =
333
+ | string[]
334
+ | {
335
+ include?: string[];
336
+ exclude?: string[];
337
+ };
330
338
  ```
331
339
 
332
- Prefer capability-level imports when you want the generated `@grant` surface to stay as small as possible. `GMapi` is more convenient for shared code or exploratory work. The complete GM API reference will be moved to a dedicated documentation site later.
340
+ ## GM APIs
333
341
 
334
- ## Reduce Build Size
342
+ The following values are exported from `@makoojs/cli/monkey`.
335
343
 
336
- `@makoojs/cli` re-exports the `cdn` helper from [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey). You can use it with `monkey.build.externalGlobals` to load external dependencies from a CDN and reduce userscript bundle size.
344
+ | Export | Methods or value |
345
+ | --- | --- |
346
+ | `GMapi` | Contains `raw`, `info`, `log`, `storage`, `style`, `request`, `menu`, `clipboard`, `notification`, `tab`, `download`, and `resource` |
347
+ | `gm` | Original `GM` object |
348
+ | `gmInfo` | `GM_info` |
349
+ | `gmLog` | `GM_log` |
350
+ | `monkeyWindow` | Userscript window |
351
+ | `unsafeWindow` | Page window |
352
+ | `gmClipboard` | `set(data, type?, callback?)` |
353
+ | `gmDownload` | `start` |
354
+ | `gmMenu` | `register`, `unregister` |
355
+ | `gmNotification` | `show` |
356
+ | `gmRequest` | `send`, `get`, `post` |
357
+ | `gmResource` | `text`, `url` |
358
+ | `gmStorage` | `get`, `getMany`, `set`, `setMany`, `remove`, `removeMany`, `keys`, `watch`, `unwatch` |
359
+ | `gmStyle` | `add`, `element` |
360
+ | `gmTab` | `open`, `get`, `getAll`, `save` |
361
+
362
+ ### `gmRequest.get()` / `gmRequest.post()`
337
363
 
338
364
  ```ts
339
- import { defineConfig } from 'vite';
340
- import { cdn, makoo } from '@makoojs/cli';
365
+ gmRequest.get<R extends GmResponseType = 'text', C = unknown>(
366
+ url: string,
367
+ options?: GmRequestOptions<R, C>
368
+ ): GmAbortHandle;
369
+
370
+ gmRequest.post<R extends GmResponseType = 'text', C = unknown>(
371
+ url: string,
372
+ options?: GmRequestOptions<R, C>
373
+ ): GmAbortHandle;
374
+ ```
341
375
 
342
- export default defineConfig({
343
- plugins: makoo({
344
- app: {
345
- name: 'my-script',
346
- version: '0.0.1'
347
- },
348
- monkey: {
349
- build: {
350
- externalGlobals: {
351
- vue: cdn.jsdelivr('Vue', 'dist/vue.global.prod.js')
352
- }
353
- }
354
- }
355
- })
356
- });
376
+ `get()` and `post()` set the request method to `GET` and `POST`, respectively.
377
+
378
+ ## GM types
379
+
380
+ ```ts
381
+ type GmRequestOptions<R extends GmResponseType = 'text', C = unknown> = Omit<
382
+ GmXmlhttpRequestOption<R, C>,
383
+ 'url' | 'method'
384
+ >;
357
385
  ```
358
386
 
359
- ## Relationship To Other Packages
387
+ `@makoojs/cli/monkey` also re-exports these types from `vite-plugin-monkey`:
388
+
389
+ - `GmAbortHandle`
390
+ - `GmAddElementAttributes`
391
+ - `GmDownloadOptions`
392
+ - `GmInfoType`
393
+ - `GmMenuCommandOptions`
394
+ - `GmNotificationOptions`
395
+ - `GmOpenInTabOptions`
396
+ - `GmResponseEvent`
397
+ - `GmResponseType`
398
+ - `GmTabControl`
399
+ - `GmType`
400
+ - `GmValueListenerId`
401
+ - `GmXmlhttpRequestOption`
402
+ - `MonkeyWindow`
403
+
404
+ ## CLI commands
360
405
 
361
- | Package | Responsibility |
406
+ | Command | Description |
362
407
  | --- | --- |
363
- | `@makoojs/cli` | Vite plugin, CLI commands, scanning, code generation, and userscript build integration |
364
- | `@makoojs/core` | Framework-agnostic injection runtime core |
365
- | `@makoojs/vue` | Vue adapter and Vue plugin registration helpers |
366
- | `@makoojs/react` | React adapter |
367
- | `@makoojs/create-makoo` | Project scaffold |
368
-
369
- `@makoojs/cli` is not a complete runtime implementation by itself. Many features cannot exist independently and rely on the injection scheduling capabilities provided by `@makoojs/core`.
408
+ | `makoo dev` | Starts the Vite development server |
409
+ | `makoo build` | Runs a Vite build |
410
+ | `makoo add <name>` | Creates a React injection module and updates the manifest |
411
+ | `makoo add <name> --framework Vue` | Creates a Vue injection module and updates the manifest |
412
+ | `makoo inspect` | Prints resolved configuration, scan results, and framework information |