@powerlines/plugin-content-collections 0.1.327 → 0.1.328
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/_virtual/rolldown_runtime.mjs +1 -1
- package/dist/helpers/create-emitter.cjs +0 -0
- package/dist/helpers/create-emitter.mjs +1 -1
- package/dist/index.cjs +0 -0
- package/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.mjs +18 -21
- package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.mjs +35 -35
- package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs +3 -3
- package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs.map +1 -1
- package/package.json +4 -4
|
Binary file
|
package/dist/index.cjs
CHANGED
|
Binary file
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { build$1, createBuildContext, createConfigurationReader } from "./node_m
|
|
|
2
2
|
import { createEmitter } from "./helpers/create-emitter.mjs";
|
|
3
3
|
import { createWriter } from "./helpers/create-writer.mjs";
|
|
4
4
|
import "./helpers/index.mjs";
|
|
5
|
-
import { createHash } from "
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
6
|
import { existsSync } from "@stryke/fs/exists";
|
|
7
7
|
import { joinPaths } from "@stryke/path/join";
|
|
8
8
|
import defu from "defu";
|
|
@@ -7,17 +7,14 @@ import "../../../../../camelcase@8.0.0/node_modules/camelcase/index.mjs";
|
|
|
7
7
|
import pLimit from "../../../../../p-limit@6.2.0/node_modules/p-limit/index.mjs";
|
|
8
8
|
import { require_main } from "../../../../../esbuild@0.25.12/node_modules/esbuild/lib/main.mjs";
|
|
9
9
|
import { require_serialize_javascript } from "../../../../../serialize-javascript@6.0.2/node_modules/serialize-javascript/index.mjs";
|
|
10
|
-
import path, { basename, dirname, extname, join } from "\u0000powerlines:node:path";
|
|
11
|
-
import { createHash } from "\u0000powerlines:node:crypto";
|
|
12
|
-
import { existsSync } from "\u0000powerlines:node:fs";
|
|
13
|
-
import fs, { mkdir, readFile, unlink, writeFile } from "\u0000powerlines:node:fs/promises";
|
|
14
|
-
import { readFile as readFile$1 } from "node:fs/promises";
|
|
15
|
-
import fs2 from "node:fs";
|
|
16
|
-
import path2 from "node:path";
|
|
17
10
|
import { createRequire } from "node:module";
|
|
11
|
+
import path, { basename, dirname, extname, join, resolve } from "node:path";
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
import fs2, { existsSync } from "node:fs";
|
|
14
|
+
import fs, { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
18
15
|
import pluralize from "pluralize";
|
|
19
|
-
import os from "
|
|
20
|
-
import { EventEmitter } from "
|
|
16
|
+
import os from "node:os";
|
|
17
|
+
import { EventEmitter } from "node:events";
|
|
21
18
|
|
|
22
19
|
//#region ../../node_modules/.pnpm/@content-collections+core@0.12.0_patch_hash=bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.js
|
|
23
20
|
var import_gray_matter = /* @__PURE__ */ __toESM(require_gray_matter(), 1);
|
|
@@ -160,7 +157,7 @@ var CollectError = class extends Error {
|
|
|
160
157
|
function createCollector(emitter, baseDirectory = ".") {
|
|
161
158
|
async function read(filePath) {
|
|
162
159
|
try {
|
|
163
|
-
return await readFile
|
|
160
|
+
return await readFile(filePath, "utf-8");
|
|
164
161
|
} catch (error) {
|
|
165
162
|
emitter.emit("collector:read-error", {
|
|
166
163
|
filePath,
|
|
@@ -225,7 +222,7 @@ function createSynchronizer(readCollectionFile, collections, baseDirectory = "."
|
|
|
225
222
|
if (relativePath.startsWith(path.sep)) relativePath = relativePath.slice(path.sep.length);
|
|
226
223
|
return relativePath;
|
|
227
224
|
}
|
|
228
|
-
function resolve$1
|
|
225
|
+
function resolve$1(filePath) {
|
|
229
226
|
return findCollections(filePath).map((collection) => {
|
|
230
227
|
return {
|
|
231
228
|
collection,
|
|
@@ -239,7 +236,7 @@ function createSynchronizer(readCollectionFile, collections, baseDirectory = "."
|
|
|
239
236
|
});
|
|
240
237
|
}
|
|
241
238
|
function deleted(filePath) {
|
|
242
|
-
const resolvedCollections = resolve$1
|
|
239
|
+
const resolvedCollections = resolve$1(filePath);
|
|
243
240
|
if (resolvedCollections.length === 0) return false;
|
|
244
241
|
let changed$1 = false;
|
|
245
242
|
for (const { collection, relativePath } of resolvedCollections) {
|
|
@@ -249,7 +246,7 @@ function createSynchronizer(readCollectionFile, collections, baseDirectory = "."
|
|
|
249
246
|
return changed$1;
|
|
250
247
|
}
|
|
251
248
|
async function changed(filePath) {
|
|
252
|
-
const resolvedCollections = resolve$1
|
|
249
|
+
const resolvedCollections = resolve$1(filePath);
|
|
253
250
|
if (resolvedCollections.length === 0) return false;
|
|
254
251
|
let changed$1 = false;
|
|
255
252
|
for (const { collection, relativePath } of resolvedCollections) {
|
|
@@ -357,36 +354,36 @@ function jsoncParse(data) {
|
|
|
357
354
|
}
|
|
358
355
|
}
|
|
359
356
|
var req = createRequire(import.meta.url);
|
|
360
|
-
var findUp = (name, startDir, stopDir =
|
|
357
|
+
var findUp = (name, startDir, stopDir = path.parse(startDir).root) => {
|
|
361
358
|
let dir = startDir;
|
|
362
359
|
while (dir !== stopDir) {
|
|
363
|
-
const file =
|
|
360
|
+
const file = path.join(dir, name);
|
|
364
361
|
if (fs2.existsSync(file)) return file;
|
|
365
362
|
if (!file.endsWith(".json")) {
|
|
366
363
|
const fileWithExt = file + ".json";
|
|
367
364
|
if (fs2.existsSync(fileWithExt)) return fileWithExt;
|
|
368
365
|
}
|
|
369
|
-
dir =
|
|
366
|
+
dir = path.dirname(dir);
|
|
370
367
|
}
|
|
371
368
|
return null;
|
|
372
369
|
};
|
|
373
370
|
var resolveTsConfigFromFile = (cwd, filename) => {
|
|
374
|
-
if (
|
|
371
|
+
if (path.isAbsolute(filename)) return fs2.existsSync(filename) ? filename : null;
|
|
375
372
|
return findUp(filename, cwd);
|
|
376
373
|
};
|
|
377
374
|
var resolveTsConfigFromExtends = (cwd, name) => {
|
|
378
|
-
if (
|
|
375
|
+
if (path.isAbsolute(name)) return fs2.existsSync(name) ? name : null;
|
|
379
376
|
if (name.startsWith(".")) return findUp(name, cwd);
|
|
380
377
|
return req.resolve(name, { paths: [cwd] });
|
|
381
378
|
};
|
|
382
379
|
var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExtends = false) => {
|
|
383
380
|
var _a, _b;
|
|
384
|
-
dir =
|
|
381
|
+
dir = path.resolve(dir);
|
|
385
382
|
const id = isExtends ? resolveTsConfigFromExtends(dir, name) : resolveTsConfigFromFile(dir, name);
|
|
386
383
|
if (!id) return null;
|
|
387
384
|
const data = jsoncParse(fs2.readFileSync(id, "utf-8"));
|
|
388
|
-
const configDir =
|
|
389
|
-
if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) data.compilerOptions.baseUrl =
|
|
385
|
+
const configDir = path.dirname(id);
|
|
386
|
+
if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) data.compilerOptions.baseUrl = path.join(configDir, data.compilerOptions.baseUrl);
|
|
390
387
|
let extendsFiles = [];
|
|
391
388
|
if (data.extends) {
|
|
392
389
|
const extendsList = Array.isArray(data.extends) ? data.extends : [data.extends];
|