@powerlines/plugin-content-collections 0.1.57 → 0.1.59
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.cjs +1 -0
- package/dist/helpers/create-emitter.cjs +1 -1
- package/dist/helpers/create-emitter.d.cts +28 -1
- package/dist/helpers/create-emitter.d.mts +28 -1
- package/dist/helpers/create-emitter.mjs +1 -1
- package/dist/helpers/create-writer.cjs +6 -1
- package/dist/helpers/create-writer.d.cts +12 -2
- package/dist/helpers/create-writer.d.mts +12 -2
- package/dist/helpers/create-writer.mjs +6 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +2 -4
- package/dist/helpers/index.d.mts +2 -4
- package/dist/helpers/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.d.mts +6 -5
- package/dist/index.mjs +1 -1
- package/dist/powerlines/src/lib/utilities/file-header.cjs +4 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +4 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +1 -0
- package/dist/powerlines/src/types/build.d.cts +139 -0
- package/dist/powerlines/src/types/build.d.mts +139 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +8 -0
- package/dist/powerlines/src/types/config.d.cts +345 -0
- package/dist/powerlines/src/types/config.d.mts +345 -0
- package/dist/powerlines/src/types/context.d.cts +347 -0
- package/dist/powerlines/src/types/context.d.mts +347 -0
- package/dist/powerlines/src/types/fs.d.cts +458 -0
- package/dist/powerlines/src/types/fs.d.mts +458 -0
- package/dist/powerlines/src/types/plugin.d.cts +232 -0
- package/dist/powerlines/src/types/plugin.d.mts +232 -0
- package/dist/powerlines/src/types/resolved.d.cts +81 -0
- package/dist/powerlines/src/types/resolved.d.mts +81 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +48 -1
- package/dist/types/plugin.d.mts +48 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +10 -10
- package/dist/create-emitter-Bk1iruR0.d.cts +0 -29
- package/dist/create-emitter-Ccqc-tkP.d.mts +0 -29
- package/dist/create-emitter-D2D-OWFH.mjs +0 -1
- package/dist/create-emitter-D5prAv7U.cjs +0 -1
- package/dist/create-writer-BUb6uBji.mjs +0 -9
- package/dist/create-writer-BzlzYION.d.cts +0 -13
- package/dist/create-writer-goiWOycc.d.mts +0 -13
- package/dist/create-writer-v6g9eZ0E.cjs +0 -9
- package/dist/helpers-DLqVzgm5.mjs +0 -1
- package/dist/helpers-yB1XkvQI.cjs +0 -0
- package/dist/index-BL32-cvv.d.cts +0 -1
- package/dist/index-BR1oNnaF.d.cts +0 -1
- package/dist/index-Bk0eNZmQ.d.mts +0 -1
- package/dist/index-DNLi60D-.d.mts +0 -1
- package/dist/plugin-BcG58blY.d.mts +0 -1683
- package/dist/plugin-CdWcc0Nu.d.cts +0 -1683
- package/dist/plugin-Ckx8qAq8.cjs +0 -0
- package/dist/plugin-G4qbpIjB.mjs +0 -1
- package/dist/types-CSNCwSXh.mjs +0 -1
- package/dist/types-a8gm_IaQ.cjs +0 -0
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
2
|
+
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
3
|
+
import { UserConfig } from "../powerlines/src/types/config.mjs";
|
|
4
|
+
import { AnyCollection, BuildContext, createInternalBuilder } from "@content-collections/core";
|
|
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
|
|
2
49
|
export { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{};
|
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.59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code using Content Collections.",
|
|
6
6
|
"repository": {
|
|
@@ -123,22 +123,22 @@
|
|
|
123
123
|
],
|
|
124
124
|
"dependencies": {
|
|
125
125
|
"@content-collections/core": "^0.12.0",
|
|
126
|
-
"@stryke/fs": "^0.33.
|
|
127
|
-
"@stryke/string-format": "^0.12.
|
|
128
|
-
"@stryke/path": "^0.22.
|
|
129
|
-
"@stryke/type-checks": "^0.
|
|
130
|
-
"@stryke/types": "^0.10.
|
|
126
|
+
"@stryke/fs": "^0.33.20",
|
|
127
|
+
"@stryke/string-format": "^0.12.24",
|
|
128
|
+
"@stryke/path": "^0.22.11",
|
|
129
|
+
"@stryke/type-checks": "^0.5.9",
|
|
130
|
+
"@stryke/types": "^0.10.23",
|
|
131
131
|
"defu": "^6.1.4",
|
|
132
132
|
"pluralize": "^8.0.0",
|
|
133
|
-
"powerlines": "^0.30.
|
|
133
|
+
"powerlines": "^0.30.10"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@powerlines/nx": "^0.10.
|
|
137
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
136
|
+
"@powerlines/nx": "^0.10.59",
|
|
137
|
+
"@powerlines/plugin-plugin": "^0.12.11",
|
|
138
138
|
"@standard-schema/spec": "^1.0.0",
|
|
139
139
|
"@types/node": "^24.10.1",
|
|
140
140
|
"@types/pluralize": "^0.0.33"
|
|
141
141
|
},
|
|
142
142
|
"publishConfig": { "access": "public" },
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "1fa17406f69248e0a35ca56c09b1f4589e4d49d7"
|
|
144
144
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
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 };
|
|
@@ -1,29 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{EventEmitter as e}from"node:events";function t(){let t=new e;function n(e,n){t.on(e,n)}function r(e,n){t.emit(e,n),typeof n==`object`&&n&&`error`in n&&t.emit(`_error`,{...n,_event:e}),t.emit(`_all`,{...n,_event:e})}return{on:n,emit:r}}export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./create-writer-v6g9eZ0E.cjs`);let t=require(`node:events`);function n(){let e=new t.EventEmitter;function n(t,n){e.on(t,n)}function r(t,n){e.emit(t,n),typeof n==`object`&&n&&`error`in n&&e.emit(`_error`,{...n,_event:t}),e.emit(`_all`,{...n,_event:t})}return{on:n,emit:r}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{serialize as e}from"@content-collections/core";import{joinPaths as t}from"@stryke/path/join-paths";import{kebabCase as n}from"@stryke/string-format/kebab-case";import r from"pluralize";import{titleCase as i}from"@stryke/string-format/title-case";function a(e){return`
|
|
2
|
-
// Generated with ${i(e.config.framework)}
|
|
3
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
4
|
-
`}const o=e=>r(e.charAt(0).toUpperCase()+e.slice(1)),s=e=>`all${o(e)}`,c=r=>({createJavaScriptFile:async e=>r.emitBuiltin(`${a(r)}
|
|
5
|
-
${e.collections.map(({name:e})=>`import ${s(e)} from "./${n(e)}";`).join(`
|
|
6
|
-
`)}
|
|
7
|
-
|
|
8
|
-
export { ${e.collections.map(({name:e})=>s(e)).join(`, `)} };
|
|
9
|
-
`,`content`),createTypeDefinitionFile:async e=>Promise.resolve(),createDataFiles:async i=>{await Promise.all(i.map(async i=>r.config.contentCollections.outputPath?r.fs.write(t(r.config.contentCollections.outputPath,n(i.name)),e(i.documents.map(e=>e.document))):r.emitBuiltin(e(i.documents.map(e=>e.document)),t(`content`,n(i.name)))))}});export{c as t};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { n as ContentCollectionsPluginContext } from "./plugin-CdWcc0Nu.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 };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { n as ContentCollectionsPluginContext } from "./plugin-BcG58blY.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 };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@content-collections/core`),l=require(`@stryke/path/join-paths`),u=require(`@stryke/string-format/kebab-case`),d=require(`pluralize`);d=s(d);let f=require(`@stryke/string-format/title-case`);function p(e){return`
|
|
2
|
-
// Generated with ${(0,f.titleCase)(e.config.framework)}
|
|
3
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
4
|
-
`}const m=e=>(0,d.default)(e.charAt(0).toUpperCase()+e.slice(1)),h=e=>`all${m(e)}`,g=e=>({createJavaScriptFile:async t=>e.emitBuiltin(`${p(e)}
|
|
5
|
-
${t.collections.map(({name:e})=>`import ${h(e)} from "./${(0,u.kebabCase)(e)}";`).join(`
|
|
6
|
-
`)}
|
|
7
|
-
|
|
8
|
-
export { ${t.collections.map(({name:e})=>h(e)).join(`, `)} };
|
|
9
|
-
`,`content`),createTypeDefinitionFile:async e=>Promise.resolve(),createDataFiles:async t=>{await Promise.all(t.map(async t=>e.config.contentCollections.outputPath?e.fs.write((0,l.joinPaths)(e.config.contentCollections.outputPath,(0,u.kebabCase)(t.name)),(0,c.serialize)(t.documents.map(e=>e.document))):e.emitBuiltin((0,c.serialize)(t.documents.map(e=>e.document)),(0,l.joinPaths)(`content`,(0,u.kebabCase)(t.name)))))}});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|