create-platformatic 2.70.1 → 2.71.0
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/package.json +8 -8
- package/src/index.mjs +28 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-platformatic",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.71.0",
|
|
4
4
|
"description": "Create platformatic application interactive tool",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"strip-ansi": "^7.1.0",
|
|
32
32
|
"undici": "^7.0.0",
|
|
33
33
|
"which": "^3.0.1",
|
|
34
|
-
"@platformatic/
|
|
35
|
-
"@platformatic/
|
|
36
|
-
"@platformatic/utils": "2.
|
|
34
|
+
"@platformatic/generators": "2.71.0",
|
|
35
|
+
"@platformatic/config": "2.71.0",
|
|
36
|
+
"@platformatic/utils": "2.71.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.5.0",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"neostandard": "^0.12.0",
|
|
49
49
|
"typescript": "~5.8.0",
|
|
50
50
|
"yaml": "^2.4.1",
|
|
51
|
-
"@platformatic/composer": "2.
|
|
52
|
-
"@platformatic/db": "2.
|
|
53
|
-
"@platformatic/runtime": "2.
|
|
54
|
-
"@platformatic/service": "2.
|
|
51
|
+
"@platformatic/composer": "2.71.0",
|
|
52
|
+
"@platformatic/db": "2.71.0",
|
|
53
|
+
"@platformatic/runtime": "2.71.0",
|
|
54
|
+
"@platformatic/service": "2.71.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"test:cli": "borp --pattern \"test/cli/*test.mjs\" --timeout=1200000 --concurrency=1",
|
package/src/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ConfigManager, { findConfigurationFile, loadConfigurationFile } from '@platformatic/config'
|
|
2
2
|
import { ImportGenerator } from '@platformatic/generators'
|
|
3
3
|
import {
|
|
4
|
+
getPackageManager, DEFAULT_PACKAGE_MANAGER,
|
|
4
5
|
createDirectory,
|
|
5
6
|
detectApplicationType,
|
|
6
7
|
executeWithTimeout,
|
|
@@ -8,6 +9,7 @@ import {
|
|
|
8
9
|
getPkgManager,
|
|
9
10
|
searchJavascriptFiles
|
|
10
11
|
} from '@platformatic/utils'
|
|
12
|
+
|
|
11
13
|
import { execa } from 'execa'
|
|
12
14
|
import defaultInquirer from 'inquirer'
|
|
13
15
|
import parseArgs from 'minimist'
|
|
@@ -22,6 +24,7 @@ import resolveModule from 'resolve'
|
|
|
22
24
|
import { request } from 'undici'
|
|
23
25
|
import { createGitRepository } from './create-git-repository.mjs'
|
|
24
26
|
import { getUsername, getVersion, say } from './utils.mjs'
|
|
27
|
+
|
|
25
28
|
const MARKETPLACE_HOST = 'https://marketplace.platformatic.dev'
|
|
26
29
|
const defaultStackables = ['@platformatic/service', '@platformatic/composer', '@platformatic/db']
|
|
27
30
|
|
|
@@ -273,6 +276,10 @@ export async function createApplication (
|
|
|
273
276
|
})
|
|
274
277
|
|
|
275
278
|
if (shouldWrap) {
|
|
279
|
+
if (!packageManager) {
|
|
280
|
+
packageManager = getPackageManager(projectDir, DEFAULT_PACKAGE_MANAGER)
|
|
281
|
+
}
|
|
282
|
+
|
|
276
283
|
return wrapApplication(
|
|
277
284
|
logger,
|
|
278
285
|
inquirer,
|
|
@@ -306,6 +313,26 @@ export async function createApplication (
|
|
|
306
313
|
|
|
307
314
|
const projectName = basename(projectDir)
|
|
308
315
|
|
|
316
|
+
if (!packageManager) {
|
|
317
|
+
packageManager = getPackageManager(projectDir, null, true)
|
|
318
|
+
|
|
319
|
+
if (!packageManager) {
|
|
320
|
+
const p = await inquirer.prompt({
|
|
321
|
+
type: 'list',
|
|
322
|
+
name: 'packageManager',
|
|
323
|
+
message: 'Which package manager do you want to use?',
|
|
324
|
+
default: DEFAULT_PACKAGE_MANAGER,
|
|
325
|
+
choices: [
|
|
326
|
+
{ name: 'npm', value: 'npm' },
|
|
327
|
+
{ name: 'pnpm', value: 'pnpm' },
|
|
328
|
+
{ name: 'yarn', value: 'yarn' }
|
|
329
|
+
]
|
|
330
|
+
})
|
|
331
|
+
|
|
332
|
+
packageManager = p.packageManager
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
309
336
|
const runtime = await importOrLocal({
|
|
310
337
|
pkgManager: packageManager,
|
|
311
338
|
name: projectName,
|
|
@@ -317,6 +344,7 @@ export async function createApplication (
|
|
|
317
344
|
logger,
|
|
318
345
|
name: projectName,
|
|
319
346
|
inquirer,
|
|
347
|
+
packageManager,
|
|
320
348
|
...additionalGeneratorOptions
|
|
321
349
|
})
|
|
322
350
|
|