@makoojs/cli 0.1.1 → 0.3.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 +6 -10
- package/README.md +6 -10
- package/dist/bin.js +120 -45
- package/dist/command/_util.d.ts +0 -8
- package/dist/command/inspect.d.ts +33 -0
- package/dist/config/defaults.d.ts +2 -2
- package/dist/config/resolve.d.ts +3 -3
- package/dist/config/types.d.ts +20 -13
- package/dist/config/validation.d.ts +1 -2
- package/dist/generator/render/import/importMakooRuntime.d.ts +1 -0
- package/dist/generator/render/init/initMakooRuntime.d.ts +3 -0
- package/dist/generator/render/run/renderMakooStart.d.ts +1 -0
- package/dist/index.cjs +24 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1363 -1309
- package/dist/scanner/types.d.ts +5 -2
- package/dist/scanner/validation.d.ts +6 -6
- package/dist/shared/terminalColor.d.ts +8 -0
- package/dist/vitePlugin/hmrController.d.ts +2 -0
- package/dist/vitePlugin/types.d.ts +6 -0
- package/dist/vitePlugin/watchList.d.ts +2 -1
- package/package.json +2 -2
- package/dist/generator/render/import/importInjector.d.ts +0 -1
- package/dist/generator/render/init/initInjector.d.ts +0 -3
- package/dist/generator/render/run/renderInjectorRun.d.ts +0 -1
package/dist/scanner/types.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { InjectionManifest, InjectionModuleConfig, ResolvedConfig, ResolvedInjectionFramework, ResolvedInjectionModule } from '../config/types';
|
|
1
|
+
import { InjectionManifest, InjectionModuleConfig, ResolvedConfig, ResolvedInjectionDefaults, ResolvedInjectionFramework, ResolvedInjectionModule } from '../config/types';
|
|
2
2
|
export type ScannerResult = {
|
|
3
3
|
manifestFile: string;
|
|
4
4
|
manifestDependencies: string[];
|
|
5
|
+
moduleManifestDependencies: string[];
|
|
6
|
+
runtimeSetupFiles: string[];
|
|
5
7
|
runtimeDependencies: string[];
|
|
6
8
|
config: ResolvedConfig;
|
|
9
|
+
injectionDefaults: ResolvedInjectionDefaults;
|
|
7
10
|
injections: ResolvedInjectionModule[];
|
|
8
11
|
frameworks: ResolvedInjectionFramework[];
|
|
9
12
|
};
|
|
@@ -13,7 +16,7 @@ export type LoadManifestResult = {
|
|
|
13
16
|
dependencies: string[];
|
|
14
17
|
};
|
|
15
18
|
export type LoadMetaResult = {
|
|
16
|
-
|
|
19
|
+
moduleManifestFile: string;
|
|
17
20
|
moduleConfig: InjectionModuleConfig;
|
|
18
21
|
dependencies: string[];
|
|
19
22
|
};
|
|
@@ -4,9 +4,9 @@ export declare const ObserveEventNameSchema: z.ZodEnum<{
|
|
|
4
4
|
"register:success": "register:success";
|
|
5
5
|
"register:duplicate": "register:duplicate";
|
|
6
6
|
"register:error": "register:error";
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
7
|
+
"start:requested": "start:requested";
|
|
8
|
+
"start:taskScheduled": "start:taskScheduled";
|
|
9
|
+
"start:taskSkipped": "start:taskSkipped";
|
|
10
10
|
"artifact:mountStart": "artifact:mountStart";
|
|
11
11
|
"artifact:mountSuccess": "artifact:mountSuccess";
|
|
12
12
|
"artifact:mountFail": "artifact:mountFail";
|
|
@@ -32,7 +32,7 @@ export declare const ObserveEventNameSchema: z.ZodEnum<{
|
|
|
32
32
|
"dom:targetRestored": "dom:targetRestored";
|
|
33
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
|
|
35
|
+
export declare const InjectionDefaultsSchema: z.ZodObject<{
|
|
36
36
|
alive: z.ZodOptional<z.ZodBoolean>;
|
|
37
37
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
38
38
|
local: "local";
|
|
@@ -67,7 +67,7 @@ export declare const InjectionModuleSchema: z.ZodObject<{
|
|
|
67
67
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
68
68
|
}, z.core.$strip>;
|
|
69
69
|
export declare const InjectionManifestSchema: z.ZodObject<{
|
|
70
|
-
|
|
70
|
+
injectionDefaults: z.ZodOptional<z.ZodObject<{
|
|
71
71
|
alive: z.ZodOptional<z.ZodBoolean>;
|
|
72
72
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
73
73
|
local: "local";
|
|
@@ -116,6 +116,6 @@ export declare const InjectionManifestSchema: z.ZodObject<{
|
|
|
116
116
|
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
117
|
}, z.core.$strip>]>>;
|
|
118
118
|
}, z.core.$strip>>]>;
|
|
119
|
-
}, z.core.$
|
|
119
|
+
}, z.core.$strict>;
|
|
120
120
|
export declare function validateManifest(data: unknown, file: string): z.infer<typeof InjectionManifestSchema>;
|
|
121
121
|
export declare function validateModuleMeta(data: unknown, file: string): z.infer<typeof InjectionModuleSchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const ansi: {
|
|
2
|
+
readonly reset: "\u001B[0m";
|
|
3
|
+
readonly bold: "\u001B[1m";
|
|
4
|
+
readonly cyan: "\u001B[36m";
|
|
5
|
+
readonly green: "\u001B[32m";
|
|
6
|
+
readonly dim: "\u001B[2m";
|
|
7
|
+
};
|
|
8
|
+
export declare const colorize: (value: string, ...codes: string[]) => string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ViteDevServer } from 'vite';
|
|
2
|
+
import { StructuralHmrPayload } from './types';
|
|
2
3
|
export declare function invalidateVirtualModule(server: ViteDevServer): void;
|
|
3
4
|
export declare function sendScanError(server: ViteDevServer, error: unknown): void;
|
|
4
5
|
export declare function triggerModuleHmr(server: ViteDevServer): void;
|
|
6
|
+
export declare function sendStructuralHmr(server: ViteDevServer, payload: StructuralHmrPayload): void;
|
|
@@ -10,3 +10,9 @@ export type WatchTargets = {
|
|
|
10
10
|
export type MakooOptions = CliConfig & {
|
|
11
11
|
root?: string;
|
|
12
12
|
};
|
|
13
|
+
export type StructuralChangeKind = 'top-level-manifest' | 'manifest-dependency' | 'module-manifest-dependency' | 'runtime-setup' | 'runtime-dependency' | 'module-manifest';
|
|
14
|
+
export type StructuralHmrPayload = {
|
|
15
|
+
file: string;
|
|
16
|
+
reason: StructuralChangeKind;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ScannerResult } from '../scanner/types';
|
|
2
|
-
import { WatchTargets } from './types';
|
|
2
|
+
import { StructuralChangeKind, WatchTargets } from './types';
|
|
3
3
|
export declare function getWatchTargets(scanResult: ScannerResult): WatchTargets;
|
|
4
4
|
export declare function isStructuralChange(changedFile: string, scanResult: ScannerResult): boolean;
|
|
5
|
+
export declare function classifyStructuralChange(changedFile: string, scanResult: ScannerResult): StructuralChangeKind | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makoojs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "CLI and Vite integration for the Makoo userscript development framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"picomatch": "^4.0.4",
|
|
43
43
|
"vite-plugin-monkey": "^7.1.9",
|
|
44
44
|
"zod": "^4.4.3",
|
|
45
|
-
"@makoojs/core": "0.
|
|
45
|
+
"@makoojs/core": "0.2.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/picomatch": "^4.0.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderImportInjector(): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderInjectorRun(instanceName: string): string;
|