@finesoft/create-app 0.1.26 → 0.1.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finesoft/create-app",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "Scaffold a new Finesoft Front project",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -8,7 +8,7 @@
8
8
  "preview": "vp preview"
9
9
  },
10
10
  "dependencies": {
11
- "@finesoft/front": "^0.1.75",
11
+ "@finesoft/front": "^0.3.0",
12
12
  "react": "^19.0.0",
13
13
  "react-dom": "^19.0.0"
14
14
  },
@@ -1,4 +1,4 @@
1
- import { type Framework, defineRoutes } from "@finesoft/front";
1
+ import { type Framework, defineRoutes, int, route } from "@finesoft/front";
2
2
  import { AboutController } from "./lib/controllers/about";
3
3
  import { HomeController } from "./lib/controllers/home";
4
4
  import { ProductDetailController } from "./lib/controllers/product-detail";
@@ -11,11 +11,11 @@ export function bootstrap(framework: Framework): void {
11
11
 
12
12
  defineRoutes(framework, [
13
13
  { path: "/", intentId: "home", controller: new HomeController() },
14
- {
15
- path: "/products/:id",
14
+ route("/products/:id", {
16
15
  intentId: "product-detail",
17
16
  controller: new ProductDetailController(),
18
- },
17
+ params: { id: int() },
18
+ }),
19
19
  {
20
20
  path: "/search",
21
21
  intentId: "search",
@@ -7,10 +7,10 @@ import {
7
7
  } from "@finesoft/front";
8
8
  import type { ProductPage } from "../models/product";
9
9
 
10
- export class ProductDetailController extends BaseController<{ id: string }, ProductPage> {
10
+ export class ProductDetailController extends BaseController<{ id: number }, ProductPage> {
11
11
  readonly intentId = "product-detail";
12
12
 
13
- async execute(params: { id: string }, container: Container): Promise<ProductPage> {
13
+ async execute(params: { id: number }, container: Container): Promise<ProductPage> {
14
14
  const loggerFactory = container.resolve<LoggerFactory>(DEP_KEYS.LOGGER_FACTORY);
15
15
  const log: Logger = loggerFactory.loggerFor("ProductDetailController");
16
16
  log.info(`Loading product ${params.id}`);
@@ -23,7 +23,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
23
23
  description: `Details for product ${params.id}`,
24
24
  url: `/products/${params.id}`,
25
25
  product: {
26
- id: params.id,
26
+ id: String(params.id),
27
27
  name: `Product ${params.id}`,
28
28
  price: 29.99,
29
29
  description:
@@ -33,7 +33,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
33
33
  };
34
34
  }
35
35
 
36
- fallback(params: { id: string }, error: Error): ProductPage {
36
+ fallback(params: { id: number }, error: Error): ProductPage {
37
37
  return {
38
38
  id: `product-${params.id}`,
39
39
  pageType: "product",
@@ -41,7 +41,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
41
41
  description: error.message,
42
42
  url: `/products/${params.id}`,
43
43
  product: {
44
- id: params.id,
44
+ id: String(params.id),
45
45
  name: "Unknown Product",
46
46
  price: 0,
47
47
  description: "Could not load product data.",
@@ -8,7 +8,7 @@
8
8
  "preview": "vp preview"
9
9
  },
10
10
  "dependencies": {
11
- "@finesoft/front": "^0.1.75",
11
+ "@finesoft/front": "^0.3.0",
12
12
  "react": "^19.0.0",
13
13
  "react-dom": "^19.0.0"
14
14
  },
@@ -8,7 +8,7 @@
8
8
  "preview": "vp preview"
9
9
  },
10
10
  "dependencies": {
11
- "@finesoft/front": "^0.1.75",
11
+ "@finesoft/front": "^0.3.0",
12
12
  "svelte": "^5.0.0"
13
13
  },
14
14
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- import { type Framework, defineRoutes } from "@finesoft/front";
1
+ import { type Framework, defineRoutes, int, route } from "@finesoft/front";
2
2
  import { AboutController } from "./lib/controllers/about";
3
3
  import { HomeController } from "./lib/controllers/home";
4
4
  import { ProductDetailController } from "./lib/controllers/product-detail";
@@ -11,11 +11,11 @@ export function bootstrap(framework: Framework): void {
11
11
 
12
12
  defineRoutes(framework, [
13
13
  { path: "/", intentId: "home", controller: new HomeController() },
14
- {
15
- path: "/products/:id",
14
+ route("/products/:id", {
16
15
  intentId: "product-detail",
17
16
  controller: new ProductDetailController(),
18
- },
17
+ params: { id: int() },
18
+ }),
19
19
  {
20
20
  path: "/search",
21
21
  intentId: "search",
@@ -7,10 +7,10 @@ import {
7
7
  } from "@finesoft/front";
8
8
  import type { ProductPage } from "../models/product";
9
9
 
10
- export class ProductDetailController extends BaseController<{ id: string }, ProductPage> {
10
+ export class ProductDetailController extends BaseController<{ id: number }, ProductPage> {
11
11
  readonly intentId = "product-detail";
12
12
 
13
- async execute(params: { id: string }, container: Container): Promise<ProductPage> {
13
+ async execute(params: { id: number }, container: Container): Promise<ProductPage> {
14
14
  const loggerFactory = container.resolve<LoggerFactory>(DEP_KEYS.LOGGER_FACTORY);
15
15
  const log: Logger = loggerFactory.loggerFor("ProductDetailController");
16
16
  log.info(`Loading product ${params.id}`);
@@ -23,7 +23,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
23
23
  title: `Product ${params.id}`,
24
24
  description: `Details for product ${params.id}`,
25
25
  product: {
26
- id: params.id,
26
+ id: String(params.id),
27
27
  name: `Product ${params.id}`,
28
28
  price: 29.99,
29
29
  description:
@@ -33,7 +33,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
33
33
  };
34
34
  }
35
35
 
36
- fallback(params: { id: string }, error: Error): ProductPage {
36
+ fallback(params: { id: number }, error: Error): ProductPage {
37
37
  return {
38
38
  id: `product-${params.id}`,
39
39
  pageType: "product",
@@ -41,7 +41,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
41
41
  title: "Product Not Found",
42
42
  description: error.message,
43
43
  product: {
44
- id: params.id,
44
+ id: String(params.id),
45
45
  name: "Unknown Product",
46
46
  price: 0,
47
47
  description: "Could not load product data.",
@@ -8,7 +8,7 @@
8
8
  "preview": "vp preview"
9
9
  },
10
10
  "dependencies": {
11
- "@finesoft/front": "^0.1.75",
11
+ "@finesoft/front": "^0.3.0",
12
12
  "svelte": "^5.0.0"
13
13
  },
14
14
  "devDependencies": {
@@ -8,7 +8,7 @@
8
8
  "preview": "vp preview"
9
9
  },
10
10
  "dependencies": {
11
- "@finesoft/front": "^0.1.75",
11
+ "@finesoft/front": "^0.3.0",
12
12
  "vue": "^3.5.0"
13
13
  },
14
14
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- import { type Framework, defineRoutes } from "@finesoft/front";
1
+ import { type Framework, defineRoutes, int, route } from "@finesoft/front";
2
2
  import { AboutController } from "./lib/controllers/about";
3
3
  import { HomeController } from "./lib/controllers/home";
4
4
  import { ProductDetailController } from "./lib/controllers/product-detail";
@@ -13,11 +13,11 @@ export function bootstrap(framework: Framework): void {
13
13
  defineRoutes(framework, [
14
14
  // SSR routes (default)
15
15
  { path: "/", intentId: "home", controller: new HomeController() },
16
- {
17
- path: "/products/:id",
16
+ route("/products/:id", {
18
17
  intentId: "product-detail",
19
18
  controller: new ProductDetailController(),
20
- },
19
+ params: { id: int() },
20
+ }),
21
21
  {
22
22
  path: "/search",
23
23
  intentId: "search",
@@ -7,10 +7,10 @@ import {
7
7
  } from "@finesoft/front";
8
8
  import type { ProductPage } from "../models/product";
9
9
 
10
- export class ProductDetailController extends BaseController<{ id: string }, ProductPage> {
10
+ export class ProductDetailController extends BaseController<{ id: number }, ProductPage> {
11
11
  readonly intentId = "product-detail";
12
12
 
13
- async execute(params: { id: string }, container: Container): Promise<ProductPage> {
13
+ async execute(params: { id: number }, container: Container): Promise<ProductPage> {
14
14
  const loggerFactory = container.resolve<LoggerFactory>(DEP_KEYS.LOGGER_FACTORY);
15
15
  const log: Logger = loggerFactory.loggerFor("ProductDetailController");
16
16
  log.info(`Loading product ${params.id}`);
@@ -23,7 +23,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
23
23
  title: `Product ${params.id}`,
24
24
  description: `Details for product ${params.id}`,
25
25
  product: {
26
- id: params.id,
26
+ id: String(params.id),
27
27
  name: `Product ${params.id}`,
28
28
  price: 29.99,
29
29
  description:
@@ -33,7 +33,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
33
33
  };
34
34
  }
35
35
 
36
- fallback(params: { id: string }, error: Error): ProductPage {
36
+ fallback(params: { id: number }, error: Error): ProductPage {
37
37
  return {
38
38
  id: `product-${params.id}`,
39
39
  pageType: "product",
@@ -41,7 +41,7 @@ export class ProductDetailController extends BaseController<{ id: string }, Prod
41
41
  title: "Product Not Found",
42
42
  description: error.message,
43
43
  product: {
44
- id: params.id,
44
+ id: String(params.id),
45
45
  name: "Unknown Product",
46
46
  price: 0,
47
47
  description: "Could not load product data.",
@@ -8,7 +8,7 @@
8
8
  "preview": "vp preview"
9
9
  },
10
10
  "dependencies": {
11
- "@finesoft/front": "^0.1.75",
11
+ "@finesoft/front": "^0.3.0",
12
12
  "vue": "^3.5.0"
13
13
  },
14
14
  "devDependencies": {