@makoojs/cli 0.1.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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.CN.md +373 -0
  3. package/README.md +373 -0
  4. package/dist/bin.js +1506 -0
  5. package/dist/command/_util.d.ts +16 -0
  6. package/dist/command/add.d.ts +1 -0
  7. package/dist/command/bin.d.ts +2 -0
  8. package/dist/command/build.d.ts +1 -0
  9. package/dist/command/dev.d.ts +1 -0
  10. package/dist/command/inspect.d.ts +1 -0
  11. package/dist/config/config.d.ts +3 -0
  12. package/dist/config/defaults.d.ts +26 -0
  13. package/dist/config/resolve.d.ts +17 -0
  14. package/dist/config/types.d.ts +140 -0
  15. package/dist/config/validation.d.ts +15 -0
  16. package/dist/error/error.d.ts +46 -0
  17. package/dist/generator/generator.d.ts +3 -0
  18. package/dist/generator/render/import/importAdapter.d.ts +3 -0
  19. package/dist/generator/render/import/importComp.d.ts +3 -0
  20. package/dist/generator/render/import/importInjector.d.ts +1 -0
  21. package/dist/generator/render/import/importRuntimeSetup.d.ts +1 -0
  22. package/dist/generator/render/init/initInjector.d.ts +3 -0
  23. package/dist/generator/render/init/registerComp.d.ts +2 -0
  24. package/dist/generator/render/run/renderInjectorRun.d.ts +1 -0
  25. package/dist/generator/render/util/value.d.ts +1 -0
  26. package/dist/generator/types.d.ts +21 -0
  27. package/dist/index.cjs +86 -0
  28. package/dist/index.d.ts +5 -0
  29. package/dist/index.js +5090 -0
  30. package/dist/monkey/clipboard.d.ts +3 -0
  31. package/dist/monkey/download.d.ts +3 -0
  32. package/dist/monkey/index.cjs +1 -0
  33. package/dist/monkey/index.d.ts +60 -0
  34. package/dist/monkey/index.js +60 -0
  35. package/dist/monkey/info.d.ts +5 -0
  36. package/dist/monkey/menu.d.ts +4 -0
  37. package/dist/monkey/notification.d.ts +3 -0
  38. package/dist/monkey/request.d.ts +7 -0
  39. package/dist/monkey/resource.d.ts +4 -0
  40. package/dist/monkey/storage.d.ts +11 -0
  41. package/dist/monkey/style.d.ts +4 -0
  42. package/dist/monkey/tab.d.ts +6 -0
  43. package/dist/scanner/collectDependenics.d.ts +2 -0
  44. package/dist/scanner/load/loadManifes.d.ts +3 -0
  45. package/dist/scanner/load/loadMeta.d.ts +2 -0
  46. package/dist/scanner/scanner.d.ts +3 -0
  47. package/dist/scanner/types.d.ts +23 -0
  48. package/dist/scanner/util.d.ts +2 -0
  49. package/dist/scanner/validation.d.ts +121 -0
  50. package/dist/vitePlugin/hmrController.d.ts +4 -0
  51. package/dist/vitePlugin/makoo.d.ts +3 -0
  52. package/dist/vitePlugin/makooMonkey.d.ts +3 -0
  53. package/dist/vitePlugin/types.d.ts +12 -0
  54. package/dist/vitePlugin/virtualModule.d.ts +2 -0
  55. package/dist/vitePlugin/watchList.d.ts +4 -0
  56. package/package.json +54 -0
@@ -0,0 +1,3 @@
1
+ export declare const gmClipboard: {
2
+ set(data: string, type?: string, callback?: () => void): void;
3
+ };
@@ -0,0 +1,3 @@
1
+ export declare const gmDownload: {
2
+ start: import('vite-plugin-monkey/dist/client').GmDownloadType;
3
+ };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vite-plugin-monkey/dist/client");var t={set(t,n=`text/plain`,r){return(0,e.GM_setClipboard)(t,n,r)}},n={start:e.GM_download},r=e.GM,i=e.GM_info,a=e.GM_log,o={register:e.GM_registerMenuCommand,unregister:e.GM_unregisterMenuCommand},s={show:e.GM_notification},c={send:e.GM_xmlhttpRequest,get(t,n){return(0,e.GM_xmlhttpRequest)({...n??{},url:t,method:`GET`})},post(t,n){return(0,e.GM_xmlhttpRequest)({...n??{},url:t,method:`POST`})}},l={text:e.GM_getResourceText,url:e.GM_getResourceURL},u={get:e.GM_getValue,getMany:e.GM_getValues,set:e.GM_setValue,setMany:e.GM_setValues,remove:e.GM_deleteValue,removeMany:e.GM_deleteValues,keys:e.GM_listValues,watch:e.GM_addValueChangeListener,unwatch:e.GM_removeValueChangeListener},d={add:e.GM_addStyle,element:e.GM_addElement},f={open:e.GM_openInTab,get:e.GM_getTab,getAll:e.GM_getTabs,save:e.GM_saveTab},p={raw:r,info:i,log:a,storage:u,style:d,request:c,menu:o,clipboard:t,notification:s,tab:f,download:n,resource:l};exports.GMapi=p,exports.gm=r,exports.gmClipboard=t,exports.gmDownload=n,exports.gmInfo=i,exports.gmLog=a,exports.gmMenu=o,exports.gmNotification=s,exports.gmRequest=c,exports.gmResource=l,exports.gmStorage=u,exports.gmStyle=d,exports.gmTab=f,exports.monkeyWindow=e.monkeyWindow,exports.unsafeWindow=e.unsafeWindow;
@@ -0,0 +1,60 @@
1
+ export { gmClipboard } from './clipboard';
2
+ export { gmDownload } from './download';
3
+ export { gm, gmInfo, gmLog, monkeyWindow, unsafeWindow } from './info';
4
+ export { gmMenu } from './menu';
5
+ export { gmNotification } from './notification';
6
+ export type { GmRequestOptions } from './request';
7
+ export { gmRequest } from './request';
8
+ export { gmResource } from './resource';
9
+ export { gmStorage } from './storage';
10
+ export { gmStyle } from './style';
11
+ export { gmTab } from './tab';
12
+ export declare const GMapi: {
13
+ raw: import('vite-plugin-monkey/dist/client').GmType;
14
+ info: import('vite-plugin-monkey/dist/client').GmInfoType;
15
+ log: import('vite-plugin-monkey/dist/client').GmLogType;
16
+ storage: {
17
+ get: import('vite-plugin-monkey/dist/client').GmGetValueType;
18
+ getMany: import('vite-plugin-monkey/dist/client').GmGetValuesType;
19
+ set: import('vite-plugin-monkey/dist/client').GmSetValueType;
20
+ setMany: import('vite-plugin-monkey/dist/client').GmSetValuesType;
21
+ remove: import('vite-plugin-monkey/dist/client').GmDeleteValueType;
22
+ removeMany: import('vite-plugin-monkey/dist/client').GmDeleteValuesType;
23
+ keys: import('vite-plugin-monkey/dist/client').GmListValuesType;
24
+ watch: import('vite-plugin-monkey/dist/client').GmAddValueChangeListenerType;
25
+ unwatch: import('vite-plugin-monkey/dist/client').GmRemoveValueChangeListenerType;
26
+ };
27
+ style: {
28
+ add: import('vite-plugin-monkey/dist/client').GmAddStyleType;
29
+ element: import('vite-plugin-monkey/dist/client').GmAddElementType;
30
+ };
31
+ request: {
32
+ send: import('vite-plugin-monkey/dist/client').GmXmlhttpRequestType;
33
+ get<R extends import('vite-plugin-monkey/dist/client').GmResponseType = "text", C = unknown>(url: string, options?: import('./request').GmRequestOptions<R, C>): import('vite-plugin-monkey/dist/client').GmAbortHandle<void>;
34
+ post<R extends import('vite-plugin-monkey/dist/client').GmResponseType = "text", C = unknown>(url: string, options?: import('./request').GmRequestOptions<R, C>): import('vite-plugin-monkey/dist/client').GmAbortHandle<void>;
35
+ };
36
+ menu: {
37
+ register: import('vite-plugin-monkey/dist/client').GmRegisterMenuCommandType;
38
+ unregister: import('vite-plugin-monkey/dist/client').GmUnregisterMenuCommandType;
39
+ };
40
+ clipboard: {
41
+ set(data: string, type?: string, callback?: () => void): void;
42
+ };
43
+ notification: {
44
+ show: import('vite-plugin-monkey/dist/client').GmNotificationType;
45
+ };
46
+ tab: {
47
+ open: import('vite-plugin-monkey/dist/client').GmOpenInTabType;
48
+ get: import('vite-plugin-monkey/dist/client').GmGetTabType;
49
+ getAll: import('vite-plugin-monkey/dist/client').GmGetTabsType;
50
+ save: import('vite-plugin-monkey/dist/client').GmSaveTab;
51
+ };
52
+ download: {
53
+ start: import('vite-plugin-monkey/dist/client').GmDownloadType;
54
+ };
55
+ resource: {
56
+ text: import('vite-plugin-monkey/dist/client').GmGetResourceTextType;
57
+ url: import('vite-plugin-monkey/dist/client').GmGetResourceURLType;
58
+ };
59
+ };
60
+ export type { GmAbortHandle, GmAddElementAttributes, GmDownloadOptions, GmInfoType, GmMenuCommandOptions, GmNotificationOptions, GmOpenInTabOptions, GmResponseEvent, GmResponseType, GmTabControl, GmType, GmValueListenerId, GmXmlhttpRequestOption, MonkeyWindow } from 'vite-plugin-monkey/dist/client';
@@ -0,0 +1,60 @@
1
+ import { GM as e, GM_addElement as t, GM_addStyle as n, GM_addValueChangeListener as r, GM_deleteValue as i, GM_deleteValues as a, GM_download as o, GM_getResourceText as s, GM_getResourceURL as c, GM_getTab as l, GM_getTabs as u, GM_getValue as d, GM_getValues as f, GM_info as p, GM_listValues as m, GM_log as h, GM_notification as g, GM_openInTab as _, GM_registerMenuCommand as v, GM_removeValueChangeListener as y, GM_saveTab as b, GM_setClipboard as x, GM_setValue as S, GM_setValues as C, GM_unregisterMenuCommand as w, GM_xmlhttpRequest as T, monkeyWindow as E, unsafeWindow as D } from "vite-plugin-monkey/dist/client";
2
+ //#region packages/cli/src/monkey/clipboard.ts
3
+ var O = { set(e, t = "text/plain", n) {
4
+ return x(e, t, n);
5
+ } }, k = { start: o }, A = e, j = p, M = h, N = {
6
+ register: v,
7
+ unregister: w
8
+ }, P = { show: g }, F = {
9
+ send: T,
10
+ get(e, t) {
11
+ return T({
12
+ ...t ?? {},
13
+ url: e,
14
+ method: "GET"
15
+ });
16
+ },
17
+ post(e, t) {
18
+ return T({
19
+ ...t ?? {},
20
+ url: e,
21
+ method: "POST"
22
+ });
23
+ }
24
+ }, I = {
25
+ text: s,
26
+ url: c
27
+ }, L = {
28
+ get: d,
29
+ getMany: f,
30
+ set: S,
31
+ setMany: C,
32
+ remove: i,
33
+ removeMany: a,
34
+ keys: m,
35
+ watch: r,
36
+ unwatch: y
37
+ }, R = {
38
+ add: n,
39
+ element: t
40
+ }, z = {
41
+ open: _,
42
+ get: l,
43
+ getAll: u,
44
+ save: b
45
+ }, B = {
46
+ raw: A,
47
+ info: j,
48
+ log: M,
49
+ storage: L,
50
+ style: R,
51
+ request: F,
52
+ menu: N,
53
+ clipboard: O,
54
+ notification: P,
55
+ tab: z,
56
+ download: k,
57
+ resource: I
58
+ };
59
+ //#endregion
60
+ export { B as GMapi, A as gm, O as gmClipboard, k as gmDownload, j as gmInfo, M as gmLog, N as gmMenu, P as gmNotification, F as gmRequest, I as gmResource, L as gmStorage, R as gmStyle, z as gmTab, E as monkeyWindow, D as unsafeWindow };
@@ -0,0 +1,5 @@
1
+ import { monkeyWindow, unsafeWindow } from 'vite-plugin-monkey/dist/client';
2
+ export declare const gm: import('vite-plugin-monkey/dist/client').GmType;
3
+ export declare const gmInfo: import('vite-plugin-monkey/dist/client').GmInfoType;
4
+ export declare const gmLog: import('vite-plugin-monkey/dist/client').GmLogType;
5
+ export { monkeyWindow, unsafeWindow };
@@ -0,0 +1,4 @@
1
+ export declare const gmMenu: {
2
+ register: import('vite-plugin-monkey/dist/client').GmRegisterMenuCommandType;
3
+ unregister: import('vite-plugin-monkey/dist/client').GmUnregisterMenuCommandType;
4
+ };
@@ -0,0 +1,3 @@
1
+ export declare const gmNotification: {
2
+ show: import('vite-plugin-monkey/dist/client').GmNotificationType;
3
+ };
@@ -0,0 +1,7 @@
1
+ import { GmResponseType, GmXmlhttpRequestOption } from 'vite-plugin-monkey/dist/client';
2
+ export type GmRequestOptions<R extends GmResponseType = 'text', C = unknown> = Omit<GmXmlhttpRequestOption<R, C>, 'url' | 'method'>;
3
+ export declare const gmRequest: {
4
+ send: import('vite-plugin-monkey/dist/client').GmXmlhttpRequestType;
5
+ get<R extends GmResponseType = "text", C = unknown>(url: string, options?: GmRequestOptions<R, C>): import('vite-plugin-monkey/dist/client').GmAbortHandle<void>;
6
+ post<R extends GmResponseType = "text", C = unknown>(url: string, options?: GmRequestOptions<R, C>): import('vite-plugin-monkey/dist/client').GmAbortHandle<void>;
7
+ };
@@ -0,0 +1,4 @@
1
+ export declare const gmResource: {
2
+ text: import('vite-plugin-monkey/dist/client').GmGetResourceTextType;
3
+ url: import('vite-plugin-monkey/dist/client').GmGetResourceURLType;
4
+ };
@@ -0,0 +1,11 @@
1
+ export declare const gmStorage: {
2
+ get: import('vite-plugin-monkey/dist/client').GmGetValueType;
3
+ getMany: import('vite-plugin-monkey/dist/client').GmGetValuesType;
4
+ set: import('vite-plugin-monkey/dist/client').GmSetValueType;
5
+ setMany: import('vite-plugin-monkey/dist/client').GmSetValuesType;
6
+ remove: import('vite-plugin-monkey/dist/client').GmDeleteValueType;
7
+ removeMany: import('vite-plugin-monkey/dist/client').GmDeleteValuesType;
8
+ keys: import('vite-plugin-monkey/dist/client').GmListValuesType;
9
+ watch: import('vite-plugin-monkey/dist/client').GmAddValueChangeListenerType;
10
+ unwatch: import('vite-plugin-monkey/dist/client').GmRemoveValueChangeListenerType;
11
+ };
@@ -0,0 +1,4 @@
1
+ export declare const gmStyle: {
2
+ add: import('vite-plugin-monkey/dist/client').GmAddStyleType;
3
+ element: import('vite-plugin-monkey/dist/client').GmAddElementType;
4
+ };
@@ -0,0 +1,6 @@
1
+ export declare const gmTab: {
2
+ open: import('vite-plugin-monkey/dist/client').GmOpenInTabType;
3
+ get: import('vite-plugin-monkey/dist/client').GmGetTabType;
4
+ getAll: import('vite-plugin-monkey/dist/client').GmGetTabsType;
5
+ save: import('vite-plugin-monkey/dist/client').GmSaveTab;
6
+ };
@@ -0,0 +1,2 @@
1
+ import { CollectDependenciesOption } from './types';
2
+ export declare function collectDependencies(entryFile: string, options: CollectDependenciesOption): string[];
@@ -0,0 +1,3 @@
1
+ import { ResolvedSourceConfig } from '../../config/types';
2
+ import { LoadManifestResult } from '../types';
3
+ export declare function loadManifest(source: ResolvedSourceConfig): Promise<LoadManifestResult | null>;
@@ -0,0 +1,2 @@
1
+ import { LoadMetaResult } from '../types';
2
+ export declare function loadMeta(root: string): Promise<LoadMetaResult | null>;
@@ -0,0 +1,3 @@
1
+ import { ResolvedConfig } from '../config/types';
2
+ import { ScannerResult } from './types';
3
+ export declare function scanner(config: ResolvedConfig): Promise<ScannerResult>;
@@ -0,0 +1,23 @@
1
+ import { InjectionManifest, InjectionModuleConfig, ResolvedConfig, ResolvedInjectionFramework, ResolvedInjectionModule } from '../config/types';
2
+ export type ScannerResult = {
3
+ manifestFile: string;
4
+ manifestDependencies: string[];
5
+ runtimeDependencies: string[];
6
+ config: ResolvedConfig;
7
+ injections: ResolvedInjectionModule[];
8
+ frameworks: ResolvedInjectionFramework[];
9
+ };
10
+ export type LoadManifestResult = {
11
+ manifest: InjectionManifest;
12
+ manifestFile: string;
13
+ dependencies: string[];
14
+ };
15
+ export type LoadMetaResult = {
16
+ overridePath: string;
17
+ moduleConfig: InjectionModuleConfig;
18
+ dependencies: string[];
19
+ };
20
+ export type CollectDependenciesOption = {
21
+ root: string;
22
+ includeEntry?: boolean;
23
+ };
@@ -0,0 +1,2 @@
1
+ import { ResolvedInjectionModule } from '../config/types';
2
+ export declare function mergeMeta(source: ResolvedInjectionModule[], target: ResolvedInjectionModule[]): ResolvedInjectionModule[];
@@ -0,0 +1,121 @@
1
+ import { z } from 'zod';
2
+ export declare const ObserveEventNameSchema: z.ZodEnum<{
3
+ "register:start": "register:start";
4
+ "register:success": "register:success";
5
+ "register:duplicate": "register:duplicate";
6
+ "register:error": "register:error";
7
+ "run:start": "run:start";
8
+ "run:taskScheduled": "run:taskScheduled";
9
+ "run:taskSkipped": "run:taskSkipped";
10
+ "artifact:mountStart": "artifact:mountStart";
11
+ "artifact:mountSuccess": "artifact:mountSuccess";
12
+ "artifact:mountFail": "artifact:mountFail";
13
+ "listener:attached": "listener:attached";
14
+ "listener:detached": "listener:detached";
15
+ "listener:attachFail": "listener:attachFail";
16
+ "alive:enabled": "alive:enabled";
17
+ "alive:disabled": "alive:disabled";
18
+ "alive:observerStarted": "alive:observerStarted";
19
+ "alive:observerStopped": "alive:observerStopped";
20
+ "task:targetReady": "task:targetReady";
21
+ "task:statusChange": "task:statusChange";
22
+ "task:beforeReset": "task:beforeReset";
23
+ "task:afterReset": "task:afterReset";
24
+ "task:beforeDestroy": "task:beforeDestroy";
25
+ "task:afterDestroy": "task:afterDestroy";
26
+ "signal:watcherReleased": "signal:watcherReleased";
27
+ "resource:listenerReleased": "resource:listenerReleased";
28
+ "artifact:unmounted": "artifact:unmounted";
29
+ "dom:targetFound": "dom:targetFound";
30
+ "dom:targetTimeout": "dom:targetTimeout";
31
+ "dom:targetRemoved": "dom:targetRemoved";
32
+ "dom:targetRestored": "dom:targetRestored";
33
+ }>;
34
+ export declare const LifecycleHookMapSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>, z.ZodArray<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>]>>;
35
+ export declare const InjectorConfigSchema: z.ZodObject<{
36
+ alive: z.ZodOptional<z.ZodBoolean>;
37
+ scope: z.ZodOptional<z.ZodEnum<{
38
+ local: "local";
39
+ global: "global";
40
+ }>>;
41
+ timeout: z.ZodOptional<z.ZodNumber>;
42
+ hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>, z.ZodArray<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>]>>>;
43
+ }, z.core.$strip>;
44
+ export declare const InjectionMatchSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
45
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ }, z.core.$strip>]>;
48
+ export declare const InjectionModuleSchema: z.ZodObject<{
49
+ name: z.ZodOptional<z.ZodString>;
50
+ injectAt: z.ZodString;
51
+ component: z.ZodString;
52
+ framework: z.ZodOptional<z.ZodEnum<{
53
+ auto: "auto";
54
+ Vue: "Vue";
55
+ React: "React";
56
+ }>>;
57
+ enabled: z.ZodOptional<z.ZodBoolean>;
58
+ match: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
59
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
+ }, z.core.$strip>]>>;
62
+ alive: z.ZodOptional<z.ZodBoolean>;
63
+ scope: z.ZodOptional<z.ZodEnum<{
64
+ local: "local";
65
+ global: "global";
66
+ }>>;
67
+ timeout: z.ZodOptional<z.ZodNumber>;
68
+ }, z.core.$strip>;
69
+ export declare const InjectionManifestSchema: z.ZodObject<{
70
+ globalInjector: z.ZodOptional<z.ZodObject<{
71
+ alive: z.ZodOptional<z.ZodBoolean>;
72
+ scope: z.ZodOptional<z.ZodEnum<{
73
+ local: "local";
74
+ global: "global";
75
+ }>>;
76
+ timeout: z.ZodOptional<z.ZodNumber>;
77
+ hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>, z.ZodArray<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>]>>>;
78
+ }, z.core.$strip>>;
79
+ injections: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
80
+ name: z.ZodOptional<z.ZodString>;
81
+ injectAt: z.ZodString;
82
+ component: z.ZodString;
83
+ framework: z.ZodOptional<z.ZodEnum<{
84
+ auto: "auto";
85
+ Vue: "Vue";
86
+ React: "React";
87
+ }>>;
88
+ enabled: z.ZodOptional<z.ZodBoolean>;
89
+ match: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
90
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
+ }, z.core.$strip>]>>;
93
+ alive: z.ZodOptional<z.ZodBoolean>;
94
+ scope: z.ZodOptional<z.ZodEnum<{
95
+ local: "local";
96
+ global: "global";
97
+ }>>;
98
+ timeout: z.ZodOptional<z.ZodNumber>;
99
+ }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodObject<{
100
+ alive: z.ZodOptional<z.ZodBoolean>;
101
+ scope: z.ZodOptional<z.ZodEnum<{
102
+ local: "local";
103
+ global: "global";
104
+ }>>;
105
+ timeout: z.ZodOptional<z.ZodNumber>;
106
+ injectAt: z.ZodString;
107
+ component: z.ZodString;
108
+ framework: z.ZodOptional<z.ZodEnum<{
109
+ auto: "auto";
110
+ Vue: "Vue";
111
+ React: "React";
112
+ }>>;
113
+ enabled: z.ZodOptional<z.ZodBoolean>;
114
+ match: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
115
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ }, z.core.$strip>]>>;
118
+ }, z.core.$strip>>]>;
119
+ }, z.core.$strip>;
120
+ export declare function validateManifest(data: unknown, file: string): z.infer<typeof InjectionManifestSchema>;
121
+ export declare function validateModuleMeta(data: unknown, file: string): z.infer<typeof InjectionModuleSchema>;
@@ -0,0 +1,4 @@
1
+ import { ViteDevServer } from 'vite';
2
+ export declare function invalidateVirtualModule(server: ViteDevServer): void;
3
+ export declare function sendScanError(server: ViteDevServer, error: unknown): void;
4
+ export declare function triggerModuleHmr(server: ViteDevServer): void;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from 'vite';
2
+ import { MakooOptions } from './types';
3
+ export declare function makoo(options: MakooOptions): Plugin[];
@@ -0,0 +1,3 @@
1
+ import { ResolvedConfig } from '../config/types';
2
+ import { MakooMonkeyPlugin } from './types';
3
+ export declare function makooMonkey(config: ResolvedConfig): MakooMonkeyPlugin;
@@ -0,0 +1,12 @@
1
+ import { Plugin } from 'vite';
2
+ import { CliConfig, ResolvedConfig } from '../config/types';
3
+ export type MakooMonkeyPlugin = Plugin & {
4
+ __makoo: ResolvedConfig;
5
+ };
6
+ export type WatchTargets = {
7
+ files: string[];
8
+ dirs: string[];
9
+ };
10
+ export type MakooOptions = CliConfig & {
11
+ root?: string;
12
+ };
@@ -0,0 +1,2 @@
1
+ import { ScannerResult } from '../scanner/types';
2
+ export declare function buildVirtualMouduleCode(scanResult: ScannerResult, isDev: boolean): string;
@@ -0,0 +1,4 @@
1
+ import { ScannerResult } from '../scanner/types';
2
+ import { WatchTargets } from './types';
3
+ export declare function getWatchTargets(scanResult: ScannerResult): WatchTargets;
4
+ export declare function isStructuralChange(changedFile: string, scanResult: ScannerResult): boolean;
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@makoojs/cli",
3
+ "version": "0.1.0",
4
+ "description": "CLI and Vite integration for the Makoo userscript development framework",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/makoojs/Makoo.git",
10
+ "directory": "packages/cli"
11
+ },
12
+ "homepage": "https://github.com/makoojs/Makoo#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/makoojs/Makoo/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "bin": {
23
+ "makoo": "./dist/bin.js"
24
+ },
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "require": "./dist/index.cjs"
33
+ },
34
+ "./monkey": {
35
+ "types": "./dist/monkey/index.d.ts",
36
+ "import": "./dist/monkey/index.js",
37
+ "require": "./dist/monkey/index.cjs"
38
+ }
39
+ },
40
+ "dependencies": {
41
+ "jiti": "^2.6.1",
42
+ "picomatch": "^4.0.4",
43
+ "vite-plugin-monkey": "^7.1.9",
44
+ "zod": "^4.4.3",
45
+ "@makoojs/core": "0.1.0"
46
+ },
47
+ "devDependencies": {
48
+ "@types/picomatch": "^4.0.3",
49
+ "cac": "^7.0.0"
50
+ },
51
+ "peerDependencies": {
52
+ "vite": ">=7"
53
+ }
54
+ }