platformatic 0.45.0 → 0.46.1

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/cli.js CHANGED
@@ -8,7 +8,6 @@ import { startCommand } from '@platformatic/runtime'
8
8
  import { runService } from '@platformatic/service/service.mjs'
9
9
  import { runComposer } from '@platformatic/composer/composer.mjs'
10
10
  import { login } from '@platformatic/authenticate/authenticate.js'
11
- import { command as frontend } from '@platformatic/frontend-template'
12
11
  import { command as client } from '@platformatic/client-cli'
13
12
  import { readFile } from 'fs/promises'
14
13
  import { join } from 'desm'
@@ -55,7 +54,6 @@ program.register('help service', async (args) => runService(['help', ...args]))
55
54
  program.register({ command: 'login', strict: true }, login)
56
55
  program.register('gh', gh)
57
56
  program.register('deploy', deploy)
58
- program.register('frontend', frontend)
59
57
 
60
58
  const args = minimist(process.argv.slice(2), {
61
59
  boolean: ['help', 'version'],
package/help/help.txt CHANGED
@@ -9,4 +9,3 @@ Welcome to Platformatic. Available commands are:
9
9
  * `deploy` - deploy a Platformatic application to the cloud.
10
10
  * `runtime` - start Platformatic Runtime; type `platformatic runtime help` to know more.
11
11
  * `start` - start a Platformatic application.
12
- * `frontend`- create frontend code to consume the REST APIs.
package/lib/deploy.js CHANGED
@@ -9,6 +9,7 @@ import dotenv from 'dotenv'
9
9
  import inquirer from 'inquirer'
10
10
  import parseArgs from 'minimist'
11
11
  import deployClient from '@platformatic/deploy-client'
12
+ import errors from './errors.js'
12
13
 
13
14
  export const DEPLOY_SERVICE_HOST = 'https://deploy.platformatic.cloud'
14
15
 
@@ -34,10 +35,7 @@ async function askWorkspaceDetails (args) {
34
35
  }
35
36
 
36
37
  if (!WORKSPACE_TYPES.includes(workspaceType)) {
37
- throw new Error(
38
- `Invalid workspace type provided: "${workspaceType}". ` +
39
- `Type must be one of: ${WORKSPACE_TYPES.join(', ')}.`
40
- )
38
+ throw new errors.InvalidWorkspaceTypeError(workspaceType, WORKSPACE_TYPES.join(', '))
41
39
  }
42
40
 
43
41
  let workspaceId = args['workspace-id']
@@ -52,7 +50,7 @@ async function askWorkspaceDetails (args) {
52
50
  }
53
51
 
54
52
  if (!UUID_REGEX.test(workspaceId)) {
55
- throw new Error('Invalid workspace id provided. Workspace id must be a valid uuid.')
53
+ throw new errors.InvalidWorkspaceIdError()
56
54
  }
57
55
 
58
56
  let workspaceKey = args['workspace-key']
@@ -105,7 +103,7 @@ async function readWorkspaceDetails (workspaceKeysPath) {
105
103
  }
106
104
  }
107
105
 
108
- throw new Error('Could not find workspace keys in provided file.')
106
+ throw new errors.CouldNotFindWorkspaceKeysError()
109
107
  }
110
108
 
111
109
  export async function deploy (argv) {
package/lib/errors.js ADDED
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ import createError from '@fastify/error'
4
+
5
+ const ERROR_PREFIX = 'PLT_CLI'
6
+
7
+ const errors = {
8
+ InvalidWorkspaceTypeError: createError(`${ERROR_PREFIX}_INVALID_WORKSPACE_TYPE`, 'Invalid workspace type provided: "%s". Type must be one of: %s'),
9
+ InvalidWorkspaceIdError: createError(`${ERROR_PREFIX}_INVALID_WORKSPACE_ID`, 'Invalid workspace id provided. Workspace id must be a valid uuid.'),
10
+ CouldNotFindWorkspaceKeysError: createError(`${ERROR_PREFIX}_COULD_NOT_FIND_WORKSPACE_KEYS`, 'Could not find workspace keys in provided file.')
11
+ }
12
+
13
+ export default errors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platformatic",
3
- "version": "0.45.0",
3
+ "version": "0.46.1",
4
4
  "description": "Platformatic CLI",
5
5
  "main": "cli.js",
6
6
  "type": "module",
@@ -38,6 +38,7 @@
38
38
  "undici": "^5.22.1"
39
39
  },
40
40
  "dependencies": {
41
+ "@fastify/error": "^3.2.1",
41
42
  "colorette": "^2.0.20",
42
43
  "commist": "^3.2.0",
43
44
  "desm": "^1.3.0",
@@ -47,17 +48,17 @@
47
48
  "minimist": "^1.2.8",
48
49
  "pino": "^8.14.1",
49
50
  "pino-pretty": "^10.0.0",
50
- "@platformatic/authenticate": "0.45.0",
51
- "@platformatic/client-cli": "0.45.0",
52
- "@platformatic/composer": "0.45.0",
53
- "@platformatic/config": "0.45.0",
54
- "@platformatic/db": "0.45.0",
55
- "@platformatic/deploy-client": "0.45.0",
56
- "@platformatic/frontend-template": "0.45.0",
57
- "@platformatic/metaconfig": "0.45.0",
58
- "@platformatic/runtime": "0.45.0",
59
- "@platformatic/service": "0.45.0",
60
- "create-platformatic": "0.45.0"
51
+ "@platformatic/authenticate": "0.46.1",
52
+ "@platformatic/client-cli": "0.46.1",
53
+ "@platformatic/composer": "0.46.1",
54
+ "@platformatic/config": "0.46.1",
55
+ "@platformatic/db": "0.46.1",
56
+ "@platformatic/deploy-client": "0.46.1",
57
+ "@platformatic/frontend-template": "0.46.1",
58
+ "@platformatic/metaconfig": "0.46.1",
59
+ "@platformatic/runtime": "0.46.1",
60
+ "@platformatic/service": "0.46.1",
61
+ "create-platformatic": "0.46.1"
61
62
  },
62
63
  "scripts": {
63
64
  "test": "standard | snazzy && tap --no-coverage test/*.test.js",