create-faas-app 8.0.0-beta.33 → 8.0.0-beta.35

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/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import { dirname, join } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import enquirer from "enquirer";
8
8
  //#region package.json
9
- var version = "8.0.0-beta.32";
9
+ var version = "8.0.0-beta.34";
10
10
  //#endregion
11
11
  //#region src/action/index.ts
12
12
  const prompt = enquirer.prompt;
@@ -56,7 +56,7 @@ function scaffold(rootPath, replacements, templateName) {
56
56
  * @param {object} [options] - Optional CLI arguments used to choose the project name and template.
57
57
  * @param {string} [options.name] - Target folder name for the generated app.
58
58
  * @param {string} [options.template] - Template name such as `admin` or `minimal`.
59
- * @returns {Promise<void>} Resolves after the project is generated and its test command finishes.
59
+ * @returns {Promise<void>} Resolves after the project is scaffolded, dependencies are installed, and tests pass.
60
60
  * @throws {Error} When the selected template is unknown.
61
61
  * @example
62
62
  * ```ts
@@ -87,8 +87,7 @@ async function action(options = {}) {
87
87
  /**
88
88
  * Register the `create-faas-app` command on a Commander program.
89
89
  *
90
- * @param {Command} program - Commander program instance extended with the generator command.
91
- * @returns {void} No return value.
90
+ * @param {Command} program - Commander program instance to register the command on.
92
91
  * @example
93
92
  * ```ts
94
93
  * const program = new Command()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-faas-app",
3
- "version": "8.0.0-beta.33",
3
+ "version": "8.0.0-beta.35",
4
4
  "homepage": "https://faasjs.com/doc/create-faas-app",
5
5
  "bugs": {
6
6
  "url": "https://github.com/faasjs/faasjs/issues"
@@ -1,5 +1,3 @@
1
- import '@faasjs/pg'
2
-
3
1
  declare module '@faasjs/pg' {
4
2
  interface Tables {
5
3
  users: {
@@ -25,6 +25,7 @@ declare module '@faasjs/types' {
25
25
 
26
26
  import { faas, useApp } from '@faasjs/ant-design'
27
27
  import { useFaas } from '@faasjs/react'
28
+ import { toErrorMessage } from '@faasjs/utils'
28
29
  import { Button, Card, Input, Space, Table, Typography } from 'antd'
29
30
  import { useState } from 'react'
30
31
 
@@ -58,7 +59,7 @@ export default function HomePage() {
58
59
  app.message.success('User saved to PostgreSQL')
59
60
  await reload()
60
61
  } catch (error: unknown) {
61
- const errorMessage = error instanceof Error ? error.message : 'Request failed'
62
+ const errorMessage = toErrorMessage(error, 'Request failed')
62
63
  setMessageText(errorMessage)
63
64
  app.notification.error({
64
65
  message: 'API call failed',
@@ -84,7 +85,7 @@ export default function HomePage() {
84
85
  setMessageText(`Auth plugin injected current user: ${currentUser?.name || 'unknown'}`)
85
86
  app.message.success('Auth plugin demo loaded current_user')
86
87
  } catch (error: unknown) {
87
- const errorMessage = error instanceof Error ? error.message : 'Auth demo failed'
88
+ const errorMessage = toErrorMessage(error, 'Auth demo failed')
88
89
  setMessageText(errorMessage)
89
90
  app.notification.error({
90
91
  message: 'Auth demo failed',
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "extends": "@faasjs/types/tsconfig/build.json",
3
- "include": ["src", "migrations", "vite.config.ts", "server.ts"]
3
+ "include": ["src", "vite.config.ts", "server.ts"]
4
4
  }