@treeseed/core 0.4.4 → 0.4.6
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import process from 'node:process';
|
|
4
|
-
import { packageRoot } from './
|
|
4
|
+
import { packageRoot } from './package-tools.js';
|
|
5
5
|
const legacyDocsRoot = path.resolve(packageRoot, '../..');
|
|
6
6
|
const candidateStarlightRoots = [
|
|
7
7
|
path.join(process.cwd(), 'node_modules/@astrojs/starlight'),
|
|
@@ -95,9 +95,23 @@ function resolvePackageBinary(packageName, binName = packageName, root = process
|
|
|
95
95
|
}
|
|
96
96
|
return resolve(dirname(packageJsonPath), relativePath);
|
|
97
97
|
}
|
|
98
|
+
function resolveInstalledCoreScript(root, scriptRelativePath) {
|
|
99
|
+
const { root: coreRoot } = installedPackageRoot(root, '@treeseed/core');
|
|
100
|
+
const scriptPath = resolve(coreRoot, scriptRelativePath);
|
|
101
|
+
if (!existsSync(scriptPath)) {
|
|
102
|
+
throw new Error(`Unable to resolve installed @treeseed/core script "${scriptRelativePath}" from "${root}".`);
|
|
103
|
+
}
|
|
104
|
+
return scriptPath;
|
|
105
|
+
}
|
|
98
106
|
function runStarlightPatchFromRegistry(root) {
|
|
99
|
-
const
|
|
100
|
-
|
|
107
|
+
const workspacePatchScript = resolve(root, 'packages', 'core', 'scripts', 'patch-starlight-content-path.ts');
|
|
108
|
+
const workspaceRunner = resolve(root, 'packages', 'core', 'scripts', 'run-ts.mjs');
|
|
109
|
+
if (existsSync(workspacePatchScript) && existsSync(workspaceRunner)) {
|
|
110
|
+
run(process.execPath, [workspaceRunner, workspacePatchScript], { cwd: root });
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const patchScript = resolveInstalledCoreScript(root, 'dist/scripts/patch-starlight-content-path.js');
|
|
114
|
+
run(process.execPath, [patchScript], { cwd: root });
|
|
101
115
|
}
|
|
102
116
|
function runStarlightPatchFromWorkspace(root, packages) {
|
|
103
117
|
const corePackage = packages.find((entry) => entry.name === '@treeseed/core');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Treeseed integrated platform starter for Astro/Starlight web runtimes and Hono API runtimes.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"release:publish": "node ./scripts/run-ts.mjs ./scripts/publish-package.ts"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@treeseed/sdk": "^0.4.
|
|
65
|
+
"@treeseed/sdk": "^0.4.5",
|
|
66
66
|
"@astrojs/check": "^0.9.8",
|
|
67
67
|
"@astrojs/cloudflare": "^12.6.13",
|
|
68
68
|
"@astrojs/sitemap": "3.7.0",
|