@olonjs/cli 3.0.107 → 3.0.109
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.
|
@@ -1646,7 +1646,7 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
|
|
|
1646
1646
|
"@tiptap/extension-link": "^2.11.5",
|
|
1647
1647
|
"@tiptap/react": "^2.11.5",
|
|
1648
1648
|
"@tiptap/starter-kit": "^2.11.5",
|
|
1649
|
-
"@olonjs/core": "^1.0.
|
|
1649
|
+
"@olonjs/core": "^1.0.96",
|
|
1650
1650
|
"class-variance-authority": "^0.7.1",
|
|
1651
1651
|
"clsx": "^2.1.1",
|
|
1652
1652
|
"lucide-react": "^0.474.0",
|
|
@@ -1960,12 +1960,18 @@ import { build } from 'vite';
|
|
|
1960
1960
|
import path from 'path';
|
|
1961
1961
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
1962
1962
|
import fs from 'fs/promises';
|
|
1963
|
-
import {
|
|
1963
|
+
import { createRequire } from 'module';
|
|
1964
|
+
|
|
1965
|
+
const require = createRequire(import.meta.url);
|
|
1966
|
+
const corePkgPath = require.resolve('@olonjs/core/package.json');
|
|
1967
|
+
const contractsUrl = pathToFileURL(corePkgPath.replace('package.json', 'src/lib/webmcp-contracts.mjs')).href;
|
|
1968
|
+
|
|
1969
|
+
const {
|
|
1964
1970
|
buildPageContract,
|
|
1965
1971
|
buildPageManifest,
|
|
1966
1972
|
buildPageManifestHref,
|
|
1967
1973
|
buildSiteManifest,
|
|
1968
|
-
}
|
|
1974
|
+
} = await import(contractsUrl);
|
|
1969
1975
|
|
|
1970
1976
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
1971
1977
|
const root = path.resolve(__dirname, '..');
|
|
@@ -2073,6 +2079,10 @@ const webMcpBuildState = getWebMcpBuildState();
|
|
|
2073
2079
|
for (const { slug } of targets) {
|
|
2074
2080
|
const pageConfig = webMcpBuildState.pages[slug];
|
|
2075
2081
|
if (!pageConfig) continue;
|
|
2082
|
+
|
|
2083
|
+
// Export the raw JSON data for the agentic web (so readResource works on SSG)
|
|
2084
|
+
await writeJsonTargets(`pages/${slug}.json`, pageConfig);
|
|
2085
|
+
|
|
2076
2086
|
const contract = buildPageContract({
|
|
2077
2087
|
slug,
|
|
2078
2088
|
pageConfig,
|
|
@@ -2089,6 +2099,9 @@ for (const { slug } of targets) {
|
|
|
2089
2099
|
await writeJsonTargets(buildPageManifestHref(slug).replace(/^\//, ''), pageManifest);
|
|
2090
2100
|
}
|
|
2091
2101
|
|
|
2102
|
+
// Export the site config for the agentic web
|
|
2103
|
+
await writeJsonTargets('config/site.json', webMcpBuildState.siteConfig);
|
|
2104
|
+
|
|
2092
2105
|
const mcpManifest = buildSiteManifest({
|
|
2093
2106
|
pages: webMcpBuildState.pages,
|
|
2094
2107
|
schemas: webMcpBuildState.schemas,
|
|
@@ -12912,7 +12925,12 @@ export default defineConfig({
|
|
|
12912
12925
|
|
|
12913
12926
|
if (isPageJsonRequest) {
|
|
12914
12927
|
const normalizedPath = decodeURIComponent(pathname).replace(/\\/g, '/');
|
|
12915
|
-
|
|
12928
|
+
// Rimuoviamo la root folder opzionale "/pages/" introdotta per matchare la prod e il file extension
|
|
12929
|
+
const slug = normalizedPath
|
|
12930
|
+
.replace(/^\/+/, '')
|
|
12931
|
+
.replace(/^pages\//i, '')
|
|
12932
|
+
.replace(/\.json$/i, '')
|
|
12933
|
+
.replace(/^\/+|\/+$/g, '');
|
|
12916
12934
|
const candidate = path.resolve(DATA_PAGES_DIR, `${slug}.json`);
|
|
12917
12935
|
const isInsidePagesDir = candidate.startsWith(`${DATA_PAGES_DIR}${path.sep}`) || candidate === DATA_PAGES_DIR;
|
|
12918
12936
|
if (!slug || !isInsidePagesDir || !fs.existsSync(candidate) || !fs.statSync(candidate).isFile()) {
|
|
@@ -596,7 +596,7 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
|
|
|
596
596
|
"@tiptap/extension-link": "^2.11.5",
|
|
597
597
|
"@tiptap/react": "^2.11.5",
|
|
598
598
|
"@tiptap/starter-kit": "^2.11.5",
|
|
599
|
-
"@olonjs/core": "^1.0.
|
|
599
|
+
"@olonjs/core": "^1.0.96",
|
|
600
600
|
"clsx": "^2.1.1",
|
|
601
601
|
"lucide-react": "^0.474.0",
|
|
602
602
|
"react": "^19.0.0",
|
|
@@ -1646,7 +1646,7 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
|
|
|
1646
1646
|
"@tiptap/extension-link": "^2.11.5",
|
|
1647
1647
|
"@tiptap/react": "^2.11.5",
|
|
1648
1648
|
"@tiptap/starter-kit": "^2.11.5",
|
|
1649
|
-
"@olonjs/core": "^1.0.
|
|
1649
|
+
"@olonjs/core": "^1.0.96",
|
|
1650
1650
|
"class-variance-authority": "^0.7.1",
|
|
1651
1651
|
"clsx": "^2.1.1",
|
|
1652
1652
|
"lucide-react": "^0.474.0",
|
|
@@ -1960,12 +1960,18 @@ import { build } from 'vite';
|
|
|
1960
1960
|
import path from 'path';
|
|
1961
1961
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
1962
1962
|
import fs from 'fs/promises';
|
|
1963
|
-
import {
|
|
1963
|
+
import { createRequire } from 'module';
|
|
1964
|
+
|
|
1965
|
+
const require = createRequire(import.meta.url);
|
|
1966
|
+
const corePkgPath = require.resolve('@olonjs/core/package.json');
|
|
1967
|
+
const contractsUrl = pathToFileURL(corePkgPath.replace('package.json', 'src/lib/webmcp-contracts.mjs')).href;
|
|
1968
|
+
|
|
1969
|
+
const {
|
|
1964
1970
|
buildPageContract,
|
|
1965
1971
|
buildPageManifest,
|
|
1966
1972
|
buildPageManifestHref,
|
|
1967
1973
|
buildSiteManifest,
|
|
1968
|
-
}
|
|
1974
|
+
} = await import(contractsUrl);
|
|
1969
1975
|
|
|
1970
1976
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
1971
1977
|
const root = path.resolve(__dirname, '..');
|
|
@@ -2073,6 +2079,10 @@ const webMcpBuildState = getWebMcpBuildState();
|
|
|
2073
2079
|
for (const { slug } of targets) {
|
|
2074
2080
|
const pageConfig = webMcpBuildState.pages[slug];
|
|
2075
2081
|
if (!pageConfig) continue;
|
|
2082
|
+
|
|
2083
|
+
// Export the raw JSON data for the agentic web (so readResource works on SSG)
|
|
2084
|
+
await writeJsonTargets(`pages/${slug}.json`, pageConfig);
|
|
2085
|
+
|
|
2076
2086
|
const contract = buildPageContract({
|
|
2077
2087
|
slug,
|
|
2078
2088
|
pageConfig,
|
|
@@ -2089,6 +2099,9 @@ for (const { slug } of targets) {
|
|
|
2089
2099
|
await writeJsonTargets(buildPageManifestHref(slug).replace(/^\//, ''), pageManifest);
|
|
2090
2100
|
}
|
|
2091
2101
|
|
|
2102
|
+
// Export the site config for the agentic web
|
|
2103
|
+
await writeJsonTargets('config/site.json', webMcpBuildState.siteConfig);
|
|
2104
|
+
|
|
2092
2105
|
const mcpManifest = buildSiteManifest({
|
|
2093
2106
|
pages: webMcpBuildState.pages,
|
|
2094
2107
|
schemas: webMcpBuildState.schemas,
|
|
@@ -12912,7 +12925,12 @@ export default defineConfig({
|
|
|
12912
12925
|
|
|
12913
12926
|
if (isPageJsonRequest) {
|
|
12914
12927
|
const normalizedPath = decodeURIComponent(pathname).replace(/\\/g, '/');
|
|
12915
|
-
|
|
12928
|
+
// Rimuoviamo la root folder opzionale "/pages/" introdotta per matchare la prod e il file extension
|
|
12929
|
+
const slug = normalizedPath
|
|
12930
|
+
.replace(/^\/+/, '')
|
|
12931
|
+
.replace(/^pages\//i, '')
|
|
12932
|
+
.replace(/\.json$/i, '')
|
|
12933
|
+
.replace(/^\/+|\/+$/g, '');
|
|
12916
12934
|
const candidate = path.resolve(DATA_PAGES_DIR, `${slug}.json`);
|
|
12917
12935
|
const isInsidePagesDir = candidate.startsWith(`${DATA_PAGES_DIR}${path.sep}`) || candidate === DATA_PAGES_DIR;
|
|
12918
12936
|
if (!slug || !isInsidePagesDir || !fs.existsSync(candidate) || !fs.statSync(candidate).isFile()) {
|