@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.
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=e=>e;function t(e){return e}exports.defineInjection=e,exports.defineInjections=t;
@@ -0,0 +1,2 @@
1
+ export { defineInjection, defineInjections } from '../config/config';
2
+ export type { InjectionDefaults, InjectionFramework, InjectionListenerConfig, InjectionManifest, InjectionMatchConfig, InjectionModuleConfig, InjectionModuleListenerConfig } from '../config/types';
@@ -0,0 +1,7 @@
1
+ //#region packages/cli/src/config/config.ts
2
+ var e = (e) => e;
3
+ function t(e) {
4
+ return e;
5
+ }
6
+ //#endregion
7
+ export { e as defineInjection, t as defineInjections };
@@ -0,0 +1,14 @@
1
+ import { InjectionManifest, InjectionModuleConfig, ResolvedInjectionModule, ResolvedListener } from '../config/types';
2
+ import { ScannerManifestBindings } from './types';
3
+ type BuildManifestBindingsOptions = {
4
+ manifest: InjectionManifest;
5
+ manifestFile: string;
6
+ manifestInjections: ResolvedInjectionModule[];
7
+ moduleInjections: ResolvedInjectionModule[];
8
+ moduleInjectionConfigs: Map<string, InjectionModuleConfig>;
9
+ manifestListeners: ResolvedListener[];
10
+ enabledInjections: ResolvedInjectionModule[];
11
+ enabledListeners: ResolvedListener[];
12
+ };
13
+ export declare function buildManifestBindings(options: BuildManifestBindingsOptions): ScannerManifestBindings;
14
+ export {};
@@ -1,6 +1,7 @@
1
- import { InjectionManifest, InjectionModuleConfig, ResolvedConfig, ResolvedInjectionDefaults, ResolvedInjectionFramework, ResolvedInjectionModule } from '../config/types';
1
+ import { InjectionManifest, InjectionModuleConfig, ResolvedConfig, ResolvedInjectionDefaults, ResolvedInjectionFramework, ResolvedInjectionModule, ResolvedListener } from '../config/types';
2
2
  export type ScannerResult = {
3
3
  manifestFile: string;
4
+ manifestBindings: ScannerManifestBindings;
4
5
  manifestDependencies: string[];
5
6
  moduleManifestDependencies: string[];
6
7
  runtimeSetupFiles: string[];
@@ -8,8 +9,31 @@ export type ScannerResult = {
8
9
  config: ResolvedConfig;
9
10
  injectionDefaults: ResolvedInjectionDefaults;
10
11
  injections: ResolvedInjectionModule[];
12
+ listeners: ResolvedListener[];
11
13
  frameworks: ResolvedInjectionFramework[];
12
14
  };
15
+ export type ManifestBinding = {
16
+ manifestFile: string;
17
+ valuePath: Array<string | number>;
18
+ };
19
+ export type InjectionManifestBindings = {
20
+ hooks?: ManifestBinding;
21
+ on?: {
22
+ callback: ManifestBinding;
23
+ activitySignal?: ManifestBinding;
24
+ };
25
+ };
26
+ export type ListenerManifestBindings = {
27
+ callback: ManifestBinding;
28
+ activitySignal?: ManifestBinding;
29
+ };
30
+ export type ScannerManifestBindings = {
31
+ injectionDefaults?: {
32
+ hooks: ManifestBinding;
33
+ };
34
+ injections: Record<string, InjectionManifestBindings>;
35
+ listeners: Record<string, ListenerManifestBindings>;
36
+ };
13
37
  export type LoadManifestResult = {
14
38
  manifest: InjectionManifest;
15
39
  manifestFile: string;
@@ -1,3 +1,4 @@
1
+ import { ActivitySignalSource, ObserveHook } from '../../../../../core';
1
2
  import { z } from 'zod';
2
3
  export declare const ObserveEventNameSchema: z.ZodEnum<{
3
4
  "register:start": "register:start";
@@ -31,7 +32,7 @@ export declare const ObserveEventNameSchema: z.ZodEnum<{
31
32
  "dom:targetRemoved": "dom:targetRemoved";
32
33
  "dom:targetRestored": "dom:targetRestored";
33
34
  }>;
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 LifecycleHookMapSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodCustom<ObserveHook, ObserveHook>, z.ZodArray<z.ZodCustom<ObserveHook, ObserveHook>>]>>;
35
36
  export declare const InjectionDefaultsSchema: z.ZodObject<{
36
37
  alive: z.ZodOptional<z.ZodBoolean>;
37
38
  scope: z.ZodOptional<z.ZodEnum<{
@@ -39,12 +40,19 @@ export declare const InjectionDefaultsSchema: z.ZodObject<{
39
40
  global: "global";
40
41
  }>>;
41
42
  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
+ hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodCustom<ObserveHook, ObserveHook>, z.ZodArray<z.ZodCustom<ObserveHook, ObserveHook>>]>>>;
43
44
  }, z.core.$strip>;
44
45
  export declare const InjectionMatchSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
45
46
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
47
  exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
48
  }, z.core.$strip>]>;
49
+ export declare const InjectionModuleListenerSchema: z.ZodObject<{
50
+ listenAt: z.ZodString;
51
+ type: z.ZodString;
52
+ callback: z.ZodCustom<EventListener, EventListener>;
53
+ capture: z.ZodOptional<z.ZodBoolean>;
54
+ activitySignal: z.ZodOptional<z.ZodCustom<() => ActivitySignalSource<boolean>, () => ActivitySignalSource<boolean>>>;
55
+ }, z.core.$strip>;
48
56
  export declare const InjectionModuleSchema: z.ZodObject<{
49
57
  name: z.ZodOptional<z.ZodString>;
50
58
  injectAt: z.ZodString;
@@ -65,6 +73,27 @@ export declare const InjectionModuleSchema: z.ZodObject<{
65
73
  global: "global";
66
74
  }>>;
67
75
  timeout: z.ZodOptional<z.ZodNumber>;
76
+ hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodCustom<ObserveHook, ObserveHook>, z.ZodArray<z.ZodCustom<ObserveHook, ObserveHook>>]>>>;
77
+ on: z.ZodOptional<z.ZodObject<{
78
+ listenAt: z.ZodString;
79
+ type: z.ZodString;
80
+ callback: z.ZodCustom<EventListener, EventListener>;
81
+ capture: z.ZodOptional<z.ZodBoolean>;
82
+ activitySignal: z.ZodOptional<z.ZodCustom<() => ActivitySignalSource<boolean>, () => ActivitySignalSource<boolean>>>;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>;
85
+ export declare const InjectionListenerSchema: z.ZodObject<{
86
+ listenAt: z.ZodString;
87
+ type: z.ZodString;
88
+ callback: z.ZodCustom<EventListener, EventListener>;
89
+ capture: z.ZodOptional<z.ZodBoolean>;
90
+ activitySignal: z.ZodOptional<z.ZodCustom<() => ActivitySignalSource<boolean>, () => ActivitySignalSource<boolean>>>;
91
+ name: z.ZodOptional<z.ZodString>;
92
+ enabled: z.ZodOptional<z.ZodBoolean>;
93
+ match: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
94
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
+ }, z.core.$strip>]>>;
68
97
  }, z.core.$strip>;
69
98
  export declare const InjectionManifestSchema: z.ZodObject<{
70
99
  injectionDefaults: z.ZodOptional<z.ZodObject<{
@@ -74,9 +103,9 @@ export declare const InjectionManifestSchema: z.ZodObject<{
74
103
  global: "global";
75
104
  }>>;
76
105
  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>>]>>>;
106
+ hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodCustom<ObserveHook, ObserveHook>, z.ZodArray<z.ZodCustom<ObserveHook, ObserveHook>>]>>>;
78
107
  }, z.core.$strip>>;
79
- injections: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
108
+ injections: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
80
109
  name: z.ZodOptional<z.ZodString>;
81
110
  injectAt: z.ZodString;
82
111
  component: z.ZodString;
@@ -96,6 +125,14 @@ export declare const InjectionManifestSchema: z.ZodObject<{
96
125
  global: "global";
97
126
  }>>;
98
127
  timeout: z.ZodOptional<z.ZodNumber>;
128
+ hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodCustom<ObserveHook, ObserveHook>, z.ZodArray<z.ZodCustom<ObserveHook, ObserveHook>>]>>>;
129
+ on: z.ZodOptional<z.ZodObject<{
130
+ listenAt: z.ZodString;
131
+ type: z.ZodString;
132
+ callback: z.ZodCustom<EventListener, EventListener>;
133
+ capture: z.ZodOptional<z.ZodBoolean>;
134
+ activitySignal: z.ZodOptional<z.ZodCustom<() => ActivitySignalSource<boolean>, () => ActivitySignalSource<boolean>>>;
135
+ }, z.core.$strip>>;
99
136
  }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodObject<{
100
137
  alive: z.ZodOptional<z.ZodBoolean>;
101
138
  scope: z.ZodOptional<z.ZodEnum<{
@@ -103,6 +140,14 @@ export declare const InjectionManifestSchema: z.ZodObject<{
103
140
  global: "global";
104
141
  }>>;
105
142
  timeout: z.ZodOptional<z.ZodNumber>;
143
+ hooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodCustom<ObserveHook, ObserveHook>, z.ZodArray<z.ZodCustom<ObserveHook, ObserveHook>>]>>>;
144
+ on: z.ZodOptional<z.ZodObject<{
145
+ listenAt: z.ZodString;
146
+ type: z.ZodString;
147
+ callback: z.ZodCustom<EventListener, EventListener>;
148
+ capture: z.ZodOptional<z.ZodBoolean>;
149
+ activitySignal: z.ZodOptional<z.ZodCustom<() => ActivitySignalSource<boolean>, () => ActivitySignalSource<boolean>>>;
150
+ }, z.core.$strip>>;
106
151
  injectAt: z.ZodString;
107
152
  component: z.ZodString;
108
153
  framework: z.ZodOptional<z.ZodEnum<{
@@ -115,7 +160,31 @@ export declare const InjectionManifestSchema: z.ZodObject<{
115
160
  include: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
161
  exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
162
  }, z.core.$strip>]>>;
118
- }, z.core.$strip>>]>;
163
+ }, z.core.$strip>>]>>;
164
+ listeners: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
165
+ listenAt: z.ZodString;
166
+ type: z.ZodString;
167
+ callback: z.ZodCustom<EventListener, EventListener>;
168
+ capture: z.ZodOptional<z.ZodBoolean>;
169
+ activitySignal: z.ZodOptional<z.ZodCustom<() => ActivitySignalSource<boolean>, () => ActivitySignalSource<boolean>>>;
170
+ name: z.ZodOptional<z.ZodString>;
171
+ enabled: z.ZodOptional<z.ZodBoolean>;
172
+ match: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
173
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
174
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
175
+ }, z.core.$strip>]>>;
176
+ }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodObject<{
177
+ enabled: z.ZodOptional<z.ZodBoolean>;
178
+ match: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
179
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
181
+ }, z.core.$strip>]>>;
182
+ listenAt: z.ZodString;
183
+ type: z.ZodString;
184
+ callback: z.ZodCustom<EventListener, EventListener>;
185
+ capture: z.ZodOptional<z.ZodBoolean>;
186
+ activitySignal: z.ZodOptional<z.ZodCustom<() => ActivitySignalSource<boolean>, () => ActivitySignalSource<boolean>>>;
187
+ }, z.core.$strip>>]>>;
119
188
  }, z.core.$strict>;
120
189
  export declare function validateManifest(data: unknown, file: string): z.infer<typeof InjectionManifestSchema>;
121
190
  export declare function validateModuleMeta(data: unknown, file: string): z.infer<typeof InjectionModuleSchema>;
@@ -2,6 +2,7 @@ export declare const ansi: {
2
2
  readonly reset: "\u001B[0m";
3
3
  readonly bold: "\u001B[1m";
4
4
  readonly cyan: "\u001B[36m";
5
+ readonly deepPink: "\u001B[38;5;162m";
5
6
  readonly green: "\u001B[32m";
6
7
  readonly dim: "\u001B[2m";
7
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makoojs/cli",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "description": "CLI and Vite integration for the Makoo userscript development framework",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,6 +31,11 @@
31
31
  "import": "./dist/index.js",
32
32
  "require": "./dist/index.cjs"
33
33
  },
34
+ "./manifest": {
35
+ "types": "./dist/manifest/index.d.ts",
36
+ "import": "./dist/manifest/index.js",
37
+ "require": "./dist/manifest/index.cjs"
38
+ },
34
39
  "./monkey": {
35
40
  "types": "./dist/monkey/index.d.ts",
36
41
  "import": "./dist/monkey/index.js",
@@ -46,10 +51,10 @@
46
51
  "devDependencies": {
47
52
  "@types/picomatch": "^4.0.3",
48
53
  "cac": "^7.0.0",
49
- "@makoojs/core": "0.2.1"
54
+ "@makoojs/core": "0.3.1"
50
55
  },
51
56
  "peerDependencies": {
52
- "vite": ">=7",
53
- "@makoojs/core": "^0.2.1"
57
+ "@makoojs/core": "*",
58
+ "vite": ">=7"
54
59
  }
55
60
  }