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.
- package/README.md +5 -16
- package/dist/build.d.ts +1 -0
- package/dist/build.js +9 -4
- package/dist/cli.js +648 -43
- package/dist/context.d.ts +39 -0
- package/dist/context.js +101 -0
- package/dist/docker.d.ts +24 -12
- package/dist/docker.js +299 -389
- package/dist/exec.d.ts +1 -1
- package/dist/exec.js +2 -2
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -1
- package/dist/init.js +19 -2
- package/dist/interpolate.d.ts +11 -0
- package/dist/interpolate.js +11 -0
- package/dist/local/dev.d.ts +31 -0
- package/dist/local/dev.js +109 -0
- package/dist/local/index.d.ts +2 -0
- package/dist/local/index.js +2 -0
- package/dist/local/runtime.d.ts +61 -0
- package/dist/local/runtime.js +391 -0
- package/dist/proxy.d.ts +16 -0
- package/dist/proxy.js +0 -0
- package/dist/resource.d.ts +104 -1
- package/dist/resource.js +11 -1
- package/dist/runtime.d.ts +11 -1
- package/dist/services/index.d.ts +26 -0
- package/dist/services/index.js +35 -0
- package/dist/services/minio.d.ts +36 -0
- package/dist/services/minio.js +53 -0
- package/dist/services/mongo.d.ts +28 -0
- package/dist/services/mongo.js +45 -0
- package/dist/services/mysql.d.ts +28 -0
- package/dist/services/mysql.js +44 -0
- package/dist/services/nats.d.ts +26 -0
- package/dist/services/nats.js +38 -0
- package/dist/services/postgres.d.ts +28 -0
- package/dist/services/postgres.js +45 -0
- package/dist/services/rabbitmq.d.ts +28 -0
- package/dist/services/rabbitmq.js +44 -0
- package/dist/services/redis.d.ts +28 -0
- package/dist/services/redis.js +49 -0
- package/dist/services/storage.d.ts +39 -0
- package/dist/services/storage.js +94 -0
- package/dist/swarm/factories.d.ts +9 -2
- package/dist/swarm/factories.js +9 -32
- package/dist/swarm/index.d.ts +11 -2
- package/dist/swarm/proxy.d.ts +24 -0
- package/dist/swarm/proxy.js +339 -0
- package/dist/swarm/types.d.ts +11 -21
- package/dist/symbols.d.ts +7 -0
- package/dist/symbols.js +3 -0
- package/package.json +4 -5
- package/templates/fullstack/package.json +2 -6
- package/templates/fullstack/vyft.config.ts +13 -28
- 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 {
|
|
18
|
-
import { swarm } from 'vyft/swarm';
|
|
17
|
+
import { service, secret, postgres, site } from 'vyft';
|
|
19
18
|
|
|
20
|
-
const
|
|
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:
|
|
26
|
+
DATABASE_URL: db.url,
|
|
27
|
+
AUTH_SECRET: authSecret,
|
|
39
28
|
}
|
|
40
29
|
});
|
|
41
30
|
|
package/dist/build.d.ts
CHANGED
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
}
|