vyft 0.1.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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +195 -0
  3. package/dist/build.d.ts +11 -0
  4. package/dist/build.js +39 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +200 -0
  7. package/dist/docker.d.ts +48 -0
  8. package/dist/docker.js +855 -0
  9. package/dist/exec.d.ts +2 -0
  10. package/dist/exec.js +28 -0
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.js +3 -0
  13. package/dist/init.d.ts +1 -0
  14. package/dist/init.js +100 -0
  15. package/dist/interpolate.d.ts +2 -0
  16. package/dist/interpolate.js +8 -0
  17. package/dist/logger.d.ts +2 -0
  18. package/dist/logger.js +10 -0
  19. package/dist/resource.d.ts +78 -0
  20. package/dist/resource.js +35 -0
  21. package/dist/runtime.d.ts +6 -0
  22. package/dist/runtime.js +0 -0
  23. package/dist/swarm/factories.d.ts +8 -0
  24. package/dist/swarm/factories.js +50 -0
  25. package/dist/swarm/index.d.ts +10 -0
  26. package/dist/swarm/index.js +5 -0
  27. package/dist/swarm/types.d.ts +25 -0
  28. package/dist/swarm/types.js +0 -0
  29. package/dist/symbols.d.ts +8 -0
  30. package/dist/symbols.js +1 -0
  31. package/package.json +68 -0
  32. package/templates/fullstack/apps/api/Dockerfile +21 -0
  33. package/templates/fullstack/apps/api/package.json +26 -0
  34. package/templates/fullstack/apps/api/src/auth.ts +21 -0
  35. package/templates/fullstack/apps/api/src/db.ts +16 -0
  36. package/templates/fullstack/apps/api/src/index.ts +17 -0
  37. package/templates/fullstack/apps/api/src/router.ts +11 -0
  38. package/templates/fullstack/apps/api/src/schema.ts +11 -0
  39. package/templates/fullstack/apps/api/tsconfig.json +8 -0
  40. package/templates/fullstack/apps/web/index.html +12 -0
  41. package/templates/fullstack/apps/web/package.json +21 -0
  42. package/templates/fullstack/apps/web/src/app.tsx +8 -0
  43. package/templates/fullstack/apps/web/src/main.tsx +9 -0
  44. package/templates/fullstack/apps/web/tsconfig.json +7 -0
  45. package/templates/fullstack/apps/web/vite.config.ts +14 -0
  46. package/templates/fullstack/compose.yaml +14 -0
  47. package/templates/fullstack/dockerignore +7 -0
  48. package/templates/fullstack/gitignore +3 -0
  49. package/templates/fullstack/package.json +17 -0
  50. package/templates/fullstack/pnpm-workspace.yaml +2 -0
  51. package/templates/fullstack/tsconfig.json +11 -0
  52. package/templates/fullstack/vyft.config.ts +37 -0
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "{{name}}-web",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "vite build",
8
+ "preview": "vite preview"
9
+ },
10
+ "dependencies": {
11
+ "react": "^19.1.0",
12
+ "react-dom": "^19.1.0"
13
+ },
14
+ "devDependencies": {
15
+ "@types/react": "^19.1.6",
16
+ "@types/react-dom": "^19.1.6",
17
+ "@vitejs/plugin-react": "^4.5.2",
18
+ "typescript": "^5.8.3",
19
+ "vite": "^6.3.5"
20
+ }
21
+ }
@@ -0,0 +1,8 @@
1
+ export function App() {
2
+ return (
3
+ <main>
4
+ <h1>{{name}}</h1>
5
+ <p>Edit <code>web/src/app.tsx</code> to get started.</p>
6
+ </main>
7
+ );
8
+ }
@@ -0,0 +1,9 @@
1
+ import { StrictMode } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import { App } from './app.js';
4
+
5
+ createRoot(document.getElementById('root')!).render(
6
+ <StrictMode>
7
+ <App />
8
+ </StrictMode>,
9
+ );
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "lib": ["ESNext", "DOM", "DOM.Iterable"]
5
+ },
6
+ "include": ["src"]
7
+ }
@@ -0,0 +1,14 @@
1
+ import react from '@vitejs/plugin-react';
2
+ import { defineConfig } from 'vite';
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ server: {
7
+ proxy: {
8
+ '/api': {
9
+ target: 'http://localhost:3000',
10
+ changeOrigin: true,
11
+ },
12
+ },
13
+ },
14
+ });
@@ -0,0 +1,14 @@
1
+ services:
2
+ db:
3
+ image: postgres:17
4
+ restart: unless-stopped
5
+ ports:
6
+ - "5432:5432"
7
+ environment:
8
+ POSTGRES_DB: {{name}}
9
+ POSTGRES_PASSWORD: postgres
10
+ volumes:
11
+ - db-data:/var/lib/postgresql/data
12
+
13
+ volumes:
14
+ db-data:
@@ -0,0 +1,7 @@
1
+ node_modules
2
+ .git
3
+ .env
4
+ dist
5
+ *.md
6
+ .vscode
7
+ .idea
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ dist
3
+ .env
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "dependencies": {
6
+ "vyft": "latest"
7
+ },
8
+ "scripts": {
9
+ "predev": "pnpm compose:up",
10
+ "dev": "pnpm --parallel -r dev",
11
+ "build": "pnpm --parallel -r build",
12
+ "deploy": "vyft deploy",
13
+ "compose:up": "docker compose up -d",
14
+ "compose:down": "docker compose down",
15
+ "compose:stop": "docker compose stop"
16
+ }
17
+ }
@@ -0,0 +1,2 @@
1
+ packages:
2
+ - "apps/*"
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "skipLibCheck": true,
8
+ "esModuleInterop": true,
9
+ "jsx": "react-jsx"
10
+ }
11
+ }
@@ -0,0 +1,37 @@
1
+ import { interpolate } from 'vyft';
2
+ import { swarm } from 'vyft/swarm';
3
+
4
+ const { service, secret, volume, site } = swarm();
5
+
6
+ export const dbPassword = secret('db-password', { length: 32 });
7
+ export const authSecret = secret('auth-secret', { length: 64 });
8
+ export const dbData = volume('db-data', { size: '10GB' });
9
+
10
+ export const db = service('db', {
11
+ image: 'postgres:17',
12
+ volumes: [
13
+ { volume: dbData, mount: '/var/lib/postgresql/data' }
14
+ ],
15
+ env: {
16
+ POSTGRES_PASSWORD: dbPassword,
17
+ POSTGRES_DB: '{{name}}',
18
+ }
19
+ });
20
+
21
+ export const api = service('api', {
22
+ route: '{{domain}}/api/*',
23
+ image: { dockerfile: './apps/api/Dockerfile' },
24
+ env: {
25
+ DATABASE_URL: interpolate`postgres://postgres:${dbPassword}@${db.host}:5432/{{name}}`,
26
+ AUTH_SECRET: authSecret,
27
+ BETTER_AUTH_URL: 'https://{{domain}}/api',
28
+ }
29
+ });
30
+
31
+ export const web = site('web', {
32
+ route: '{{domain}}',
33
+ spa: true,
34
+ build: {
35
+ cwd: './apps/web',
36
+ }
37
+ });