@powerlines/plugin-content-collections 0.1.378 → 0.1.380

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/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.1.348-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.1.378-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -23,7 +23,7 @@ const createArrayConstName = (name) => {
23
23
  const createWriter = (context) => {
24
24
  return {
25
25
  createJavaScriptFile: async (configuration) => {
26
- return context.emitBuiltin(`${(0, powerlines_utils.getBaseFileHeader)(context)}
26
+ return context.emitBuiltin(`${(0, powerlines_utils.getFileHeader)(context)}
27
27
  ${configuration.collections.map(({ name }) => `import ${createArrayConstName(name)} from "./${(0, _stryke_string_format_kebab_case.kebabCase)(name)}";`).join("\n")}
28
28
 
29
29
  export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
@@ -2,7 +2,7 @@ import { serialize } from "@content-collections/core";
2
2
  import { joinPaths } from "@stryke/path/join-paths";
3
3
  import { kebabCase } from "@stryke/string-format/kebab-case";
4
4
  import pluralize from "pluralize";
5
- import { getBaseFileHeader } from "powerlines/utils";
5
+ import { getFileHeader } from "powerlines/utils";
6
6
 
7
7
  //#region src/helpers/create-writer.ts
8
8
  const createConstName = (name) => {
@@ -20,7 +20,7 @@ const createArrayConstName = (name) => {
20
20
  const createWriter = (context) => {
21
21
  return {
22
22
  createJavaScriptFile: async (configuration) => {
23
- return context.emitBuiltin(`${getBaseFileHeader(context)}
23
+ return context.emitBuiltin(`${getFileHeader(context)}
24
24
  ${configuration.collections.map(({ name }) => `import ${createArrayConstName(name)} from "./${kebabCase(name)}";`).join("\n")}
25
25
 
26
26
  export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
@@ -1 +1 @@
1
- {"version":3,"file":"create-writer.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/utils\";\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 * Creates a Writer instance for emitting files related to content collections.\n *\n * @param context - The Powerlines build plugin\n * @returns A Writer instance for emitting files related to content collections\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;;;;;;;;AASpC,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
+ {"version":3,"file":"create-writer.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 { getFileHeader } from \"powerlines/utils\";\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 * Creates a Writer instance for emitting files related to content collections.\n *\n * @param context - The Powerlines build plugin\n * @returns A Writer instance for emitting files related to content collections\n */\nexport const createWriter = (\n context: ContentCollectionsPluginContext\n): Writer => {\n return {\n createJavaScriptFile: async (\n configuration: JavaScriptFileConfiguration\n ) => {\n return context.emitBuiltin(\n `${getFileHeader(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;;;;;;;;AASpC,MAAa,gBACX,YACW;AACX,QAAO;EACL,sBAAsB,OACpB,kBACG;AACH,UAAO,QAAQ,YACb,GAAG,cAAc,QAAQ,CAAC;EAChC,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-content-collections",
3
- "version": "0.1.378",
3
+ "version": "0.1.380",
4
4
  "private": false,
5
5
  "description": "A Powerlines plugin to generate project code using Content Collections.",
6
6
  "keywords": [
@@ -138,18 +138,18 @@
138
138
  "files": ["dist/**/*"],
139
139
  "dependencies": {
140
140
  "@standard-schema/spec": "^1.1.0",
141
- "@stryke/fs": "^0.33.63",
142
- "@stryke/path": "^0.27.2",
143
- "@stryke/string-format": "^0.17.6",
144
- "@stryke/type-checks": "^0.5.41",
145
- "@stryke/types": "^0.11.1",
141
+ "@stryke/fs": "^0.33.64",
142
+ "@stryke/path": "^0.27.3",
143
+ "@stryke/string-format": "^0.17.7",
144
+ "@stryke/type-checks": "^0.6.0",
145
+ "@stryke/types": "^0.11.2",
146
146
  "defu": "^6.1.4",
147
147
  "pluralize": "^8.0.0",
148
- "powerlines": "^0.42.19"
148
+ "powerlines": "^0.42.21"
149
149
  },
150
150
  "devDependencies": {
151
151
  "@content-collections/core": "^0.12.0",
152
- "@powerlines/plugin-plugin": "^0.12.329",
152
+ "@powerlines/plugin-plugin": "^0.12.331",
153
153
  "@types/node": "^25.5.0",
154
154
  "@types/pluralize": "^0.0.33"
155
155
  },
@@ -158,5 +158,5 @@
158
158
  "@content-collections/core": { "optional": false }
159
159
  },
160
160
  "publishConfig": { "access": "public" },
161
- "gitHead": "d500b0c65a5440cf3a483c6e1b329640dba89568"
161
+ "gitHead": "e4cf83423cc9df85f747265b04d051bdfd4d1156"
162
162
  }
@@ -1,3 +0,0 @@
1
- import "node:module";
2
-
3
- export { };