@constela/start 1.8.7 → 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 +9 -9
- package/dist/{chunk-IODZX7L3.js → chunk-WXYF35Q7.js} +6 -9
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
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,
|
|
@@ -2558,10 +2558,7 @@ async function createDevServer(options = {}) {
|
|
|
2558
2558
|
if (css) {
|
|
2559
2559
|
viteServer = await createViteServer({
|
|
2560
2560
|
root: process.cwd(),
|
|
2561
|
-
server: {
|
|
2562
|
-
middlewareMode: true,
|
|
2563
|
-
hmr: false
|
|
2564
|
-
},
|
|
2561
|
+
server: { middlewareMode: true },
|
|
2565
2562
|
appType: "custom",
|
|
2566
2563
|
logLevel: "silent"
|
|
2567
2564
|
});
|
|
@@ -3059,7 +3056,7 @@ function isDynamicRoute(pattern) {
|
|
|
3059
3056
|
return pattern.includes(":") || pattern.includes("*");
|
|
3060
3057
|
}
|
|
3061
3058
|
function getOutputPath(filePath, outDir) {
|
|
3062
|
-
const withoutExt = filePath.replace(/\.(json|ts|tsx|js|jsx)$/, "");
|
|
3059
|
+
const withoutExt = filePath.replace(/\.(constela\.json|json|ts|tsx|js|jsx)$/, "");
|
|
3063
3060
|
if (withoutExt === "index" || withoutExt.endsWith("/index")) {
|
|
3064
3061
|
return join11(outDir, withoutExt + ".html");
|
|
3065
3062
|
}
|
|
@@ -3079,7 +3076,7 @@ function paramsToOutputPath(basePattern, params, outDir) {
|
|
|
3079
3076
|
}
|
|
3080
3077
|
async function loadGetStaticPaths(pageFile) {
|
|
3081
3078
|
const dir = dirname6(pageFile);
|
|
3082
|
-
const baseName = basename4(pageFile, ".json");
|
|
3079
|
+
const baseName = pageFile.endsWith(".constela.json") ? basename4(pageFile, ".constela.json") : basename4(pageFile, ".json");
|
|
3083
3080
|
const pathsFile = join11(dir, `${baseName}.paths.ts`);
|
|
3084
3081
|
if (!existsSync9(pathsFile)) {
|
|
3085
3082
|
return null;
|
|
@@ -3571,7 +3568,7 @@ async function build2(options) {
|
|
|
3571
3568
|
}
|
|
3572
3569
|
const routes = scannedRoutes.map((r) => r.pattern);
|
|
3573
3570
|
const jsonPages = scannedRoutes.filter(
|
|
3574
|
-
(route) => route.type === "page" && route.file.endsWith(".json")
|
|
3571
|
+
(route) => route.type === "page" && (route.file.endsWith(".json") || route.file.endsWith(".constela.json"))
|
|
3575
3572
|
);
|
|
3576
3573
|
if (jsonPages.length === 0) {
|
|
3577
3574
|
if (publicDir) {
|
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/start",
|
|
3
|
-
"version": "1.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.
|
|
48
|
-
"@constela/
|
|
49
|
-
"@constela/
|
|
50
|
-
"@constela/
|
|
51
|
-
"@constela/
|
|
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",
|