@constela/start 1.8.8 → 1.8.12

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/README.md CHANGED
@@ -19,7 +19,7 @@ npm install @constela/start
19
19
  mkdir -p src/routes
20
20
  ```
21
21
 
22
- 2. Create a page (`src/routes/index.json`):
22
+ 2. Create a page (`src/routes/index.constela.json`):
23
23
 
24
24
  ```json
25
25
  {
@@ -68,11 +68,11 @@ npx constela start --port 3000
68
68
  ```
69
69
  project/
70
70
  src/
71
- routes/ # Page files (.json)
72
- index.json # / route
73
- about.json # /about route
71
+ routes/ # Page files (.constela.json)
72
+ index.constela.json # / route
73
+ about.constela.json # /about route
74
74
  users/
75
- [id].json # /users/:id route
75
+ [id].constela.json # /users/:id route
76
76
  layouts/ # Layout files
77
77
  main.json
78
78
  docs.json
@@ -92,10 +92,10 @@ project/
92
92
 
93
93
  | File | Route |
94
94
  |------|-------|
95
- | `index.json` | `/` |
96
- | `about.json` | `/about` |
97
- | `users/[id].json` | `/users/:id` |
98
- | `docs/[...slug].json` | `/docs/*` |
95
+ | `index.constela.json` | `/` |
96
+ | `about.constela.json` | `/about` |
97
+ | `users/[id].constela.json` | `/users/:id` |
98
+ | `docs/[...slug].constela.json` | `/docs/*` |
99
99
 
100
100
  ## Data Sources
101
101
 
@@ -11,7 +11,7 @@ import { existsSync, statSync } from "fs";
11
11
  import { join } from "path";
12
12
  function filePathToPattern(filePath, _routesDir) {
13
13
  let normalized = filePath.replace(/\\/g, "/");
14
- normalized = normalized.replace(/\.(ts|tsx|js|jsx|json)$/, "");
14
+ normalized = normalized.replace(/\.(constela\.json|ts|tsx|js|jsx|json)$/, "");
15
15
  const segments = normalized.split("/");
16
16
  const processedSegments = segments.map((segment) => {
17
17
  if (segment.startsWith("[...") && segment.endsWith("]")) {
@@ -75,7 +75,7 @@ async function scanRoutes(routesDir) {
75
75
  if (!stats.isDirectory()) {
76
76
  throw new Error(`Routes path is not a directory: ${routesDir}`);
77
77
  }
78
- const files = await fg("**/*.{ts,tsx,js,jsx,json}", {
78
+ const files = await fg("**/*.{ts,tsx,js,jsx,json,constela.json}", {
79
79
  cwd: routesDir,
80
80
  ignore: ["node_modules/**", "**/*.d.ts"],
81
81
  onlyFiles: true,
@@ -3056,7 +3056,7 @@ function isDynamicRoute(pattern) {
3056
3056
  return pattern.includes(":") || pattern.includes("*");
3057
3057
  }
3058
3058
  function getOutputPath(filePath, outDir) {
3059
- const withoutExt = filePath.replace(/\.(json|ts|tsx|js|jsx)$/, "");
3059
+ const withoutExt = filePath.replace(/\.(constela\.json|json|ts|tsx|js|jsx)$/, "");
3060
3060
  if (withoutExt === "index" || withoutExt.endsWith("/index")) {
3061
3061
  return join11(outDir, withoutExt + ".html");
3062
3062
  }
@@ -3076,7 +3076,7 @@ function paramsToOutputPath(basePattern, params, outDir) {
3076
3076
  }
3077
3077
  async function loadGetStaticPaths(pageFile) {
3078
3078
  const dir = dirname6(pageFile);
3079
- const baseName = basename4(pageFile, ".json");
3079
+ const baseName = pageFile.endsWith(".constela.json") ? basename4(pageFile, ".constela.json") : basename4(pageFile, ".json");
3080
3080
  const pathsFile = join11(dir, `${baseName}.paths.ts`);
3081
3081
  if (!existsSync9(pathsFile)) {
3082
3082
  return null;
@@ -3568,7 +3568,7 @@ async function build2(options) {
3568
3568
  }
3569
3569
  const routes = scannedRoutes.map((r) => r.pattern);
3570
3570
  const jsonPages = scannedRoutes.filter(
3571
- (route) => route.type === "page" && route.file.endsWith(".json")
3571
+ (route) => route.type === "page" && (route.file.endsWith(".json") || route.file.endsWith(".constela.json"))
3572
3572
  );
3573
3573
  if (jsonPages.length === 0) {
3574
3574
  if (publicDir) {
package/dist/cli/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  hyperlink,
5
5
  loadConfig,
6
6
  resolveConfig
7
- } from "../chunk-PT6FDT6M.js";
7
+ } from "../chunk-WXYF35Q7.js";
8
8
  import "../chunk-3GFRJEKD.js";
9
9
 
10
10
  // src/cli/index.ts
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  transformCsv,
29
29
  transformMdx,
30
30
  transformYaml
31
- } from "./chunk-PT6FDT6M.js";
31
+ } from "./chunk-WXYF35Q7.js";
32
32
  import {
33
33
  evaluateMetaExpression,
34
34
  generateHydrationScript,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constela/start",
3
- "version": "1.8.8",
3
+ "version": "1.8.12",
4
4
  "description": "Meta-framework for Constela applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,11 +44,11 @@
44
44
  "@tailwindcss/postcss": "^4.0.0",
45
45
  "tailwindcss": "^4.0.0",
46
46
  "ws": "^8.18.0",
47
- "@constela/compiler": "0.12.0",
48
- "@constela/core": "0.13.0",
49
- "@constela/runtime": "0.16.6",
50
- "@constela/router": "15.0.0",
51
- "@constela/server": "9.0.0"
47
+ "@constela/compiler": "0.13.0",
48
+ "@constela/router": "16.0.0",
49
+ "@constela/core": "0.14.0",
50
+ "@constela/server": "10.0.1",
51
+ "@constela/runtime": "0.17.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/ws": "^8.5.0",