@makoojs/cli 0.5.0 → 0.5.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.CN.md +43 -124
- package/README.md +43 -124
- package/dist/bin.js +148 -59
- package/dist/cli/commands/dev/DevTerminal.d.ts +2 -2
- package/dist/cli/injections/renderInjections.d.ts +2 -0
- package/dist/config/errors.d.ts +1 -12
- package/dist/index.cjs +65 -97
- package/dist/index.js +197 -237
- package/dist/session/DevSession.d.ts +4 -3
- package/dist/session/types.d.ts +37 -12
- package/package.json +2 -2
- package/dist/cli/tasks/renderTasks.d.ts +0 -2
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { NormalizedHotChannelClient } from 'vite';
|
|
2
|
-
import {
|
|
2
|
+
import { RuntimeInjection, RuntimeNotice, RuntimeOpen, RuntimeSnapshot } from './types';
|
|
3
3
|
export declare class DevSession {
|
|
4
4
|
private readonly clients;
|
|
5
5
|
private nextClientId;
|
|
6
6
|
private onChange;
|
|
7
7
|
subscribe(onChange: () => void): () => void;
|
|
8
8
|
open(client: NormalizedHotChannelClient, payload: RuntimeOpen): void;
|
|
9
|
-
|
|
9
|
+
updateInjection(client: NormalizedHotChannelClient, payload: RuntimeInjection): void;
|
|
10
|
+
applyNotice(client: NormalizedHotChannelClient, payload: RuntimeNotice): void;
|
|
10
11
|
disconnect(client: NormalizedHotChannelClient): void;
|
|
11
12
|
isEmpty(): boolean;
|
|
12
|
-
|
|
13
|
+
getRuntimeSnapshots(): RuntimeSnapshot[];
|
|
13
14
|
}
|
package/dist/session/types.d.ts
CHANGED
|
@@ -1,22 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TaskKind = NonNullable<ObserveEvent['kind']>;
|
|
3
|
-
type TaskStatus = NonNullable<ObserveEvent['status']>;
|
|
1
|
+
import { ComponentStatus, ListenerStatus, ObservationNotice } from '../../../../../core';
|
|
4
2
|
export type RuntimeOpen = {
|
|
5
3
|
runtimeId: number;
|
|
6
4
|
};
|
|
7
|
-
export type
|
|
5
|
+
export type SerializedMakooError = {
|
|
6
|
+
code: string;
|
|
7
|
+
message: string;
|
|
8
|
+
cause?: string;
|
|
9
|
+
};
|
|
10
|
+
export type AttachedListenerSnapshot = {
|
|
11
|
+
name: string;
|
|
12
|
+
status: ListenerStatus;
|
|
13
|
+
};
|
|
14
|
+
export type InjectionSnapshot = {
|
|
15
|
+
name: string;
|
|
16
|
+
kind: 'component';
|
|
17
|
+
status: ComponentStatus;
|
|
18
|
+
lastError?: SerializedMakooError;
|
|
19
|
+
attachedListeners: AttachedListenerSnapshot[];
|
|
20
|
+
} | {
|
|
21
|
+
name: string;
|
|
22
|
+
kind: 'standalone-listener';
|
|
23
|
+
status: ListenerStatus;
|
|
24
|
+
lastError?: SerializedMakooError;
|
|
25
|
+
};
|
|
26
|
+
export type SerializedDiagnostic = {
|
|
27
|
+
type: 'diagnostic';
|
|
28
|
+
name?: string;
|
|
29
|
+
error: SerializedMakooError;
|
|
30
|
+
};
|
|
31
|
+
export type SerializedObservationNotice = Exclude<ObservationNotice, {
|
|
32
|
+
type: 'diagnostic';
|
|
33
|
+
}> | SerializedDiagnostic;
|
|
34
|
+
export type RuntimeInjection = {
|
|
8
35
|
runtimeId: number;
|
|
9
|
-
|
|
36
|
+
injection: InjectionSnapshot;
|
|
10
37
|
};
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
status: TaskStatus;
|
|
15
|
-
injectAt: string;
|
|
38
|
+
export type RuntimeNotice = {
|
|
39
|
+
runtimeId: number;
|
|
40
|
+
notice: SerializedObservationNotice;
|
|
16
41
|
};
|
|
17
42
|
export type RuntimeSnapshot = {
|
|
18
43
|
clientId: number;
|
|
19
44
|
runtimeId: number;
|
|
20
|
-
|
|
45
|
+
injections: InjectionSnapshot[];
|
|
46
|
+
diagnostics: SerializedDiagnostic[];
|
|
21
47
|
};
|
|
22
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makoojs/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "CLI and Vite integration for the Makoo userscript development framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"zod": "^4.4.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@makoojs/core": "0.
|
|
48
|
+
"@makoojs/core": "0.5.0",
|
|
49
49
|
"vite": "^8.2.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|