@powerlines/plugin-content-collections 0.1.127 → 0.1.129

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.
@@ -1,10 +1,10 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_file_header = require('../powerlines/src/lib/utilities/file-header.cjs');
3
2
  let __content_collections_core = require("@content-collections/core");
4
3
  let __stryke_path_join_paths = require("@stryke/path/join-paths");
5
4
  let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
6
5
  let pluralize = require("pluralize");
7
6
  pluralize = require_rolldown_runtime.__toESM(pluralize);
7
+ let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
8
8
 
9
9
  //#region src/helpers/create-writer.ts
10
10
  const createConstName = (name) => {
@@ -21,7 +21,7 @@ const createArrayConstName = (name) => {
21
21
  const createWriter = (context) => {
22
22
  return {
23
23
  createJavaScriptFile: async (configuration) => {
24
- return context.emitBuiltin(`${require_file_header.getBaseFileHeader(context)}
24
+ return context.emitBuiltin(`${(0, powerlines_lib_utilities_file_header.getBaseFileHeader)(context)}
25
25
  ${configuration.collections.map(({ name }) => `import ${createArrayConstName(name)} from "./${(0, __stryke_string_format_kebab_case.kebabCase)(name)}";`).join("\n")}
26
26
 
27
27
  export { ${configuration.collections.map(({ name }) => createArrayConstName(name)).join(", ")} };
@@ -1,8 +1,8 @@
1
- import { getBaseFileHeader } from "../powerlines/src/lib/utilities/file-header.mjs";
2
1
  import { serialize } from "@content-collections/core";
3
2
  import { joinPaths } from "@stryke/path/join-paths";
4
3
  import { kebabCase } from "@stryke/string-format/kebab-case";
5
4
  import pluralize from "pluralize";
5
+ import { getBaseFileHeader } from "powerlines/lib/utilities/file-header";
6
6
 
7
7
  //#region src/helpers/create-writer.ts
8
8
  const createConstName = (name) => {
package/dist/index.cjs CHANGED
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_paths = require('./powerlines/src/plugin-utils/paths.cjs');
4
3
  const require_helpers_create_emitter = require('./helpers/create-emitter.cjs');
5
4
  const require_helpers_create_writer = require('./helpers/create-writer.cjs');
6
5
  require('./helpers/index.cjs');
@@ -10,6 +9,7 @@ let __stryke_path_join = require("@stryke/path/join");
10
9
  let defu = require("defu");
11
10
  defu = require_rolldown_runtime.__toESM(defu);
12
11
  let node_crypto = require("node:crypto");
12
+ let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
13
13
 
14
14
  //#region src/index.ts
15
15
  /**
@@ -28,8 +28,8 @@ const plugin = (options) => {
28
28
  }) };
29
29
  },
30
30
  async configResolved() {
31
- this.config.contentCollections.configFile ||= require_paths.replacePathTokens(this, this.config.contentCollections.configFile);
32
- this.config.contentCollections.outputPath ||= require_paths.replacePathTokens(this, this.config.contentCollections.outputPath);
31
+ this.config.contentCollections.configFile ||= (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.contentCollections.configFile);
32
+ this.config.contentCollections.outputPath ||= (0, powerlines_plugin_utils_paths.replacePathTokens)(this, this.config.contentCollections.outputPath);
33
33
  const emitter = require_helpers_create_emitter.createEmitter();
34
34
  const readConfiguration = (0, __content_collections_core.createConfigurationReader)();
35
35
  let configuration = {};
package/dist/index.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
2
1
  import { createEmitter } from "./helpers/create-emitter.mjs";
3
2
  import { createWriter } from "./helpers/create-writer.mjs";
4
3
  import "./helpers/index.mjs";
@@ -7,6 +6,7 @@ import { existsSync } from "@stryke/fs/exists";
7
6
  import { joinPaths } from "@stryke/path/join";
8
7
  import defu from "defu";
9
8
  import { createHash } from "node:crypto";
9
+ import { replacePathTokens } from "powerlines/plugin-utils/paths";
10
10
 
11
11
  //#region src/index.ts
12
12
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-content-collections",
3
- "version": "0.1.127",
3
+ "version": "0.1.129",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code using Content Collections.",
6
6
  "repository": {
@@ -123,22 +123,21 @@
123
123
  ],
124
124
  "dependencies": {
125
125
  "@content-collections/core": "^0.12.0",
126
+ "@standard-schema/spec": "^1.1.0",
126
127
  "@stryke/fs": "^0.33.27",
127
- "@stryke/string-format": "^0.12.30",
128
128
  "@stryke/path": "^0.24.1",
129
+ "@stryke/string-format": "^0.12.30",
129
130
  "@stryke/type-checks": "^0.5.15",
130
131
  "@stryke/types": "^0.10.29",
131
132
  "defu": "^6.1.4",
132
133
  "pluralize": "^8.0.0",
133
- "powerlines": "^0.37.1"
134
+ "powerlines": "^0.37.3"
134
135
  },
135
136
  "devDependencies": {
136
- "@powerlines/nx": "^0.11.57",
137
- "@powerlines/plugin-plugin": "^0.12.79",
138
- "@standard-schema/spec": "^1.1.0",
137
+ "@powerlines/plugin-plugin": "^0.12.81",
139
138
  "@types/node": "^24.10.4",
140
139
  "@types/pluralize": "^0.0.33"
141
140
  },
142
141
  "publishConfig": { "access": "public" },
143
- "gitHead": "de1cf37aba4595c9b10fbe4e26a87f8609d2ad1f"
142
+ "gitHead": "ae9a5afaa497538477b63988242f433b60974623"
144
143
  }
@@ -1,13 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
3
-
4
- //#region ../powerlines/src/lib/utilities/file-header.ts
5
- function getBaseFileHeader(context) {
6
- return `
7
- // Generated with ${(0, __stryke_string_format_title_case.titleCase)(context.config.framework)}
8
- // Note: Do not edit this file manually - it will be overwritten automatically
9
- `;
10
- }
11
-
12
- //#endregion
13
- exports.getBaseFileHeader = getBaseFileHeader;
@@ -1,12 +0,0 @@
1
- import { titleCase } from "@stryke/string-format/title-case";
2
-
3
- //#region ../powerlines/src/lib/utilities/file-header.ts
4
- function getBaseFileHeader(context) {
5
- return `
6
- // Generated with ${titleCase(context.config.framework)}
7
- // Note: Do not edit this file manually - it will be overwritten automatically
8
- `;
9
- }
10
-
11
- //#endregion
12
- export { getBaseFileHeader };
@@ -1,36 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let __stryke_path_replace = require("@stryke/path/replace");
3
-
4
- //#region ../powerlines/src/plugin-utils/paths.ts
5
- /**
6
- * Replaces tokens in the given path string with their corresponding values from the context.
7
- *
8
- * @remarks
9
- * The following tokens are supported:
10
- * - `{workspaceRoot}` - The root directory of the workspace.
11
- * - `{root}` - The root directory of the project (same as `{projectRoot}`).
12
- * - `{projectRoot}` - The root directory of the project (same as `{root}`).
13
- * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
14
- * - `{powerlinesPath}` - The directory where Powerlines is installed.
15
- * - `{cachePath}` - The environment's directory for cached files.
16
- * - `{dataPath}` - The environment's directory for data files.
17
- * - `{logPath}` - The environment's directory for log files.
18
- * - `{tempPath}` - The environment's directory for temporary files.
19
- * - `{configPath}` - The environment's directory for configuration files.
20
- * - `{outputPath}` - The configured output directory for the project.
21
- * - `{buildPath}` - The configured distribution directory for the project.
22
- * - `{artifactsPath}` - The configured directory for build artifacts.
23
- * - `{builtinPath}` - The configured directory for generated built-in plugins.
24
- * - `{entryPath}` - The configured directory for generated entry files.
25
- *
26
- * @param context - The context containing the values for the path tokens.
27
- * @param path - The path string with tokens to replace.
28
- * @returns The path string with tokens replaced by their corresponding values from the context.
29
- */
30
- function replacePathTokens(context, path) {
31
- if (!path) return path;
32
- return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", (0, __stryke_path_replace.replacePath)(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", (0, __stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", (0, __stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot));
33
- }
34
-
35
- //#endregion
36
- exports.replacePathTokens = replacePathTokens;
@@ -1,35 +0,0 @@
1
- import { replacePath } from "@stryke/path/replace";
2
-
3
- //#region ../powerlines/src/plugin-utils/paths.ts
4
- /**
5
- * Replaces tokens in the given path string with their corresponding values from the context.
6
- *
7
- * @remarks
8
- * The following tokens are supported:
9
- * - `{workspaceRoot}` - The root directory of the workspace.
10
- * - `{root}` - The root directory of the project (same as `{projectRoot}`).
11
- * - `{projectRoot}` - The root directory of the project (same as `{root}`).
12
- * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
13
- * - `{powerlinesPath}` - The directory where Powerlines is installed.
14
- * - `{cachePath}` - The environment's directory for cached files.
15
- * - `{dataPath}` - The environment's directory for data files.
16
- * - `{logPath}` - The environment's directory for log files.
17
- * - `{tempPath}` - The environment's directory for temporary files.
18
- * - `{configPath}` - The environment's directory for configuration files.
19
- * - `{outputPath}` - The configured output directory for the project.
20
- * - `{buildPath}` - The configured distribution directory for the project.
21
- * - `{artifactsPath}` - The configured directory for build artifacts.
22
- * - `{builtinPath}` - The configured directory for generated built-in plugins.
23
- * - `{entryPath}` - The configured directory for generated entry files.
24
- *
25
- * @param context - The context containing the values for the path tokens.
26
- * @param path - The path string with tokens to replace.
27
- * @returns The path string with tokens replaced by their corresponding values from the context.
28
- */
29
- function replacePathTokens(context, path) {
30
- if (!path) return path;
31
- return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
32
- }
33
-
34
- //#endregion
35
- export { replacePathTokens };