@powerlines/plugin-content-collections 0.1.302 → 0.1.303
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/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -6,8 +6,8 @@ import "./types/index.cjs";
|
|
|
6
6
|
import { Plugin } from "powerlines";
|
|
7
7
|
|
|
8
8
|
//#region src/index.d.ts
|
|
9
|
-
declare module "powerlines" {
|
|
10
|
-
interface
|
|
9
|
+
declare module "@powerlines/core" {
|
|
10
|
+
interface BaseConfig {
|
|
11
11
|
contentCollections?: ContentCollectionsPluginOptions;
|
|
12
12
|
}
|
|
13
13
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -6,8 +6,8 @@ import "./types/index.mjs";
|
|
|
6
6
|
import { Plugin } from "powerlines";
|
|
7
7
|
|
|
8
8
|
//#region src/index.d.ts
|
|
9
|
-
declare module "powerlines" {
|
|
10
|
-
interface
|
|
9
|
+
declare module "@powerlines/core" {
|
|
10
|
+
interface BaseConfig {
|
|
11
11
|
contentCollections?: ContentCollectionsPluginOptions;
|
|
12
12
|
}
|
|
13
13
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["build"],"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 { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\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\ndeclare module \"powerlines\" {\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["build"],"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 { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\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\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n contentCollections?: ContentCollectionsPluginOptions;\n }\n}\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: \"{root}/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.root\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":";;;;;;;;;;;;;;;;;AAqDA,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,KACb;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,YAAYA,QAAM,QAAQ;IACjC,IAAI,QAAQ;IACb;;EAEH,MAAM,UAAU;AACd,UAAO,KAAK,mBAAmB,OAAO;;EAEzC;;AAGH,kBAAe"}
|
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.303",
|
|
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.39",
|
|
146
146
|
"defu": "^6.1.4",
|
|
147
147
|
"pluralize": "^8.0.0",
|
|
148
|
-
"powerlines": "^0.39.
|
|
148
|
+
"powerlines": "^0.39.11"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
151
|
+
"@powerlines/plugin-plugin": "^0.12.254",
|
|
152
152
|
"@types/node": "^25.3.3",
|
|
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": "e63eb5a0ecd0e5ee3e030388ad1c534b3ecb2136"
|
|
158
158
|
}
|