hokit 1.0.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.md ADDED
@@ -0,0 +1,41 @@
1
+ <div align="center">
2
+ <img src="https://xgjzloifyvgpbmyonaya.supabase.co/storage/v1/object/public/files/CLkIt_6NNL/original" alt="Logo" width="150" />
3
+ <p>A type-safe snippet registry and compiler for VSCode and Cursor.</p>
4
+ Define snippets using an expressive DSL while Hokit handles validation, compilation and JSON generation automatically.
5
+ </div>
6
+
7
+ <br />
8
+
9
+ ## Installation
10
+
11
+ Using Bun:
12
+
13
+ ```sh
14
+ bun add hokit --dev
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ![How to use](https://xgjzloifyvgpbmyonaya.supabase.co/storage/v1/object/public/files/2xZ5Kq-OLw/original)
20
+
21
+ Build your snippets:
22
+
23
+ ![Build](https://xgjzloifyvgpbmyonaya.supabase.co/storage/v1/object/public/files/_s5vv1A8hn/original)
24
+
25
+ Run:
26
+
27
+ ```sh
28
+ bun run build.ts
29
+ ```
30
+
31
+ Generated output:
32
+
33
+ ![JSON generated](https://xgjzloifyvgpbmyonaya.supabase.co/storage/v1/object/public/files/UpIX7GpL4d/original)
34
+
35
+ <div align="right">
36
+ <img src="https://xgjzloifyvgpbmyonaya.supabase.co/storage/v1/object/public/files/CLkIt_6NNL/original" alt="Logo" width="50">
37
+ </div>
38
+
39
+ ## License
40
+
41
+ MIT
@@ -0,0 +1,39 @@
1
+ type Scope = "typescript" | "javascript" | "typescriptreact" | "javascriptreact" | "html" | "json";
2
+ interface Snippet {
3
+ name: string;
4
+ scope: Scope[];
5
+ prefix: string;
6
+ body: string[];
7
+ description?: string;
8
+ isFileTemplate?: boolean;
9
+ tags: string[];
10
+ }
11
+
12
+ declare class SnippetBuilder {
13
+ private snippet;
14
+ name(name: string): this;
15
+ scope(scope: Scope[]): this;
16
+ prefix(prefix: string): this;
17
+ body(snippet: string[]): this;
18
+ describe(description: string): this;
19
+ template(isFileTemplate?: boolean): this;
20
+ tag(tags: string[]): this;
21
+ /**
22
+ * Build the final object.
23
+ */
24
+ build(): Snippet;
25
+ }
26
+
27
+ interface Config {
28
+ output: string;
29
+ snippets: SnippetBuilder[];
30
+ }
31
+ declare function defineCofig(config: Config): Config;
32
+
33
+ declare function build(...config: Config[]): Promise<void>;
34
+
35
+ declare abstract class Registry {
36
+ static name(name: string): SnippetBuilder;
37
+ }
38
+
39
+ export { Registry, type Snippet, build, defineCofig };