@powerlines/plugin-content-collections 0.1.238 → 0.1.240
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/create-emitter-9FUdmUDk.cjs +38 -0
- package/dist/create-emitter-Bk1iruR0.d.cts +30 -0
- package/dist/create-emitter-Bk1iruR0.d.cts.map +1 -0
- package/dist/create-emitter-Ccqc-tkP.d.mts +30 -0
- package/dist/create-emitter-Ccqc-tkP.d.mts.map +1 -0
- package/dist/create-emitter-CdX9SXDY.mjs +33 -0
- package/dist/create-emitter-CdX9SXDY.mjs.map +1 -0
- package/dist/create-writer-B1kiqShf.d.mts +14 -0
- package/dist/create-writer-B1kiqShf.d.mts.map +1 -0
- package/dist/create-writer-B2z350kr.cjs +78 -0
- package/dist/create-writer-Bt5X22V1.d.cts +14 -0
- package/dist/create-writer-Bt5X22V1.d.cts.map +1 -0
- package/dist/create-writer-CCVVT4dm.mjs +40 -0
- package/dist/create-writer-CCVVT4dm.mjs.map +1 -0
- package/dist/helpers/create-emitter.cjs +2 -32
- package/dist/helpers/create-emitter.d.cts +1 -28
- package/dist/helpers/create-emitter.d.mts +1 -28
- package/dist/helpers/create-emitter.mjs +1 -30
- package/dist/helpers/create-writer.cjs +2 -40
- package/dist/helpers/create-writer.d.cts +2 -12
- package/dist/helpers/create-writer.d.mts +2 -12
- package/dist/helpers/create-writer.mjs +1 -37
- package/dist/helpers/index.cjs +5 -4
- package/dist/helpers/index.d.cts +4 -2
- package/dist/helpers/index.d.mts +4 -2
- package/dist/helpers/index.mjs +3 -2
- package/dist/helpers-y2jvHwgF.mjs +1 -0
- package/dist/helpers-yB1XkvQI.cjs +0 -0
- package/dist/index-BL32-cvv.d.cts +1 -0
- package/dist/index-BR1oNnaF.d.cts +1 -0
- package/dist/index-Bk0eNZmQ.d.mts +1 -0
- package/dist/index-DNLi60D-.d.mts +1 -0
- package/dist/index.cjs +10 -9
- package/dist/index.d.cts +7 -6
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +7 -6
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -0
- package/dist/plugin-B0q2kj8i.mjs +1 -0
- package/dist/plugin-B8NELjmq.d.mts +50 -0
- package/dist/plugin-B8NELjmq.d.mts.map +1 -0
- package/dist/plugin-Ckx8qAq8.cjs +0 -0
- package/dist/plugin-sUSM5ZDl.d.cts +50 -0
- package/dist/plugin-sUSM5ZDl.d.cts.map +1 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -48
- package/dist/types/plugin.d.mts +1 -48
- package/dist/types/plugin.mjs +2 -0
- package/dist/types--fVOUYBq.mjs +1 -0
- package/dist/types-a8gm_IaQ.cjs +0 -0
- package/package.json +4 -4
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const require_create_writer = require('./create-writer-B2z350kr.cjs');
|
|
2
|
+
let node_events = require("node:events");
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/create-emitter.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create an event emitter with typed events.
|
|
7
|
+
*
|
|
8
|
+
* @returns An event emitter instance with typed event handling.
|
|
9
|
+
*/
|
|
10
|
+
function createEmitter() {
|
|
11
|
+
const emitter = new node_events.EventEmitter();
|
|
12
|
+
function on(key, listener) {
|
|
13
|
+
emitter.on(key, listener);
|
|
14
|
+
}
|
|
15
|
+
function emit(key, event) {
|
|
16
|
+
emitter.emit(key, event);
|
|
17
|
+
if (typeof event === "object" && event !== null && "error" in event) emitter.emit("_error", {
|
|
18
|
+
...event,
|
|
19
|
+
_event: key
|
|
20
|
+
});
|
|
21
|
+
emitter.emit("_all", {
|
|
22
|
+
...event,
|
|
23
|
+
_event: key
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
on,
|
|
28
|
+
emit
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
Object.defineProperty(exports, 'createEmitter', {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return createEmitter;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/helpers/create-emitter.d.ts
|
|
2
|
+
type EventMap = Record<string, object>;
|
|
3
|
+
interface EventWithError {
|
|
4
|
+
error: Error;
|
|
5
|
+
}
|
|
6
|
+
interface SystemEvent {
|
|
7
|
+
_event: string;
|
|
8
|
+
}
|
|
9
|
+
type ErrorEvent = EventWithError & SystemEvent;
|
|
10
|
+
interface SystemEvents extends EventMap {
|
|
11
|
+
_error: ErrorEvent;
|
|
12
|
+
_all: SystemEvent;
|
|
13
|
+
}
|
|
14
|
+
type Keys<TEvents extends EventMap> = keyof TEvents & string;
|
|
15
|
+
type Listener<TEvent> = (event: TEvent) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Create an event emitter with typed events.
|
|
18
|
+
*
|
|
19
|
+
* @returns An event emitter instance with typed event handling.
|
|
20
|
+
*/
|
|
21
|
+
declare function createEmitter<TEvents extends EventMap>(): {
|
|
22
|
+
on: {
|
|
23
|
+
<TKey extends Keys<TEvents>>(key: TKey, listener: Listener<TEvents[TKey]>): void;
|
|
24
|
+
<TKey extends Keys<SystemEvents>>(key: TKey, listener: Listener<SystemEvents[TKey]>): void;
|
|
25
|
+
};
|
|
26
|
+
emit: <TKey extends Keys<TEvents>>(key: TKey, event: TEvents[TKey]) => void;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { createEmitter as t };
|
|
30
|
+
//# sourceMappingURL=create-emitter-Bk1iruR0.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-emitter-Bk1iruR0.d.cts","names":[],"sources":["../src/helpers/create-emitter.ts"],"sourcesContent":[],"mappings":";KAoBK,QAAA,GAAW;UAEN,cAAA,CAFG;EAEH,KAAA,EACD,KADC;AACI;AAGO,UAAX,WAAA,CAIK;EAEL,MAAA,EAAA,MAAA;;KAFL,UAAA,GAAa,cAIV,GAJ2B,WAI3B;UAFE,YAAA,SAAqB,QAAA,CAAA;EAAQ,MAAA,EAC7B,UAD6B;EAKlC,IAAA,EAHG,WAGC;AAA0C;AAQnD,KARK,IAQW,CAAA,gBARU,QAQG,CAAA,GAAA,MARe,OAQf,GAAA,MAAA;KAPxB,QAOyC,CAAA,MAAA,CAAA,GAAA,CAAA,KAAA,EAPd,MAOc,EAAA,GAAA,IAAA;;;;;;AAKhC,iBALE,aAKF,CAAA,gBALgC,QAKhC,CAAA,CAAA,CAAA,EAAA;EAGkB,EAAA,EAAA;IAAL,CAAA,aALA,IAKA,CALK,OAKL,CAAA,CAAA,CAAA,GAAA,EAJlB,IAIkB,EAAA,QAAA,EAHb,QAGa,CAHJ,OAGI,CAHI,IAGJ,CAAA,CAAA,CAAA,EAAA,IAAA;IAClB,CAAA,aADkB,IAClB,CADuB,YACvB,CAAA,CAAA,CAAA,GAAA,EAAA,IAAA,EAAA,QAAA,EACK,QADL,CACc,YADd,CAC2B,IAD3B,CAAA,CAAA,CAAA,EAAA,IAAA;EACc,CAAA;EAAa,IAAA,EAAA,CAAA,aAOP,IAPO,CAOF,OAPE,CAAA,CAAA,CAAA,GAAA,EAOa,IAPb,EAAA,KAAA,EAO0B,OAP1B,CAOkC,IAPlC,CAAA,EAAA,GAAA,IAAA;CAAtB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/helpers/create-emitter.d.ts
|
|
2
|
+
type EventMap = Record<string, object>;
|
|
3
|
+
interface EventWithError {
|
|
4
|
+
error: Error;
|
|
5
|
+
}
|
|
6
|
+
interface SystemEvent {
|
|
7
|
+
_event: string;
|
|
8
|
+
}
|
|
9
|
+
type ErrorEvent = EventWithError & SystemEvent;
|
|
10
|
+
interface SystemEvents extends EventMap {
|
|
11
|
+
_error: ErrorEvent;
|
|
12
|
+
_all: SystemEvent;
|
|
13
|
+
}
|
|
14
|
+
type Keys<TEvents extends EventMap> = keyof TEvents & string;
|
|
15
|
+
type Listener<TEvent> = (event: TEvent) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Create an event emitter with typed events.
|
|
18
|
+
*
|
|
19
|
+
* @returns An event emitter instance with typed event handling.
|
|
20
|
+
*/
|
|
21
|
+
declare function createEmitter<TEvents extends EventMap>(): {
|
|
22
|
+
on: {
|
|
23
|
+
<TKey extends Keys<TEvents>>(key: TKey, listener: Listener<TEvents[TKey]>): void;
|
|
24
|
+
<TKey extends Keys<SystemEvents>>(key: TKey, listener: Listener<SystemEvents[TKey]>): void;
|
|
25
|
+
};
|
|
26
|
+
emit: <TKey extends Keys<TEvents>>(key: TKey, event: TEvents[TKey]) => void;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { createEmitter as t };
|
|
30
|
+
//# sourceMappingURL=create-emitter-Ccqc-tkP.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-emitter-Ccqc-tkP.d.mts","names":[],"sources":["../src/helpers/create-emitter.ts"],"sourcesContent":[],"mappings":";KAoBK,QAAA,GAAW;UAEN,cAAA,CAFG;EAEH,KAAA,EACD,KADC;AACI;AAGO,UAAX,WAAA,CAIK;EAEL,MAAA,EAAA,MAAA;;KAFL,UAAA,GAAa,cAIV,GAJ2B,WAI3B;UAFE,YAAA,SAAqB,QAAA,CAAA;EAAQ,MAAA,EAC7B,UAD6B;EAKlC,IAAA,EAHG,WAGC;AAA0C;AAQnD,KARK,IAQW,CAAA,gBARU,QAQG,CAAA,GAAA,MARe,OAQf,GAAA,MAAA;KAPxB,QAOyC,CAAA,MAAA,CAAA,GAAA,CAAA,KAAA,EAPd,MAOc,EAAA,GAAA,IAAA;;;;;;AAKhC,iBALE,aAKF,CAAA,gBALgC,QAKhC,CAAA,CAAA,CAAA,EAAA;EAGkB,EAAA,EAAA;IAAL,CAAA,aALA,IAKA,CALK,OAKL,CAAA,CAAA,CAAA,GAAA,EAJlB,IAIkB,EAAA,QAAA,EAHb,QAGa,CAHJ,OAGI,CAHI,IAGJ,CAAA,CAAA,CAAA,EAAA,IAAA;IAClB,CAAA,aADkB,IAClB,CADuB,YACvB,CAAA,CAAA,CAAA,GAAA,EAAA,IAAA,EAAA,QAAA,EACK,QADL,CACc,YADd,CAC2B,IAD3B,CAAA,CAAA,CAAA,EAAA,IAAA;EACc,CAAA;EAAa,IAAA,EAAA,CAAA,aAOP,IAPO,CAOF,OAPE,CAAA,CAAA,CAAA,GAAA,EAOa,IAPb,EAAA,KAAA,EAO0B,OAP1B,CAOkC,IAPlC,CAAA,EAAA,GAAA,IAAA;CAAtB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/create-emitter.ts
|
|
4
|
+
/**
|
|
5
|
+
* Create an event emitter with typed events.
|
|
6
|
+
*
|
|
7
|
+
* @returns An event emitter instance with typed event handling.
|
|
8
|
+
*/
|
|
9
|
+
function createEmitter() {
|
|
10
|
+
const emitter = new EventEmitter();
|
|
11
|
+
function on(key, listener) {
|
|
12
|
+
emitter.on(key, listener);
|
|
13
|
+
}
|
|
14
|
+
function emit(key, event) {
|
|
15
|
+
emitter.emit(key, event);
|
|
16
|
+
if (typeof event === "object" && event !== null && "error" in event) emitter.emit("_error", {
|
|
17
|
+
...event,
|
|
18
|
+
_event: key
|
|
19
|
+
});
|
|
20
|
+
emitter.emit("_all", {
|
|
21
|
+
...event,
|
|
22
|
+
_event: key
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
on,
|
|
27
|
+
emit
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { createEmitter as t };
|
|
33
|
+
//# sourceMappingURL=create-emitter-CdX9SXDY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-emitter-CdX9SXDY.mjs","names":[],"sources":["../src/helpers/create-emitter.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EventEmitter } from \"node:events\";\n\ntype EventMap = Record<string, object>;\n\ninterface EventWithError {\n error: Error;\n}\n\ninterface SystemEvent {\n _event: string;\n}\n\ntype ErrorEvent = EventWithError & SystemEvent;\n\ninterface SystemEvents extends EventMap {\n _error: ErrorEvent;\n _all: SystemEvent;\n}\n\ntype Keys<TEvents extends EventMap> = keyof TEvents & string;\ntype Listener<TEvent> = (event: TEvent) => void;\n\n/**\n * Create an event emitter with typed events.\n *\n * @returns An event emitter instance with typed event handling.\n */\nexport function createEmitter<TEvents extends EventMap>() {\n const emitter = new EventEmitter();\n\n function on<TKey extends Keys<TEvents>>(\n key: TKey,\n listener: Listener<TEvents[TKey]>\n ): void;\n\n function on<TKey extends Keys<SystemEvents>>(\n key: TKey,\n listener: Listener<SystemEvents[TKey]>\n ): void;\n\n function on(key: string, listener: Listener<any>) {\n emitter.on(key, listener);\n }\n\n function emit<TKey extends Keys<TEvents>>(key: TKey, event: TEvents[TKey]) {\n emitter.emit(key, event);\n\n if (typeof event === \"object\" && event !== null && \"error\" in event) {\n emitter.emit(\"_error\", {\n ...event,\n _event: key\n });\n }\n\n emitter.emit(\"_all\", {\n ...event,\n _event: key\n });\n }\n\n return {\n on,\n emit\n };\n}\n"],"mappings":";;;;;;;;AA6CA,SAAgB,gBAA0C;CACxD,MAAM,UAAU,IAAI,cAAc;CAYlC,SAAS,GAAG,KAAa,UAAyB;AAChD,UAAQ,GAAG,KAAK,SAAS;;CAG3B,SAAS,KAAiC,KAAW,OAAsB;AACzE,UAAQ,KAAK,KAAK,MAAM;AAExB,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,WAAW,MAC5D,SAAQ,KAAK,UAAU;GACrB,GAAG;GACH,QAAQ;GACT,CAAC;AAGJ,UAAQ,KAAK,QAAQ;GACnB,GAAG;GACH,QAAQ;GACT,CAAC;;AAGJ,QAAO;EACL;EACA;EACD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as ContentCollectionsPluginContext } from "./plugin-B8NELjmq.mjs";
|
|
2
|
+
import { Writer } from "@content-collections/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/create-writer.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param context - The Powerlines build plugin
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
declare const createWriter: (context: ContentCollectionsPluginContext) => Writer;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { createWriter as t };
|
|
14
|
+
//# sourceMappingURL=create-writer-B1kiqShf.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-writer-B1kiqShf.d.mts","names":[],"sources":["../src/helpers/create-writer.ts"],"sourcesContent":[],"mappings":";;;;;;;AA4CA;;;cAAa,wBACF,oCACR"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
let __content_collections_core = require("@content-collections/core");
|
|
29
|
+
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
30
|
+
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
31
|
+
let pluralize = require("pluralize");
|
|
32
|
+
pluralize = __toESM(pluralize);
|
|
33
|
+
let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
|
|
34
|
+
|
|
35
|
+
//#region src/helpers/create-writer.ts
|
|
36
|
+
const createConstName = (name) => {
|
|
37
|
+
return (0, pluralize.default)(name.charAt(0).toUpperCase() + name.slice(1));
|
|
38
|
+
};
|
|
39
|
+
const createArrayConstName = (name) => {
|
|
40
|
+
return `all${createConstName(name)}`;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param context - The Powerlines build plugin
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
const createWriter = (context) => {
|
|
48
|
+
return {
|
|
49
|
+
createJavaScriptFile: async (configuration) => {
|
|
50
|
+
return context.emitBuiltin(`${(0, powerlines_lib_utilities_file_header.getBaseFileHeader)(context)}
|
|
51
|
+
${configuration.collections.map(({ name }) => `import ${createArrayConstName(name)} from "./${(0, __stryke_string_format_kebab_case.kebabCase)(name)}";`).join("\n")}
|
|
52
|
+
|
|
53
|
+
export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
|
|
54
|
+
`, "content");
|
|
55
|
+
},
|
|
56
|
+
createTypeDefinitionFile: async (_) => Promise.resolve(),
|
|
57
|
+
createDataFiles: async (collections) => {
|
|
58
|
+
await Promise.all(collections.map(async (collection) => {
|
|
59
|
+
if (context.config.contentCollections.outputPath) return context.fs.write((0, __stryke_path_join_paths.joinPaths)(context.config.contentCollections.outputPath, (0, __stryke_string_format_kebab_case.kebabCase)(collection.name)), (0, __content_collections_core.serialize)(collection.documents.map((doc) => doc.document)));
|
|
60
|
+
return context.emitBuiltin((0, __content_collections_core.serialize)(collection.documents.map((doc) => doc.document)), (0, __stryke_path_join_paths.joinPaths)("content", (0, __stryke_string_format_kebab_case.kebabCase)(collection.name)));
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
Object.defineProperty(exports, '__toESM', {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return __toESM;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, 'createWriter', {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () {
|
|
76
|
+
return createWriter;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as ContentCollectionsPluginContext } from "./plugin-sUSM5ZDl.cjs";
|
|
2
|
+
import { Writer } from "@content-collections/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/create-writer.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param context - The Powerlines build plugin
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
declare const createWriter: (context: ContentCollectionsPluginContext) => Writer;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { createWriter as t };
|
|
14
|
+
//# sourceMappingURL=create-writer-Bt5X22V1.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-writer-Bt5X22V1.d.cts","names":[],"sources":["../src/helpers/create-writer.ts"],"sourcesContent":[],"mappings":";;;;;;;AA4CA;;;cAAa,wBACF,oCACR"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { serialize } from "@content-collections/core";
|
|
2
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
3
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
4
|
+
import pluralize from "pluralize";
|
|
5
|
+
import { getBaseFileHeader } from "powerlines/lib/utilities/file-header";
|
|
6
|
+
|
|
7
|
+
//#region src/helpers/create-writer.ts
|
|
8
|
+
const createConstName = (name) => {
|
|
9
|
+
return pluralize(name.charAt(0).toUpperCase() + name.slice(1));
|
|
10
|
+
};
|
|
11
|
+
const createArrayConstName = (name) => {
|
|
12
|
+
return `all${createConstName(name)}`;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param context - The Powerlines build plugin
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
const createWriter = (context) => {
|
|
20
|
+
return {
|
|
21
|
+
createJavaScriptFile: async (configuration) => {
|
|
22
|
+
return context.emitBuiltin(`${getBaseFileHeader(context)}
|
|
23
|
+
${configuration.collections.map(({ name }) => `import ${createArrayConstName(name)} from "./${kebabCase(name)}";`).join("\n")}
|
|
24
|
+
|
|
25
|
+
export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
|
|
26
|
+
`, "content");
|
|
27
|
+
},
|
|
28
|
+
createTypeDefinitionFile: async (_) => Promise.resolve(),
|
|
29
|
+
createDataFiles: async (collections) => {
|
|
30
|
+
await Promise.all(collections.map(async (collection) => {
|
|
31
|
+
if (context.config.contentCollections.outputPath) return context.fs.write(joinPaths(context.config.contentCollections.outputPath, kebabCase(collection.name)), serialize(collection.documents.map((doc) => doc.document)));
|
|
32
|
+
return context.emitBuiltin(serialize(collection.documents.map((doc) => doc.document)), joinPaths("content", kebabCase(collection.name)));
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { createWriter as t };
|
|
40
|
+
//# sourceMappingURL=create-writer-CCVVT4dm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-writer-CCVVT4dm.mjs","names":[],"sources":["../src/helpers/create-writer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n DataFileCollection,\n JavaScriptFileConfiguration,\n serialize,\n TypeDefinitionFileConfiguration,\n Writer\n} from \"@content-collections/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport pluralize from \"pluralize\";\nimport { getBaseFileHeader } from \"powerlines/lib/utilities/file-header\";\nimport { ContentCollectionsPluginContext } from \"../types/plugin\";\n\nconst createConstName = (name: string) => {\n return pluralize(name.charAt(0).toUpperCase() + name.slice(1));\n};\n\nconst createArrayConstName = (name: string) => {\n return `all${createConstName(name)}`;\n};\n\n/**\n *\n * @param context - The Powerlines build plugin\n * @returns\n */\nexport const createWriter = (\n context: ContentCollectionsPluginContext\n): Writer => {\n return {\n createJavaScriptFile: async (\n configuration: JavaScriptFileConfiguration\n ) => {\n return context.emitBuiltin(\n `${getBaseFileHeader(context)}\n${configuration.collections\n .map(\n ({ name }) =>\n `import ${createArrayConstName(name)} from \"./${kebabCase(name)}\";`\n )\n .join(\"\\n\")}\n\nexport { ${configuration.collections\n .map(({ name }) => createArrayConstName(name))\n .join(\", \")} };\n`,\n \"content\"\n );\n },\n createTypeDefinitionFile: async (_: TypeDefinitionFileConfiguration) =>\n Promise.resolve(),\n createDataFiles: async (collections: Array<DataFileCollection>) => {\n await Promise.all(\n collections.map(async collection => {\n if (context.config.contentCollections.outputPath) {\n return context.fs.write(\n joinPaths(\n context.config.contentCollections.outputPath,\n kebabCase(collection.name)\n ),\n serialize(collection.documents.map(doc => doc.document))\n );\n }\n\n return context.emitBuiltin(\n serialize(collection.documents.map(doc => doc.document)),\n joinPaths(\"content\", kebabCase(collection.name))\n );\n })\n );\n }\n };\n};\n"],"mappings":";;;;;;;AA+BA,MAAM,mBAAmB,SAAiB;AACxC,QAAO,UAAU,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC;;AAGhE,MAAM,wBAAwB,SAAiB;AAC7C,QAAO,MAAM,gBAAgB,KAAK;;;;;;;AAQpC,MAAa,gBACX,YACW;AACX,QAAO;EACL,sBAAsB,OACpB,kBACG;AACH,UAAO,QAAQ,YACb,GAAG,kBAAkB,QAAQ,CAAC;EACpC,cAAc,YACb,KACE,EAAE,WACD,UAAU,qBAAqB,KAAK,CAAC,WAAW,UAAU,KAAK,CAAC,IACnE,CACA,KAAK,KAAK,CAAC;;WAEH,cAAc,YACd,KAAK,EAAE,WAAW,qBAAqB,KAAK,CAAC,CAC7C,KAAK,KAAK,CAAC;GAEd,UACD;;EAEH,0BAA0B,OAAO,MAC/B,QAAQ,SAAS;EACnB,iBAAiB,OAAO,gBAA2C;AACjE,SAAM,QAAQ,IACZ,YAAY,IAAI,OAAM,eAAc;AAClC,QAAI,QAAQ,OAAO,mBAAmB,WACpC,QAAO,QAAQ,GAAG,MAChB,UACE,QAAQ,OAAO,mBAAmB,YAClC,UAAU,WAAW,KAAK,CAC3B,EACD,UAAU,WAAW,UAAU,KAAI,QAAO,IAAI,SAAS,CAAC,CACzD;AAGH,WAAO,QAAQ,YACb,UAAU,WAAW,UAAU,KAAI,QAAO,IAAI,SAAS,CAAC,EACxD,UAAU,WAAW,UAAU,WAAW,KAAK,CAAC,CACjD;KACD,CACH;;EAEJ"}
|
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
let node_events = require("node:events");
|
|
1
|
+
const require_create_emitter = require('../create-emitter-9FUdmUDk.cjs');
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Create an event emitter with typed events.
|
|
7
|
-
*
|
|
8
|
-
* @returns An event emitter instance with typed event handling.
|
|
9
|
-
*/
|
|
10
|
-
function createEmitter() {
|
|
11
|
-
const emitter = new node_events.EventEmitter();
|
|
12
|
-
function on(key, listener) {
|
|
13
|
-
emitter.on(key, listener);
|
|
14
|
-
}
|
|
15
|
-
function emit(key, event) {
|
|
16
|
-
emitter.emit(key, event);
|
|
17
|
-
if (typeof event === "object" && event !== null && "error" in event) emitter.emit("_error", {
|
|
18
|
-
...event,
|
|
19
|
-
_event: key
|
|
20
|
-
});
|
|
21
|
-
emitter.emit("_all", {
|
|
22
|
-
...event,
|
|
23
|
-
_event: key
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
on,
|
|
28
|
-
emit
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.createEmitter = createEmitter;
|
|
3
|
+
exports.createEmitter = require_create_emitter.createEmitter;
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type EventMap = Record<string, object>;
|
|
3
|
-
interface EventWithError {
|
|
4
|
-
error: Error;
|
|
5
|
-
}
|
|
6
|
-
interface SystemEvent {
|
|
7
|
-
_event: string;
|
|
8
|
-
}
|
|
9
|
-
type ErrorEvent = EventWithError & SystemEvent;
|
|
10
|
-
interface SystemEvents extends EventMap {
|
|
11
|
-
_error: ErrorEvent;
|
|
12
|
-
_all: SystemEvent;
|
|
13
|
-
}
|
|
14
|
-
type Keys<TEvents extends EventMap> = keyof TEvents & string;
|
|
15
|
-
type Listener<TEvent> = (event: TEvent) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Create an event emitter with typed events.
|
|
18
|
-
*
|
|
19
|
-
* @returns An event emitter instance with typed event handling.
|
|
20
|
-
*/
|
|
21
|
-
declare function createEmitter<TEvents extends EventMap>(): {
|
|
22
|
-
on: {
|
|
23
|
-
<TKey extends Keys<TEvents>>(key: TKey, listener: Listener<TEvents[TKey]>): void;
|
|
24
|
-
<TKey extends Keys<SystemEvents>>(key: TKey, listener: Listener<SystemEvents[TKey]>): void;
|
|
25
|
-
};
|
|
26
|
-
emit: <TKey extends Keys<TEvents>>(key: TKey, event: TEvents[TKey]) => void;
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
1
|
+
import { t as createEmitter } from "../create-emitter-Bk1iruR0.cjs";
|
|
29
2
|
export { createEmitter };
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
type EventMap = Record<string, object>;
|
|
3
|
-
interface EventWithError {
|
|
4
|
-
error: Error;
|
|
5
|
-
}
|
|
6
|
-
interface SystemEvent {
|
|
7
|
-
_event: string;
|
|
8
|
-
}
|
|
9
|
-
type ErrorEvent = EventWithError & SystemEvent;
|
|
10
|
-
interface SystemEvents extends EventMap {
|
|
11
|
-
_error: ErrorEvent;
|
|
12
|
-
_all: SystemEvent;
|
|
13
|
-
}
|
|
14
|
-
type Keys<TEvents extends EventMap> = keyof TEvents & string;
|
|
15
|
-
type Listener<TEvent> = (event: TEvent) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Create an event emitter with typed events.
|
|
18
|
-
*
|
|
19
|
-
* @returns An event emitter instance with typed event handling.
|
|
20
|
-
*/
|
|
21
|
-
declare function createEmitter<TEvents extends EventMap>(): {
|
|
22
|
-
on: {
|
|
23
|
-
<TKey extends Keys<TEvents>>(key: TKey, listener: Listener<TEvents[TKey]>): void;
|
|
24
|
-
<TKey extends Keys<SystemEvents>>(key: TKey, listener: Listener<SystemEvents[TKey]>): void;
|
|
25
|
-
};
|
|
26
|
-
emit: <TKey extends Keys<TEvents>>(key: TKey, event: TEvents[TKey]) => void;
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
1
|
+
import { t as createEmitter } from "../create-emitter-Ccqc-tkP.mjs";
|
|
29
2
|
export { createEmitter };
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as createEmitter } from "../create-emitter-CdX9SXDY.mjs";
|
|
2
2
|
|
|
3
|
-
//#region src/helpers/create-emitter.ts
|
|
4
|
-
/**
|
|
5
|
-
* Create an event emitter with typed events.
|
|
6
|
-
*
|
|
7
|
-
* @returns An event emitter instance with typed event handling.
|
|
8
|
-
*/
|
|
9
|
-
function createEmitter() {
|
|
10
|
-
const emitter = new EventEmitter();
|
|
11
|
-
function on(key, listener) {
|
|
12
|
-
emitter.on(key, listener);
|
|
13
|
-
}
|
|
14
|
-
function emit(key, event) {
|
|
15
|
-
emitter.emit(key, event);
|
|
16
|
-
if (typeof event === "object" && event !== null && "error" in event) emitter.emit("_error", {
|
|
17
|
-
...event,
|
|
18
|
-
_event: key
|
|
19
|
-
});
|
|
20
|
-
emitter.emit("_all", {
|
|
21
|
-
...event,
|
|
22
|
-
_event: key
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
on,
|
|
27
|
-
emit
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
3
|
export { createEmitter };
|
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
let __content_collections_core = require("@content-collections/core");
|
|
3
|
-
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
4
|
-
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
5
|
-
let pluralize = require("pluralize");
|
|
6
|
-
pluralize = require_rolldown_runtime.__toESM(pluralize);
|
|
7
|
-
let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
|
|
1
|
+
const require_create_writer = require('../create-writer-B2z350kr.cjs');
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
const createConstName = (name) => {
|
|
11
|
-
return (0, pluralize.default)(name.charAt(0).toUpperCase() + name.slice(1));
|
|
12
|
-
};
|
|
13
|
-
const createArrayConstName = (name) => {
|
|
14
|
-
return `all${createConstName(name)}`;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @param context - The Powerlines build plugin
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
const createWriter = (context) => {
|
|
22
|
-
return {
|
|
23
|
-
createJavaScriptFile: async (configuration) => {
|
|
24
|
-
return context.emitBuiltin(`${(0, powerlines_lib_utilities_file_header.getBaseFileHeader)(context)}
|
|
25
|
-
${configuration.collections.map(({ name }) => `import ${createArrayConstName(name)} from "./${(0, __stryke_string_format_kebab_case.kebabCase)(name)}";`).join("\n")}
|
|
26
|
-
|
|
27
|
-
export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
|
|
28
|
-
`, "content");
|
|
29
|
-
},
|
|
30
|
-
createTypeDefinitionFile: async (_) => Promise.resolve(),
|
|
31
|
-
createDataFiles: async (collections) => {
|
|
32
|
-
await Promise.all(collections.map(async (collection) => {
|
|
33
|
-
if (context.config.contentCollections.outputPath) return context.fs.write((0, __stryke_path_join_paths.joinPaths)(context.config.contentCollections.outputPath, (0, __stryke_string_format_kebab_case.kebabCase)(collection.name)), (0, __content_collections_core.serialize)(collection.documents.map((doc) => doc.document)));
|
|
34
|
-
return context.emitBuiltin((0, __content_collections_core.serialize)(collection.documents.map((doc) => doc.document)), (0, __stryke_path_join_paths.joinPaths)("content", (0, __stryke_string_format_kebab_case.kebabCase)(collection.name)));
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.createWriter = createWriter;
|
|
3
|
+
exports.createWriter = require_create_writer.createWriter;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/create-writer.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param context - The Powerlines build plugin
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
declare const createWriter: (context: ContentCollectionsPluginContext) => Writer;
|
|
12
|
-
//#endregion
|
|
1
|
+
import "../plugin-sUSM5ZDl.cjs";
|
|
2
|
+
import { t as createWriter } from "../create-writer-Bt5X22V1.cjs";
|
|
13
3
|
export { createWriter };
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/create-writer.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param context - The Powerlines build plugin
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
declare const createWriter: (context: ContentCollectionsPluginContext) => Writer;
|
|
12
|
-
//#endregion
|
|
1
|
+
import "../plugin-B8NELjmq.mjs";
|
|
2
|
+
import { t as createWriter } from "../create-writer-B1kiqShf.mjs";
|
|
13
3
|
export { createWriter };
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
3
|
-
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
4
|
-
import pluralize from "pluralize";
|
|
5
|
-
import { getBaseFileHeader } from "powerlines/lib/utilities/file-header";
|
|
1
|
+
import { t as createWriter } from "../create-writer-CCVVT4dm.mjs";
|
|
6
2
|
|
|
7
|
-
//#region src/helpers/create-writer.ts
|
|
8
|
-
const createConstName = (name) => {
|
|
9
|
-
return pluralize(name.charAt(0).toUpperCase() + name.slice(1));
|
|
10
|
-
};
|
|
11
|
-
const createArrayConstName = (name) => {
|
|
12
|
-
return `all${createConstName(name)}`;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @param context - The Powerlines build plugin
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
const createWriter = (context) => {
|
|
20
|
-
return {
|
|
21
|
-
createJavaScriptFile: async (configuration) => {
|
|
22
|
-
return context.emitBuiltin(`${getBaseFileHeader(context)}
|
|
23
|
-
${configuration.collections.map(({ name }) => `import ${createArrayConstName(name)} from "./${kebabCase(name)}";`).join("\n")}
|
|
24
|
-
|
|
25
|
-
export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
|
|
26
|
-
`, "content");
|
|
27
|
-
},
|
|
28
|
-
createTypeDefinitionFile: async (_) => Promise.resolve(),
|
|
29
|
-
createDataFiles: async (collections) => {
|
|
30
|
-
await Promise.all(collections.map(async (collection) => {
|
|
31
|
-
if (context.config.contentCollections.outputPath) return context.fs.write(joinPaths(context.config.contentCollections.outputPath, kebabCase(collection.name)), serialize(collection.documents.map((doc) => doc.document)));
|
|
32
|
-
return context.emitBuiltin(serialize(collection.documents.map((doc) => doc.document)), joinPaths("content", kebabCase(collection.name)));
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
3
|
export { createWriter };
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const require_create_writer = require('../create-writer-B2z350kr.cjs');
|
|
2
|
+
const require_create_emitter = require('../create-emitter-9FUdmUDk.cjs');
|
|
3
|
+
require('../helpers-yB1XkvQI.cjs');
|
|
3
4
|
|
|
4
|
-
exports.createEmitter =
|
|
5
|
-
exports.createWriter =
|
|
5
|
+
exports.createEmitter = require_create_emitter.createEmitter;
|
|
6
|
+
exports.createWriter = require_create_writer.createWriter;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { createEmitter } from "
|
|
2
|
-
import
|
|
1
|
+
import { t as createEmitter } from "../create-emitter-Bk1iruR0.cjs";
|
|
2
|
+
import "../plugin-sUSM5ZDl.cjs";
|
|
3
|
+
import { t as createWriter } from "../create-writer-Bt5X22V1.cjs";
|
|
4
|
+
import "../index-BR1oNnaF.cjs";
|
|
3
5
|
export { createEmitter, createWriter };
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { createEmitter } from "
|
|
2
|
-
import
|
|
1
|
+
import { t as createEmitter } from "../create-emitter-Ccqc-tkP.mjs";
|
|
2
|
+
import "../plugin-B8NELjmq.mjs";
|
|
3
|
+
import { t as createWriter } from "../create-writer-B1kiqShf.mjs";
|
|
4
|
+
import "../index-DNLi60D-.mjs";
|
|
3
5
|
export { createEmitter, createWriter };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createEmitter } from "
|
|
2
|
-
import { createWriter } from "
|
|
1
|
+
import { t as createEmitter } from "../create-emitter-CdX9SXDY.mjs";
|
|
2
|
+
import { t as createWriter } from "../create-writer-CCVVT4dm.mjs";
|
|
3
|
+
import "../helpers-y2jvHwgF.mjs";
|
|
3
4
|
|
|
4
5
|
export { createEmitter, createWriter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
require('./
|
|
2
|
+
const require_create_writer = require('./create-writer-B2z350kr.cjs');
|
|
3
|
+
const require_create_emitter = require('./create-emitter-9FUdmUDk.cjs');
|
|
4
|
+
require('./helpers-yB1XkvQI.cjs');
|
|
5
|
+
require('./plugin-Ckx8qAq8.cjs');
|
|
6
|
+
require('./types-a8gm_IaQ.cjs');
|
|
6
7
|
let __content_collections_core = require("@content-collections/core");
|
|
7
8
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
8
9
|
let __stryke_path_join = require("@stryke/path/join");
|
|
9
10
|
let defu = require("defu");
|
|
10
|
-
defu =
|
|
11
|
+
defu = require_create_writer.__toESM(defu);
|
|
11
12
|
let node_crypto = require("node:crypto");
|
|
12
13
|
let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
|
|
13
14
|
|
|
@@ -30,7 +31,7 @@ const plugin = (options) => {
|
|
|
30
31
|
async configResolved() {
|
|
31
32
|
this.config.contentCollections.configFile ||= (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.contentCollections.configFile);
|
|
32
33
|
this.config.contentCollections.outputPath ||= (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.contentCollections.outputPath);
|
|
33
|
-
const emitter =
|
|
34
|
+
const emitter = require_create_emitter.createEmitter();
|
|
34
35
|
const readConfiguration = (0, __content_collections_core.createConfigurationReader)();
|
|
35
36
|
let configuration = {};
|
|
36
37
|
try {
|
|
@@ -47,7 +48,7 @@ const plugin = (options) => {
|
|
|
47
48
|
outputDirectory: this.config.contentCollections.outputPath || (0, __stryke_path_join.joinPaths)(this.builtinsPath, "content"),
|
|
48
49
|
configuration
|
|
49
50
|
});
|
|
50
|
-
context.writer =
|
|
51
|
+
context.writer = require_create_writer.createWriter(this);
|
|
51
52
|
this.contentCollections = {
|
|
52
53
|
context,
|
|
53
54
|
build: async () => (0, __content_collections_core.build)(context),
|
|
@@ -62,7 +63,7 @@ const plugin = (options) => {
|
|
|
62
63
|
var src_default = plugin;
|
|
63
64
|
|
|
64
65
|
//#endregion
|
|
65
|
-
exports.createEmitter =
|
|
66
|
-
exports.createWriter =
|
|
66
|
+
exports.createEmitter = require_create_emitter.createEmitter;
|
|
67
|
+
exports.createWriter = require_create_writer.createWriter;
|
|
67
68
|
exports.default = src_default;
|
|
68
69
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createEmitter } from "./
|
|
2
|
-
import {
|
|
3
|
-
import { createWriter } from "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
1
|
+
import { t as createEmitter } from "./create-emitter-Bk1iruR0.cjs";
|
|
2
|
+
import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "./plugin-sUSM5ZDl.cjs";
|
|
3
|
+
import { t as createWriter } from "./create-writer-Bt5X22V1.cjs";
|
|
4
|
+
import "./index-BR1oNnaF.cjs";
|
|
5
|
+
import "./index-BL32-cvv.cjs";
|
|
6
6
|
import { Plugin } from "powerlines/types/plugin";
|
|
7
7
|
|
|
8
8
|
//#region src/index.d.ts
|
|
@@ -15,4 +15,5 @@ import { Plugin } from "powerlines/types/plugin";
|
|
|
15
15
|
*/
|
|
16
16
|
declare const plugin: <TContext extends ContentCollectionsPluginContext = ContentCollectionsPluginContext>(options: ContentCollectionsPluginOptions) => Plugin<TContext>;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig, createEmitter, createWriter, plugin as default, plugin };
|
|
18
|
+
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig, createEmitter, createWriter, plugin as default, plugin };
|
|
19
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA+CA;;AAEI,cAFS,MAET,EAAA,CAAA,iBADe,+BACf,GAAA,+BAAA,CAAA,CAAA,OAAA,EAEO,+BAFP,EAAA,GAGD,MAHC,CAGM,QAHN,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createEmitter } from "./
|
|
2
|
-
import {
|
|
3
|
-
import { createWriter } from "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
1
|
+
import { t as createEmitter } from "./create-emitter-Ccqc-tkP.mjs";
|
|
2
|
+
import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "./plugin-B8NELjmq.mjs";
|
|
3
|
+
import { t as createWriter } from "./create-writer-B1kiqShf.mjs";
|
|
4
|
+
import "./index-DNLi60D-.mjs";
|
|
5
|
+
import "./index-Bk0eNZmQ.mjs";
|
|
6
6
|
import { Plugin } from "powerlines/types/plugin";
|
|
7
7
|
|
|
8
8
|
//#region src/index.d.ts
|
|
@@ -15,4 +15,5 @@ import { Plugin } from "powerlines/types/plugin";
|
|
|
15
15
|
*/
|
|
16
16
|
declare const plugin: <TContext extends ContentCollectionsPluginContext = ContentCollectionsPluginContext>(options: ContentCollectionsPluginOptions) => Plugin<TContext>;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig, createEmitter, createWriter, plugin as default, plugin };
|
|
18
|
+
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig, createEmitter, createWriter, plugin as default, plugin };
|
|
19
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA+CA;;AAEI,cAFS,MAET,EAAA,CAAA,iBADe,+BACf,GAAA,+BAAA,CAAA,CAAA,OAAA,EAEO,+BAFP,EAAA,GAGD,MAHC,CAGM,QAHN,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { createEmitter } from "./
|
|
2
|
-
import { createWriter } from "./
|
|
3
|
-
import "./helpers
|
|
1
|
+
import { t as createEmitter } from "./create-emitter-CdX9SXDY.mjs";
|
|
2
|
+
import { t as createWriter } from "./create-writer-CCVVT4dm.mjs";
|
|
3
|
+
import "./helpers-y2jvHwgF.mjs";
|
|
4
|
+
import "./plugin-B0q2kj8i.mjs";
|
|
5
|
+
import "./types--fVOUYBq.mjs";
|
|
4
6
|
import { build, createBuildContext, createConfigurationReader } from "@content-collections/core";
|
|
5
7
|
import { existsSync } from "@stryke/fs/exists";
|
|
6
8
|
import { joinPaths } from "@stryke/path/join";
|
|
@@ -59,4 +61,5 @@ const plugin = (options) => {
|
|
|
59
61
|
var src_default = plugin;
|
|
60
62
|
|
|
61
63
|
//#endregion
|
|
62
|
-
export { createEmitter, createWriter, src_default as default, plugin };
|
|
64
|
+
export { createEmitter, createWriter, src_default as default, plugin };
|
|
65
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n build,\n createBuildContext,\n createConfigurationReader,\n InternalConfiguration\n} from \"@content-collections/core\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport defu from \"defu\";\nimport { createHash } from \"node:crypto\";\nimport { replacePathTokens } from \"powerlines/plugin-utils/paths\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { createEmitter } from \"./helpers/create-emitter\";\nimport { createWriter } from \"./helpers/create-writer\";\nimport {\n ContentCollectionsPluginContext,\n ContentCollectionsPluginOptions,\n ContentCollectionsPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to integrate Content Collections for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends ContentCollectionsPluginContext =\n ContentCollectionsPluginContext\n>(\n options: ContentCollectionsPluginOptions\n): Plugin<TContext> => {\n return {\n name: \"content-collections\",\n config() {\n return {\n contentCollections: defu(options, {\n configFile: \"{projectRoot}/content-collections.ts\",\n collections: []\n })\n } as Partial<ContentCollectionsPluginUserConfig>;\n },\n async configResolved() {\n this.config.contentCollections.configFile ||= replacePathTokens(\n this,\n this.config.contentCollections.configFile\n );\n\n this.config.contentCollections.outputPath ||= replacePathTokens(\n this,\n this.config.contentCollections.outputPath\n );\n\n const emitter = createEmitter();\n const readConfiguration = createConfigurationReader();\n\n let configuration = {} as InternalConfiguration;\n try {\n if (existsSync(this.config.contentCollections.configFile)) {\n configuration = await readConfiguration(\n this.config.contentCollections.configFile,\n {\n configName: \"config.mjs\",\n cacheDir: joinPaths(this.cachePath, \"content-collections\")\n }\n );\n }\n } catch {\n // Do nothing\n }\n\n configuration = defu(configuration ?? {}, this.config.contentCollections);\n configuration.checksum = createHash(\"sha256\")\n .update(JSON.stringify(configuration))\n .digest(\"hex\");\n\n const context = await createBuildContext({\n emitter,\n baseDirectory: joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot\n ),\n outputDirectory:\n this.config.contentCollections.outputPath ||\n joinPaths(this.builtinsPath, \"content\"),\n configuration\n });\n context.writer = createWriter(this);\n\n this.contentCollections = {\n context,\n build: async () => build(context),\n on: emitter.on\n };\n },\n async prepare() {\n return this.contentCollections.build();\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+CA,MAAa,UAIX,YACqB;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,oBAAoB,KAAK,SAAS;IAChC,YAAY;IACZ,aAAa,EAAE;IAChB,CAAC,EACH;;EAEH,MAAM,iBAAiB;AACrB,QAAK,OAAO,mBAAmB,eAAe,kBAC5C,MACA,KAAK,OAAO,mBAAmB,WAChC;AAED,QAAK,OAAO,mBAAmB,eAAe,kBAC5C,MACA,KAAK,OAAO,mBAAmB,WAChC;GAED,MAAM,UAAU,eAAe;GAC/B,MAAM,oBAAoB,2BAA2B;GAErD,IAAI,gBAAgB,EAAE;AACtB,OAAI;AACF,QAAI,WAAW,KAAK,OAAO,mBAAmB,WAAW,CACvD,iBAAgB,MAAM,kBACpB,KAAK,OAAO,mBAAmB,YAC/B;KACE,YAAY;KACZ,UAAU,UAAU,KAAK,WAAW,sBAAsB;KAC3D,CACF;WAEG;AAIR,mBAAgB,KAAK,iBAAiB,EAAE,EAAE,KAAK,OAAO,mBAAmB;AACzE,iBAAc,WAAW,WAAW,SAAS,CAC1C,OAAO,KAAK,UAAU,cAAc,CAAC,CACrC,OAAO,MAAM;GAEhB,MAAM,UAAU,MAAM,mBAAmB;IACvC;IACA,eAAe,UACb,KAAK,gBAAgB,eACrB,KAAK,OAAO,YACb;IACD,iBACE,KAAK,OAAO,mBAAmB,cAC/B,UAAU,KAAK,cAAc,UAAU;IACzC;IACD,CAAC;AACF,WAAQ,SAAS,aAAa,KAAK;AAEnC,QAAK,qBAAqB;IACxB;IACA,OAAO,YAAY,MAAM,QAAQ;IACjC,IAAI,QAAQ;IACb;;EAEH,MAAM,UAAU;AACd,UAAO,KAAK,mBAAmB,OAAO;;EAEzC;;AAGH,kBAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AnyCollection, BuildContext, createInternalBuilder } from "@content-collections/core";
|
|
2
|
+
import { UserConfig } from "powerlines/types/config";
|
|
3
|
+
import { PluginContext } from "powerlines/types/context";
|
|
4
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
5
|
+
|
|
6
|
+
//#region src/types/plugin.d.ts
|
|
7
|
+
type ContentCollectionsContext = Pick<Awaited<ReturnType<typeof createInternalBuilder>>, "build" | "on"> & {
|
|
8
|
+
context: BuildContext;
|
|
9
|
+
};
|
|
10
|
+
interface ContentCollectionsPluginOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The path to a custom Prisma configuration file.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This field allows the use of the "\{projectRoot\}" token to refer to the project's root directory - the value will be replaced with the correct file path by the plugin.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue "\{projectRoot\}/content-collections.ts"
|
|
18
|
+
*/
|
|
19
|
+
configFile?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The list of content collections to include.
|
|
22
|
+
*/
|
|
23
|
+
collections?: AnyCollection[];
|
|
24
|
+
/**
|
|
25
|
+
* The path to the content collection output files generated by the plugin.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* If using the default value, the file can be imported from "powerlines:content/collection-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue "\{builtinPath\}/content"
|
|
31
|
+
*/
|
|
32
|
+
outputPath?: string;
|
|
33
|
+
}
|
|
34
|
+
type ContentCollectionsPluginUserConfig = UserConfig & {
|
|
35
|
+
contentCollections?: ContentCollectionsPluginOptions;
|
|
36
|
+
};
|
|
37
|
+
type ContentCollectionsPluginResolvedConfig = ResolvedConfig & {
|
|
38
|
+
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "outputPath">> & Pick<ContentCollectionsPluginOptions, "outputPath">;
|
|
39
|
+
};
|
|
40
|
+
type ContentCollectionsPluginContext<TResolvedConfig extends ContentCollectionsPluginResolvedConfig = ContentCollectionsPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
41
|
+
contentCollections: ContentCollectionsContext;
|
|
42
|
+
};
|
|
43
|
+
declare type __ΩContentCollectionsContext = any[];
|
|
44
|
+
declare type __ΩContentCollectionsPluginOptions = any[];
|
|
45
|
+
declare type __ΩContentCollectionsPluginUserConfig = any[];
|
|
46
|
+
declare type __ΩContentCollectionsPluginResolvedConfig = any[];
|
|
47
|
+
declare type __ΩContentCollectionsPluginContext = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ContentCollectionsPluginUserConfig as a, __ΩContentCollectionsPluginOptions as c, ContentCollectionsPluginResolvedConfig as i, __ΩContentCollectionsPluginResolvedConfig as l, ContentCollectionsPluginContext as n, __ΩContentCollectionsContext as o, ContentCollectionsPluginOptions as r, __ΩContentCollectionsPluginContext as s, ContentCollectionsContext as t, __ΩContentCollectionsPluginUserConfig as u };
|
|
50
|
+
//# sourceMappingURL=plugin-B8NELjmq.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-B8NELjmq.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KA2BY,yBAAA,GAA4B,KACtC,QAAQ,kBAAkB;WAEb;AAHf,CAAA;AAC4B,UAIX,+BAAA,CAJW;EAAlB;;;;;AAIV;AA2BA;AAIA;EAAqD,UAAA,CAAA,EAAA,MAAA;EAE5C;;;EAEA,WAAA,CAAA,EArBO,aAqBP,EAAA;EAAL;;AAGJ;;;;;;EAI+C,UAAA,CAAA,EAAA,MAAA;;KAfnC,kCAAA,GAAqC;uBAC1B;;KAGX,sCAAA,GAAyC;sBAC/B,SAClB,KAAK,kDAEL,KAAK;;KAGG,wDAER,yCAAyC,0CACzC,cAAc;sBACI"}
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AnyCollection, BuildContext, createInternalBuilder } from "@content-collections/core";
|
|
2
|
+
import { UserConfig } from "powerlines/types/config";
|
|
3
|
+
import { PluginContext } from "powerlines/types/context";
|
|
4
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
5
|
+
|
|
6
|
+
//#region src/types/plugin.d.ts
|
|
7
|
+
type ContentCollectionsContext = Pick<Awaited<ReturnType<typeof createInternalBuilder>>, "build" | "on"> & {
|
|
8
|
+
context: BuildContext;
|
|
9
|
+
};
|
|
10
|
+
interface ContentCollectionsPluginOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The path to a custom Prisma configuration file.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This field allows the use of the "\{projectRoot\}" token to refer to the project's root directory - the value will be replaced with the correct file path by the plugin.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue "\{projectRoot\}/content-collections.ts"
|
|
18
|
+
*/
|
|
19
|
+
configFile?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The list of content collections to include.
|
|
22
|
+
*/
|
|
23
|
+
collections?: AnyCollection[];
|
|
24
|
+
/**
|
|
25
|
+
* The path to the content collection output files generated by the plugin.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* If using the default value, the file can be imported from "powerlines:content/collection-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue "\{builtinPath\}/content"
|
|
31
|
+
*/
|
|
32
|
+
outputPath?: string;
|
|
33
|
+
}
|
|
34
|
+
type ContentCollectionsPluginUserConfig = UserConfig & {
|
|
35
|
+
contentCollections?: ContentCollectionsPluginOptions;
|
|
36
|
+
};
|
|
37
|
+
type ContentCollectionsPluginResolvedConfig = ResolvedConfig & {
|
|
38
|
+
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "outputPath">> & Pick<ContentCollectionsPluginOptions, "outputPath">;
|
|
39
|
+
};
|
|
40
|
+
type ContentCollectionsPluginContext<TResolvedConfig extends ContentCollectionsPluginResolvedConfig = ContentCollectionsPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
41
|
+
contentCollections: ContentCollectionsContext;
|
|
42
|
+
};
|
|
43
|
+
declare type __ΩContentCollectionsContext = any[];
|
|
44
|
+
declare type __ΩContentCollectionsPluginOptions = any[];
|
|
45
|
+
declare type __ΩContentCollectionsPluginUserConfig = any[];
|
|
46
|
+
declare type __ΩContentCollectionsPluginResolvedConfig = any[];
|
|
47
|
+
declare type __ΩContentCollectionsPluginContext = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ContentCollectionsPluginUserConfig as a, __ΩContentCollectionsPluginOptions as c, ContentCollectionsPluginResolvedConfig as i, __ΩContentCollectionsPluginResolvedConfig as l, ContentCollectionsPluginContext as n, __ΩContentCollectionsContext as o, ContentCollectionsPluginOptions as r, __ΩContentCollectionsPluginContext as s, ContentCollectionsContext as t, __ΩContentCollectionsPluginUserConfig as u };
|
|
50
|
+
//# sourceMappingURL=plugin-sUSM5ZDl.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-sUSM5ZDl.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KA2BY,yBAAA,GAA4B,KACtC,QAAQ,kBAAkB;WAEb;AAHf,CAAA;AAC4B,UAIX,+BAAA,CAJW;EAAlB;;;;;AAIV;AA2BA;AAIA;EAAqD,UAAA,CAAA,EAAA,MAAA;EAE5C;;;EAEA,WAAA,CAAA,EArBO,aAqBP,EAAA;EAAL;;AAGJ;;;;;;EAI+C,UAAA,CAAA,EAAA,MAAA;;KAfnC,kCAAA,GAAqC;uBAC1B;;KAGX,sCAAA,GAAyC;sBAC/B,SAClB,KAAK,kDAEL,KAAK;;KAGG,wDAER,yCAAyC,0CACzC,cAAc;sBACI"}
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "../plugin-sUSM5ZDl.cjs";
|
|
2
|
+
import "../index-BL32-cvv.cjs";
|
|
2
3
|
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "../plugin-B8NELjmq.mjs";
|
|
2
|
+
import "../index-Bk0eNZmQ.mjs";
|
|
2
3
|
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-Ckx8qAq8.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,49 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UserConfig } from "powerlines/types/config";
|
|
3
|
-
import { PluginContext } from "powerlines/types/context";
|
|
4
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
type ContentCollectionsContext = Pick<Awaited<ReturnType<typeof createInternalBuilder>>, "build" | "on"> & {
|
|
8
|
-
context: BuildContext;
|
|
9
|
-
};
|
|
10
|
-
interface ContentCollectionsPluginOptions {
|
|
11
|
-
/**
|
|
12
|
-
* The path to a custom Prisma configuration file.
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* This field allows the use of the "\{projectRoot\}" token to refer to the project's root directory - the value will be replaced with the correct file path by the plugin.
|
|
16
|
-
*
|
|
17
|
-
* @defaultValue "\{projectRoot\}/content-collections.ts"
|
|
18
|
-
*/
|
|
19
|
-
configFile?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The list of content collections to include.
|
|
22
|
-
*/
|
|
23
|
-
collections?: AnyCollection[];
|
|
24
|
-
/**
|
|
25
|
-
* The path to the content collection output files generated by the plugin.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* If using the default value, the file can be imported from "powerlines:content/collection-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
29
|
-
*
|
|
30
|
-
* @defaultValue "\{builtinPath\}/content"
|
|
31
|
-
*/
|
|
32
|
-
outputPath?: string;
|
|
33
|
-
}
|
|
34
|
-
type ContentCollectionsPluginUserConfig = UserConfig & {
|
|
35
|
-
contentCollections?: ContentCollectionsPluginOptions;
|
|
36
|
-
};
|
|
37
|
-
type ContentCollectionsPluginResolvedConfig = ResolvedConfig & {
|
|
38
|
-
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "outputPath">> & Pick<ContentCollectionsPluginOptions, "outputPath">;
|
|
39
|
-
};
|
|
40
|
-
type ContentCollectionsPluginContext<TResolvedConfig extends ContentCollectionsPluginResolvedConfig = ContentCollectionsPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
41
|
-
contentCollections: ContentCollectionsContext;
|
|
42
|
-
};
|
|
43
|
-
declare type __ΩContentCollectionsContext = any[];
|
|
44
|
-
declare type __ΩContentCollectionsPluginOptions = any[];
|
|
45
|
-
declare type __ΩContentCollectionsPluginUserConfig = any[];
|
|
46
|
-
declare type __ΩContentCollectionsPluginResolvedConfig = any[];
|
|
47
|
-
declare type __ΩContentCollectionsPluginContext = any[];
|
|
48
|
-
//#endregion
|
|
1
|
+
import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "../plugin-sUSM5ZDl.cjs";
|
|
49
2
|
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,49 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UserConfig } from "powerlines/types/config";
|
|
3
|
-
import { PluginContext } from "powerlines/types/context";
|
|
4
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
type ContentCollectionsContext = Pick<Awaited<ReturnType<typeof createInternalBuilder>>, "build" | "on"> & {
|
|
8
|
-
context: BuildContext;
|
|
9
|
-
};
|
|
10
|
-
interface ContentCollectionsPluginOptions {
|
|
11
|
-
/**
|
|
12
|
-
* The path to a custom Prisma configuration file.
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* This field allows the use of the "\{projectRoot\}" token to refer to the project's root directory - the value will be replaced with the correct file path by the plugin.
|
|
16
|
-
*
|
|
17
|
-
* @defaultValue "\{projectRoot\}/content-collections.ts"
|
|
18
|
-
*/
|
|
19
|
-
configFile?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The list of content collections to include.
|
|
22
|
-
*/
|
|
23
|
-
collections?: AnyCollection[];
|
|
24
|
-
/**
|
|
25
|
-
* The path to the content collection output files generated by the plugin.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* If using the default value, the file can be imported from "powerlines:content/collection-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
29
|
-
*
|
|
30
|
-
* @defaultValue "\{builtinPath\}/content"
|
|
31
|
-
*/
|
|
32
|
-
outputPath?: string;
|
|
33
|
-
}
|
|
34
|
-
type ContentCollectionsPluginUserConfig = UserConfig & {
|
|
35
|
-
contentCollections?: ContentCollectionsPluginOptions;
|
|
36
|
-
};
|
|
37
|
-
type ContentCollectionsPluginResolvedConfig = ResolvedConfig & {
|
|
38
|
-
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "outputPath">> & Pick<ContentCollectionsPluginOptions, "outputPath">;
|
|
39
|
-
};
|
|
40
|
-
type ContentCollectionsPluginContext<TResolvedConfig extends ContentCollectionsPluginResolvedConfig = ContentCollectionsPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
41
|
-
contentCollections: ContentCollectionsContext;
|
|
42
|
-
};
|
|
43
|
-
declare type __ΩContentCollectionsContext = any[];
|
|
44
|
-
declare type __ΩContentCollectionsPluginOptions = any[];
|
|
45
|
-
declare type __ΩContentCollectionsPluginUserConfig = any[];
|
|
46
|
-
declare type __ΩContentCollectionsPluginResolvedConfig = any[];
|
|
47
|
-
declare type __ΩContentCollectionsPluginContext = any[];
|
|
48
|
-
//#endregion
|
|
1
|
+
import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "../plugin-B8NELjmq.mjs";
|
|
49
2
|
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-content-collections",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.240",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code using Content Collections.",
|
|
6
6
|
"repository": {
|
|
@@ -145,14 +145,14 @@
|
|
|
145
145
|
"@stryke/types": "^0.10.36",
|
|
146
146
|
"defu": "^6.1.4",
|
|
147
147
|
"pluralize": "^8.0.0",
|
|
148
|
-
"powerlines": "^0.38.
|
|
148
|
+
"powerlines": "^0.38.7"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
151
|
+
"@powerlines/plugin-plugin": "^0.12.191",
|
|
152
152
|
"@types/node": "^24.10.9",
|
|
153
153
|
"@types/pluralize": "^0.0.33"
|
|
154
154
|
},
|
|
155
155
|
"publishConfig": { "access": "public" },
|
|
156
156
|
"types": "./dist/index.d.cts",
|
|
157
|
-
"gitHead": "
|
|
157
|
+
"gitHead": "d389997536baee28d116675d7916d9bfa5596dce"
|
|
158
158
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
exports.__toESM = __toESM;
|