nuxt-ai-ready 2.5.0 → 2.5.2
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/dist/chunks/agent-skills.mjs +1 -1
- package/dist/chunks/prerender.mjs +1 -1
- package/dist/cli.mjs +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/server/db/drizzle/queries.js +0 -1
- package/dist/runtime/server/db/queries.d.ts +2 -0
- package/dist/runtime/server/db/queries.js +11 -5
- package/dist/runtime/server/db/seed.d.ts +2 -2
- package/dist/runtime/server/routes/__ai-ready/reindex.post.js +2 -0
- package/dist/runtime/server/utils/batchIndex.js +4 -2
- package/dist/runtime/server/utils/checkStale.d.ts +1 -1
- package/dist/runtime/server/utils/checkStale.js +1 -1
- package/dist/runtime/server/utils/indexPage.d.ts +8 -1
- package/dist/runtime/server/utils/indexPage.js +13 -5
- package/dist/shared/{nuxt-ai-ready.DsokNmXc.mjs → nuxt-ai-ready.CLSWou20.mjs} +2 -0
- package/node_modules/@mdream/js/LICENSE.md +9 -0
- package/node_modules/@mdream/js/README.md +792 -0
- package/node_modules/@mdream/js/bin/mdream.mjs +2 -0
- package/node_modules/@mdream/js/dist/_chunks/const.mjs +134 -0
- package/node_modules/@mdream/js/dist/_chunks/index.d.mts +9 -0
- package/node_modules/@mdream/js/dist/_chunks/markdown-processor.mjs +1968 -0
- package/node_modules/@mdream/js/dist/_chunks/minimal.d.mts +6 -0
- package/node_modules/@mdream/js/dist/_chunks/parse.mjs +2756 -0
- package/node_modules/@mdream/js/dist/_chunks/plugins.mjs +725 -0
- package/node_modules/@mdream/js/dist/_chunks/resolve-plugins.mjs +44 -0
- package/node_modules/@mdream/js/dist/_chunks/stream.mjs +37 -0
- package/node_modules/@mdream/js/dist/_chunks/types.d.mts +473 -0
- package/node_modules/@mdream/js/dist/cli.d.mts +1 -0
- package/node_modules/@mdream/js/dist/cli.mjs +32 -0
- package/node_modules/@mdream/js/dist/core.d.mts +15 -0
- package/node_modules/@mdream/js/dist/core.mjs +28 -0
- package/node_modules/@mdream/js/dist/index.d.mts +4 -0
- package/node_modules/@mdream/js/dist/index.mjs +58 -0
- package/node_modules/@mdream/js/dist/llms-txt.d.mts +86 -0
- package/node_modules/@mdream/js/dist/llms-txt.mjs +308 -0
- package/node_modules/@mdream/js/dist/negotiate.d.mts +35 -0
- package/node_modules/@mdream/js/dist/negotiate.mjs +121 -0
- package/node_modules/@mdream/js/dist/parse.d.mts +90 -0
- package/node_modules/@mdream/js/dist/parse.mjs +2 -0
- package/node_modules/@mdream/js/dist/plugins.d.mts +85 -0
- package/node_modules/@mdream/js/dist/plugins.mjs +2 -0
- package/node_modules/@mdream/js/dist/preset/minimal.d.mts +2 -0
- package/node_modules/@mdream/js/dist/preset/minimal.mjs +33 -0
- package/node_modules/@mdream/js/dist/splitter.d.mts +18 -0
- package/node_modules/@mdream/js/dist/splitter.mjs +194 -0
- package/node_modules/@mdream/js/package.json +103 -0
- package/node_modules/cac/LICENSE +21 -0
- package/node_modules/cac/README.md +492 -0
- package/node_modules/cac/dist/index.d.ts +196 -0
- package/node_modules/cac/dist/index.js +638 -0
- package/node_modules/cac/package.json +72 -0
- package/node_modules/mdream/LICENSE.md +9 -0
- package/node_modules/mdream/README.md +1091 -0
- package/node_modules/mdream/bin/mdream.mjs +46 -0
- package/node_modules/mdream/dist/browser.d.mts +105 -0
- package/node_modules/mdream/dist/browser.mjs +262 -0
- package/node_modules/mdream/dist/edge.d.mts +100 -0
- package/node_modules/mdream/dist/edge.mjs +250 -0
- package/node_modules/mdream/dist/iife.js +605 -0
- package/node_modules/mdream/dist/index.d.mts +89 -0
- package/node_modules/mdream/dist/index.mjs +184 -0
- package/node_modules/mdream/dist/wasm.d.mts +100 -0
- package/node_modules/mdream/dist/wasm.mjs +140 -0
- package/node_modules/mdream/dist/worker.d.mts +101 -0
- package/node_modules/mdream/dist/worker.mjs +217 -0
- package/node_modules/mdream/napi/index.d.mts +127 -0
- package/node_modules/mdream/napi/index.d.ts +127 -0
- package/node_modules/mdream/napi/index.mjs +725 -0
- package/node_modules/mdream/napi/rust.android-arm-eabi.node +0 -0
- package/node_modules/mdream/napi/rust.android-arm64.node +0 -0
- package/node_modules/mdream/napi/rust.darwin-arm64.node +0 -0
- package/node_modules/mdream/napi/rust.darwin-x64.node +0 -0
- package/node_modules/mdream/napi/rust.freebsd-x64.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm-gnueabihf.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm64-gnu.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm64-musl.node +0 -0
- package/node_modules/mdream/napi/rust.linux-x64-gnu.node +0 -0
- package/node_modules/mdream/napi/rust.linux-x64-musl.node +0 -0
- package/node_modules/mdream/napi/rust.wasi.cjs +2144 -0
- package/node_modules/mdream/napi/rust.wasm32-wasi.wasm +0 -0
- package/node_modules/mdream/napi/rust.win32-arm64-msvc.node +0 -0
- package/node_modules/mdream/napi/rust.win32-x64-msvc.node +0 -0
- package/node_modules/mdream/node_modules/@emnapi/core/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@emnapi/core/README.md +1 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.d.ts +392 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.d.ts +392 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.js +8351 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.js +7268 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.d.ts +5 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.js +843 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.d.ts +4 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.js +3 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.d.ts +5 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.js +1010 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.d.ts +5 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.js +1446 -0
- package/node_modules/mdream/node_modules/@emnapi/core/package.json +39 -0
- package/node_modules/mdream/node_modules/@emnapi/core/rollup.config.js +60 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/README.md +1 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.d.ts +833 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js +2306 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js.map +1 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/index.cjs +63 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/package.json +39 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/rollup.config.js +25 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/README.md +203 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +236 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +1086 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/package.json +35 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/rollup.config.js +6 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +1472 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +1470 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +237 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs.js +18260 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +317 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/package.json +67 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.cjs +39 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.js +36 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/README.md +193 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +11 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +423 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +2932 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +2932 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +1 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.js +2954 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +1 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +158 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/index.js +13 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +46 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/load.js +97 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/memory.js +35 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +103 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +268 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +3 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +192 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +316 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +1599 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +141 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +220 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +128 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +13 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +153 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +9 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +39 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +89 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +28 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +97 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +256 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +1 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +186 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +310 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +1593 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +135 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +216 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +113 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +9 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/package.json +58 -0
- package/node_modules/mdream/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/mdream/node_modules/tslib/LICENSE.txt +12 -0
- package/node_modules/mdream/node_modules/tslib/README.md +164 -0
- package/node_modules/mdream/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/mdream/node_modules/tslib/modules/index.d.ts +38 -0
- package/node_modules/mdream/node_modules/tslib/modules/index.js +70 -0
- package/node_modules/mdream/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/mdream/node_modules/tslib/package.json +47 -0
- package/node_modules/mdream/node_modules/tslib/tslib.d.ts +460 -0
- package/node_modules/mdream/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/mdream/node_modules/tslib/tslib.es6.js +402 -0
- package/node_modules/mdream/node_modules/tslib/tslib.es6.mjs +401 -0
- package/node_modules/mdream/node_modules/tslib/tslib.html +1 -0
- package/node_modules/mdream/node_modules/tslib/tslib.js +484 -0
- package/node_modules/mdream/package.json +110 -0
- package/node_modules/mdream/skills/mdream/SKILL.md +124 -0
- package/node_modules/mdream/skills/mdream/references/runtimes.md +49 -0
- package/node_modules/mdream/wasm/mdream_edge.d.ts +90 -0
- package/node_modules/mdream/wasm/mdream_edge.js +517 -0
- package/node_modules/mdream/wasm/mdream_edge_bg.wasm +0 -0
- package/node_modules/mdream/wasm/mdream_edge_bg.wasm.d.ts +20 -0
- package/node_modules/mdream/wasm/package.json +17 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge.d.ts +45 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge.js +13 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.js +413 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm +0 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm.d.ts +20 -0
- package/node_modules/mdream/wasm-bundler/package.json +19 -0
- package/node_modules/pathe/LICENSE +70 -0
- package/node_modules/pathe/README.md +73 -0
- package/node_modules/pathe/dist/index.cjs +39 -0
- package/node_modules/pathe/dist/index.d.cts +47 -0
- package/node_modules/pathe/dist/index.d.mts +47 -0
- package/node_modules/pathe/dist/index.d.ts +47 -0
- package/node_modules/pathe/dist/index.mjs +19 -0
- package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +266 -0
- package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +249 -0
- package/node_modules/pathe/dist/utils.cjs +82 -0
- package/node_modules/pathe/dist/utils.d.cts +32 -0
- package/node_modules/pathe/dist/utils.d.mts +32 -0
- package/node_modules/pathe/dist/utils.d.ts +32 -0
- package/node_modules/pathe/dist/utils.mjs +77 -0
- package/node_modules/pathe/package.json +61 -0
- package/node_modules/pathe/utils.d.ts +1 -0
- package/package.json +8 -64
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const _path = require('./shared/pathe.BSlhyZSM.cjs');
|
|
4
|
+
|
|
5
|
+
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
|
|
6
|
+
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
|
|
7
|
+
const SLASH_RE = /[/\\]/;
|
|
8
|
+
function normalizeAliases(_aliases) {
|
|
9
|
+
if (_aliases[normalizedAliasSymbol]) {
|
|
10
|
+
return _aliases;
|
|
11
|
+
}
|
|
12
|
+
const aliases = Object.fromEntries(
|
|
13
|
+
Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
|
|
14
|
+
);
|
|
15
|
+
for (const key in aliases) {
|
|
16
|
+
for (const alias in aliases) {
|
|
17
|
+
if (alias === key || key.startsWith(alias)) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (aliases[key]?.startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
|
|
21
|
+
aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(aliases, normalizedAliasSymbol, {
|
|
26
|
+
value: true,
|
|
27
|
+
enumerable: false
|
|
28
|
+
});
|
|
29
|
+
return aliases;
|
|
30
|
+
}
|
|
31
|
+
function resolveAlias(path, aliases) {
|
|
32
|
+
const _path$1 = _path.normalizeWindowsPath(path);
|
|
33
|
+
aliases = normalizeAliases(aliases);
|
|
34
|
+
for (const [alias, to] of Object.entries(aliases)) {
|
|
35
|
+
if (!_path$1.startsWith(alias)) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
|
39
|
+
if (hasTrailingSlash(_path$1[_alias.length])) {
|
|
40
|
+
return _path.join(to, _path$1.slice(alias.length));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return _path$1;
|
|
44
|
+
}
|
|
45
|
+
function reverseResolveAlias(path, aliases) {
|
|
46
|
+
const _path$1 = _path.normalizeWindowsPath(path);
|
|
47
|
+
aliases = normalizeAliases(aliases);
|
|
48
|
+
const matches = [];
|
|
49
|
+
for (const [to, alias] of Object.entries(aliases)) {
|
|
50
|
+
if (!_path$1.startsWith(alias)) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
|
54
|
+
if (hasTrailingSlash(_path$1[_alias.length])) {
|
|
55
|
+
matches.push(_path.join(to, _path$1.slice(alias.length)));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return matches.sort((a, b) => b.length - a.length);
|
|
59
|
+
}
|
|
60
|
+
function filename(path) {
|
|
61
|
+
const base = path.split(SLASH_RE).pop();
|
|
62
|
+
if (!base) {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
const separatorIndex = base.lastIndexOf(".");
|
|
66
|
+
if (separatorIndex <= 0) {
|
|
67
|
+
return base;
|
|
68
|
+
}
|
|
69
|
+
return base.slice(0, separatorIndex);
|
|
70
|
+
}
|
|
71
|
+
function _compareAliases(a, b) {
|
|
72
|
+
return b.split("/").length - a.split("/").length;
|
|
73
|
+
}
|
|
74
|
+
function hasTrailingSlash(path = "/") {
|
|
75
|
+
const lastChar = path[path.length - 1];
|
|
76
|
+
return lastChar === "/" || lastChar === "\\";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
exports.filename = filename;
|
|
80
|
+
exports.normalizeAliases = normalizeAliases;
|
|
81
|
+
exports.resolveAlias = resolveAlias;
|
|
82
|
+
exports.reverseResolveAlias = reverseResolveAlias;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
|
|
3
|
+
* This function also ensures that aliases do not resolve to themselves cyclically.
|
|
4
|
+
*
|
|
5
|
+
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
|
|
6
|
+
* @returns a set of normalised alias mappings.
|
|
7
|
+
*/
|
|
8
|
+
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a path string to its alias if applicable, otherwise returns the original path.
|
|
11
|
+
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
|
|
12
|
+
*
|
|
13
|
+
* @param path - The path string to resolve.
|
|
14
|
+
* @param aliases - A set of alias mappings to use for resolution.
|
|
15
|
+
* @returns the resolved path as a string.
|
|
16
|
+
*/
|
|
17
|
+
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a path string to its possible alias.
|
|
20
|
+
*
|
|
21
|
+
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
|
|
22
|
+
*/
|
|
23
|
+
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
|
|
24
|
+
/**
|
|
25
|
+
* Extracts the filename from a given path, excluding any directory paths and the file extension.
|
|
26
|
+
*
|
|
27
|
+
* @param path - The full path of the file from which to extract the filename.
|
|
28
|
+
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
|
|
29
|
+
*/
|
|
30
|
+
declare function filename(path: string): string | undefined;
|
|
31
|
+
|
|
32
|
+
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
|
|
3
|
+
* This function also ensures that aliases do not resolve to themselves cyclically.
|
|
4
|
+
*
|
|
5
|
+
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
|
|
6
|
+
* @returns a set of normalised alias mappings.
|
|
7
|
+
*/
|
|
8
|
+
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a path string to its alias if applicable, otherwise returns the original path.
|
|
11
|
+
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
|
|
12
|
+
*
|
|
13
|
+
* @param path - The path string to resolve.
|
|
14
|
+
* @param aliases - A set of alias mappings to use for resolution.
|
|
15
|
+
* @returns the resolved path as a string.
|
|
16
|
+
*/
|
|
17
|
+
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a path string to its possible alias.
|
|
20
|
+
*
|
|
21
|
+
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
|
|
22
|
+
*/
|
|
23
|
+
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
|
|
24
|
+
/**
|
|
25
|
+
* Extracts the filename from a given path, excluding any directory paths and the file extension.
|
|
26
|
+
*
|
|
27
|
+
* @param path - The full path of the file from which to extract the filename.
|
|
28
|
+
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
|
|
29
|
+
*/
|
|
30
|
+
declare function filename(path: string): string | undefined;
|
|
31
|
+
|
|
32
|
+
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
|
|
3
|
+
* This function also ensures that aliases do not resolve to themselves cyclically.
|
|
4
|
+
*
|
|
5
|
+
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
|
|
6
|
+
* @returns a set of normalised alias mappings.
|
|
7
|
+
*/
|
|
8
|
+
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a path string to its alias if applicable, otherwise returns the original path.
|
|
11
|
+
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
|
|
12
|
+
*
|
|
13
|
+
* @param path - The path string to resolve.
|
|
14
|
+
* @param aliases - A set of alias mappings to use for resolution.
|
|
15
|
+
* @returns the resolved path as a string.
|
|
16
|
+
*/
|
|
17
|
+
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a path string to its possible alias.
|
|
20
|
+
*
|
|
21
|
+
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
|
|
22
|
+
*/
|
|
23
|
+
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
|
|
24
|
+
/**
|
|
25
|
+
* Extracts the filename from a given path, excluding any directory paths and the file extension.
|
|
26
|
+
*
|
|
27
|
+
* @param path - The full path of the file from which to extract the filename.
|
|
28
|
+
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
|
|
29
|
+
*/
|
|
30
|
+
declare function filename(path: string): string | undefined;
|
|
31
|
+
|
|
32
|
+
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { g as normalizeWindowsPath, j as join } from './shared/pathe.M-eThtNZ.mjs';
|
|
2
|
+
|
|
3
|
+
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
|
|
4
|
+
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
|
|
5
|
+
const SLASH_RE = /[/\\]/;
|
|
6
|
+
function normalizeAliases(_aliases) {
|
|
7
|
+
if (_aliases[normalizedAliasSymbol]) {
|
|
8
|
+
return _aliases;
|
|
9
|
+
}
|
|
10
|
+
const aliases = Object.fromEntries(
|
|
11
|
+
Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
|
|
12
|
+
);
|
|
13
|
+
for (const key in aliases) {
|
|
14
|
+
for (const alias in aliases) {
|
|
15
|
+
if (alias === key || key.startsWith(alias)) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (aliases[key]?.startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
|
|
19
|
+
aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(aliases, normalizedAliasSymbol, {
|
|
24
|
+
value: true,
|
|
25
|
+
enumerable: false
|
|
26
|
+
});
|
|
27
|
+
return aliases;
|
|
28
|
+
}
|
|
29
|
+
function resolveAlias(path, aliases) {
|
|
30
|
+
const _path = normalizeWindowsPath(path);
|
|
31
|
+
aliases = normalizeAliases(aliases);
|
|
32
|
+
for (const [alias, to] of Object.entries(aliases)) {
|
|
33
|
+
if (!_path.startsWith(alias)) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
|
37
|
+
if (hasTrailingSlash(_path[_alias.length])) {
|
|
38
|
+
return join(to, _path.slice(alias.length));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return _path;
|
|
42
|
+
}
|
|
43
|
+
function reverseResolveAlias(path, aliases) {
|
|
44
|
+
const _path = normalizeWindowsPath(path);
|
|
45
|
+
aliases = normalizeAliases(aliases);
|
|
46
|
+
const matches = [];
|
|
47
|
+
for (const [to, alias] of Object.entries(aliases)) {
|
|
48
|
+
if (!_path.startsWith(alias)) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
|
52
|
+
if (hasTrailingSlash(_path[_alias.length])) {
|
|
53
|
+
matches.push(join(to, _path.slice(alias.length)));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return matches.sort((a, b) => b.length - a.length);
|
|
57
|
+
}
|
|
58
|
+
function filename(path) {
|
|
59
|
+
const base = path.split(SLASH_RE).pop();
|
|
60
|
+
if (!base) {
|
|
61
|
+
return void 0;
|
|
62
|
+
}
|
|
63
|
+
const separatorIndex = base.lastIndexOf(".");
|
|
64
|
+
if (separatorIndex <= 0) {
|
|
65
|
+
return base;
|
|
66
|
+
}
|
|
67
|
+
return base.slice(0, separatorIndex);
|
|
68
|
+
}
|
|
69
|
+
function _compareAliases(a, b) {
|
|
70
|
+
return b.split("/").length - a.split("/").length;
|
|
71
|
+
}
|
|
72
|
+
function hasTrailingSlash(path = "/") {
|
|
73
|
+
const lastChar = path[path.length - 1];
|
|
74
|
+
return lastChar === "/" || lastChar === "\\";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pathe",
|
|
3
|
+
"version": "2.0.3",
|
|
4
|
+
"description": "Universal filesystem path utils",
|
|
5
|
+
"repository": "unjs/pathe",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.mts",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./utils": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/utils.d.mts",
|
|
23
|
+
"default": "./dist/utils.mjs"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/utils.d.cts",
|
|
27
|
+
"default": "./dist/utils.cjs"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"main": "./dist/index.cjs",
|
|
32
|
+
"module": "./dist/index.mjs",
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"utils.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^22.13.1",
|
|
40
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
41
|
+
"changelogen": "^0.5.7",
|
|
42
|
+
"esbuild": "^0.25.0",
|
|
43
|
+
"eslint": "^9.20.1",
|
|
44
|
+
"eslint-config-unjs": "^0.4.2",
|
|
45
|
+
"jiti": "^2.4.2",
|
|
46
|
+
"prettier": "^3.5.0",
|
|
47
|
+
"typescript": "^5.7.3",
|
|
48
|
+
"unbuild": "^3.3.1",
|
|
49
|
+
"vitest": "^3.0.5",
|
|
50
|
+
"zeptomatch": "^2.0.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "unbuild",
|
|
54
|
+
"dev": "vitest",
|
|
55
|
+
"lint": "eslint . && prettier -c src test",
|
|
56
|
+
"lint:fix": "eslint . --fix && prettier -w src test",
|
|
57
|
+
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
|
|
58
|
+
"test": "pnpm lint && vitest run --coverage",
|
|
59
|
+
"test:types": "tsc --noEmit"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/utils";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ai-ready",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.2",
|
|
5
5
|
"description": "Best practice AI & LLM discoverability for Nuxt sites.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@mdream/js": "
|
|
69
|
+
"@mdream/js": "2.0.0-beta.1",
|
|
70
70
|
"@nuxt/kit": "^4.5.2",
|
|
71
71
|
"@nuxtjs/robots": "^6.2.3",
|
|
72
72
|
"@nuxtjs/sitemap": "^8.5.1",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"consola": "^3.4.2",
|
|
75
75
|
"defu": "^6.1.7",
|
|
76
76
|
"drizzle-orm": "1.0.0-rc.4",
|
|
77
|
-
"mdream": "
|
|
77
|
+
"mdream": "2.0.0-beta.1",
|
|
78
78
|
"nuxt-site-config": "^4.2.3",
|
|
79
79
|
"nuxtseo-shared": "^5.3.16",
|
|
80
80
|
"pathe": "^2.0.3",
|
|
@@ -85,64 +85,8 @@
|
|
|
85
85
|
"uncrypto": "^0.1.3",
|
|
86
86
|
"yaml": "^2.9.1"
|
|
87
87
|
},
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"@
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"@nuxt/content": "^3.16.1",
|
|
94
|
-
"@nuxt/module-builder": "^1.0.3",
|
|
95
|
-
"@nuxt/test-utils": "^4.3.2",
|
|
96
|
-
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
97
|
-
"@nuxtjs/mcp-toolkit": "^0.21.0",
|
|
98
|
-
"@types/better-sqlite3": "^9.6.0",
|
|
99
|
-
"@vitest/coverage-v8": "^5.0.1",
|
|
100
|
-
"@vue/test-utils": "^2.5.1",
|
|
101
|
-
"@vueuse/nuxt": "^15.0.0",
|
|
102
|
-
"better-sqlite3": "^13.0.3",
|
|
103
|
-
"bumpp": "^12.3.0",
|
|
104
|
-
"eslint": "^10.11.0",
|
|
105
|
-
"eslint-plugin-harlanzw": "^0.23.0",
|
|
106
|
-
"execa": "^10.0.1",
|
|
107
|
-
"h3": "^1.15.11",
|
|
108
|
-
"happy-dom": "^20.14.5",
|
|
109
|
-
"nitropack": "^2.13.4",
|
|
110
|
-
"nuxt": "^4.5.2",
|
|
111
|
-
"nuxt-site-config": "^4.2.3",
|
|
112
|
-
"nuxtseo-layer-devtools": "^5.3.16",
|
|
113
|
-
"playwright": "^1.63.0",
|
|
114
|
-
"playwright-core": "^1.63.0",
|
|
115
|
-
"postgres": "^3.4.9",
|
|
116
|
-
"tinyglobby": "^0.2.17",
|
|
117
|
-
"typescript": "6.0.3",
|
|
118
|
-
"unbuild": "^3.6.1",
|
|
119
|
-
"vitest": "^5.0.1",
|
|
120
|
-
"vue": "^3.5.43",
|
|
121
|
-
"vue-router": "^5.3.1",
|
|
122
|
-
"vue-tsc": "^3.3.11",
|
|
123
|
-
"wrangler": "^4.136.3",
|
|
124
|
-
"zod": "^4.6.5"
|
|
125
|
-
},
|
|
126
|
-
"scripts": {
|
|
127
|
-
"lint": "eslint .",
|
|
128
|
-
"lint:fix": "eslint . --fix",
|
|
129
|
-
"build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && pnpm run build:devtools && pnpm run test:dist",
|
|
130
|
-
"build:devtools": "node -e \"require('fs').cpSync('devtools','dist/devtools',{recursive:true})\"",
|
|
131
|
-
"dev": "nuxt dev playground",
|
|
132
|
-
"dev:minimal": "nuxt dev playground",
|
|
133
|
-
"prepare:fixtures": "nuxt prepare playground && nuxt prepare playground && nuxt prepare test/fixtures/basic",
|
|
134
|
-
"dev:build": "nuxt build playground",
|
|
135
|
-
"dev:build:minimal": "nuxt build playground",
|
|
136
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && nuxt prepare playground && pnpm run build:devtools",
|
|
137
|
-
"dev:prepare:minimal": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && nuxt prepare playground",
|
|
138
|
-
"release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.md\"",
|
|
139
|
-
"test": "pnpm run prepare:fixtures && vitest",
|
|
140
|
-
"test:run": "pnpm run prepare:fixtures && vitest run && pnpm test:nuxt5",
|
|
141
|
-
"test:unit": "vitest run --project=unit",
|
|
142
|
-
"test:e2e": "pnpm run prepare:fixtures && vitest run --project=e2e",
|
|
143
|
-
"test:dist": "node scripts/check-dist-imports.mjs",
|
|
144
|
-
"typecheck": "nuxt typecheck && tsc -p test/types/tsconfig.json",
|
|
145
|
-
"test:attw": "attw --pack",
|
|
146
|
-
"test:nuxt5": "pnpm pack --out test/fixtures/nuxt5/module.tgz && pnpm install --dir test/fixtures/nuxt5 --no-frozen-lockfile --force --update-checksums && pnpm --dir test/fixtures/nuxt5 test"
|
|
147
|
-
}
|
|
148
|
-
}
|
|
88
|
+
"bundledDependencies": [
|
|
89
|
+
"mdream",
|
|
90
|
+
"@mdream/js"
|
|
91
|
+
]
|
|
92
|
+
}
|