fuma-content 1.2.2 → 1.3.0
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/async-cache-C47yxLCv.js +0 -2
- package/dist/bin.js +0 -2
- package/dist/{build-mdx-C8u32vDa.js → build-mdx-DjMJg3TP.js} +1 -3
- package/dist/bun/index.d.ts +2 -3
- package/dist/bun/index.js +1 -3
- package/dist/{bun-NahDFkhR.js → bun-qVjHRKNw.js} +0 -2
- package/dist/{code-generator-pLUE7Rk7.js → code-generator-DFGEY6P5.js} +12 -14
- package/dist/collections/data/runtime.d.ts +6 -6
- package/dist/collections/data/runtime.js +0 -2
- package/dist/collections/data.d.ts +4 -5
- package/dist/collections/data.js +4 -6
- package/dist/collections/fs.d.ts +1 -1
- package/dist/collections/fs.js +10 -12
- package/dist/collections/index.d.ts +1 -1
- package/dist/collections/index.js +1 -1
- package/dist/collections/json/loader-webpack.d.ts +2 -3
- package/dist/collections/json/loader-webpack.js +1 -5
- package/dist/collections/mdx/loader-webpack.d.ts +2 -3
- package/dist/collections/mdx/loader-webpack.js +1 -5
- package/dist/collections/mdx/react.d.ts +3 -4
- package/dist/collections/mdx/react.js +0 -2
- package/dist/collections/mdx/runtime-browser.d.ts +2 -2
- package/dist/collections/mdx/runtime-browser.js +0 -2
- package/dist/collections/mdx/runtime-dynamic.d.ts +8 -7
- package/dist/collections/mdx/runtime-dynamic.js +4 -7
- package/dist/collections/mdx/runtime.d.ts +1 -1
- package/dist/collections/mdx/runtime.js +0 -2
- package/dist/collections/mdx/vue.d.ts +7 -8
- package/dist/collections/mdx/vue.js +0 -2
- package/dist/collections/mdx.d.ts +1 -1
- package/dist/collections/mdx.js +3 -5
- package/dist/collections/obsidian.d.ts +2 -3
- package/dist/collections/obsidian.js +4 -7
- package/dist/collections/runtime/file-store.d.ts +1 -1
- package/dist/collections/runtime/file-store.js +0 -2
- package/dist/collections/runtime/store.d.ts +1 -1
- package/dist/collections/runtime/store.js +7 -9
- package/dist/collections/yaml/loader-webpack.d.ts +2 -3
- package/dist/collections/yaml/loader-webpack.js +1 -5
- package/dist/{collections-Cl-23FUa.js → collections-Bl9hpWMS.js} +4 -6
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +0 -2
- package/dist/{core-Dkl2eUwU.js → core-CrYszxmc.js} +8 -11
- package/dist/{core-1dkeRoD-.d.ts → core-Dmd3yqUH.d.ts} +15 -16
- package/dist/{dynamic-DGbONJ46.d.ts → dynamic-C15fv7uG.d.ts} +2 -3
- package/dist/dynamic.d.ts +1 -1
- package/dist/dynamic.js +1 -3
- package/dist/{file-store-NLjnayNa.d.ts → file-store-Bs81Afz5.d.ts} +2 -3
- package/dist/{flatten-m0wfHxLH.js → flatten-Db7WzTB7.js} +0 -2
- package/dist/{fs-C8dHWQw9.d.ts → fs-DYfoYdl-.d.ts} +3 -7
- package/dist/{git-W7QH8hQh.d.ts → git-C0-Uazuh.d.ts} +2 -3
- package/dist/{index-h97OPng4.d.ts → index-Dfg2QKTT.d.ts} +3 -4
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -2
- package/dist/is-promise-like-C04ERo2r.js +0 -2
- package/dist/{load-from-file-C3CnD8mJ.js → load-from-file-DpW8who8.js} +0 -2
- package/dist/{loader-ol04zeoP.js → loader-B19JQedw.js} +0 -2
- package/dist/{loader-CyhM9SLt.js → loader-BTPxE-0W.js} +3 -5
- package/dist/{loader-e2SkeDfY.js → loader-CORy1xd9.js} +1 -3
- package/dist/{loader-D_sKOzDc.js → loader-DJcLC5Gg.js} +1 -3
- package/dist/{mdx-CBjuia2v.d.ts → mdx-0plToRQa.d.ts} +3 -4
- package/dist/next/index.d.ts +2 -3
- package/dist/next/index.js +2 -4
- package/dist/node/index.d.ts +1 -2
- package/dist/node/index.js +0 -2
- package/dist/node/loader.d.ts +2 -3
- package/dist/node/loader.js +1 -3
- package/dist/{node-Du4i4XDg.js → node--IKK4_8Y.js} +0 -2
- package/dist/plugins/git.d.ts +1 -1
- package/dist/plugins/git.js +1 -3
- package/dist/plugins/json-schema.d.ts +2 -3
- package/dist/plugins/json-schema.js +1 -3
- package/dist/plugins/loader/index.d.ts +1 -1
- package/dist/plugins/loader/index.js +4 -6
- package/dist/plugins/loader/webpack.d.ts +1 -1
- package/dist/plugins/loader/webpack.js +1 -3
- package/dist/plugins/remark/include.d.ts +1 -2
- package/dist/plugins/remark/include.js +4 -5
- package/dist/{runtime-CY1liEj_.d.ts → runtime-4S3BDs-G.d.ts} +8 -7
- package/dist/{runtime-browser-BqhaLAei.d.ts → runtime-browser-CXjm3FXK.d.ts} +7 -7
- package/dist/{store-DySTeDAM.d.ts → store-j10gHjm1.d.ts} +3 -5
- package/dist/utils/frontmatter.d.ts +15 -0
- package/dist/{fuma-matter-E30PU53R.js → utils/frontmatter.js} +3 -5
- package/dist/validation-Bf_v2L3p.js +0 -2
- package/dist/vite/index.d.ts +2 -3
- package/dist/vite/index.js +2 -4
- package/dist/{vite-DVIOnBqW.js → vite-myuLielb.js} +0 -2
- package/package.json +24 -20
- package/dist/async-cache-C47yxLCv.js.map +0 -1
- package/dist/bin.js.map +0 -1
- package/dist/build-mdx-C8u32vDa.js.map +0 -1
- package/dist/bun/index.d.ts.map +0 -1
- package/dist/bun/index.js.map +0 -1
- package/dist/bun-NahDFkhR.js.map +0 -1
- package/dist/code-generator-pLUE7Rk7.js.map +0 -1
- package/dist/collections/data/runtime.d.ts.map +0 -1
- package/dist/collections/data/runtime.js.map +0 -1
- package/dist/collections/data.d.ts.map +0 -1
- package/dist/collections/data.js.map +0 -1
- package/dist/collections/fs.js.map +0 -1
- package/dist/collections/json/loader-webpack.d.ts.map +0 -1
- package/dist/collections/json/loader-webpack.js.map +0 -1
- package/dist/collections/mdx/loader-webpack.d.ts.map +0 -1
- package/dist/collections/mdx/loader-webpack.js.map +0 -1
- package/dist/collections/mdx/react.d.ts.map +0 -1
- package/dist/collections/mdx/react.js.map +0 -1
- package/dist/collections/mdx/runtime-browser.js.map +0 -1
- package/dist/collections/mdx/runtime-dynamic.d.ts.map +0 -1
- package/dist/collections/mdx/runtime-dynamic.js.map +0 -1
- package/dist/collections/mdx/runtime.js.map +0 -1
- package/dist/collections/mdx/vue.d.ts.map +0 -1
- package/dist/collections/mdx/vue.js.map +0 -1
- package/dist/collections/mdx.js.map +0 -1
- package/dist/collections/obsidian.d.ts.map +0 -1
- package/dist/collections/obsidian.js.map +0 -1
- package/dist/collections/runtime/file-store.js.map +0 -1
- package/dist/collections/runtime/store.js.map +0 -1
- package/dist/collections/yaml/loader-webpack.d.ts.map +0 -1
- package/dist/collections/yaml/loader-webpack.js.map +0 -1
- package/dist/collections-Cl-23FUa.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/core-1dkeRoD-.d.ts.map +0 -1
- package/dist/core-Dkl2eUwU.js.map +0 -1
- package/dist/dynamic-DGbONJ46.d.ts.map +0 -1
- package/dist/dynamic.js.map +0 -1
- package/dist/file-store-NLjnayNa.d.ts.map +0 -1
- package/dist/flatten-m0wfHxLH.js.map +0 -1
- package/dist/fs-C8dHWQw9.d.ts.map +0 -1
- package/dist/fuma-matter-E30PU53R.js.map +0 -1
- package/dist/git-W7QH8hQh.d.ts.map +0 -1
- package/dist/index-h97OPng4.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/is-promise-like-C04ERo2r.js.map +0 -1
- package/dist/load-from-file-C3CnD8mJ.js.map +0 -1
- package/dist/loader-CyhM9SLt.js.map +0 -1
- package/dist/loader-D_sKOzDc.js.map +0 -1
- package/dist/loader-e2SkeDfY.js.map +0 -1
- package/dist/loader-ol04zeoP.js.map +0 -1
- package/dist/mdx-CBjuia2v.d.ts.map +0 -1
- package/dist/next/index.d.ts.map +0 -1
- package/dist/next/index.js.map +0 -1
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js.map +0 -1
- package/dist/node/loader.d.ts.map +0 -1
- package/dist/node/loader.js.map +0 -1
- package/dist/node-Du4i4XDg.js.map +0 -1
- package/dist/plugins/git.js.map +0 -1
- package/dist/plugins/json-schema.d.ts.map +0 -1
- package/dist/plugins/json-schema.js.map +0 -1
- package/dist/plugins/loader/index.js.map +0 -1
- package/dist/plugins/loader/webpack.js.map +0 -1
- package/dist/plugins/remark/include.d.ts.map +0 -1
- package/dist/plugins/remark/include.js.map +0 -1
- package/dist/runtime-CY1liEj_.d.ts.map +0 -1
- package/dist/runtime-browser-BqhaLAei.d.ts.map +0 -1
- package/dist/store-DySTeDAM.d.ts.map +0 -1
- package/dist/validation-Bf_v2L3p.js.map +0 -1
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js.map +0 -1
- package/dist/vite-DVIOnBqW.js.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
2
|
import { t as createCache } from "./async-cache-C47yxLCv.js";
|
|
3
|
-
import { t as flattenNode } from "./flatten-
|
|
3
|
+
import { t as flattenNode } from "./flatten-Db7WzTB7.js";
|
|
4
4
|
import { visit } from "unist-util-visit";
|
|
5
5
|
import { VFile } from "vfile";
|
|
6
6
|
import { createProcessor } from "@mdx-js/mdx";
|
|
@@ -154,5 +154,3 @@ async function buildMDX({ core, collection, filePath, frontmatter, source, compi
|
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
156
|
export { build_mdx_exports as n, buildMDX as t };
|
|
157
|
-
|
|
158
|
-
//# sourceMappingURL=build-mdx-C8u32vDa.js.map
|
package/dist/bun/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as CoreOptions, t as Core } from "../core-
|
|
1
|
+
import { n as CoreOptions, t as Core } from "../core-Dmd3yqUH.js";
|
|
2
2
|
import { BunPlugin } from "bun";
|
|
3
3
|
|
|
4
4
|
//#region src/bun/index.d.ts
|
|
@@ -8,5 +8,4 @@ declare class BunCore extends Core {
|
|
|
8
8
|
createBunPlugin(): BunPlugin;
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
|
-
export { BunCore, BunOptions, createContent };
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
11
|
+
export { BunCore, BunOptions, createContent };
|
package/dist/bun/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Core } from "../core-
|
|
1
|
+
import { t as Core } from "../core-CrYszxmc.js";
|
|
2
2
|
import { loaderPlugin } from "../plugins/loader/index.js";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
//#region src/bun/index.ts
|
|
@@ -27,5 +27,3 @@ var BunCore = class extends Core {
|
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
29
|
export { BunCore, createContent };
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -5,9 +5,9 @@ import { URLSearchParams } from "node:url";
|
|
|
5
5
|
* Code generator (one instance per file)
|
|
6
6
|
*/
|
|
7
7
|
var CodeGenerator = class {
|
|
8
|
-
lines = [];
|
|
9
|
-
importInfos = /* @__PURE__ */ new Map();
|
|
10
|
-
eagerImportId = 0;
|
|
8
|
+
#lines = [];
|
|
9
|
+
#importInfos = /* @__PURE__ */ new Map();
|
|
10
|
+
#eagerImportId = 0;
|
|
11
11
|
options;
|
|
12
12
|
constructor({ jsExtension = false, outDir = "" }) {
|
|
13
13
|
this.options = {
|
|
@@ -16,8 +16,8 @@ var CodeGenerator = class {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
addNamespaceImport(namespace, specifier, typeOnly = false) {
|
|
19
|
-
const info = this
|
|
20
|
-
this
|
|
19
|
+
const info = this.#importInfos.get(specifier) ?? {};
|
|
20
|
+
this.#importInfos.set(specifier, info);
|
|
21
21
|
if (!typeOnly) {
|
|
22
22
|
info.isUsed ??= /* @__PURE__ */ new Set();
|
|
23
23
|
info.isUsed.add(namespace);
|
|
@@ -26,8 +26,8 @@ var CodeGenerator = class {
|
|
|
26
26
|
info.namespaces.add(namespace);
|
|
27
27
|
}
|
|
28
28
|
addNamedImport(names, specifier, typeOnly = false) {
|
|
29
|
-
const info = this
|
|
30
|
-
this
|
|
29
|
+
const info = this.#importInfos.get(specifier) ?? {};
|
|
30
|
+
this.#importInfos.set(specifier, info);
|
|
31
31
|
info.named ??= /* @__PURE__ */ new Map();
|
|
32
32
|
for (const name of names) {
|
|
33
33
|
const [memberName, importName = memberName] = name.split(/\s+as\s+/, 2);
|
|
@@ -39,17 +39,17 @@ var CodeGenerator = class {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
push(...insert) {
|
|
42
|
-
this
|
|
42
|
+
this.#lines.push(...insert);
|
|
43
43
|
}
|
|
44
44
|
async pushAsync(insert) {
|
|
45
45
|
for (const line of await Promise.all(insert)) {
|
|
46
46
|
if (line === void 0) continue;
|
|
47
|
-
this
|
|
47
|
+
this.#lines.push(line);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/** generate a random import name that is unique in file. */
|
|
51
51
|
generateImportName() {
|
|
52
|
-
return `__${this
|
|
52
|
+
return `__${this.#eagerImportId++}`;
|
|
53
53
|
}
|
|
54
54
|
formatDynamicImport(specifier, mod) {
|
|
55
55
|
let s = `import("${specifier}")`;
|
|
@@ -80,7 +80,7 @@ var CodeGenerator = class {
|
|
|
80
80
|
}
|
|
81
81
|
toString() {
|
|
82
82
|
const final = ["// @ts-nocheck"];
|
|
83
|
-
for (const [specifier, { namespaces, isUsed, named }] of this
|
|
83
|
+
for (const [specifier, { namespaces, isUsed, named }] of this.#importInfos) {
|
|
84
84
|
if (namespaces) for (const namespace of namespaces) final.push(isUsed?.has(namespace) ? `import * as ${namespace} from "${specifier}";` : `import type * as ${namespace} from "${specifier}";`);
|
|
85
85
|
if (named && named.size > 0) {
|
|
86
86
|
const namedImports = [];
|
|
@@ -91,7 +91,7 @@ var CodeGenerator = class {
|
|
|
91
91
|
final.push(`import { ${namedImports.join(", ")} } from "${specifier}";`);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
final.push(...this
|
|
94
|
+
final.push(...this.#lines);
|
|
95
95
|
return final.join("\n");
|
|
96
96
|
}
|
|
97
97
|
};
|
|
@@ -101,5 +101,3 @@ function slash(path) {
|
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
export { slash as n, CodeGenerator as t };
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=code-generator-pLUE7Rk7.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { D as GetCollectionConfig } from "../../core-
|
|
2
|
-
import {
|
|
3
|
-
import { t as FileCollectionStore } from "../../file-store-NLjnayNa.js";
|
|
1
|
+
import { D as GetCollectionConfig } from "../../core-Dmd3yqUH.js";
|
|
2
|
+
import { t as FileCollectionStore } from "../../file-store-Bs81Afz5.js";
|
|
4
3
|
|
|
5
4
|
//#region src/collections/data/runtime.d.ts
|
|
6
5
|
declare function dataStore<Config, Name extends string>(_name: Name, base: string, input: Record<string, unknown>): FileCollectionStore<{
|
|
7
|
-
data: GetCollectionConfig<Config, Name> extends
|
|
6
|
+
data: GetCollectionConfig<Config, Name> extends {
|
|
7
|
+
$inferOutput: unknown;
|
|
8
|
+
} ? GetCollectionConfig<Config, Name>["$inferOutput"] : never;
|
|
8
9
|
}>;
|
|
9
10
|
//#endregion
|
|
10
|
-
export { dataStore };
|
|
11
|
-
//# sourceMappingURL=runtime.d.ts.map
|
|
11
|
+
export { dataStore };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { v as AsyncPipe } from "../core-
|
|
2
|
-
import { n as LoaderConfig } from "../index-
|
|
3
|
-
import { n as FileSystemCollectionConfig, t as FileSystemCollection } from "../fs-
|
|
1
|
+
import { v as AsyncPipe } from "../core-Dmd3yqUH.js";
|
|
2
|
+
import { n as LoaderConfig } from "../index-Dfg2QKTT.js";
|
|
3
|
+
import { n as FileSystemCollectionConfig, t as FileSystemCollection } from "../fs-DYfoYdl-.js";
|
|
4
4
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
5
|
|
|
6
6
|
//#region src/collections/data.d.ts
|
|
@@ -42,5 +42,4 @@ declare function dataCollection<Schema extends StandardSchemaV1 | undefined = un
|
|
|
42
42
|
declare function yamlLoader(): LoaderConfig;
|
|
43
43
|
declare function jsonLoader(): LoaderConfig;
|
|
44
44
|
//#endregion
|
|
45
|
-
export { DataCollection, DataCollectionConfig, DataTransformationContext, dataCollection, jsonLoader, yamlLoader };
|
|
46
|
-
//# sourceMappingURL=data.d.ts.map
|
|
45
|
+
export { DataCollection, DataCollectionConfig, DataTransformationContext, dataCollection, jsonLoader, yamlLoader };
|
package/dist/collections/data.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as asyncPipe } from "../collections-
|
|
2
|
-
import { n as slash } from "../code-generator-
|
|
1
|
+
import { r as asyncPipe } from "../collections-Bl9hpWMS.js";
|
|
2
|
+
import { n as slash } from "../code-generator-DFGEY6P5.js";
|
|
3
3
|
import { loaderHook } from "../plugins/loader/index.js";
|
|
4
4
|
import { FileSystemCollection } from "./fs.js";
|
|
5
5
|
import path from "node:path";
|
|
@@ -101,7 +101,7 @@ function yamlLoader() {
|
|
|
101
101
|
};
|
|
102
102
|
},
|
|
103
103
|
async createLoader() {
|
|
104
|
-
const { createYamlLoader } = await import("../loader-
|
|
104
|
+
const { createYamlLoader } = await import("../loader-DJcLC5Gg.js").then((n) => n.n);
|
|
105
105
|
const core = this.core;
|
|
106
106
|
return createYamlLoader({ getCore: () => core });
|
|
107
107
|
}
|
|
@@ -146,7 +146,7 @@ function jsonLoader() {
|
|
|
146
146
|
};
|
|
147
147
|
},
|
|
148
148
|
async createLoader(environment) {
|
|
149
|
-
const { createJsonLoader } = await import("../loader-
|
|
149
|
+
const { createJsonLoader } = await import("../loader-CORy1xd9.js").then((n) => n.n);
|
|
150
150
|
const core = this.core;
|
|
151
151
|
return createJsonLoader({ getCore: () => core }, environment === "vite" ? "json" : "js");
|
|
152
152
|
}
|
|
@@ -154,5 +154,3 @@ function jsonLoader() {
|
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
156
|
export { DataCollection, dataCollection, jsonLoader, yamlLoader };
|
|
157
|
-
|
|
158
|
-
//# sourceMappingURL=data.js.map
|
package/dist/collections/fs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FileSystemCollectionConfig, r as fileSystemCollection, t as FileSystemCollection } from "../fs-
|
|
1
|
+
import { n as FileSystemCollectionConfig, r as fileSystemCollection, t as FileSystemCollection } from "../fs-DYfoYdl-.js";
|
|
2
2
|
export { FileSystemCollection, FileSystemCollectionConfig, fileSystemCollection };
|
package/dist/collections/fs.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { t as Collection } from "../collections-
|
|
1
|
+
import { t as Collection } from "../collections-Bl9hpWMS.js";
|
|
2
2
|
import { t as createCache } from "../async-cache-C47yxLCv.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import picomatch from "picomatch";
|
|
5
5
|
//#region src/collections/fs.ts
|
|
6
6
|
var FileSystemCollection = class extends Collection {
|
|
7
|
-
matcher;
|
|
7
|
+
#matcher;
|
|
8
8
|
/**
|
|
9
9
|
* content directory (absolute)
|
|
10
10
|
*/
|
|
11
11
|
dir;
|
|
12
|
-
filesCache = createCache();
|
|
12
|
+
#filesCache = createCache();
|
|
13
13
|
/** the glob patterns to match files in collection, this doesn't take `supportedFormats` into account. */
|
|
14
|
-
patterns;
|
|
14
|
+
#patterns;
|
|
15
15
|
supportedFileFormats;
|
|
16
16
|
constructor(config) {
|
|
17
17
|
super();
|
|
18
18
|
const { files, supportedFormats } = config;
|
|
19
19
|
this.dir = config.dir;
|
|
20
|
-
this
|
|
20
|
+
this.#patterns = files ?? [supportedFormats ? `**/*.{${supportedFormats.join(",")}}` : `**/*`];
|
|
21
21
|
this.supportedFileFormats = supportedFormats;
|
|
22
22
|
this.onInit.hook(({ core }) => {
|
|
23
23
|
this.dir = path.resolve(core.getOptions().cwd, this.dir);
|
|
@@ -27,7 +27,7 @@ var FileSystemCollection = class extends Collection {
|
|
|
27
27
|
server.watcher.add(this.dir);
|
|
28
28
|
server.watcher.on("all", (event, file) => {
|
|
29
29
|
if (event === "change" || !this.hasFile(file)) return;
|
|
30
|
-
this
|
|
30
|
+
this.#filesCache.invalidate("");
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -41,19 +41,19 @@ var FileSystemCollection = class extends Collection {
|
|
|
41
41
|
* the result is cached.
|
|
42
42
|
*/
|
|
43
43
|
async getFiles() {
|
|
44
|
-
return this
|
|
44
|
+
return this.#filesCache.cached("", async () => {
|
|
45
45
|
const { glob } = await import("tinyglobby");
|
|
46
|
-
return (await glob(this
|
|
46
|
+
return (await glob(this.#patterns, { cwd: this.dir })).filter((v) => this.isFileSupported(v));
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
hasFile(filePath) {
|
|
50
50
|
if (!this.isFileSupported(filePath)) return false;
|
|
51
51
|
const relativePath = path.relative(this.dir, filePath);
|
|
52
52
|
if (relativePath.startsWith(`..${path.sep}`)) return false;
|
|
53
|
-
return (this
|
|
53
|
+
return (this.#matcher ??= picomatch(this.#patterns))(relativePath);
|
|
54
54
|
}
|
|
55
55
|
invalidateCache() {
|
|
56
|
-
this
|
|
56
|
+
this.#filesCache.invalidate("");
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
function fileSystemCollection(config) {
|
|
@@ -61,5 +61,3 @@ function fileSystemCollection(config) {
|
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
export { FileSystemCollection, fileSystemCollection };
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=fs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as defineCollectionHook, g as CollectionHookContext, h as CollectionHook, m as Collection } from "../core-
|
|
1
|
+
import { _ as defineCollectionHook, g as CollectionHookContext, h as CollectionHook, m as Collection } from "../core-Dmd3yqUH.js";
|
|
2
2
|
export { Collection, CollectionHook, CollectionHookContext, defineCollectionHook };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as defineCollectionHook, t as Collection } from "../collections-
|
|
1
|
+
import { n as defineCollectionHook, t as Collection } from "../collections-Bl9hpWMS.js";
|
|
2
2
|
export { Collection, defineCollectionHook };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { c as WebpackLoader } from "../../index-
|
|
1
|
+
import { c as WebpackLoader } from "../../index-Dfg2QKTT.js";
|
|
2
2
|
|
|
3
3
|
//#region src/collections/json/loader-webpack.d.ts
|
|
4
4
|
declare const _default: WebpackLoader;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { _default as default };
|
|
7
|
-
//# sourceMappingURL=loader-webpack.d.ts.map
|
|
6
|
+
export { _default as default };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import "../../validation-Bf_v2L3p.js";
|
|
2
1
|
import { createWebpackLoader } from "../../plugins/loader/webpack.js";
|
|
3
|
-
import "../../loader-
|
|
4
|
-
import { t as createJsonLoader } from "../../loader-e2SkeDfY.js";
|
|
2
|
+
import { t as createJsonLoader } from "../../loader-CORy1xd9.js";
|
|
5
3
|
//#region src/collections/json/loader-webpack.ts
|
|
6
4
|
var loader_webpack_default = createWebpackLoader((core) => createJsonLoader(core, "json"));
|
|
7
5
|
//#endregion
|
|
8
6
|
export { loader_webpack_default as default };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=loader-webpack.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { c as WebpackLoader } from "../../index-
|
|
1
|
+
import { c as WebpackLoader } from "../../index-Dfg2QKTT.js";
|
|
2
2
|
|
|
3
3
|
//#region src/collections/mdx/loader-webpack.d.ts
|
|
4
4
|
declare const _default: WebpackLoader;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { _default as default };
|
|
7
|
-
//# sourceMappingURL=loader-webpack.d.ts.map
|
|
6
|
+
export { _default as default };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import "../../validation-Bf_v2L3p.js";
|
|
2
|
-
import "../../fuma-matter-E30PU53R.js";
|
|
3
1
|
import { createWebpackLoader } from "../../plugins/loader/webpack.js";
|
|
4
|
-
import { t as createMdxLoader } from "../../loader-
|
|
2
|
+
import { t as createMdxLoader } from "../../loader-BTPxE-0W.js";
|
|
5
3
|
//#region src/collections/mdx/loader-webpack.ts
|
|
6
4
|
var loader_webpack_default = createWebpackLoader(createMdxLoader);
|
|
7
5
|
//#endregion
|
|
8
6
|
export { loader_webpack_default as default };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=loader-webpack.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as CompiledMDX } from "../../mdx-
|
|
2
|
-
import { t as MDXStoreBrowserData } from "../../runtime-browser-
|
|
1
|
+
import { i as CompiledMDX } from "../../mdx-0plToRQa.js";
|
|
2
|
+
import { t as MDXStoreBrowserData } from "../../runtime-browser-CXjm3FXK.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/collections/mdx/react.d.ts
|
|
@@ -10,5 +10,4 @@ import { ReactNode } from "react";
|
|
|
10
10
|
*/
|
|
11
11
|
declare function useRenderer<Frontmatter, Attached>(entry: MDXStoreBrowserData<Frontmatter, Attached> | undefined, renderFn: (data: CompiledMDX<Frontmatter> & Attached) => ReactNode): ReactNode;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { useRenderer };
|
|
14
|
-
//# sourceMappingURL=react.d.ts.map
|
|
13
|
+
export { useRenderer };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as _internal_data, r as mdxStoreBrowser, t as MDXStoreBrowserData } from "../../runtime-browser-
|
|
2
|
-
import { r as WithGit } from "../../runtime-
|
|
1
|
+
import { n as _internal_data, r as mdxStoreBrowser, t as MDXStoreBrowserData } from "../../runtime-browser-CXjm3FXK.js";
|
|
2
|
+
import { r as WithGit } from "../../runtime-4S3BDs-G.js";
|
|
3
3
|
export { MDXStoreBrowserData, WithGit, _internal_data, mdxStoreBrowser };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as GetCollectionConfig, n as CoreOptions } from "../../core-
|
|
2
|
-
import { t as FileCollectionStore } from "../../file-store-
|
|
3
|
-
import { i as CompiledMDX
|
|
4
|
-
import { r as WithGit } from "../../runtime-
|
|
1
|
+
import { D as GetCollectionConfig, n as CoreOptions } from "../../core-Dmd3yqUH.js";
|
|
2
|
+
import { t as FileCollectionStore } from "../../file-store-Bs81Afz5.js";
|
|
3
|
+
import { i as CompiledMDX } from "../../mdx-0plToRQa.js";
|
|
4
|
+
import { r as WithGit } from "../../runtime-4S3BDs-G.js";
|
|
5
5
|
import { MDXContent } from "mdx/types";
|
|
6
6
|
|
|
7
7
|
//#region src/collections/mdx/runtime-dynamic.d.ts
|
|
@@ -10,9 +10,10 @@ interface MDXStoreDynamicData<Frontmatter, Attached = unknown> {
|
|
|
10
10
|
frontmatter: Frontmatter;
|
|
11
11
|
compile: () => Promise<CompiledMDX<Frontmatter> & Attached>;
|
|
12
12
|
}
|
|
13
|
-
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends
|
|
13
|
+
type GetFrontmatter<Config, Name extends string> = GetCollectionConfig<Config, Name> extends {
|
|
14
|
+
$inferFrontmatter: unknown;
|
|
15
|
+
} ? GetCollectionConfig<Config, Name>["$inferFrontmatter"] : never;
|
|
14
16
|
declare function mdxStoreDynamic<Config, Name extends string, Attached>(config: Config, coreOptions: CoreOptions, name: Name, base: string, _frontmatter: Record<string, unknown>, jsxRuntime: unknown): Promise<FileCollectionStore<MDXStoreDynamicData<GetFrontmatter<Config, Name>, Attached>>>;
|
|
15
17
|
type MdxContent = MDXContent;
|
|
16
18
|
//#endregion
|
|
17
|
-
export { MDXStoreDynamicData, MdxContent, type WithGit, mdxStoreDynamic };
|
|
18
|
-
//# sourceMappingURL=runtime-dynamic.d.ts.map
|
|
19
|
+
export { MDXStoreDynamicData, MdxContent, type WithGit, mdxStoreDynamic };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { t as Core } from "../../core-
|
|
2
|
-
import "../../validation-Bf_v2L3p.js";
|
|
1
|
+
import { t as Core } from "../../core-CrYszxmc.js";
|
|
3
2
|
import { t as createCache } from "../../async-cache-C47yxLCv.js";
|
|
4
3
|
import { MDXCollection } from "../mdx.js";
|
|
5
|
-
import {
|
|
4
|
+
import { parseFrontmatter } from "../../utils/frontmatter.js";
|
|
6
5
|
import { FileCollectionStore } from "../runtime/file-store.js";
|
|
7
|
-
import { t as buildMDX } from "../../build-mdx-
|
|
6
|
+
import { t as buildMDX } from "../../build-mdx-DjMJg3TP.js";
|
|
8
7
|
import fs from "node:fs/promises";
|
|
9
8
|
import path from "node:path";
|
|
10
9
|
import { pathToFileURL } from "node:url";
|
|
@@ -29,7 +28,7 @@ async function mdxStoreDynamic(config, coreOptions, name, base, _frontmatter, js
|
|
|
29
28
|
return cache.cached(k, async () => {
|
|
30
29
|
const filePath = path.join(base, k);
|
|
31
30
|
let content = (await fs.readFile(filePath)).toString();
|
|
32
|
-
content =
|
|
31
|
+
content = parseFrontmatter(content).content;
|
|
33
32
|
const compiled = await buildMDX({
|
|
34
33
|
core,
|
|
35
34
|
collection,
|
|
@@ -69,5 +68,3 @@ async function executeMdx(compiled, options = {}) {
|
|
|
69
68
|
}
|
|
70
69
|
//#endregion
|
|
71
70
|
export { mdxStoreDynamic };
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=runtime-dynamic.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as mdxStoreLazy, i as mdxStore, n as MDXStoreLazyData, r as WithGit, t as MDXStoreData } from "../../runtime-
|
|
1
|
+
import { a as mdxStoreLazy, i as mdxStore, n as MDXStoreLazyData, r as WithGit, t as MDXStoreData } from "../../runtime-4S3BDs-G.js";
|
|
2
2
|
export { MDXStoreData, MDXStoreLazyData, WithGit, mdxStore, mdxStoreLazy };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as CompiledMDX } from "../../mdx-
|
|
2
|
-
import { t as MDXStoreBrowserData } from "../../runtime-browser-
|
|
3
|
-
import * as vue from "vue";
|
|
1
|
+
import { i as CompiledMDX } from "../../mdx-0plToRQa.js";
|
|
2
|
+
import { t as MDXStoreBrowserData } from "../../runtime-browser-CXjm3FXK.js";
|
|
3
|
+
import * as _$vue from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/collections/mdx/vue.vue.d.ts
|
|
6
6
|
declare const __VLS_export: <Frontmatter, Attached = unknown>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
7
|
-
props: vue.PublicProps & __VLS_PrettifyLocal<{
|
|
7
|
+
props: _$vue.PublicProps & __VLS_PrettifyLocal<{
|
|
8
8
|
entry?: MDXStoreBrowserData<Frontmatter, Attached>;
|
|
9
9
|
}> & (typeof globalThis extends {
|
|
10
10
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -17,11 +17,10 @@ declare const __VLS_export: <Frontmatter, Attached = unknown>(__VLS_props: NonNu
|
|
|
17
17
|
}) => any;
|
|
18
18
|
};
|
|
19
19
|
emit: {};
|
|
20
|
-
}>) => vue.VNode & {
|
|
20
|
+
}>) => _$vue.VNode & {
|
|
21
21
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
22
22
|
};
|
|
23
23
|
declare const _default: typeof __VLS_export;
|
|
24
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
24
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
25
25
|
//#endregion
|
|
26
|
-
export { _default as Vue };
|
|
27
|
-
//# sourceMappingURL=vue.d.ts.map
|
|
26
|
+
export { _default as Vue };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LinkReference, i as CompiledMDX, n as MDXCollectionConfig, r as mdxCollection, t as MDXCollection } from "../mdx-
|
|
1
|
+
import { a as LinkReference, i as CompiledMDX, n as MDXCollectionConfig, r as mdxCollection, t as MDXCollection } from "../mdx-0plToRQa.js";
|
|
2
2
|
export { CompiledMDX, LinkReference, MDXCollection, MDXCollectionConfig, mdxCollection };
|
package/dist/collections/mdx.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as pipe, r as asyncPipe } from "../collections-
|
|
2
|
-
import { n as slash } from "../code-generator-
|
|
1
|
+
import { i as pipe, r as asyncPipe } from "../collections-Bl9hpWMS.js";
|
|
2
|
+
import { n as slash } from "../code-generator-DFGEY6P5.js";
|
|
3
3
|
import { r as validate } from "../validation-Bf_v2L3p.js";
|
|
4
4
|
import { t as createCache } from "../async-cache-C47yxLCv.js";
|
|
5
5
|
import { loaderHook } from "../plugins/loader/index.js";
|
|
@@ -312,12 +312,10 @@ function mdxLoader() {
|
|
|
312
312
|
};
|
|
313
313
|
},
|
|
314
314
|
async createLoader() {
|
|
315
|
-
const { createMdxLoader } = await import("../loader-
|
|
315
|
+
const { createMdxLoader } = await import("../loader-BTPxE-0W.js").then((n) => n.n);
|
|
316
316
|
return createMdxLoader({ getCore: () => this.core });
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
320
|
//#endregion
|
|
321
321
|
export { MDXCollection, mdxCollection };
|
|
322
|
-
|
|
323
|
-
//# sourceMappingURL=mdx.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { n as MDXCollectionConfig, t as MDXCollection } from "../mdx-
|
|
1
|
+
import { n as MDXCollectionConfig, t as MDXCollection } from "../mdx-0plToRQa.js";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
|
|
4
4
|
//#region src/collections/obsidian.d.ts
|
|
5
5
|
type MDXObsidianCollectionConfig<FrontmatterSchema extends StandardSchemaV1 | undefined = undefined> = MDXCollectionConfig<FrontmatterSchema>;
|
|
6
6
|
declare function mdxObsidianCollection<FrontmatterSchema extends StandardSchemaV1 | undefined = undefined>(config: MDXObsidianCollectionConfig<FrontmatterSchema>): MDXCollection<FrontmatterSchema>;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { MDXObsidianCollectionConfig, mdxObsidianCollection };
|
|
9
|
-
//# sourceMappingURL=obsidian.d.ts.map
|
|
8
|
+
export { MDXObsidianCollectionConfig, mdxObsidianCollection };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { n as slash } from "../code-generator-
|
|
2
|
-
import "../validation-Bf_v2L3p.js";
|
|
1
|
+
import { n as slash } from "../code-generator-DFGEY6P5.js";
|
|
3
2
|
import { MDXCollection, mdxCollection } from "./mdx.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as flattenNode } from "../flatten-
|
|
3
|
+
import { parseFrontmatter } from "../utils/frontmatter.js";
|
|
4
|
+
import { t as flattenNode } from "../flatten-Db7WzTB7.js";
|
|
6
5
|
import { remarkInclude } from "../plugins/remark/include.js";
|
|
7
6
|
import { readFile } from "node:fs/promises";
|
|
8
7
|
import path from "node:path";
|
|
@@ -47,7 +46,7 @@ async function buildStorage(options) {
|
|
|
47
46
|
case ".md":
|
|
48
47
|
case ".mdx": {
|
|
49
48
|
const rawContent = await raw.read();
|
|
50
|
-
const { data, content } =
|
|
49
|
+
const { data, content } = parseFrontmatter(rawContent);
|
|
51
50
|
if (enforceMdx) outPath = outPath.slice(0, -path.extname(outPath).length) + ".mdx";
|
|
52
51
|
parsed = {
|
|
53
52
|
format: "content",
|
|
@@ -534,5 +533,3 @@ function mdxObsidianCollection(config) {
|
|
|
534
533
|
}
|
|
535
534
|
//#endregion
|
|
536
535
|
export { mdxObsidianCollection };
|
|
537
|
-
|
|
538
|
-
//# sourceMappingURL=obsidian.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FileInfo, t as FileCollectionStore } from "../../file-store-
|
|
1
|
+
import { n as FileInfo, t as FileCollectionStore } from "../../file-store-Bs81Afz5.js";
|
|
2
2
|
export { FileCollectionStore, FileInfo };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MapCollectionStore, t as CollectionStore } from "../../store-
|
|
1
|
+
import { n as MapCollectionStore, t as CollectionStore } from "../../store-j10gHjm1.js";
|
|
2
2
|
export { CollectionStore, MapCollectionStore };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
//#region src/collections/runtime/store.ts
|
|
2
2
|
var MapCollectionStore = class MapCollectionStore {
|
|
3
|
-
dataMap;
|
|
4
|
-
dataList;
|
|
3
|
+
#dataMap;
|
|
4
|
+
#dataList;
|
|
5
5
|
constructor(input) {
|
|
6
|
-
this
|
|
7
|
-
this
|
|
6
|
+
this.#dataMap = input;
|
|
7
|
+
this.#dataList = Array.from(input.values());
|
|
8
8
|
}
|
|
9
9
|
get(id) {
|
|
10
|
-
return this
|
|
10
|
+
return this.#dataMap.get(id);
|
|
11
11
|
}
|
|
12
12
|
list() {
|
|
13
|
-
return this
|
|
13
|
+
return this.#dataList;
|
|
14
14
|
}
|
|
15
15
|
castData(_cast) {
|
|
16
16
|
return this;
|
|
@@ -20,7 +20,7 @@ var MapCollectionStore = class MapCollectionStore {
|
|
|
20
20
|
*/
|
|
21
21
|
transform(fn) {
|
|
22
22
|
const updated = /* @__PURE__ */ new Map();
|
|
23
|
-
for (const [k, v] of this
|
|
23
|
+
for (const [k, v] of this.#dataMap) {
|
|
24
24
|
const out = fn(k, v);
|
|
25
25
|
updated.set(out[0], out[1]);
|
|
26
26
|
}
|
|
@@ -30,5 +30,3 @@ var MapCollectionStore = class MapCollectionStore {
|
|
|
30
30
|
};
|
|
31
31
|
//#endregion
|
|
32
32
|
export { MapCollectionStore };
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { c as WebpackLoader } from "../../index-
|
|
1
|
+
import { c as WebpackLoader } from "../../index-Dfg2QKTT.js";
|
|
2
2
|
|
|
3
3
|
//#region src/collections/yaml/loader-webpack.d.ts
|
|
4
4
|
declare const _default: WebpackLoader;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { _default as default };
|
|
7
|
-
//# sourceMappingURL=loader-webpack.d.ts.map
|
|
6
|
+
export { _default as default };
|