@dbos-inc/create 1.31.23-preview → 1.31.25-preview

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 (142) hide show
  1. package/dist/cli.js +3 -4
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/dbos-drizzle/README.md +23 -0
  5. package/templates/dbos-drizzle/nodemon.json +7 -0
  6. package/templates/{hello-drizzle → dbos-drizzle}/package.json +1 -1
  7. package/templates/dbos-knex/README.md +23 -0
  8. package/templates/dbos-knex/nodemon.json +7 -0
  9. package/templates/{hello-contexts → dbos-knex}/package.json +3 -3
  10. package/templates/dbos-knex/src/main.ts +94 -0
  11. package/templates/dbos-prisma/README.md +23 -0
  12. package/templates/{hello-prisma → dbos-prisma}/nodemon.json +1 -1
  13. package/templates/{hello-prisma → dbos-prisma}/package.json +1 -1
  14. package/templates/{hello-express → dbos-prisma}/start_postgres_docker.js +0 -0
  15. package/templates/dbos-typeorm/README.md +23 -0
  16. package/templates/dbos-typeorm/nodemon.json +8 -0
  17. package/templates/{hello-typeorm → dbos-typeorm}/package.json +1 -1
  18. package/templates/{hello-nextjs → dbos-typeorm}/start_postgres_docker.js +0 -0
  19. package/templates/hello/.vscode/extensions.json +0 -7
  20. package/templates/hello/.vscode/launch.json +0 -21
  21. package/templates/hello/.vscode/tasks.json +0 -19
  22. package/templates/hello/README.md +0 -55
  23. package/templates/hello/dbos-config.yaml +0 -20
  24. package/templates/hello/eslint.config.js +0 -28
  25. package/templates/hello/gitignore.template +0 -144
  26. package/templates/hello/jest.config.js +0 -8
  27. package/templates/hello/knexfile.js +0 -20
  28. package/templates/hello/migrations/20240212161006_create_dbos_hello_tables.js +0 -18
  29. package/templates/hello/nodemon.json +0 -7
  30. package/templates/hello/package.json +0 -23
  31. package/templates/hello/src/operations.test.ts +0 -37
  32. package/templates/hello/src/operations.ts +0 -64
  33. package/templates/hello/start_postgres_docker.js +0 -40
  34. package/templates/hello/tsconfig.json +0 -25
  35. package/templates/hello-contexts/.vscode/extensions.json +0 -7
  36. package/templates/hello-contexts/.vscode/launch.json +0 -21
  37. package/templates/hello-contexts/.vscode/tasks.json +0 -19
  38. package/templates/hello-contexts/README.md +0 -76
  39. package/templates/hello-contexts/dbos-config.yaml +0 -20
  40. package/templates/hello-contexts/nodemon.json +0 -7
  41. package/templates/hello-contexts/src/operations.test.ts +0 -38
  42. package/templates/hello-contexts/src/operations.ts +0 -66
  43. package/templates/hello-drizzle/.vscode/extensions.json +0 -7
  44. package/templates/hello-drizzle/.vscode/launch.json +0 -21
  45. package/templates/hello-drizzle/.vscode/tasks.json +0 -19
  46. package/templates/hello-drizzle/README.md +0 -48
  47. package/templates/hello-drizzle/nodemon.json +0 -7
  48. package/templates/hello-express/README.md +0 -77
  49. package/templates/hello-express/knexfile.js +0 -20
  50. package/templates/hello-express/migrations/20240212161006_create_dbos_hello_tables.js +0 -18
  51. package/templates/hello-express/nodemon.json +0 -7
  52. package/templates/hello-express/package.json +0 -24
  53. package/templates/hello-express/src/main.ts +0 -99
  54. package/templates/hello-express/tsconfig.json +0 -25
  55. package/templates/hello-nextjs/README.md +0 -100
  56. package/templates/hello-nextjs/dbos-config.yaml +0 -18
  57. package/templates/hello-nextjs/eslint.config.mjs +0 -16
  58. package/templates/hello-nextjs/gitignore.template +0 -41
  59. package/templates/hello-nextjs/knexfile.js +0 -20
  60. package/templates/hello-nextjs/migrations/20240212161006_create_dbos_hello_tables.js +0 -18
  61. package/templates/hello-nextjs/next.config.ts +0 -18
  62. package/templates/hello-nextjs/package.json +0 -32
  63. package/templates/hello-nextjs/postcss.config.mjs +0 -8
  64. package/templates/hello-nextjs/public/file.svg +0 -1
  65. package/templates/hello-nextjs/public/globe.svg +0 -1
  66. package/templates/hello-nextjs/public/next.svg +0 -1
  67. package/templates/hello-nextjs/public/vercel.svg +0 -1
  68. package/templates/hello-nextjs/public/window.svg +0 -1
  69. package/templates/hello-nextjs/src/actions/dbosWorkflow.ts +0 -12
  70. package/templates/hello-nextjs/src/actions/hello.ts +0 -15
  71. package/templates/hello-nextjs/src/app/crash/route.ts +0 -8
  72. package/templates/hello-nextjs/src/app/favicon.ico +0 -0
  73. package/templates/hello-nextjs/src/app/globals.css +0 -21
  74. package/templates/hello-nextjs/src/app/greetings/route.ts +0 -11
  75. package/templates/hello-nextjs/src/app/layout.tsx +0 -34
  76. package/templates/hello-nextjs/src/app/page.tsx +0 -73
  77. package/templates/hello-nextjs/src/app/step/[slug]/route.ts +0 -15
  78. package/templates/hello-nextjs/src/app/tasks/[slug]/route.ts +0 -18
  79. package/templates/hello-nextjs/src/components/client/BackGroundTask.tsx +0 -179
  80. package/templates/hello-nextjs/src/components/client/callDBOSWorkflow.tsx +0 -31
  81. package/templates/hello-nextjs/src/dbos/background.ts +0 -23
  82. package/templates/hello-nextjs/src/dbos/hello.ts +0 -24
  83. package/templates/hello-nextjs/src/dbos/operations.ts +0 -9
  84. package/templates/hello-nextjs/tailwind.config.ts +0 -18
  85. package/templates/hello-nextjs/tsconfig.json +0 -29
  86. package/templates/hello-prisma/.vscode/extensions.json +0 -7
  87. package/templates/hello-prisma/.vscode/launch.json +0 -21
  88. package/templates/hello-prisma/.vscode/tasks.json +0 -19
  89. package/templates/hello-prisma/README.md +0 -51
  90. package/templates/hello-prisma/start_postgres_docker.js +0 -40
  91. package/templates/hello-typeorm/.vscode/extensions.json +0 -7
  92. package/templates/hello-typeorm/.vscode/launch.json +0 -21
  93. package/templates/hello-typeorm/.vscode/tasks.json +0 -19
  94. package/templates/hello-typeorm/README.md +0 -51
  95. package/templates/hello-typeorm/eslint.config.js +0 -28
  96. package/templates/hello-typeorm/gitignore.template +0 -144
  97. package/templates/hello-typeorm/jest.config.js +0 -8
  98. package/templates/hello-typeorm/nodemon.json +0 -8
  99. package/templates/hello-typeorm/start_postgres_docker.js +0 -40
  100. /package/templates/{hello-drizzle → dbos-drizzle}/dbos-config.yaml +0 -0
  101. /package/templates/{hello-drizzle → dbos-drizzle}/drizzle/0000_hello.sql +0 -0
  102. /package/templates/{hello-drizzle → dbos-drizzle}/drizzle/meta/0000_snapshot.json +0 -0
  103. /package/templates/{hello-drizzle → dbos-drizzle}/drizzle/meta/_journal.json +0 -0
  104. /package/templates/{hello-drizzle → dbos-drizzle}/drizzle.config.ts +0 -0
  105. /package/templates/{hello-contexts → dbos-drizzle}/eslint.config.js +0 -0
  106. /package/templates/{hello-contexts → dbos-drizzle}/gitignore.template +0 -0
  107. /package/templates/{hello-contexts → dbos-drizzle}/jest.config.js +0 -0
  108. /package/templates/{hello-drizzle → dbos-drizzle}/src/operations.test.ts +0 -0
  109. /package/templates/{hello-drizzle → dbos-drizzle}/src/operations.ts +0 -0
  110. /package/templates/{hello-drizzle → dbos-drizzle}/src/schema.ts +0 -0
  111. /package/templates/{hello-contexts → dbos-drizzle}/start_postgres_docker.js +0 -0
  112. /package/templates/{hello-contexts → dbos-drizzle}/tsconfig.json +0 -0
  113. /package/templates/{hello-express → dbos-knex}/dbos-config.yaml +0 -0
  114. /package/templates/{hello-drizzle → dbos-knex}/eslint.config.js +0 -0
  115. /package/templates/{hello-drizzle → dbos-knex}/gitignore.template +0 -0
  116. /package/templates/{hello-drizzle → dbos-knex}/jest.config.js +0 -0
  117. /package/templates/{hello-contexts → dbos-knex}/knexfile.js +0 -0
  118. /package/templates/{hello-contexts → dbos-knex}/migrations/20240212161006_create_dbos_hello_tables.js +0 -0
  119. /package/templates/{hello-express → dbos-knex}/src/main.test.ts +0 -0
  120. /package/templates/{hello-drizzle → dbos-knex}/start_postgres_docker.js +0 -0
  121. /package/templates/{hello-drizzle → dbos-knex}/tsconfig.json +0 -0
  122. /package/templates/{hello-prisma → dbos-prisma}/dbos-config.yaml +0 -0
  123. /package/templates/{hello-express → dbos-prisma}/eslint.config.js +0 -0
  124. /package/templates/{hello-prisma → dbos-prisma}/generate_env.js +0 -0
  125. /package/templates/{hello-prisma → dbos-prisma}/gitignore.template +0 -0
  126. /package/templates/{hello-express → dbos-prisma}/jest.config.js +0 -0
  127. /package/templates/{hello-prisma → dbos-prisma}/prisma/migrations/20240604184654_init/migration.sql +0 -0
  128. /package/templates/{hello-prisma → dbos-prisma}/prisma/migrations/migration_lock.toml +0 -0
  129. /package/templates/{hello-prisma → dbos-prisma}/prisma/schema.prisma +0 -0
  130. /package/templates/{hello-prisma → dbos-prisma}/src/operations.test.ts +0 -0
  131. /package/templates/{hello-prisma → dbos-prisma}/src/operations.ts +0 -0
  132. /package/templates/{hello-prisma → dbos-prisma}/tsconfig.json +0 -0
  133. /package/templates/{hello-typeorm → dbos-typeorm}/datasource.ts +0 -0
  134. /package/templates/{hello-typeorm → dbos-typeorm}/dbos-config.yaml +0 -0
  135. /package/templates/{hello-typeorm → dbos-typeorm}/entities/DBOSHello.ts +0 -0
  136. /package/templates/{hello-prisma → dbos-typeorm}/eslint.config.js +0 -0
  137. /package/templates/{hello-express → dbos-typeorm}/gitignore.template +0 -0
  138. /package/templates/{hello-prisma → dbos-typeorm}/jest.config.js +0 -0
  139. /package/templates/{hello-typeorm → dbos-typeorm}/migrations/1714934318136-DBOSHello.ts +0 -0
  140. /package/templates/{hello-typeorm → dbos-typeorm}/src/operations.test.ts +0 -0
  141. /package/templates/{hello-typeorm → dbos-typeorm}/src/operations.ts +0 -0
  142. /package/templates/{hello-typeorm → dbos-typeorm}/tsconfig.json +0 -0
@@ -1,51 +0,0 @@
1
- # DBOS Hello with TypeORM
2
-
3
- This is a [DBOS app](https://docs.dbos.dev/) bootstrapped with `npx @dbos-inc/create` and using [TypeORM](https://docs.dbos.dev/typescript/tutorials/orms/using-typeorm).
4
-
5
- ## Getting Started
6
-
7
- Before you can launch your app, you need a database.
8
- DBOS works with any Postgres database, but to make things easier, we've provided a script that starts a Docker Postgres container and creates a database.
9
- Run:
10
-
11
- ```bash
12
- node start_postgres_docker.js
13
- ```
14
-
15
- If successful, the script should print `Database started successfully!`.
16
-
17
- Next, build the app:
18
-
19
- ```bash
20
- npm run build
21
- ```
22
-
23
- Then, run a schema migration to create some tables.
24
- TypeORM provides rich support for [schema migrations](https://typeorm.io/migrations), including automatic generation of migration files from entity files.
25
- Fore more information, see [our docs](https://docs.dbos.dev/typescript/tutorials/orms/using-typeorm).
26
-
27
- ```bash
28
- npx dbos migrate
29
- ```
30
-
31
- If successful, the migration should print `Migration successful!`.
32
-
33
- Finally, run the app:
34
-
35
- ```bash
36
- npx dbos start
37
- ```
38
-
39
- To see that it's working, visit this URL in your browser: [`http://localhost:3000/greeting/dbos`](http://localhost:3000/greeting/dbos).
40
- You should get this message: `Hello, dbos! You have been greeted 1 times.`
41
- Each time you refresh the page, the counter should go up by one!
42
-
43
- Congratulations! You just launched a DBOS application.
44
-
45
- ## Next Steps
46
-
47
- - For more information on using TypeORM with DBOS, check out [our docs](https://docs.dbos.dev/typescript/tutorials/orms/using-typeorm).
48
- - To add more functionality to this application, modify `src/operations.ts`, then rebuild and restart it. Alternatively, `npm run dev` uses `nodemon` to automatically rebuild and restart the app when source files change, using instructions specified in `nodemon.json`.
49
- - For a detailed tutorial, check out our [programming quickstart](https://docs.dbos.dev/typescript/programming-guide).
50
- - To learn how to deploy your application to DBOS Cloud, visit our [cloud quickstart](https://docs.dbos.dev/quickstart)
51
- - To learn more about DBOS, take a look at [our documentation](https://docs.dbos.dev/) or our [source code](https://github.com/dbos-inc).
@@ -1,28 +0,0 @@
1
- const { FlatCompat } = require("@eslint/eslintrc");
2
- const dbosIncEslintPlugin = require("@dbos-inc/eslint-plugin");
3
- const typescriptEslint = require("typescript-eslint");
4
- const typescriptEslintParser = require("@typescript-eslint/parser");
5
- const globals = require("globals");
6
- const js = require("@eslint/js");
7
-
8
- const compat = new FlatCompat({
9
- baseDirectory: __dirname,
10
- recommendedConfig: js.configs.recommended
11
- });
12
-
13
- module.exports = typescriptEslint.config({
14
- extends: compat.extends("plugin:@dbos-inc/dbosRecommendedConfig"),
15
- plugins: { "@dbos-inc": dbosIncEslintPlugin },
16
-
17
- languageOptions: {
18
- parser: typescriptEslintParser,
19
- parserOptions: { project: "./tsconfig.json" },
20
- globals: { ...globals.node, ...globals.es6 }
21
- },
22
-
23
- rules: {
24
- "no-secrets/no-secrets": ["error", { "tolerance": 5 }]
25
- },
26
-
27
- ignores: ["**/*.test.ts"]
28
- });
@@ -1,144 +0,0 @@
1
- # DBOS-specific
2
- .dbos
3
-
4
- # Logs
5
- **/.DS_Store
6
- **/prisma/migrations/*
7
-
8
- logs
9
- *.log
10
- npm-debug.log*
11
- yarn-debug.log*
12
- yarn-error.log*
13
- lerna-debug.log*
14
- .pnpm-debug.log*
15
- dbos_deploy/
16
-
17
- # Diagnostic reports (https://nodejs.org/api/report.html)
18
- report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
19
-
20
- # Runtime data
21
- pids
22
- *.pid
23
- *.seed
24
- *.pid.lock
25
-
26
- # Directory for instrumented libs generated by jscoverage/JSCover
27
- lib-cov
28
-
29
- # Coverage directory used by tools like istanbul
30
- coverage
31
- *.lcov
32
-
33
- # nyc test coverage
34
- .nyc_output
35
-
36
- # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
37
- .grunt
38
-
39
- # Bower dependency directory (https://bower.io/)
40
- bower_components
41
-
42
- # node-waf configuration
43
- .lock-wscript
44
-
45
- # Compiled binary addons (https://nodejs.org/api/addons.html)
46
- build/Release
47
-
48
- # Dependency directories
49
- node_modules/
50
- jspm_packages/
51
-
52
- # Snowpack dependency directory (https://snowpack.dev/)
53
- web_modules/
54
-
55
- # TypeScript cache
56
- *.tsbuildinfo
57
-
58
- # Optional npm cache directory
59
- .npm
60
-
61
- # Optional eslint cache
62
- .eslintcache
63
-
64
- # Optional stylelint cache
65
- .stylelintcache
66
-
67
- # Microbundle cache
68
- .rpt2_cache/
69
- .rts2_cache_cjs/
70
- .rts2_cache_es/
71
- .rts2_cache_umd/
72
-
73
- # Optional REPL history
74
- .node_repl_history
75
-
76
- # Output of 'npm pack'
77
- *.tgz
78
-
79
- # Yarn Integrity file
80
- .yarn-integrity
81
-
82
- # dotenv environment variable files
83
- .env
84
- .env.development.local
85
- .env.test.local
86
- .env.production.local
87
- .env.local
88
-
89
- # parcel-bundler cache (https://parceljs.org/)
90
- .cache
91
- .parcel-cache
92
-
93
- # Next.js build output
94
- .next
95
- out
96
-
97
- # Nuxt.js build / generate output
98
- .nuxt
99
- dist
100
-
101
- # Gatsby files
102
- .cache/
103
- # Comment in the public line in if your project uses Gatsby and not Next.js
104
- # https://nextjs.org/blog/next-9-1#public-directory-support
105
- # public
106
-
107
- # vuepress build output
108
- .vuepress/dist
109
-
110
- # vuepress v2.x temp and cache directory
111
- .temp
112
- .cache
113
-
114
- # Docusaurus cache and generated files
115
- .docusaurus
116
-
117
- # Serverless directories
118
- .serverless/
119
-
120
- # FuseBox cache
121
- .fusebox/
122
-
123
- # DynamoDB Local files
124
- .dynamodb/
125
-
126
- # TernJS port file
127
- .tern-port
128
-
129
- # Stores VSCode versions used for testing VSCode extensions
130
- .vscode-test
131
-
132
- # VSCode settings
133
- .vscode/settings.json
134
-
135
- # yarn v2
136
- .yarn/cache
137
- .yarn/unplugged
138
- .yarn/build-state.yml
139
- .yarn/install-state.gz
140
- .pnp.*
141
-
142
- # Editor temp/recovery files
143
- *.swp
144
- *.swo
@@ -1,8 +0,0 @@
1
- /** @type {import('ts-jest').JestConfigWithTsJest} */
2
- module.exports = {
3
- preset: 'ts-jest',
4
- testEnvironment: 'node',
5
- testRegex: '((\\.|/)(test|spec))\\.ts?$',
6
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
7
- modulePaths: ["./"],
8
- };
@@ -1,8 +0,0 @@
1
- {
2
- "watch": ["src/", "migrations/", "entities/"],
3
- "ext": "ts,json",
4
- "ignore": ["src/**/*.test.ts"],
5
- "exec": "npm run build && npx dbos migrate && npm run start"
6
- }
7
-
8
-
@@ -1,40 +0,0 @@
1
- const { execSync } = require('child_process');
2
-
3
- // Default PostgreSQL port
4
- let port = '5432';
5
-
6
- // Set the host PostgreSQL port with the -p/--port flag.
7
- process.argv.forEach((val, index) => {
8
- if (val === '-p' || val === '--port') {
9
- if (process.argv[index + 1]) {
10
- port = process.argv[index + 1];
11
- }
12
- }
13
- });
14
-
15
- if (!process.env.PGPASSWORD) {
16
- console.error("Error: PGPASSWORD is not set.");
17
- process.exit(1);
18
- }
19
-
20
- try {
21
- execSync(`docker run --rm --name=dbos-db --env=POSTGRES_PASSWORD="${process.env.PGPASSWORD}" --env=PGDATA=/var/lib/postgresql/data --volume=/var/lib/postgresql/data -p ${port}:5432 -d sibedge/postgres-plv8`);
22
- console.log("Waiting for PostgreSQL to start...");
23
-
24
- let attempts = 30;
25
- const checkDatabase = setInterval(() => {
26
- try {
27
- execSync('docker exec dbos-db psql -U postgres -c "SELECT 1;"', { stdio: 'ignore' });
28
- console.log("PostgreSQL started!");
29
- clearInterval(checkDatabase);
30
- console.log("Database started successfully!");
31
- } catch (error) {
32
- if (--attempts === 0) {
33
- clearInterval(checkDatabase);
34
- console.error("Failed to start PostgreSQL.");
35
- }
36
- }
37
- }, 1000);
38
- } catch (error) {
39
- console.error("Error starting PostgreSQL in Docker:", error.message);
40
- }