@powerlines/plugin-content-collections 0.1.326 → 0.1.327
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 +21 -18
- 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 "node:crypto";
|
|
5
|
+
import { createHash } from "\u0000powerlines: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,14 +7,17 @@ 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";
|
|
10
17
|
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";
|
|
15
18
|
import pluralize from "pluralize";
|
|
16
|
-
import os from "node:os";
|
|
17
|
-
import { EventEmitter } from "node:events";
|
|
19
|
+
import os from "\u0000powerlines:node:os";
|
|
20
|
+
import { EventEmitter } from "\u0000powerlines:node:events";
|
|
18
21
|
|
|
19
22
|
//#region ../../node_modules/.pnpm/@content-collections+core@0.12.0_patch_hash=bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.js
|
|
20
23
|
var import_gray_matter = /* @__PURE__ */ __toESM(require_gray_matter(), 1);
|
|
@@ -157,7 +160,7 @@ var CollectError = class extends Error {
|
|
|
157
160
|
function createCollector(emitter, baseDirectory = ".") {
|
|
158
161
|
async function read(filePath) {
|
|
159
162
|
try {
|
|
160
|
-
return await readFile(filePath, "utf-8");
|
|
163
|
+
return await readFile$1(filePath, "utf-8");
|
|
161
164
|
} catch (error) {
|
|
162
165
|
emitter.emit("collector:read-error", {
|
|
163
166
|
filePath,
|
|
@@ -222,7 +225,7 @@ function createSynchronizer(readCollectionFile, collections, baseDirectory = "."
|
|
|
222
225
|
if (relativePath.startsWith(path.sep)) relativePath = relativePath.slice(path.sep.length);
|
|
223
226
|
return relativePath;
|
|
224
227
|
}
|
|
225
|
-
function resolve$1(filePath) {
|
|
228
|
+
function resolve$1$1(filePath) {
|
|
226
229
|
return findCollections(filePath).map((collection) => {
|
|
227
230
|
return {
|
|
228
231
|
collection,
|
|
@@ -236,7 +239,7 @@ function createSynchronizer(readCollectionFile, collections, baseDirectory = "."
|
|
|
236
239
|
});
|
|
237
240
|
}
|
|
238
241
|
function deleted(filePath) {
|
|
239
|
-
const resolvedCollections = resolve$1(filePath);
|
|
242
|
+
const resolvedCollections = resolve$1$1(filePath);
|
|
240
243
|
if (resolvedCollections.length === 0) return false;
|
|
241
244
|
let changed$1 = false;
|
|
242
245
|
for (const { collection, relativePath } of resolvedCollections) {
|
|
@@ -246,7 +249,7 @@ function createSynchronizer(readCollectionFile, collections, baseDirectory = "."
|
|
|
246
249
|
return changed$1;
|
|
247
250
|
}
|
|
248
251
|
async function changed(filePath) {
|
|
249
|
-
const resolvedCollections = resolve$1(filePath);
|
|
252
|
+
const resolvedCollections = resolve$1$1(filePath);
|
|
250
253
|
if (resolvedCollections.length === 0) return false;
|
|
251
254
|
let changed$1 = false;
|
|
252
255
|
for (const { collection, relativePath } of resolvedCollections) {
|
|
@@ -354,36 +357,36 @@ function jsoncParse(data) {
|
|
|
354
357
|
}
|
|
355
358
|
}
|
|
356
359
|
var req = createRequire(import.meta.url);
|
|
357
|
-
var findUp = (name, startDir, stopDir =
|
|
360
|
+
var findUp = (name, startDir, stopDir = path2.parse(startDir).root) => {
|
|
358
361
|
let dir = startDir;
|
|
359
362
|
while (dir !== stopDir) {
|
|
360
|
-
const file =
|
|
363
|
+
const file = path2.join(dir, name);
|
|
361
364
|
if (fs2.existsSync(file)) return file;
|
|
362
365
|
if (!file.endsWith(".json")) {
|
|
363
366
|
const fileWithExt = file + ".json";
|
|
364
367
|
if (fs2.existsSync(fileWithExt)) return fileWithExt;
|
|
365
368
|
}
|
|
366
|
-
dir =
|
|
369
|
+
dir = path2.dirname(dir);
|
|
367
370
|
}
|
|
368
371
|
return null;
|
|
369
372
|
};
|
|
370
373
|
var resolveTsConfigFromFile = (cwd, filename) => {
|
|
371
|
-
if (
|
|
374
|
+
if (path2.isAbsolute(filename)) return fs2.existsSync(filename) ? filename : null;
|
|
372
375
|
return findUp(filename, cwd);
|
|
373
376
|
};
|
|
374
377
|
var resolveTsConfigFromExtends = (cwd, name) => {
|
|
375
|
-
if (
|
|
378
|
+
if (path2.isAbsolute(name)) return fs2.existsSync(name) ? name : null;
|
|
376
379
|
if (name.startsWith(".")) return findUp(name, cwd);
|
|
377
380
|
return req.resolve(name, { paths: [cwd] });
|
|
378
381
|
};
|
|
379
382
|
var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExtends = false) => {
|
|
380
383
|
var _a, _b;
|
|
381
|
-
dir =
|
|
384
|
+
dir = path2.resolve(dir);
|
|
382
385
|
const id = isExtends ? resolveTsConfigFromExtends(dir, name) : resolveTsConfigFromFile(dir, name);
|
|
383
386
|
if (!id) return null;
|
|
384
387
|
const data = jsoncParse(fs2.readFileSync(id, "utf-8"));
|
|
385
|
-
const configDir =
|
|
386
|
-
if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) data.compilerOptions.baseUrl =
|
|
388
|
+
const configDir = path2.dirname(id);
|
|
389
|
+
if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) data.compilerOptions.baseUrl = path2.join(configDir, data.compilerOptions.baseUrl);
|
|
387
390
|
let extendsFiles = [];
|
|
388
391
|
if (data.extends) {
|
|
389
392
|
const extendsList = Array.isArray(data.extends) ? data.extends : [data.extends];
|