create-platformatic 2.5.2 → 2.5.4

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 (2) hide show
  1. package/package.json +8 -8
  2. package/src/index.mjs +11 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-platformatic",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "Create platformatic application interactive tool",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,9 +34,9 @@
34
34
  "strip-ansi": "^7.1.0",
35
35
  "undici": "^6.9.0",
36
36
  "which": "^3.0.1",
37
- "@platformatic/config": "2.5.2",
38
- "@platformatic/generators": "2.5.2",
39
- "@platformatic/utils": "2.5.2"
37
+ "@platformatic/config": "2.5.4",
38
+ "@platformatic/generators": "2.5.4",
39
+ "@platformatic/utils": "2.5.4"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^22.5.0",
@@ -51,10 +51,10 @@
51
51
  "neostandard": "^0.11.1",
52
52
  "typescript": "~5.6.0",
53
53
  "yaml": "^2.4.1",
54
- "@platformatic/composer": "2.5.2",
55
- "@platformatic/db": "2.5.2",
56
- "@platformatic/runtime": "2.5.2",
57
- "@platformatic/service": "2.5.2"
54
+ "@platformatic/composer": "2.5.4",
55
+ "@platformatic/db": "2.5.4",
56
+ "@platformatic/runtime": "2.5.4",
57
+ "@platformatic/service": "2.5.4"
58
58
  },
59
59
  "scripts": {
60
60
  "test:cli": "borp --pattern \"test/cli/*test.mjs\" --timeout=180000 --concurrency=1",
package/src/index.mjs CHANGED
@@ -15,6 +15,7 @@ import { request } from 'undici'
15
15
  import { createGitRepository } from './create-git-repository.mjs'
16
16
  import { say } from './say.mjs'
17
17
  import { getUsername, getVersion } from './utils.mjs'
18
+ import { ConfigManager } from '@platformatic/config'
18
19
 
19
20
  const MARKETPLACE_HOST = 'https://marketplace.platformatic.dev'
20
21
  const defaultStackables = ['@platformatic/composer', '@platformatic/db', '@platformatic/service']
@@ -110,14 +111,17 @@ export const createPlatformatic = async argv => {
110
111
  }
111
112
 
112
113
  async function createApplication (args, logger, pkgManager) {
113
- const optionsDir = await inquirer.prompt({
114
- type: 'input',
115
- name: 'dir',
116
- message: 'Where would you like to create your project?',
117
- default: 'platformatic',
118
- })
114
+ let projectDir = process.cwd()
115
+ if (!(await ConfigManager.findConfigFile())) {
116
+ const optionsDir = await inquirer.prompt({
117
+ type: 'input',
118
+ name: 'dir',
119
+ message: 'Where would you like to create your project?',
120
+ default: 'platformatic',
121
+ })
119
122
 
120
- const projectDir = path.resolve(process.cwd(), optionsDir.dir)
123
+ projectDir = path.resolve(process.cwd(), optionsDir.dir)
124
+ }
121
125
  const projectName = basename(projectDir)
122
126
 
123
127
  await createDirectory(projectDir)