@spirobel/mininext 0.2.11 → 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 +40 -0
- package/dist/mininext.d.ts +2 -1
- package/dist/mininext.js +14 -1
- package/mininext/mininext.ts +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,3 +9,43 @@ bun add @spirobel/mininext
|
|
|
9
9
|
syntax highlighting:
|
|
10
10
|
|
|
11
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
|
+
|
|
29
|
+
To install dependencies:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bun install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
dev:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bun run dev
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
production:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bun run start
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
build:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bun run build
|
|
51
|
+
```
|
package/dist/mininext.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
declare function build(backendPath?: string): Promise<void>;
|
|
7
7
|
declare const standardDevReloader: HtmlString;
|
|
8
|
-
|
|
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
|
-
|
|
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, };
|
package/mininext/mininext.ts
CHANGED
|
@@ -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,
|