platformatic 0.21.1 → 0.22.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.
Files changed (3) hide show
  1. package/lib/gh.js +2 -14
  2. package/lib/upgrade.js +4 -18
  3. package/package.json +15 -14
package/lib/gh.js CHANGED
@@ -7,6 +7,7 @@ import parseArgs from 'minimist'
7
7
  import { access } from 'fs/promises'
8
8
  import pino from 'pino'
9
9
  import pretty from 'pino-pretty'
10
+ import ConfigManager from '@platformatic/config'
10
11
 
11
12
  export const createGHAction = async (logger, workspaceId, env, config, buildTS, type, projectDir = process.cwd()) => {
12
13
  if (type === 'static') {
@@ -21,20 +22,7 @@ const logger = pino(pretty({
21
22
  ignore: 'hostname,pid'
22
23
  }))
23
24
 
24
- const configFileNames = [
25
- './platformatic.db.json',
26
- './platformatic.db.json5',
27
- './platformatic.db.yaml',
28
- './platformatic.db.yml',
29
- './platformatic.db.toml',
30
- './platformatic.db.tml',
31
- './platformatic.service.json',
32
- './platformatic.service.json5',
33
- './platformatic.service.yaml',
34
- './platformatic.service.yml',
35
- './platformatic.service.toml',
36
- './platformatic.service.tml'
37
- ]
25
+ const configFileNames = ConfigManager.listConfigFiles()
38
26
 
39
27
  async function isFileAccessible (filename) {
40
28
  try {
package/lib/upgrade.js CHANGED
@@ -1,22 +1,10 @@
1
- import { analyze, write } from '@platformatic/metaconfig'
1
+ import ConfigManager from '@platformatic/config'
2
+ import { analyze, write, upgrade as upgradeConfig } from '@platformatic/metaconfig'
2
3
  import parseArgs from 'minimist'
3
4
  import { access } from 'fs/promises'
4
5
  import { resolve } from 'path'
5
6
 
6
- const configFileNames = [
7
- './platformatic.db.json',
8
- './platformatic.db.json5',
9
- './platformatic.db.yaml',
10
- './platformatic.db.yml',
11
- './platformatic.db.toml',
12
- './platformatic.db.tml',
13
- './platformatic.service.json',
14
- './platformatic.service.json5',
15
- './platformatic.service.yaml',
16
- './platformatic.service.yml',
17
- './platformatic.service.toml',
18
- './platformatic.service.tml'
19
- ]
7
+ const configFileNames = ConfigManager.listConfigFiles()
20
8
 
21
9
  async function isFileAccessible (filename) {
22
10
  try {
@@ -53,9 +41,7 @@ export async function upgrade (argv) {
53
41
 
54
42
  console.log(`Found ${meta.version} for Platformatic ${meta.kind} in ${meta.format} format`)
55
43
 
56
- while (typeof meta.up === 'function') {
57
- meta = meta.up()
58
- }
44
+ meta = upgradeConfig(meta)
59
45
 
60
46
  await write(meta)
61
47
  console.log('Upgraded to', meta.version)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platformatic",
3
- "version": "0.21.1",
3
+ "version": "0.22.0",
4
4
  "description": "Platformatic CLI",
5
5
  "main": "cli.js",
6
6
  "type": "module",
@@ -28,32 +28,33 @@
28
28
  ],
29
29
  "devDependencies": {
30
30
  "c8": "^7.13.0",
31
- "execa": "^7.0.0",
31
+ "execa": "^7.1.1",
32
+ "fastify": "^4.17.0",
32
33
  "license-checker": "^25.0.1",
33
- "mkdirp": "^2.1.3",
34
+ "mkdirp": "^2.1.6",
34
35
  "snazzy": "^9.0.0",
35
- "split2": "^4.1.0",
36
+ "split2": "^4.2.0",
36
37
  "standard": "^17.0.0",
37
38
  "tap": "^16.3.4",
38
- "undici": "^5.20.0",
39
- "fastify": "^4.13.0"
39
+ "undici": "^5.22.0"
40
40
  },
41
41
  "dependencies": {
42
42
  "@platformatic/deploy-client": "^0.1.2",
43
- "colorette": "^2.0.19",
43
+ "colorette": "^2.0.20",
44
44
  "commist": "^3.2.0",
45
45
  "desm": "^1.3.0",
46
46
  "help-me": "^4.2.0",
47
+ "inquirer": "^9.2.0",
47
48
  "minimist": "^1.2.8",
48
49
  "pino": "^8.11.0",
49
50
  "pino-pretty": "^10.0.0",
50
- "inquirer": "^9.1.4",
51
- "@platformatic/authenticate": "0.21.1",
52
- "@platformatic/db": "0.21.1",
53
- "@platformatic/metaconfig": "0.21.1",
54
- "@platformatic/service": "0.21.1",
55
- "@platformatic/client-cli": "0.21.1",
56
- "create-platformatic": "0.21.1"
51
+ "@platformatic/authenticate": "0.22.0",
52
+ "@platformatic/client-cli": "0.22.0",
53
+ "@platformatic/config": "0.22.0",
54
+ "@platformatic/db": "0.22.0",
55
+ "@platformatic/metaconfig": "0.22.0",
56
+ "@platformatic/service": "0.22.0",
57
+ "create-platformatic": "0.22.0"
57
58
  },
58
59
  "scripts": {
59
60
  "test": "standard | snazzy && c8 --100 tap --no-coverage test/*.test.js",