@makoojs/cli 0.4.0 → 0.5.0
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.CN.md +93 -345
- package/README.md +93 -345
- package/dist/bin.js +516 -1151
- package/dist/cli/commands/build.d.ts +2 -0
- package/dist/cli/commands/dev/DevTerminal.d.ts +51 -0
- package/dist/cli/commands/dev/dev.d.ts +2 -0
- package/dist/cli/commands/preview.d.ts +2 -0
- package/dist/cli/tasks/renderTasks.d.ts +2 -0
- package/dist/{shared → cli}/terminalColor.d.ts +2 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/config/defaults.d.ts +3 -24
- package/dist/config/errors.d.ts +14 -0
- package/dist/config/resolve.d.ts +6 -18
- package/dist/config/types.d.ts +8 -105
- package/dist/config/validation.d.ts +4 -7
- package/dist/index.cjs +121 -38
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1036 -3240
- package/dist/session/DevSession.d.ts +13 -0
- package/dist/session/types.d.ts +22 -0
- package/dist/vite/makoo.d.ts +3 -0
- package/dist/vite/makooDev.d.ts +7 -0
- package/package.json +8 -13
- package/dist/command/_util.d.ts +0 -8
- package/dist/command/add.d.ts +0 -1
- package/dist/command/build.d.ts +0 -1
- package/dist/command/dev.d.ts +0 -1
- package/dist/command/inspect.d.ts +0 -35
- package/dist/config/config.d.ts +0 -3
- package/dist/error/MakooCliError.d.ts +0 -58
- package/dist/generator/generator.d.ts +0 -3
- package/dist/generator/render/import/importAdapter.d.ts +0 -3
- package/dist/generator/render/import/importComp.d.ts +0 -3
- package/dist/generator/render/import/importMakooRuntime.d.ts +0 -1
- package/dist/generator/render/import/importManifest.d.ts +0 -3
- package/dist/generator/render/import/importRuntimeSetup.d.ts +0 -1
- package/dist/generator/render/init/initMakooRuntime.d.ts +0 -4
- package/dist/generator/render/init/registerComp.d.ts +0 -3
- package/dist/generator/render/init/registerListener.d.ts +0 -4
- package/dist/generator/render/run/renderMakooStart.d.ts +0 -1
- package/dist/generator/render/util/match.d.ts +0 -1
- package/dist/generator/render/util/value.d.ts +0 -1
- package/dist/generator/types.d.ts +0 -27
- package/dist/manifest/index.cjs +0 -1
- package/dist/manifest/index.d.ts +0 -2
- package/dist/manifest/index.js +0 -7
- package/dist/scanner/collectDependenics.d.ts +0 -2
- package/dist/scanner/load/loadManifes.d.ts +0 -3
- package/dist/scanner/load/loadMeta.d.ts +0 -2
- package/dist/scanner/manifestBinding.d.ts +0 -14
- package/dist/scanner/scanner.d.ts +0 -3
- package/dist/scanner/types.d.ts +0 -50
- package/dist/scanner/util.d.ts +0 -2
- package/dist/scanner/validation.d.ts +0 -183
- package/dist/vitePlugin/hmrController.d.ts +0 -6
- package/dist/vitePlugin/makoo.d.ts +0 -3
- package/dist/vitePlugin/makooMonkey.d.ts +0 -3
- package/dist/vitePlugin/types.d.ts +0 -18
- package/dist/vitePlugin/virtualModule.d.ts +0 -2
- package/dist/vitePlugin/watchList.d.ts +0 -5
- /package/dist/{command → cli}/bin.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,59 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @makoojs/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@makoojs/cli` provides Makoo's Vite plugin and CLI commands, with userscript development and build capabilities powered by [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Application code composes runtime behavior through `createMakoo()`, `inject()`, and `listen()` from `@makoojs/core`. `@makoojs/cli` handles the Vite and userscript build integration.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [`cdn`](#cdn): creates CDN configuration for external dependencies
|
|
9
|
-
- [Configuration types](#configuration-types): `MakooOptions`, `CliConfig`, and monkey configuration
|
|
7
|
+
## Use Cases
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
- Develop Makoo userscript projects with Vite.
|
|
10
|
+
- Generate userscript metadata, dev entries, and build output through [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey).
|
|
11
|
+
- Use the `makoo dev` and `makoo build` commands.
|
|
12
|
+
- Use Makoo's stable GM API entry through `@makoojs/cli/monkey`.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
- [`defineInjection()`](#defineinjection): declares a module manifest
|
|
15
|
-
- [Manifest types](#manifest-types)
|
|
14
|
+
## Installation
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Command line
|
|
23
|
-
|
|
24
|
-
- [CLI commands](#cli-commands)
|
|
25
|
-
|
|
26
|
-
## `makoo()`
|
|
27
|
-
|
|
28
|
-
Creates Vite plugins from Makoo configuration.
|
|
29
|
-
|
|
30
|
-
### Type
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
function makoo(options: MakooOptions): Plugin[];
|
|
16
|
+
```bash
|
|
17
|
+
# npm install @makoojs/cli
|
|
18
|
+
# yarn add @makoojs/cli
|
|
19
|
+
pnpm add @makoojs/cli
|
|
34
20
|
```
|
|
35
21
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`options` uses `MakooOptions`. Its `app` field is required.
|
|
39
|
-
|
|
40
|
-
### Returns
|
|
22
|
+
If you create a project with `@makoojs/create-makoo`, `@makoojs/cli` is usually configured for you.
|
|
41
23
|
|
|
42
|
-
|
|
24
|
+
## Minimal Vite Config
|
|
43
25
|
|
|
44
|
-
|
|
26
|
+
Use `makoo()` in the Vite configuration:
|
|
45
27
|
|
|
46
28
|
```ts
|
|
29
|
+
import { defineConfig } from 'vite';
|
|
30
|
+
import { makoo } from '@makoojs/cli';
|
|
31
|
+
import vue from '@vitejs/plugin-vue';
|
|
32
|
+
|
|
47
33
|
export default defineConfig({
|
|
48
34
|
plugins: [
|
|
49
|
-
|
|
35
|
+
vue(),
|
|
36
|
+
makoo({
|
|
37
|
+
entry: './src/app.ts',
|
|
50
38
|
app: {
|
|
51
|
-
name: 'my-
|
|
52
|
-
version: '0.0.1'
|
|
39
|
+
name: 'my-userscript',
|
|
40
|
+
version: '0.0.1',
|
|
41
|
+
description: 'My first Makoo script'
|
|
53
42
|
},
|
|
54
43
|
monkey: {
|
|
55
44
|
userscript: {
|
|
56
|
-
|
|
45
|
+
namespace: 'https://example.com',
|
|
46
|
+
// This is only an example. Replace it with the pages supported by the userscript.
|
|
47
|
+
match: ['https://www.google.com/']
|
|
57
48
|
}
|
|
58
49
|
}
|
|
59
50
|
})
|
|
@@ -61,346 +52,103 @@ export default defineConfig({
|
|
|
61
52
|
});
|
|
62
53
|
```
|
|
63
54
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
CDN configuration factories re-exported from `vite-plugin-monkey`.
|
|
67
|
-
|
|
68
|
-
### Type
|
|
69
|
-
|
|
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
|
-
};
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
`bootcdn` and `staticfile` are marked as deprecated by `vite-plugin-monkey`.
|
|
91
|
-
|
|
92
|
-
## Configuration types
|
|
93
|
-
|
|
94
|
-
### `MakooOptions`
|
|
95
|
-
|
|
96
|
-
```ts
|
|
97
|
-
type MakooOptions = CliConfig & {
|
|
98
|
-
root?: string;
|
|
99
|
-
};
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### `CliConfig`
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
type CliConfig = {
|
|
106
|
-
app: AppConfig;
|
|
107
|
-
monkey?: MonkeyConfig;
|
|
108
|
-
source?: SourceConfig;
|
|
109
|
-
runtime?: {
|
|
110
|
-
setup?: string | string[];
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### `AppConfig`
|
|
116
|
-
|
|
117
|
-
```ts
|
|
118
|
-
type AppConfig = {
|
|
119
|
-
name: string;
|
|
120
|
-
version: string;
|
|
121
|
-
description?: string;
|
|
122
|
-
};
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### `SourceConfig`
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
type SourceConfig = {
|
|
129
|
-
include?: string[];
|
|
130
|
-
exclude?: string[];
|
|
131
|
-
};
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
`include` and `exclude` match injection module directory names.
|
|
135
|
-
|
|
136
|
-
### `MonkeyConfig`
|
|
137
|
-
|
|
138
|
-
```ts
|
|
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
|
-
};
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### `MonkeyServerConfig`
|
|
153
|
-
|
|
154
|
-
```ts
|
|
155
|
-
type MonkeyServerConfig = {
|
|
156
|
-
open?: boolean;
|
|
157
|
-
prefix?: string | ((name: string) => string) | false;
|
|
158
|
-
};
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### `MonkeyBuildConfig`
|
|
162
|
-
|
|
163
|
-
```ts
|
|
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
|
-
};
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## `defineInjections()`
|
|
181
|
-
|
|
182
|
-
Declares a top-level `InjectionManifest` while preserving the specific type of the provided object.
|
|
183
|
-
|
|
184
|
-
### Type
|
|
185
|
-
|
|
186
|
-
```ts
|
|
187
|
-
function defineInjections<T extends InjectionManifest>(
|
|
188
|
-
manifest: StrictShape<InjectionManifest, T>
|
|
189
|
-
): T;
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Returns
|
|
55
|
+
`makoo()` passes the configuration to [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) for userscript development and builds.
|
|
193
56
|
|
|
194
|
-
|
|
57
|
+
## Configuration Overview
|
|
195
58
|
|
|
196
|
-
|
|
59
|
+
`makoo()` has three main configuration areas:
|
|
197
60
|
|
|
198
61
|
```ts
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
injectAt: 'body',
|
|
206
|
-
component: './panel/App.vue'
|
|
207
|
-
}
|
|
62
|
+
makoo({
|
|
63
|
+
entry: './src/app.ts',
|
|
64
|
+
app: {
|
|
65
|
+
name: 'my-script',
|
|
66
|
+
version: '0.0.1',
|
|
67
|
+
description: 'demo script'
|
|
208
68
|
},
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
type: 'keydown',
|
|
213
|
-
callback: onEscape
|
|
69
|
+
monkey: {
|
|
70
|
+
userscript: {
|
|
71
|
+
match: ['https://www.google.com/']
|
|
214
72
|
}
|
|
215
73
|
}
|
|
216
74
|
});
|
|
217
75
|
```
|
|
218
76
|
|
|
219
|
-
|
|
77
|
+
| Config | Description |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `entry` | Application module passed to Vite for building |
|
|
80
|
+
| `app` | Generates userscript `name`, `version`, and `description` |
|
|
81
|
+
| `monkey` | Most options are passed through to [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey) |
|
|
220
82
|
|
|
221
|
-
|
|
83
|
+
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.
|
|
222
84
|
|
|
223
|
-
|
|
85
|
+
## CLI Commands
|
|
224
86
|
|
|
225
|
-
|
|
226
|
-
function defineInjection<T extends InjectionModuleConfig>(
|
|
227
|
-
config: StrictShape<InjectionModuleConfig, T>
|
|
228
|
-
): T;
|
|
229
|
-
```
|
|
87
|
+
After installation, you can use the `makoo` command:
|
|
230
88
|
|
|
231
|
-
|
|
89
|
+
| Command | Description |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `makoo dev` | Starts the Vite dev server and prints the local URL |
|
|
92
|
+
| `makoo build` | Runs Vite build and generates userscript output |
|
|
93
|
+
| `makoo preview` | Previews the built userscript with the Vite preview server |
|
|
232
94
|
|
|
233
|
-
|
|
95
|
+
## Use GM APIs
|
|
234
96
|
|
|
235
|
-
|
|
97
|
+
`@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.
|
|
236
98
|
|
|
237
99
|
```ts
|
|
238
|
-
|
|
239
|
-
name: 'panel',
|
|
240
|
-
injectAt: 'body',
|
|
241
|
-
component: './App.vue',
|
|
242
|
-
hooks: {
|
|
243
|
-
'artifact:mountSuccess': onMounted
|
|
244
|
-
},
|
|
245
|
-
on: {
|
|
246
|
-
listenAt: 'body',
|
|
247
|
-
type: 'click',
|
|
248
|
-
callback: onClick
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
## Manifest types
|
|
100
|
+
import { gmStorage, gmStyle } from '@makoojs/cli/monkey';
|
|
254
101
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
```ts
|
|
258
|
-
type InjectionManifest = {
|
|
259
|
-
injectionDefaults?: InjectionDefaults;
|
|
260
|
-
injections?: InjectionModuleConfig[] | Record<
|
|
261
|
-
string,
|
|
262
|
-
Omit<InjectionModuleConfig, 'name'>
|
|
263
|
-
>;
|
|
264
|
-
listeners?: InjectionListenerConfig[] | Record<
|
|
265
|
-
string,
|
|
266
|
-
Omit<InjectionListenerConfig, 'name'>
|
|
267
|
-
>;
|
|
268
|
-
};
|
|
102
|
+
gmStyle.add('.makoo-panel { z-index: 999999; }');
|
|
103
|
+
gmStorage.set('enabled', true);
|
|
269
104
|
```
|
|
270
105
|
|
|
271
|
-
|
|
106
|
+
You can also use the grouped entry:
|
|
272
107
|
|
|
273
108
|
```ts
|
|
274
|
-
|
|
275
|
-
alive?: boolean;
|
|
276
|
-
scope?: 'local' | 'global';
|
|
277
|
-
timeout?: number;
|
|
278
|
-
hooks?: LifecycleHookMap;
|
|
279
|
-
};
|
|
280
|
-
```
|
|
109
|
+
import { GMapi } from '@makoojs/cli/monkey';
|
|
281
110
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
```ts
|
|
285
|
-
type InjectionModuleConfig = {
|
|
286
|
-
name?: string;
|
|
287
|
-
injectAt: string;
|
|
288
|
-
component: string;
|
|
289
|
-
framework?: InjectionFramework;
|
|
290
|
-
enabled?: boolean;
|
|
291
|
-
match?: InjectionMatchConfig;
|
|
292
|
-
alive?: boolean;
|
|
293
|
-
scope?: 'local' | 'global';
|
|
294
|
-
timeout?: number;
|
|
295
|
-
hooks?: LifecycleHookMap;
|
|
296
|
-
on?: InjectionModuleListenerConfig;
|
|
297
|
-
};
|
|
111
|
+
GMapi.storage.set('enabled', true);
|
|
298
112
|
```
|
|
299
113
|
|
|
300
|
-
|
|
114
|
+
Use capability-level imports when you want the generated `@grant` surface to stay as small as possible. See the CLI API documentation for the complete GM API.
|
|
301
115
|
|
|
302
|
-
|
|
303
|
-
type InjectionModuleListenerConfig = {
|
|
304
|
-
listenAt: string;
|
|
305
|
-
type: string;
|
|
306
|
-
callback: EventListener;
|
|
307
|
-
activitySignal?: () => ActivitySignalSource<boolean>;
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
type InjectionListenerConfig = InjectionModuleListenerConfig & {
|
|
311
|
-
name?: string;
|
|
312
|
-
enabled?: boolean;
|
|
313
|
-
match?: InjectionMatchConfig;
|
|
314
|
-
};
|
|
315
|
-
```
|
|
116
|
+
## Reduce Build Size
|
|
316
117
|
|
|
317
|
-
|
|
118
|
+
`@makoojs/cli` re-exports `cdn` from [lisonge/vite-plugin-monkey](https://github.com/lisonge/vite-plugin-monkey). Use it with `monkey.build.externalGlobals` to load external dependencies from a CDN and reduce userscript bundle size.
|
|
318
119
|
|
|
319
120
|
```ts
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
### `InjectionMatchConfig`
|
|
121
|
+
import { defineConfig } from 'vite';
|
|
122
|
+
import { cdn, makoo } from '@makoojs/cli';
|
|
324
123
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
124
|
+
export default defineConfig({
|
|
125
|
+
plugins: [
|
|
126
|
+
makoo({
|
|
127
|
+
entry: './src/app.ts',
|
|
128
|
+
app: {
|
|
129
|
+
name: 'my-script',
|
|
130
|
+
version: '0.0.1'
|
|
131
|
+
},
|
|
132
|
+
monkey: {
|
|
133
|
+
build: {
|
|
134
|
+
externalGlobals: {
|
|
135
|
+
vue: cdn.jsdelivr('Vue', 'dist/vue.global.prod.js')
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
});
|
|
332
142
|
```
|
|
333
143
|
|
|
334
|
-
##
|
|
144
|
+
## Relationship To Other Packages
|
|
335
145
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
| Export | Methods or value |
|
|
146
|
+
| Package | Responsibility |
|
|
339
147
|
| --- | --- |
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
| `
|
|
343
|
-
| `
|
|
344
|
-
| `
|
|
345
|
-
| `unsafeWindow` | Page window |
|
|
346
|
-
| `gmClipboard` | `set(data, type?, callback?)` |
|
|
347
|
-
| `gmDownload` | `start` |
|
|
348
|
-
| `gmMenu` | `register`, `unregister` |
|
|
349
|
-
| `gmNotification` | `show` |
|
|
350
|
-
| `gmRequest` | `send`, `get`, `post` |
|
|
351
|
-
| `gmResource` | `text`, `url` |
|
|
352
|
-
| `gmStorage` | `get`, `getMany`, `set`, `setMany`, `remove`, `removeMany`, `keys`, `watch`, `unwatch` |
|
|
353
|
-
| `gmStyle` | `add`, `element` |
|
|
354
|
-
| `gmTab` | `open`, `get`, `getAll`, `save` |
|
|
355
|
-
|
|
356
|
-
### `gmRequest.get()` / `gmRequest.post()`
|
|
357
|
-
|
|
358
|
-
```ts
|
|
359
|
-
gmRequest.get<R extends GmResponseType = 'text', C = unknown>(
|
|
360
|
-
url: string,
|
|
361
|
-
options?: GmRequestOptions<R, C>
|
|
362
|
-
): GmAbortHandle;
|
|
363
|
-
|
|
364
|
-
gmRequest.post<R extends GmResponseType = 'text', C = unknown>(
|
|
365
|
-
url: string,
|
|
366
|
-
options?: GmRequestOptions<R, C>
|
|
367
|
-
): GmAbortHandle;
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
`get()` and `post()` set the request method to `GET` and `POST`, respectively.
|
|
371
|
-
|
|
372
|
-
## GM types
|
|
148
|
+
| `@makoojs/cli` | Vite plugin, CLI commands, and userscript build integration |
|
|
149
|
+
| `@makoojs/core` | Framework-agnostic injection runtime core |
|
|
150
|
+
| `@makoojs/vue` | Vue adapter and Vue plugin registration |
|
|
151
|
+
| `@makoojs/react` | React adapter |
|
|
152
|
+
| `@makoojs/create-makoo` | Project scaffold |
|
|
373
153
|
|
|
374
|
-
|
|
375
|
-
type GmRequestOptions<R extends GmResponseType = 'text', C = unknown> = Omit<
|
|
376
|
-
GmXmlhttpRequestOption<R, C>,
|
|
377
|
-
'url' | 'method'
|
|
378
|
-
>;
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
`@makoojs/cli/monkey` also re-exports these types from `vite-plugin-monkey`:
|
|
382
|
-
|
|
383
|
-
- `GmAbortHandle`
|
|
384
|
-
- `GmAddElementAttributes`
|
|
385
|
-
- `GmDownloadOptions`
|
|
386
|
-
- `GmInfoType`
|
|
387
|
-
- `GmMenuCommandOptions`
|
|
388
|
-
- `GmNotificationOptions`
|
|
389
|
-
- `GmOpenInTabOptions`
|
|
390
|
-
- `GmResponseEvent`
|
|
391
|
-
- `GmResponseType`
|
|
392
|
-
- `GmTabControl`
|
|
393
|
-
- `GmType`
|
|
394
|
-
- `GmValueListenerId`
|
|
395
|
-
- `GmXmlhttpRequestOption`
|
|
396
|
-
- `MonkeyWindow`
|
|
397
|
-
|
|
398
|
-
## CLI commands
|
|
399
|
-
|
|
400
|
-
| Command | Description |
|
|
401
|
-
| --- | --- |
|
|
402
|
-
| `makoo dev` | Starts the Vite development server |
|
|
403
|
-
| `makoo build` | Runs a Vite build |
|
|
404
|
-
| `makoo add <name>` | Creates a React injection module and updates the manifest |
|
|
405
|
-
| `makoo add <name> --framework Vue` | Creates a Vue injection module and updates the manifest |
|
|
406
|
-
| `makoo inspect` | Prints resolved configuration, scan results, and framework information |
|
|
154
|
+
Application code composes runtime behavior through `@makoojs/core`.
|