nept-frameworks 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 ADDED
@@ -0,0 +1,81 @@
1
+ # nept-frameworks
2
+
3
+ Generates production Dockerfiles for 33 backend and full-stack targets across
4
+ JavaScript, Python, Go, Rust, Java, Ruby, PHP, .NET, Deno, and Bun. The typed
5
+ `FRAMEWORK_DEFAULTS` registry is the source of truth for deployment metadata.
6
+
7
+ ## Generate
8
+
9
+ ```ts
10
+ import { DOCKERIGNORE, generateDockerfile } from "nept-frameworks";
11
+
12
+ const dockerfile = generateDockerfile({
13
+ outputDir: null,
14
+ installCMD: "bun install --frozen-lockfile",
15
+ buildCMD: null,
16
+ runCMD: null,
17
+ cmd: '["bun", ".output/server/index.mjs"]',
18
+ envVars: {},
19
+ version: "1.3.14-slim",
20
+ framework: "nuxt",
21
+ });
22
+ ```
23
+
24
+ The install command identifies the JavaScript package manager. When it is
25
+ `null`, exactly one supported lockfile must exist in the current directory.
26
+ Write `dockerfile` to `Dockerfile` and `DOCKERIGNORE` to `.dockerignore` in the
27
+ Docker build context.
28
+
29
+ Framework requirements:
30
+
31
+ - Next.js: `output: "standalone"`
32
+ - Nuxt: built-in Nitro Node or Bun preset
33
+ - Astro: `@astrojs/node` in standalone mode
34
+ - SvelteKit: `@sveltejs/adapter-node`
35
+ - Remix: Remix v2 Vite build with `@remix-run/serve`
36
+ - Qwik: Qwik City Node server adapter
37
+
38
+ Node-targeted adapters can run under Bun's Node compatibility layer, but
39
+ application dependencies may still require Node. Nuxt receives its native Bun
40
+ preset when `runtime: "bun"` is selected.
41
+
42
+ Runtime versions accept pinned official image tags:
43
+
44
+ ```ts
45
+ generateDockerfile({
46
+ outputDir: null,
47
+ installCMD: null,
48
+ buildCMD: null,
49
+ runCMD: null,
50
+ cmd: null,
51
+ envVars: {},
52
+ version: "1.20.14-bookworm",
53
+ framework: "go",
54
+ });
55
+ ```
56
+
57
+ `version` is the official image tag for the selected framework runtime. Use
58
+ full tags such as `3.11.15-slim-bookworm`, not floating shorthand.
59
+ Framework versions are supplied by the application's package and lock files;
60
+ the Dockerfile generator does not replace them.
61
+
62
+ ## Test
63
+
64
+ A running Docker daemon is required. The complete test builds and runs 50
65
+ images from disposable copies of the apps under `playground/`.
66
+
67
+ ```sh
68
+ bun install
69
+ bunx tsc --noEmit
70
+ bun test
71
+ ```
72
+
73
+ ## Install
74
+
75
+ ```sh
76
+ npm install nept-frameworks
77
+ ```
78
+
79
+ Every container is checked for SSR output, its JSON route, runtime environment
80
+ values, static assets, non-root execution, and image size. Baseline changes in
81
+ `tests/baselines/image-size.json` require explicit review.
@@ -0,0 +1,514 @@
1
+ import type { Framework, Runtime } from "./types/dockerfile";
2
+ export type FrameworkStatus = "supported" | "planned" | "excluded";
3
+ export type StackType = "backend" | "fullstack" | "static";
4
+ export interface JavaScriptDeployment {
5
+ kind: "js-artifact";
6
+ selfContained: boolean;
7
+ copies: readonly (readonly [source: string, destination: string])[];
8
+ entrypoint: string;
9
+ entrypointArgument?: string;
10
+ }
11
+ export interface JavaScriptSourceDeployment {
12
+ kind: "js-source";
13
+ build: boolean;
14
+ entrypoint: string;
15
+ }
16
+ export interface DenoDeployment {
17
+ kind: "deno-source";
18
+ entrypoint: string;
19
+ }
20
+ export interface BunDeployment {
21
+ kind: "bun-source";
22
+ entrypoint: string;
23
+ }
24
+ export interface PythonDeployment {
25
+ kind: "python";
26
+ command: readonly string[];
27
+ }
28
+ export interface GoDeployment {
29
+ kind: "go";
30
+ }
31
+ export interface RustDeployment {
32
+ kind: "rust";
33
+ }
34
+ export interface JavaDeployment {
35
+ kind: "java";
36
+ mode: "class" | "jar" | "quarkus";
37
+ }
38
+ export interface RubyDeployment {
39
+ kind: "ruby";
40
+ command: readonly string[];
41
+ }
42
+ export interface PhpDeployment {
43
+ kind: "php";
44
+ }
45
+ export interface DotnetDeployment {
46
+ kind: "dotnet";
47
+ aspnet: boolean;
48
+ dll: string;
49
+ }
50
+ export interface CustomDeployment {
51
+ kind: "custom";
52
+ }
53
+ export type Deployment = BunDeployment | CustomDeployment | DenoDeployment | DotnetDeployment | GoDeployment | JavaDeployment | JavaScriptDeployment | JavaScriptSourceDeployment | PythonDeployment | PhpDeployment | RubyDeployment | RustDeployment;
54
+ export interface FrameworkDefault {
55
+ displayName: string;
56
+ language: string;
57
+ stackType: StackType;
58
+ defaultPort: number;
59
+ defaultRuntime: string;
60
+ defaultVersion: string;
61
+ status: FrameworkStatus;
62
+ deployment?: Deployment;
63
+ }
64
+ export declare const FRAMEWORK_DEFAULTS: {
65
+ readonly express: {
66
+ readonly status: "supported";
67
+ readonly deployment: {
68
+ readonly kind: "js-source";
69
+ readonly build: false;
70
+ readonly entrypoint: "server.js";
71
+ };
72
+ readonly displayName: string;
73
+ readonly language: string;
74
+ readonly stackType: StackType;
75
+ readonly defaultPort: number;
76
+ readonly defaultRuntime: string;
77
+ readonly defaultVersion: string;
78
+ };
79
+ readonly nest: {
80
+ readonly status: "supported";
81
+ readonly deployment: {
82
+ readonly kind: "js-source";
83
+ readonly build: true;
84
+ readonly entrypoint: "dist/main.js";
85
+ };
86
+ readonly displayName: string;
87
+ readonly language: string;
88
+ readonly stackType: StackType;
89
+ readonly defaultPort: number;
90
+ readonly defaultRuntime: string;
91
+ readonly defaultVersion: string;
92
+ };
93
+ readonly fastify: {
94
+ readonly status: "supported";
95
+ readonly deployment: {
96
+ readonly kind: "js-source";
97
+ readonly build: false;
98
+ readonly entrypoint: "server.js";
99
+ };
100
+ readonly displayName: string;
101
+ readonly language: string;
102
+ readonly stackType: StackType;
103
+ readonly defaultPort: number;
104
+ readonly defaultRuntime: string;
105
+ readonly defaultVersion: string;
106
+ };
107
+ readonly koa: {
108
+ readonly status: "supported";
109
+ readonly deployment: {
110
+ readonly kind: "js-source";
111
+ readonly build: false;
112
+ readonly entrypoint: "server.js";
113
+ };
114
+ readonly displayName: string;
115
+ readonly language: string;
116
+ readonly stackType: StackType;
117
+ readonly defaultPort: number;
118
+ readonly defaultRuntime: string;
119
+ readonly defaultVersion: string;
120
+ };
121
+ readonly deno: {
122
+ readonly status: "supported";
123
+ readonly deployment: {
124
+ readonly kind: "deno-source";
125
+ readonly entrypoint: "main.ts";
126
+ };
127
+ readonly displayName: string;
128
+ readonly language: string;
129
+ readonly stackType: StackType;
130
+ readonly defaultPort: number;
131
+ readonly defaultRuntime: string;
132
+ readonly defaultVersion: string;
133
+ };
134
+ readonly bun: {
135
+ readonly status: "supported";
136
+ readonly deployment: {
137
+ readonly kind: "bun-source";
138
+ readonly entrypoint: "server.ts";
139
+ };
140
+ readonly displayName: string;
141
+ readonly language: string;
142
+ readonly stackType: StackType;
143
+ readonly defaultPort: number;
144
+ readonly defaultRuntime: string;
145
+ readonly defaultVersion: string;
146
+ };
147
+ readonly django: {
148
+ readonly status: "supported";
149
+ readonly deployment: {
150
+ readonly kind: "python";
151
+ readonly command: readonly ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"];
152
+ };
153
+ readonly displayName: string;
154
+ readonly language: string;
155
+ readonly stackType: StackType;
156
+ readonly defaultPort: number;
157
+ readonly defaultRuntime: string;
158
+ readonly defaultVersion: string;
159
+ };
160
+ readonly flask: {
161
+ readonly status: "supported";
162
+ readonly deployment: {
163
+ readonly kind: "python";
164
+ readonly command: readonly ["gunicorn", "app:app", "--bind", "0.0.0.0:8000"];
165
+ };
166
+ readonly displayName: string;
167
+ readonly language: string;
168
+ readonly stackType: StackType;
169
+ readonly defaultPort: number;
170
+ readonly defaultRuntime: string;
171
+ readonly defaultVersion: string;
172
+ };
173
+ readonly fastapi: {
174
+ readonly status: "supported";
175
+ readonly deployment: {
176
+ readonly kind: "python";
177
+ readonly command: readonly ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"];
178
+ };
179
+ readonly displayName: string;
180
+ readonly language: string;
181
+ readonly stackType: StackType;
182
+ readonly defaultPort: number;
183
+ readonly defaultRuntime: string;
184
+ readonly defaultVersion: string;
185
+ };
186
+ readonly python: {
187
+ readonly status: "supported";
188
+ readonly deployment: {
189
+ readonly kind: "python";
190
+ readonly command: readonly ["gunicorn", "app:app", "--bind", "0.0.0.0:8000"];
191
+ };
192
+ readonly displayName: string;
193
+ readonly language: string;
194
+ readonly stackType: StackType;
195
+ readonly defaultPort: number;
196
+ readonly defaultRuntime: string;
197
+ readonly defaultVersion: string;
198
+ };
199
+ readonly go: {
200
+ readonly status: "supported";
201
+ readonly deployment: {
202
+ readonly kind: "go";
203
+ };
204
+ readonly displayName: string;
205
+ readonly language: string;
206
+ readonly stackType: StackType;
207
+ readonly defaultPort: number;
208
+ readonly defaultRuntime: string;
209
+ readonly defaultVersion: string;
210
+ };
211
+ readonly gin: {
212
+ readonly status: "supported";
213
+ readonly deployment: {
214
+ readonly kind: "go";
215
+ };
216
+ readonly displayName: string;
217
+ readonly language: string;
218
+ readonly stackType: StackType;
219
+ readonly defaultPort: number;
220
+ readonly defaultRuntime: string;
221
+ readonly defaultVersion: string;
222
+ };
223
+ readonly echo: {
224
+ readonly status: "supported";
225
+ readonly deployment: {
226
+ readonly kind: "go";
227
+ };
228
+ readonly displayName: string;
229
+ readonly language: string;
230
+ readonly stackType: StackType;
231
+ readonly defaultPort: number;
232
+ readonly defaultRuntime: string;
233
+ readonly defaultVersion: string;
234
+ };
235
+ readonly rust: {
236
+ readonly status: "supported";
237
+ readonly deployment: {
238
+ readonly kind: "rust";
239
+ };
240
+ readonly displayName: string;
241
+ readonly language: string;
242
+ readonly stackType: StackType;
243
+ readonly defaultPort: number;
244
+ readonly defaultRuntime: string;
245
+ readonly defaultVersion: string;
246
+ };
247
+ readonly actix: {
248
+ readonly status: "supported";
249
+ readonly deployment: {
250
+ readonly kind: "rust";
251
+ };
252
+ readonly displayName: string;
253
+ readonly language: string;
254
+ readonly stackType: StackType;
255
+ readonly defaultPort: number;
256
+ readonly defaultRuntime: string;
257
+ readonly defaultVersion: string;
258
+ };
259
+ readonly rocket: {
260
+ readonly status: "supported";
261
+ readonly deployment: {
262
+ readonly kind: "rust";
263
+ };
264
+ readonly displayName: string;
265
+ readonly language: string;
266
+ readonly stackType: StackType;
267
+ readonly defaultPort: number;
268
+ readonly defaultRuntime: string;
269
+ readonly defaultVersion: string;
270
+ };
271
+ readonly java: {
272
+ readonly status: "supported";
273
+ readonly deployment: {
274
+ readonly kind: "java";
275
+ readonly mode: "class";
276
+ };
277
+ readonly displayName: string;
278
+ readonly language: string;
279
+ readonly stackType: StackType;
280
+ readonly defaultPort: number;
281
+ readonly defaultRuntime: string;
282
+ readonly defaultVersion: string;
283
+ };
284
+ readonly springBoot: {
285
+ readonly status: "supported";
286
+ readonly deployment: {
287
+ readonly kind: "java";
288
+ readonly mode: "jar";
289
+ };
290
+ readonly displayName: string;
291
+ readonly language: string;
292
+ readonly stackType: StackType;
293
+ readonly defaultPort: number;
294
+ readonly defaultRuntime: string;
295
+ readonly defaultVersion: string;
296
+ };
297
+ readonly quarkus: {
298
+ readonly status: "supported";
299
+ readonly deployment: {
300
+ readonly kind: "java";
301
+ readonly mode: "quarkus";
302
+ };
303
+ readonly displayName: string;
304
+ readonly language: string;
305
+ readonly stackType: StackType;
306
+ readonly defaultPort: number;
307
+ readonly defaultRuntime: string;
308
+ readonly defaultVersion: string;
309
+ };
310
+ readonly ruby: {
311
+ readonly status: "supported";
312
+ readonly deployment: {
313
+ readonly kind: "ruby";
314
+ readonly command: readonly ["ruby", "app.rb"];
315
+ };
316
+ readonly displayName: string;
317
+ readonly language: string;
318
+ readonly stackType: StackType;
319
+ readonly defaultPort: number;
320
+ readonly defaultRuntime: string;
321
+ readonly defaultVersion: string;
322
+ };
323
+ readonly rails: {
324
+ readonly status: "supported";
325
+ readonly deployment: {
326
+ readonly kind: "ruby";
327
+ readonly command: readonly ["bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "3000"];
328
+ };
329
+ readonly displayName: string;
330
+ readonly language: string;
331
+ readonly stackType: StackType;
332
+ readonly defaultPort: number;
333
+ readonly defaultRuntime: string;
334
+ readonly defaultVersion: string;
335
+ };
336
+ readonly php: {
337
+ readonly status: "supported";
338
+ readonly deployment: {
339
+ readonly kind: "php";
340
+ };
341
+ readonly displayName: string;
342
+ readonly language: string;
343
+ readonly stackType: StackType;
344
+ readonly defaultPort: number;
345
+ readonly defaultRuntime: string;
346
+ readonly defaultVersion: string;
347
+ };
348
+ readonly laravel: {
349
+ readonly status: "supported";
350
+ readonly deployment: {
351
+ readonly kind: "php";
352
+ };
353
+ readonly displayName: string;
354
+ readonly language: string;
355
+ readonly stackType: StackType;
356
+ readonly defaultPort: number;
357
+ readonly defaultRuntime: string;
358
+ readonly defaultVersion: string;
359
+ };
360
+ readonly symfony: {
361
+ readonly status: "supported";
362
+ readonly deployment: {
363
+ readonly kind: "php";
364
+ };
365
+ readonly displayName: string;
366
+ readonly language: string;
367
+ readonly stackType: StackType;
368
+ readonly defaultPort: number;
369
+ readonly defaultRuntime: string;
370
+ readonly defaultVersion: string;
371
+ };
372
+ readonly csharp: {
373
+ readonly status: "supported";
374
+ readonly deployment: {
375
+ readonly kind: "dotnet";
376
+ readonly aspnet: false;
377
+ readonly dll: "App.dll";
378
+ };
379
+ readonly displayName: string;
380
+ readonly language: string;
381
+ readonly stackType: StackType;
382
+ readonly defaultPort: number;
383
+ readonly defaultRuntime: string;
384
+ readonly defaultVersion: string;
385
+ };
386
+ readonly aspnet: {
387
+ readonly status: "supported";
388
+ readonly deployment: {
389
+ readonly kind: "dotnet";
390
+ readonly aspnet: true;
391
+ readonly dll: "App.dll";
392
+ };
393
+ readonly displayName: string;
394
+ readonly language: string;
395
+ readonly stackType: StackType;
396
+ readonly defaultPort: number;
397
+ readonly defaultRuntime: string;
398
+ readonly defaultVersion: string;
399
+ };
400
+ readonly other: {
401
+ readonly status: "supported";
402
+ readonly deployment: {
403
+ readonly kind: "custom";
404
+ };
405
+ readonly displayName: string;
406
+ readonly language: string;
407
+ readonly stackType: StackType;
408
+ readonly defaultPort: number;
409
+ readonly defaultRuntime: string;
410
+ readonly defaultVersion: string;
411
+ };
412
+ readonly html: FrameworkDefault;
413
+ readonly react: FrameworkDefault;
414
+ readonly vue: FrameworkDefault;
415
+ readonly angular: FrameworkDefault;
416
+ readonly svelte: FrameworkDefault;
417
+ readonly vite: FrameworkDefault;
418
+ readonly gatsby: FrameworkDefault;
419
+ readonly solid: FrameworkDefault;
420
+ readonly next: {
421
+ readonly displayName: "Next.js";
422
+ readonly language: "TypeScript";
423
+ readonly stackType: "fullstack";
424
+ readonly defaultPort: 3000;
425
+ readonly defaultRuntime: "node";
426
+ readonly defaultVersion: "24.18.0-trixie-slim";
427
+ readonly status: "supported";
428
+ readonly deployment: {
429
+ readonly kind: "js-artifact";
430
+ readonly selfContained: true;
431
+ readonly copies: readonly [readonly ["/app/public", "./public"], readonly ["/app/.next/standalone", "./"], readonly ["/app/.next/static", "./.next/static"]];
432
+ readonly entrypoint: "server.js";
433
+ };
434
+ };
435
+ readonly nuxt: {
436
+ readonly displayName: "Nuxt";
437
+ readonly language: "TypeScript";
438
+ readonly stackType: "fullstack";
439
+ readonly defaultPort: 3000;
440
+ readonly defaultRuntime: "node";
441
+ readonly defaultVersion: "24.18.0-trixie-slim";
442
+ readonly status: "supported";
443
+ readonly deployment: {
444
+ readonly kind: "js-artifact";
445
+ readonly selfContained: true;
446
+ readonly copies: readonly [readonly ["/app/.output", "./.output"]];
447
+ readonly entrypoint: ".output/server/index.mjs";
448
+ };
449
+ };
450
+ readonly astro: {
451
+ readonly displayName: "Astro";
452
+ readonly language: "TypeScript";
453
+ readonly stackType: "fullstack";
454
+ readonly defaultPort: 3000;
455
+ readonly defaultRuntime: "node";
456
+ readonly defaultVersion: "24.18.0-trixie-slim";
457
+ readonly status: "supported";
458
+ readonly deployment: {
459
+ readonly kind: "js-artifact";
460
+ readonly selfContained: false;
461
+ readonly copies: readonly [readonly ["/app/dist", "./dist"]];
462
+ readonly entrypoint: "dist/server/entry.mjs";
463
+ };
464
+ };
465
+ readonly sveltekit: {
466
+ readonly displayName: "SvelteKit";
467
+ readonly language: "TypeScript";
468
+ readonly stackType: "fullstack";
469
+ readonly defaultPort: 3000;
470
+ readonly defaultRuntime: "node";
471
+ readonly defaultVersion: "24.18.0-trixie-slim";
472
+ readonly status: "supported";
473
+ readonly deployment: {
474
+ readonly kind: "js-artifact";
475
+ readonly selfContained: false;
476
+ readonly copies: readonly [readonly ["/app/build", "./build"]];
477
+ readonly entrypoint: "build/index.js";
478
+ };
479
+ };
480
+ readonly remix: {
481
+ readonly displayName: "Remix";
482
+ readonly language: "TypeScript";
483
+ readonly stackType: "fullstack";
484
+ readonly defaultPort: 3000;
485
+ readonly defaultRuntime: "node";
486
+ readonly defaultVersion: "24.18.0-trixie-slim";
487
+ readonly status: "supported";
488
+ readonly deployment: {
489
+ readonly kind: "js-artifact";
490
+ readonly selfContained: false;
491
+ readonly copies: readonly [readonly ["/app/build", "./build"]];
492
+ readonly entrypoint: "node_modules/@remix-run/serve/dist/cli.js";
493
+ readonly entrypointArgument: "build/server/index.js";
494
+ };
495
+ };
496
+ readonly qwik: {
497
+ readonly displayName: "Qwik";
498
+ readonly language: "TypeScript";
499
+ readonly stackType: "fullstack";
500
+ readonly defaultPort: 3000;
501
+ readonly defaultRuntime: "node";
502
+ readonly defaultVersion: "24.18.0-trixie-slim";
503
+ readonly status: "supported";
504
+ readonly deployment: {
505
+ readonly kind: "js-artifact";
506
+ readonly selfContained: false;
507
+ readonly copies: readonly [readonly ["/app/dist", "./dist"], readonly ["/app/server", "./server"]];
508
+ readonly entrypoint: "server/entry.node-server.js";
509
+ };
510
+ };
511
+ };
512
+ export type FrameworkId = keyof typeof FRAMEWORK_DEFAULTS;
513
+ export declare function getJavaScriptDeployment(framework: Framework): JavaScriptDeployment;
514
+ export declare function defaultVersionFor(runtime: Runtime): string;