@platformatic/basic 2.0.0-alpha.18 → 2.0.0-alpha.20

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 (3) hide show
  1. package/index.js +25 -5
  2. package/package.json +7 -7
  3. package/schema.json +1 -1
package/index.js CHANGED
@@ -8,6 +8,23 @@ import { packageJson, schema } from './lib/schema.js'
8
8
  import { importFile } from './lib/utils.js'
9
9
 
10
10
  const importStackablePackageMarker = '__pltImportStackablePackage.js'
11
+ const configCandidates = [
12
+ 'platformatic.application.json',
13
+ 'platformatic.json',
14
+ 'watt.json',
15
+ 'platformatic.application.yaml',
16
+ 'platformatic.yaml',
17
+ 'watt.yaml',
18
+ 'platformatic.application.yml',
19
+ 'platformatic.yml',
20
+ 'watt.yml',
21
+ 'platformatic.application.toml',
22
+ 'platformatic.toml',
23
+ 'watt.toml',
24
+ 'platformatic.application.tml',
25
+ 'platformatic.tml',
26
+ 'watt.tml',
27
+ ]
11
28
 
12
29
  function isImportFailedError (error, pkg) {
13
30
  if (error.code !== 'ERR_MODULE_NOT_FOUND' && error.code !== 'MODULE_NOT_FOUND') {
@@ -68,10 +85,13 @@ async function buildStackable (opts) {
68
85
  const hadConfig = opts.config
69
86
 
70
87
  if (!hadConfig) {
71
- const candidate = resolve(root, 'platformatic.application.json')
88
+ for (const candidate of configCandidates) {
89
+ const candidatePath = resolve(root, candidate)
72
90
 
73
- if (existsSync(candidate)) {
74
- opts.config = candidate
91
+ if (existsSync(candidatePath)) {
92
+ opts.config = candidatePath
93
+ break
94
+ }
75
95
  }
76
96
  }
77
97
 
@@ -94,7 +114,7 @@ async function buildStackable (opts) {
94
114
  const imported = await importStackablePackage(opts, toImport, autodetectDescription)
95
115
 
96
116
  const serviceRoot = relative(process.cwd(), opts.context.directory)
97
- if (!hadConfig && !existsSync(resolve(serviceRoot, 'platformatic.application.json'))) {
117
+ if (!hadConfig && !(existsSync(resolve(serviceRoot, 'platformatic.json') || existsSync(resolve(serviceRoot, 'watt.json'))))) {
98
118
  const logger = pino({
99
119
  level: opts.context.serverConfig?.logger?.level ?? 'warn',
100
120
  name: opts.context.serviceId
@@ -103,7 +123,7 @@ async function buildStackable (opts) {
103
123
  logger.warn(
104
124
  [
105
125
  `Platformatic has auto-detected that service ${opts.context.serviceId} ${autodetectDescription}.\n`,
106
- `We suggest you create a platformatic.application.json file in the folder ${serviceRoot} with the "$schema" `,
126
+ `We suggest you create a platformatic.json or watt.json file in the folder ${serviceRoot} with the "$schema" `,
107
127
  `property set to "https://schemas.platformatic.dev/${toImport}/${packageJson.version}.json".`
108
128
  ].join('')
109
129
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/basic",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.20",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,10 +23,10 @@
23
23
  "split2": "^4.2.0",
24
24
  "undici": "^6.19.5",
25
25
  "ws": "^8.18.0",
26
- "@platformatic/config": "2.0.0-alpha.18",
27
- "@platformatic/itc": "2.0.0-alpha.18",
28
- "@platformatic/telemetry": "2.0.0-alpha.18",
29
- "@platformatic/utils": "2.0.0-alpha.18"
26
+ "@platformatic/config": "2.0.0-alpha.20",
27
+ "@platformatic/telemetry": "2.0.0-alpha.20",
28
+ "@platformatic/itc": "2.0.0-alpha.20",
29
+ "@platformatic/utils": "2.0.0-alpha.20"
30
30
  },
31
31
  "devDependencies": {
32
32
  "borp": "^0.17.0",
@@ -40,8 +40,8 @@
40
40
  "react-dom": "^18.3.1",
41
41
  "typescript": "^5.5.4",
42
42
  "vite": "^5.4.0",
43
- "@platformatic/composer": "2.0.0-alpha.18",
44
- "@platformatic/service": "2.0.0-alpha.18"
43
+ "@platformatic/composer": "2.0.0-alpha.20",
44
+ "@platformatic/service": "2.0.0-alpha.20"
45
45
  },
46
46
  "scripts": {
47
47
  "gen-schema": "node lib/schema.js > schema.json",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.0.0-alpha.18.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.0.0-alpha.20.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Stackable",
5
5
  "type": "object",