create-wattpm 3.0.2 → 3.0.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.
- package/lib/index.js +15 -8
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import resolveModule from 'resolve'
|
|
|
24
24
|
import { createGitRepository } from './git.js'
|
|
25
25
|
import { findGatewayConfigFile, getUsername, getVersion, say } from './utils.js'
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const internalCapabilities = [
|
|
28
28
|
'@platformatic/node',
|
|
29
29
|
'@platformatic/gateway',
|
|
30
30
|
'@platformatic/next',
|
|
@@ -33,7 +33,10 @@ const defaultCapabilities = [
|
|
|
33
33
|
'@platformatic/remix',
|
|
34
34
|
'@platformatic/nest',
|
|
35
35
|
'@platformatic/service',
|
|
36
|
-
'@platformatic/db'
|
|
36
|
+
'@platformatic/db'
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
const externalCapabilities = [
|
|
37
40
|
'@platformatic/php',
|
|
38
41
|
'@platformatic/ai-warp',
|
|
39
42
|
'@platformatic/pg-hooks',
|
|
@@ -95,7 +98,7 @@ async function importOrLocal ({ pkgManager, projectDir, pkg }) {
|
|
|
95
98
|
|
|
96
99
|
let version = ''
|
|
97
100
|
|
|
98
|
-
if (
|
|
101
|
+
if (internalCapabilities.includes(pkg) || pkg === '@platformatic/runtime') {
|
|
99
102
|
// Let's find if we are using one of the default capabilities
|
|
100
103
|
// If we are, we have to use the "local" version of the package
|
|
101
104
|
|
|
@@ -186,7 +189,7 @@ export async function wrapApplication (
|
|
|
186
189
|
await generator.writeFiles()
|
|
187
190
|
|
|
188
191
|
if (install) {
|
|
189
|
-
logger.info(`Installing dependencies for the
|
|
192
|
+
logger.info(`Installing dependencies for the project using ${packageManager} ...`)
|
|
190
193
|
await execa(packageManager, ['install'], {
|
|
191
194
|
cwd: projectDir,
|
|
192
195
|
stdio: 'inherit',
|
|
@@ -210,7 +213,7 @@ export async function createPlatformatic (argv) {
|
|
|
210
213
|
const username = await getUsername()
|
|
211
214
|
const version = await getVersion()
|
|
212
215
|
const greeting = username ? `Hello ${username},` : 'Hello,'
|
|
213
|
-
await say(`${greeting} welcome to ${version ? `
|
|
216
|
+
await say(`${greeting} welcome to ${version ? `Watt ${version}!` : 'Watt!'}`)
|
|
214
217
|
|
|
215
218
|
const logger = pino(
|
|
216
219
|
pretty({
|
|
@@ -221,7 +224,10 @@ export async function createPlatformatic (argv) {
|
|
|
221
224
|
|
|
222
225
|
const pkgManager = getPkgManager()
|
|
223
226
|
const modules = Array.isArray(args.module) ? args.module : [args.module]
|
|
224
|
-
await createApplication(logger, pkgManager, modules, args['install']
|
|
227
|
+
await createApplication(logger, pkgManager, modules, args['install'], {
|
|
228
|
+
runtimeConfig: 'watt.json',
|
|
229
|
+
applicationsFolder: 'web'
|
|
230
|
+
})
|
|
225
231
|
}
|
|
226
232
|
|
|
227
233
|
export async function createApplication (
|
|
@@ -245,6 +251,7 @@ export async function createApplication (
|
|
|
245
251
|
if (runtimeConfigFile) {
|
|
246
252
|
shouldChooseProjectDir = false
|
|
247
253
|
projectDir = dirname(runtimeConfigFile)
|
|
254
|
+
additionalGeneratorOptions.runtimeConfig = basename(runtimeConfigFile)
|
|
248
255
|
} else {
|
|
249
256
|
// Check the current directory for suitable config files
|
|
250
257
|
const applicationRoot = await findApplicationRoot(projectDir)
|
|
@@ -365,7 +372,7 @@ export async function createApplication (
|
|
|
365
372
|
await say('Using existing configuration ...')
|
|
366
373
|
}
|
|
367
374
|
|
|
368
|
-
const capabilities = Array.from(new Set([...modules, ...
|
|
375
|
+
const capabilities = Array.from(new Set([...modules, ...internalCapabilities, ...externalCapabilities]))
|
|
369
376
|
|
|
370
377
|
const names = generator.existingApplications ?? []
|
|
371
378
|
|
|
@@ -500,7 +507,7 @@ export async function createApplication (
|
|
|
500
507
|
// add pnpm-workspace.yaml file if needed
|
|
501
508
|
const content = `packages:
|
|
502
509
|
# all packages in direct subdirs of packages/
|
|
503
|
-
- '
|
|
510
|
+
- 'applications/*'
|
|
504
511
|
- 'services/*'
|
|
505
512
|
- 'web/*'`
|
|
506
513
|
await writeFile(join(projectDir, 'pnpm-workspace.yaml'), content)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-wattpm",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Create platformatic application interactive tool",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"resolve": "^1.22.8",
|
|
25
25
|
"undici": "^7.0.0",
|
|
26
26
|
"which": "^3.0.1",
|
|
27
|
-
"@platformatic/foundation": "3.0.
|
|
28
|
-
"@platformatic/generators": "3.0.
|
|
27
|
+
"@platformatic/foundation": "3.0.4",
|
|
28
|
+
"@platformatic/generators": "3.0.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.5.0",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"semver": "^7.6.0",
|
|
40
40
|
"typescript": "~5.8.0",
|
|
41
41
|
"yaml": "^2.4.1",
|
|
42
|
-
"@platformatic/
|
|
43
|
-
"@platformatic/runtime": "3.0.
|
|
44
|
-
"@platformatic/
|
|
45
|
-
"@platformatic/
|
|
42
|
+
"@platformatic/db": "3.0.4",
|
|
43
|
+
"@platformatic/runtime": "3.0.4",
|
|
44
|
+
"@platformatic/gateway": "3.0.4",
|
|
45
|
+
"@platformatic/service": "3.0.4"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=22.18.0"
|