@powerlines/plugin-content-collections 0.1.0 → 0.1.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/helpers/create-writer.cjs +4 -4
- package/dist/helpers/create-writer.d.cts +1 -1
- package/dist/helpers/create-writer.d.ts +1 -1
- package/dist/helpers/create-writer.js +4 -4
- package/dist/helpers/index.d.cts +1 -1
- package/dist/helpers/index.d.ts +1 -1
- package/dist/{index-3C9UezFx.d.cts → index-DUdx3_SO.d.cts} +2 -2
- package/dist/{index-3C9UezFx.d.ts → index-DUdx3_SO.d.ts} +2 -2
- package/dist/src/index.cjs +2 -2
- package/dist/src/index.d.cts +2 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +2 -2
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/package.json +5 -5
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
const p=chunkFBBMZ4NC_cjs.a(
|
|
8
|
-
${r.collections.map(({name:
|
|
7
|
+
const p=chunkFBBMZ4NC_cjs.a(t=>m__default.default(t.charAt(0).toUpperCase()+t.slice(1)),"createConstName"),s=chunkFBBMZ4NC_cjs.a(t=>`all${p(t)}`,"createArrayConstName"),w=chunkFBBMZ4NC_cjs.a(t=>({createJavaScriptFile:chunkFBBMZ4NC_cjs.a(async r=>t.writeBuiltin(`${fileHeader.getBaseFileHeader(t)}
|
|
8
|
+
${r.collections.map(({name:e})=>`import ${s(e)} from "./${kebabCase.kebabCase(e)}";`).join(`
|
|
9
9
|
`)}
|
|
10
10
|
|
|
11
|
-
export { ${r.collections.map(({name:
|
|
12
|
-
`,"content"),"createJavaScriptFile"),createTypeDefinitionFile:chunkFBBMZ4NC_cjs.a(async r=>Promise.resolve(),"createTypeDefinitionFile"),createDataFiles:chunkFBBMZ4NC_cjs.a(async r=>{await Promise.all(r.map(async t
|
|
11
|
+
export { ${r.collections.map(({name:e})=>s(e)).join(", ")} };
|
|
12
|
+
`,"content"),"createJavaScriptFile"),createTypeDefinitionFile:chunkFBBMZ4NC_cjs.a(async r=>Promise.resolve(),"createTypeDefinitionFile"),createDataFiles:chunkFBBMZ4NC_cjs.a(async r=>{await Promise.all(r.map(async e=>t.config.contentCollections.outputPath?t.fs.writeFile(joinPaths.joinPaths(t.config.contentCollections.outputPath,kebabCase.kebabCase(e.name)),core.serialize(e.documents.map(o=>o.document))):t.writeBuiltin(core.serialize(e.documents.map(o=>o.document)),joinPaths.joinPaths("content",kebabCase.kebabCase(e.name)))));},"createDataFiles")}),"createWriter");exports.createWriter=w;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Writer } from '@content-collections/core';
|
|
2
|
-
import { C as ContentCollectionsPluginContext } from '../index-
|
|
2
|
+
import { C as ContentCollectionsPluginContext } from '../index-DUdx3_SO.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Writer } from '@content-collections/core';
|
|
2
|
-
import { C as ContentCollectionsPluginContext } from '../index-
|
|
2
|
+
import { C as ContentCollectionsPluginContext } from '../index-DUdx3_SO.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -4,9 +4,9 @@ import {a}from'../chunk-UCUR73HG.js';import {serialize}from'@content-collections
|
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
const p=a(
|
|
8
|
-
${r.collections.map(({name:
|
|
7
|
+
const p=a(t=>m(t.charAt(0).toUpperCase()+t.slice(1)),"createConstName"),s=a(t=>`all${p(t)}`,"createArrayConstName"),j=a(t=>({createJavaScriptFile:a(async r=>t.writeBuiltin(`${getBaseFileHeader(t)}
|
|
8
|
+
${r.collections.map(({name:e})=>`import ${s(e)} from "./${kebabCase(e)}";`).join(`
|
|
9
9
|
`)}
|
|
10
10
|
|
|
11
|
-
export { ${r.collections.map(({name:
|
|
12
|
-
`,"content"),"createJavaScriptFile"),createTypeDefinitionFile:a(async r=>Promise.resolve(),"createTypeDefinitionFile"),createDataFiles:a(async r=>{await Promise.all(r.map(async t
|
|
11
|
+
export { ${r.collections.map(({name:e})=>s(e)).join(", ")} };
|
|
12
|
+
`,"content"),"createJavaScriptFile"),createTypeDefinitionFile:a(async r=>Promise.resolve(),"createTypeDefinitionFile"),createDataFiles:a(async r=>{await Promise.all(r.map(async e=>t.config.contentCollections.outputPath?t.fs.writeFile(joinPaths(t.config.contentCollections.outputPath,kebabCase(e.name)),serialize(e.documents.map(o=>o.document))):t.writeBuiltin(serialize(e.documents.map(o=>o.document)),joinPaths("content",kebabCase(e.name)))));},"createDataFiles")}),"createWriter");export{j as createWriter};
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createEmitter } from './create-emitter.cjs';
|
|
2
2
|
export { createWriter } from './create-writer.cjs';
|
|
3
3
|
import '@content-collections/core';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-DUdx3_SO.cjs';
|
|
5
5
|
import '@storm-software/build-tools/types';
|
|
6
6
|
import '@storm-software/config-tools/types';
|
|
7
7
|
import '@storm-software/config/types';
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createEmitter } from './create-emitter.js';
|
|
2
2
|
export { createWriter } from './create-writer.js';
|
|
3
3
|
import '@content-collections/core';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-DUdx3_SO.js';
|
|
5
5
|
import '@storm-software/build-tools/types';
|
|
6
6
|
import '@storm-software/config-tools/types';
|
|
7
7
|
import '@storm-software/config/types';
|
|
@@ -1327,13 +1327,13 @@ interface ContentCollectionsPluginOptions {
|
|
|
1327
1327
|
*
|
|
1328
1328
|
* @defaultValue "\{builtinPath\}/content"
|
|
1329
1329
|
*/
|
|
1330
|
-
|
|
1330
|
+
outputPath?: string;
|
|
1331
1331
|
}
|
|
1332
1332
|
type ContentCollectionsPluginUserConfig = UserConfig & {
|
|
1333
1333
|
contentCollections?: ContentCollectionsPluginOptions;
|
|
1334
1334
|
};
|
|
1335
1335
|
type ContentCollectionsPluginResolvedConfig = ResolvedConfig & {
|
|
1336
|
-
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "
|
|
1336
|
+
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "outputPath">> & Pick<ContentCollectionsPluginOptions, "outputPath">;
|
|
1337
1337
|
};
|
|
1338
1338
|
type ContentCollectionsPluginContext<TResolvedConfig extends ContentCollectionsPluginResolvedConfig = ContentCollectionsPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
1339
1339
|
contentCollections: ContentCollectionsContext;
|
|
@@ -1327,13 +1327,13 @@ interface ContentCollectionsPluginOptions {
|
|
|
1327
1327
|
*
|
|
1328
1328
|
* @defaultValue "\{builtinPath\}/content"
|
|
1329
1329
|
*/
|
|
1330
|
-
|
|
1330
|
+
outputPath?: string;
|
|
1331
1331
|
}
|
|
1332
1332
|
type ContentCollectionsPluginUserConfig = UserConfig & {
|
|
1333
1333
|
contentCollections?: ContentCollectionsPluginOptions;
|
|
1334
1334
|
};
|
|
1335
1335
|
type ContentCollectionsPluginResolvedConfig = ResolvedConfig & {
|
|
1336
|
-
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "
|
|
1336
|
+
contentCollections: Required<Omit<ContentCollectionsPluginOptions, "outputPath">> & Pick<ContentCollectionsPluginOptions, "outputPath">;
|
|
1337
1337
|
};
|
|
1338
1338
|
type ContentCollectionsPluginContext<TResolvedConfig extends ContentCollectionsPluginResolvedConfig = ContentCollectionsPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
1339
1339
|
contentCollections: ContentCollectionsContext;
|
package/dist/src/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),core=require('@content-collections/core'),exists=require('@stryke/fs/exists'),join=require('@stryke/path/join'),c=require('defu'),node_crypto=require('node:crypto'),createEmitter=require('./helpers/create-emitter'),createWriter=require('./helpers/create-writer'),helpers=require('./helpers'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var c__default=/*#__PURE__*/_interopDefault(c);/*****************************************
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),core=require('@content-collections/core'),exists=require('@stryke/fs/exists'),join=require('@stryke/path/join'),c=require('defu'),node_crypto=require('node:crypto'),paths=require('powerlines/plugin-utils/paths'),createEmitter=require('./helpers/create-emitter'),createWriter=require('./helpers/create-writer'),helpers=require('./helpers'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var c__default=/*#__PURE__*/_interopDefault(c);/*****************************************
|
|
2
2
|
*
|
|
3
3
|
* ⚡ Built by Storm Software
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const m=chunkFBBMZ4NC_cjs.a(r=>({name:"content-collections",config(){return {contentCollections:c__default.default(r,{configFile:"{projectRoot}/content-collections.ts",collections:[]})}},async configResolved(){this.config.contentCollections.configFile||=paths.replacePathTokens(this,this.config.contentCollections.configFile),this.config.contentCollections.outputPath||=paths.replacePathTokens(this,this.config.contentCollections.outputPath);const e=createEmitter.createEmitter(),s=core.createConfigurationReader();let t={};try{exists.existsSync(this.config.contentCollections.configFile)&&(t=await s(this.config.contentCollections.configFile,{configName:"config.mjs",cacheDir:join.joinPaths(this.cachePath,"content-collections")}));}catch{}t=c__default.default(t??{},this.config.contentCollections),t.checksum=node_crypto.createHash("sha256").update(JSON.stringify(t)).digest("hex");const o=await core.createBuildContext({emitter:e,baseDirectory:join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),outputDirectory:this.config.contentCollections.outputPath||join.joinPaths(this.builtinsPath,"content"),configuration:t});o.writer=createWriter.createWriter(this),this.contentCollections={context:o,build:chunkFBBMZ4NC_cjs.a(async()=>core.build(o),"build"),on:e.on};},async prepare(){return this.contentCollections.build()}}),"plugin");var U=m;exports.default=U;exports.plugin=m;Object.keys(helpers).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return helpers[k]}})});Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
|
package/dist/src/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, P as Plugin } from '../index-
|
|
2
|
-
export { b as ContentCollectionsContext, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-
|
|
1
|
+
import { C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, P as Plugin } from '../index-DUdx3_SO.cjs';
|
|
2
|
+
export { b as ContentCollectionsContext, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-DUdx3_SO.cjs';
|
|
3
3
|
export { createEmitter } from '../helpers/create-emitter.cjs';
|
|
4
4
|
export { createWriter } from '../helpers/create-writer.cjs';
|
|
5
5
|
import '@content-collections/core';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, P as Plugin } from '../index-
|
|
2
|
-
export { b as ContentCollectionsContext, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-
|
|
1
|
+
import { C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, P as Plugin } from '../index-DUdx3_SO.js';
|
|
2
|
+
export { b as ContentCollectionsContext, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-DUdx3_SO.js';
|
|
3
3
|
export { createEmitter } from '../helpers/create-emitter.js';
|
|
4
4
|
export { createWriter } from '../helpers/create-writer.js';
|
|
5
5
|
import '@content-collections/core';
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {a}from'../chunk-UCUR73HG.js';import {createConfigurationReader,createBuildContext,build}from'@content-collections/core';import {existsSync}from'@stryke/fs/exists';import {joinPaths}from'@stryke/path/join';import c from'defu';import {createHash}from'node:crypto';import {createEmitter}from'./helpers/create-emitter';import {createWriter}from'./helpers/create-writer';export*from'./helpers';export*from'./types';/*****************************************
|
|
1
|
+
import {a}from'../chunk-UCUR73HG.js';import {createConfigurationReader,createBuildContext,build}from'@content-collections/core';import {existsSync}from'@stryke/fs/exists';import {joinPaths}from'@stryke/path/join';import c from'defu';import {createHash}from'node:crypto';import {replacePathTokens}from'powerlines/plugin-utils/paths';import {createEmitter}from'./helpers/create-emitter';import {createWriter}from'./helpers/create-writer';export*from'./helpers';export*from'./types';/*****************************************
|
|
2
2
|
*
|
|
3
3
|
* ⚡ Built by Storm Software
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const m=a(r=>({name:"content-collections",config(){return {contentCollections:c(r,{configFile:"{projectRoot}/content-collections.ts",collections:[]})}},async configResolved(){this.config.contentCollections.configFile||=replacePathTokens(this,this.config.contentCollections.configFile),this.config.contentCollections.outputPath||=replacePathTokens(this,this.config.contentCollections.outputPath);const e=createEmitter(),s=createConfigurationReader();let t={};try{existsSync(this.config.contentCollections.configFile)&&(t=await s(this.config.contentCollections.configFile,{configName:"config.mjs",cacheDir:joinPaths(this.cachePath,"content-collections")}));}catch{}t=c(t??{},this.config.contentCollections),t.checksum=createHash("sha256").update(JSON.stringify(t)).digest("hex");const o=await createBuildContext({emitter:e,baseDirectory:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),outputDirectory:this.config.contentCollections.outputPath||joinPaths(this.builtinsPath,"content"),configuration:t});o.writer=createWriter(this),this.contentCollections={context:o,build:a(async()=>build(o),"build"),on:e.on};},async prepare(){return this.contentCollections.build()}}),"plugin");var v=m;export{v as default,m as plugin};
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-
|
|
1
|
+
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-DUdx3_SO.cjs';
|
|
2
2
|
import '@content-collections/core';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-
|
|
1
|
+
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-DUdx3_SO.js';
|
|
2
2
|
import '@content-collections/core';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@content-collections/core';
|
|
2
|
-
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-
|
|
2
|
+
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-DUdx3_SO.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@content-collections/core';
|
|
2
|
-
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-
|
|
2
|
+
export { b as ContentCollectionsContext, C as ContentCollectionsPluginContext, a as ContentCollectionsPluginOptions, d as ContentCollectionsPluginResolvedConfig, c as ContentCollectionsPluginUserConfig } from '../index-DUdx3_SO.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
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.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code using Content Collections.",
|
|
6
6
|
"repository": {
|
|
@@ -112,15 +112,15 @@
|
|
|
112
112
|
"@stryke/types": "^0.10.0",
|
|
113
113
|
"defu": "^6.1.4",
|
|
114
114
|
"pluralize": "^8.0.0",
|
|
115
|
-
"powerlines": "^0.
|
|
115
|
+
"powerlines": "^0.17.0"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
|
-
"@powerlines/nx": "^0.10.
|
|
119
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
118
|
+
"@powerlines/nx": "^0.10.2",
|
|
119
|
+
"@powerlines/plugin-plugin": "^0.11.10",
|
|
120
120
|
"@standard-schema/spec": "^1.0.0",
|
|
121
121
|
"@types/node": "^22.19.0",
|
|
122
122
|
"@types/pluralize": "^0.0.33"
|
|
123
123
|
},
|
|
124
124
|
"publishConfig": { "access": "public" },
|
|
125
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "27064ac269a2d34c5b9371105cdd58bf6ebe85b4"
|
|
126
126
|
}
|