vyft 0.2.0-alpha → 0.4.0-alpha

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.
Files changed (56) hide show
  1. package/README.md +5 -16
  2. package/dist/build.d.ts +1 -0
  3. package/dist/build.js +9 -4
  4. package/dist/cli.js +648 -43
  5. package/dist/context.d.ts +39 -0
  6. package/dist/context.js +101 -0
  7. package/dist/docker.d.ts +24 -12
  8. package/dist/docker.js +299 -389
  9. package/dist/exec.d.ts +1 -1
  10. package/dist/exec.js +2 -2
  11. package/dist/index.d.ts +4 -1
  12. package/dist/index.js +5 -1
  13. package/dist/init.js +19 -2
  14. package/dist/interpolate.d.ts +11 -0
  15. package/dist/interpolate.js +11 -0
  16. package/dist/local/dev.d.ts +31 -0
  17. package/dist/local/dev.js +109 -0
  18. package/dist/local/index.d.ts +2 -0
  19. package/dist/local/index.js +2 -0
  20. package/dist/local/runtime.d.ts +61 -0
  21. package/dist/local/runtime.js +391 -0
  22. package/dist/proxy.d.ts +16 -0
  23. package/dist/proxy.js +0 -0
  24. package/dist/resource.d.ts +104 -1
  25. package/dist/resource.js +11 -1
  26. package/dist/runtime.d.ts +11 -1
  27. package/dist/services/index.d.ts +26 -0
  28. package/dist/services/index.js +35 -0
  29. package/dist/services/minio.d.ts +36 -0
  30. package/dist/services/minio.js +53 -0
  31. package/dist/services/mongo.d.ts +28 -0
  32. package/dist/services/mongo.js +45 -0
  33. package/dist/services/mysql.d.ts +28 -0
  34. package/dist/services/mysql.js +44 -0
  35. package/dist/services/nats.d.ts +26 -0
  36. package/dist/services/nats.js +38 -0
  37. package/dist/services/postgres.d.ts +28 -0
  38. package/dist/services/postgres.js +45 -0
  39. package/dist/services/rabbitmq.d.ts +28 -0
  40. package/dist/services/rabbitmq.js +44 -0
  41. package/dist/services/redis.d.ts +28 -0
  42. package/dist/services/redis.js +49 -0
  43. package/dist/services/storage.d.ts +39 -0
  44. package/dist/services/storage.js +94 -0
  45. package/dist/swarm/factories.d.ts +9 -2
  46. package/dist/swarm/factories.js +9 -32
  47. package/dist/swarm/index.d.ts +11 -2
  48. package/dist/swarm/proxy.d.ts +24 -0
  49. package/dist/swarm/proxy.js +339 -0
  50. package/dist/swarm/types.d.ts +11 -21
  51. package/dist/symbols.d.ts +7 -0
  52. package/dist/symbols.js +3 -0
  53. package/package.json +4 -5
  54. package/templates/fullstack/package.json +2 -6
  55. package/templates/fullstack/vyft.config.ts +13 -28
  56. package/templates/fullstack/compose.yaml +0 -14
package/README.md CHANGED
@@ -14,28 +14,17 @@ This scaffolds a fullstack project with a Hono API, React SPA, and Postgres —
14
14
 
15
15
  ```typescript
16
16
  // vyft.config.ts
17
- import { interpolate } from 'vyft';
18
- import { swarm } from 'vyft/swarm';
17
+ import { service, secret, postgres, site } from 'vyft';
19
18
 
20
- const { service, secret, volume, site } = swarm();
21
-
22
- export const dbPassword = secret('db-password', { length: 32 });
23
- export const dbData = volume('db-data', { size: '10GB' });
24
-
25
- export const db = service('db', {
26
- image: 'postgres:17',
27
- volumes: [{ volume: dbData, mount: '/var/lib/postgresql/data' }],
28
- env: {
29
- POSTGRES_PASSWORD: dbPassword,
30
- POSTGRES_DB: 'myapp',
31
- }
32
- });
19
+ export const authSecret = secret('auth-secret', { length: 64 });
20
+ export const db = postgres('db');
33
21
 
34
22
  export const api = service('api', {
35
23
  route: 'example.com/api/*',
36
24
  image: { dockerfile: './apps/api/Dockerfile' },
37
25
  env: {
38
- DATABASE_URL: interpolate`postgres://postgres:${dbPassword}@${db.host}:5432/myapp`,
26
+ DATABASE_URL: db.url,
27
+ AUTH_SECRET: authSecret,
39
28
  }
40
29
  });
41
30
 
package/dist/build.d.ts CHANGED
@@ -6,6 +6,7 @@ type BuildOptions = {
6
6
  output?: string;
7
7
  command?: string;
8
8
  env?: Record<string, string>;
9
+ silent?: boolean;
9
10
  };
10
11
  export declare function buildStatic(context: string, options: BuildOptions, log?: Logger): Promise<BuildResult>;
11
12
  export {};
package/dist/build.js CHANGED
@@ -25,10 +25,15 @@ export async function buildStatic(context, options, log) {
25
25
  if (buildCommand) {
26
26
  const start = performance.now();
27
27
  log?.info({ command: buildCommand, context: buildContext }, "static build started");
28
- const s = spinner();
29
- s.start(`Building static site (${buildCommand})`);
30
- await exec(buildCommand, buildContext, options.env, log);
31
- s.stop("Build complete");
28
+ if (!options.silent) {
29
+ const s = spinner();
30
+ s.start(`Building static site (${buildCommand})`);
31
+ await exec(buildCommand, buildContext, options.env, log);
32
+ s.stop("Build complete");
33
+ }
34
+ else {
35
+ await exec(buildCommand, buildContext, options.env, log, true);
36
+ }
32
37
  const durationMs = Math.round(performance.now() - start);
33
38
  log?.info({ command: buildCommand, context: buildContext, durationMs }, "static build completed");
34
39
  }