@powerlines/plugin-content-collections 0.1.535 → 0.1.537

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.
@@ -29,7 +29,7 @@ ${configuration.collections.map(({ name }) => `import ${createArrayConstName(nam
29
29
  export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
30
30
  `, "content");
31
31
  },
32
- createTypeDefinitionFile: async (_) => Promise.resolve(),
32
+ createFileReferenceFile: async (_) => Promise.resolve(),
33
33
  createDataFiles: async (collections) => {
34
34
  await Promise.all(collections.map(async (collection) => {
35
35
  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)));
@@ -26,7 +26,7 @@ ${configuration.collections.map(({ name }) => `import ${createArrayConstName(nam
26
26
  export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
27
27
  `, "content");
28
28
  },
29
- createTypeDefinitionFile: async (_) => Promise.resolve(),
29
+ createFileReferenceFile: async (_) => Promise.resolve(),
30
30
  createDataFiles: async (collections) => {
31
31
  await Promise.all(collections.map(async (collection) => {
32
32
  if (context.config.contentCollections.outputPath) return context.fs.write(joinPaths(context.config.contentCollections.outputPath, kebabCase(collection.name)), serialize(collection.documents.map((doc) => doc.document)));
@@ -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 { 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;CACxC,OAAO,UAAU,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC;AAC/D;AAEA,MAAM,wBAAwB,SAAiB;CAC7C,OAAO,MAAM,gBAAgB,IAAI;AACnC;;;;;;;AAQA,MAAa,gBACX,YACW;CACX,OAAO;EACL,sBAAsB,OACpB,kBACG;GACH,OAAO,QAAQ,YACb,GAAG,cAAc,OAAO,EAAE;EAChC,cAAc,YACb,KACE,EAAE,WACD,UAAU,qBAAqB,IAAI,EAAE,WAAW,UAAU,IAAI,EAAE,GACpE,EACC,KAAK,IAAI,EAAE;;WAEH,cAAc,YACd,KAAK,EAAE,WAAW,qBAAqB,IAAI,CAAC,EAC5C,KAAK,IAAI,EAAE;GAEd,SACF;EACF;EACA,0BAA0B,OAAO,MAC/B,QAAQ,QAAQ;EAClB,iBAAiB,OAAO,gBAA2C;GACjE,MAAM,QAAQ,IACZ,YAAY,IAAI,OAAM,eAAc;IAClC,IAAI,QAAQ,OAAO,mBAAmB,YACpC,OAAO,QAAQ,GAAG,MAChB,UACE,QAAQ,OAAO,mBAAmB,YAClC,UAAU,WAAW,IAAI,CAC3B,GACA,UAAU,WAAW,UAAU,KAAI,QAAO,IAAI,QAAQ,CAAC,CACzD;IAGF,OAAO,QAAQ,YACb,UAAU,WAAW,UAAU,KAAI,QAAO,IAAI,QAAQ,CAAC,GACvD,UAAU,WAAW,UAAU,WAAW,IAAI,CAAC,CACjD;GACF,CAAC,CACH;EACF;CACF;AACF"}
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 FileReferenceFileConfiguration,\n JavaScriptFileConfiguration,\n serialize,\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 createFileReferenceFile: async (_: FileReferenceFileConfiguration) =>\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;CACxC,OAAO,UAAU,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC;AAC/D;AAEA,MAAM,wBAAwB,SAAiB;CAC7C,OAAO,MAAM,gBAAgB,IAAI;AACnC;;;;;;;AAQA,MAAa,gBACX,YACW;CACX,OAAO;EACL,sBAAsB,OACpB,kBACG;GACH,OAAO,QAAQ,YACb,GAAG,cAAc,OAAO,EAAE;EAChC,cAAc,YACb,KACE,EAAE,WACD,UAAU,qBAAqB,IAAI,EAAE,WAAW,UAAU,IAAI,EAAE,GACpE,EACC,KAAK,IAAI,EAAE;;WAEH,cAAc,YACd,KAAK,EAAE,WAAW,qBAAqB,IAAI,CAAC,EAC5C,KAAK,IAAI,EAAE;GAEd,SACF;EACF;EACA,yBAAyB,OAAO,MAC9B,QAAQ,QAAQ;EAClB,iBAAiB,OAAO,gBAA2C;GACjE,MAAM,QAAQ,IACZ,YAAY,IAAI,OAAM,eAAc;IAClC,IAAI,QAAQ,OAAO,mBAAmB,YACpC,OAAO,QAAQ,GAAG,MAChB,UACE,QAAQ,OAAO,mBAAmB,YAClC,UAAU,WAAW,IAAI,CAC3B,GACA,UAAU,WAAW,UAAU,KAAI,QAAO,IAAI,QAAQ,CAAC,CACzD;IAGF,OAAO,QAAQ,YACb,UAAU,WAAW,UAAU,KAAI,QAAO,IAAI,QAAQ,CAAC,GACvD,UAAU,WAAW,UAAU,WAAW,IAAI,CAAC,CACjD;GACF,CAAC,CACH;EACF;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-content-collections",
3
- "version": "0.1.535",
3
+ "version": "0.1.537",
4
4
  "private": false,
5
5
  "description": "A Powerlines plugin to generate project code using Content Collections.",
6
6
  "keywords": [
@@ -75,18 +75,18 @@
75
75
  "files": ["dist/**/*"],
76
76
  "dependencies": {
77
77
  "@standard-schema/spec": "^1.1.0",
78
- "@stryke/fs": "^0.33.77",
79
- "@stryke/path": "^0.29.4",
80
- "@stryke/string-format": "^0.17.19",
81
- "@stryke/type-checks": "^0.6.10",
82
- "@stryke/types": "^0.12.5",
78
+ "@stryke/fs": "^0.33.78",
79
+ "@stryke/path": "^0.29.5",
80
+ "@stryke/string-format": "^0.17.20",
81
+ "@stryke/type-checks": "^0.6.11",
82
+ "@stryke/types": "^0.12.6",
83
83
  "defu": "^6.1.7",
84
84
  "pluralize": "^8.0.0",
85
- "powerlines": "^0.47.74"
85
+ "powerlines": "^0.47.76"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@content-collections/core": "^0.12.0",
89
- "@powerlines/plugin-plugin": "^0.12.486",
89
+ "@powerlines/plugin-plugin": "^0.12.488",
90
90
  "@types/node": "^25.9.1",
91
91
  "@types/pluralize": "^0.0.33"
92
92
  },
@@ -95,5 +95,5 @@
95
95
  "@content-collections/core": { "optional": false }
96
96
  },
97
97
  "publishConfig": { "access": "public" },
98
- "gitHead": "f3fdbd0e76de7d7e057362d235875488f4ee3a04"
98
+ "gitHead": "53c5911f6d02444075c38d2965bb8361ae30f7e5"
99
99
  }