@spirobel/mininext 0.2.10 → 0.2.12

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,15 +1,51 @@
1
1
  # mininext
2
2
 
3
+ To install
4
+
5
+ ```bash
6
+ bun add @spirobel/mininext
7
+ ```
8
+
9
+ syntax highlighting:
10
+
11
+ [mininext vs code extension](https://marketplace.visualstudio.com/items?itemName=spirobel.mini-next-vs-code)
12
+
13
+ github:
14
+
15
+ [mininext github repo](https://github.com/spirobel/mininext)
16
+
17
+ quickstart:
18
+
19
+ ```bash
20
+ bun create spirobel/gucci yournewproject
21
+ ```
22
+
23
+ if you don't have bun installed, run first:
24
+
25
+ ```bash
26
+ curl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL
27
+ ```
28
+
3
29
  To install dependencies:
4
30
 
5
31
  ```bash
6
32
  bun install
7
33
  ```
8
34
 
9
- To run:
35
+ dev:
10
36
 
11
37
  ```bash
12
- bun run index.ts
38
+ bun run dev
13
39
  ```
14
40
 
15
- This project was created using `bun init` in bun v1.1.7. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
41
+ production:
42
+
43
+ ```bash
44
+ bun run start
45
+ ```
46
+
47
+ build:
48
+
49
+ ```bash
50
+ bun run build
51
+ ```
@@ -5,4 +5,5 @@ declare global {
5
5
  }
6
6
  declare function build(backendPath?: string): Promise<void>;
7
7
  declare const standardDevReloader: HtmlString;
8
- export { url, html, head, build, isError, HtmlString, type HtmlHandler, Mini, standardDevReloader, commonHead, cssReset, };
8
+ declare function makeEntrypoint(): Promise<(w: any) => Promise<Response>>;
9
+ export { url, html, head, build, makeEntrypoint, isError, HtmlString, type HtmlHandler, Mini, standardDevReloader, commonHead, cssReset, };
package/dist/mininext.js CHANGED
@@ -144,4 +144,17 @@ const standardDevReloader = html `
144
144
  reloader();
145
145
  </script>
146
146
  `;
147
- export { url, html, head, build, isError, HtmlString, Mini, standardDevReloader, commonHead, cssReset, };
147
+ async function makeEntrypoint() {
148
+ let module;
149
+ try {
150
+ // @ts-ignore
151
+ module = await import("./dist/backend.js");
152
+ }
153
+ catch (error) {
154
+ await build();
155
+ // @ts-ignore
156
+ module = await import("./dist/backend.js");
157
+ }
158
+ return module.default;
159
+ }
160
+ export { url, html, head, build, makeEntrypoint, isError, HtmlString, Mini, standardDevReloader, commonHead, cssReset, };
@@ -157,12 +157,26 @@ const standardDevReloader = html`
157
157
  reloader();
158
158
  </script>
159
159
  `;
160
+ async function makeEntrypoint() {
161
+ let module;
162
+
163
+ try {
164
+ // @ts-ignore
165
+ module = await import("./dist/backend.js");
166
+ } catch (error) {
167
+ await build();
168
+ // @ts-ignore
169
+ module = await import("./dist/backend.js");
170
+ }
171
+ return module.default as (w: any) => Promise<Response>;
172
+ }
160
173
 
161
174
  export {
162
175
  url,
163
176
  html,
164
177
  head,
165
178
  build,
179
+ makeEntrypoint,
166
180
  isError,
167
181
  HtmlString,
168
182
  type HtmlHandler,
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  },
14
14
  "files": ["dist", "mininext"],
15
- "version": "0.2.10",
15
+ "version": "0.2.12",
16
16
  "devDependencies": {
17
17
  "@types/bun": "latest"
18
18
  },