@seedcord/cli 0.0.1 → 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.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="../../assets/banner.png" alt="seedcord" width="100%" />
2
+ <img src="https://raw.githubusercontent.com/seedcord/seedcord/main/assets/banner.png" alt="seedcord" width="100%" />
3
3
  </p>
4
4
 
5
5
  ---
@@ -10,4 +10,4 @@ _This repository is a work in progress._
10
10
  - Till a major v1.0.0 release for seedcord, expect breaking changes in minor versions.
11
11
  - Documentation will come soon as well!
12
12
 
13
- I'm planning to release the first major version by the end of 2025, or Jan 2026. But till then, if you'd like to try using it, you can check out the code in `mock`
13
+ If you'd like to try it out, you can check out the code in `mock`
@@ -0,0 +1,22 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath, pathToFileURL } from 'node:url';
4
+
5
+ async function run() {
6
+ const here = dirname(fileURLToPath(import.meta.url));
7
+ const distEntry = resolve(here, '../dist/cli.mjs');
8
+ if (existsSync(distEntry)) {
9
+ await import(pathToFileURL(distEntry).href);
10
+ return;
11
+ }
12
+
13
+ const srcEntry = resolve(here, '../src/cli.ts');
14
+ await import('tsx/esm/api');
15
+ await import(pathToFileURL(srcEntry).href);
16
+ }
17
+
18
+ run().catch((error) => {
19
+ // eslint-disable-next-line no-console
20
+ console.error(error);
21
+ process.exitCode = 1;
22
+ });
@@ -0,0 +1,33 @@
1
+ //#region src/api/Hmr.d.ts
2
+ /**
3
+ * Type of HMR event.
4
+ */
5
+ type HmrEventType = 'create' | 'createDir' | 'update' | 'delete' | 'deleteDir';
6
+ /**
7
+ * Payload for the HMR update event.
8
+ */
9
+ interface HmrUpdateEvent {
10
+ file: string;
11
+ type: HmrEventType;
12
+ /**
13
+ * List of files that are affected by this update (e.g., importers).
14
+ * Only populated for 'update' events.
15
+ */
16
+ affectedModules?: string[];
17
+ }
18
+ /**
19
+ * Interface for HMR handlers that can process hot updates for specific modules.
20
+ */
21
+ interface HmrAware {
22
+ /**
23
+ * A name to identify the HMR-aware module (for logging/debugging purposes).
24
+ */
25
+ readonly name: string;
26
+ /**
27
+ * Method that is called on HMR update and receives the full update event.
28
+ */
29
+ onHmr(event: HmrUpdateEvent): Promise<void>;
30
+ }
31
+ //#endregion
32
+ export { HmrEventType as n, HmrUpdateEvent as r, HmrAware as t };
33
+ //# sourceMappingURL=Hmr-BXZ-LFe5.d.mts.map
@@ -0,0 +1,33 @@
1
+ import { r as HmrUpdateEvent } from "../Hmr-BXZ-LFe5.mjs";
2
+
3
+ //#region src/api/vite-hmr.d.ts
4
+ /**
5
+ * Map of HMR events sent from the framework (client) to the CLI (server).
6
+ *
7
+ * @internal
8
+ */
9
+ interface SeedcordFrameworkEvents {
10
+ 'seedcord:register-critical-files': {
11
+ patterns: string[];
12
+ };
13
+ 'seedcord:commands-update-prompt': {
14
+ files: string[];
15
+ };
16
+ }
17
+ /**
18
+ * Map of HMR events sent from the CLI (server) to the framework (client).
19
+ *
20
+ * @internal
21
+ */
22
+ interface SeedcordCliEvents {
23
+ 'seedcord:hmr': HmrUpdateEvent;
24
+ 'seedcord:refresh-commands': {
25
+ shouldRefresh: boolean;
26
+ };
27
+ }
28
+ declare module 'vite/types/customEvent.d.ts' {
29
+ interface CustomEventMap extends SeedcordFrameworkEvents, SeedcordCliEvents {}
30
+ }
31
+ //#endregion
32
+ export { SeedcordCliEvents, SeedcordFrameworkEvents };
33
+ //# sourceMappingURL=vite-hmr.d.mts.map
@@ -0,0 +1 @@
1
+ export { };
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };