@content-collections/core 0.14.1 → 0.14.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/index.js +11 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import fs2 from "fs";
|
|
|
8
8
|
import path2 from "path";
|
|
9
9
|
import { build } from "esbuild";
|
|
10
10
|
import { createRequire } from "module";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
11
12
|
import matter from "gray-matter";
|
|
12
13
|
import { parse, stringify } from "yaml";
|
|
13
14
|
import camelcase from "camelcase";
|
|
@@ -247,7 +248,7 @@ var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExten
|
|
|
247
248
|
var loadTsConfig = (dir, name) => loadTsConfigInternal(dir, name);
|
|
248
249
|
|
|
249
250
|
//#endregion
|
|
250
|
-
//#region ../../node_modules/.pnpm/bundle-require@5.0.0_esbuild@0.25.
|
|
251
|
+
//#region ../../node_modules/.pnpm/bundle-require@5.0.0_esbuild@0.25.12/node_modules/bundle-require/dist/index.js
|
|
251
252
|
var tsconfigPathsToRegExp = (paths) => {
|
|
252
253
|
return Object.keys(paths || {}).map((key) => {
|
|
253
254
|
return /* @__PURE__ */ new RegExp(`^${key.replace(/\*/, ".*")}$`);
|
|
@@ -272,14 +273,21 @@ const NON_NODE_MODULE_RE = /^[A-Z]:[/\\]|^\.{0,2}\/|^\.{1,2}$/;
|
|
|
272
273
|
function isCoreImport(path$1, kind) {
|
|
273
274
|
return path$1 === "@content-collections/core" && kind === "import-statement";
|
|
274
275
|
}
|
|
276
|
+
function resolveDirname() {
|
|
277
|
+
return dirname(fileURLToPath(import.meta.url));
|
|
278
|
+
}
|
|
279
|
+
function isInternalTest() {
|
|
280
|
+
return process.env.CC_TEST_INDICATOR === "__yes";
|
|
281
|
+
}
|
|
275
282
|
function createExternalsPlugin(configPath) {
|
|
276
283
|
const resolvePatterns = tsconfigPathsToRegExp(tsconfigResolvePaths(configPath));
|
|
284
|
+
const currentDir = resolveDirname();
|
|
277
285
|
return {
|
|
278
286
|
name: "external-packages",
|
|
279
287
|
setup: (build$2) => {
|
|
280
288
|
build$2.onResolve({ filter: /.*/ }, ({ path: path$1, kind }) => {
|
|
281
|
-
if (
|
|
282
|
-
path: join(
|
|
289
|
+
if (isInternalTest() && isCoreImport(path$1, kind)) return {
|
|
290
|
+
path: join(currentDir, "index.ts"),
|
|
283
291
|
external: true
|
|
284
292
|
};
|
|
285
293
|
if (match(path$1, resolvePatterns)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@content-collections/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.2",
|
|
5
5
|
"description": "Core of Content Collections",
|
|
6
6
|
"author": "Sebastian Sdorra <s.sdorra@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"p-limit": "^6.1.0",
|
|
50
50
|
"picomatch": "^4.0.2",
|
|
51
51
|
"pluralize": "^8.0.0",
|
|
52
|
-
"serialize-javascript": "^
|
|
52
|
+
"serialize-javascript": "^7.0.3",
|
|
53
53
|
"tinyglobby": "^0.2.5",
|
|
54
54
|
"yaml": "^2.4.5"
|
|
55
55
|
},
|