@powerlines/plugin-content-collections 0.1.121 → 0.1.122

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.
Files changed (66) hide show
  1. package/dist/create-emitter-Bk1iruR0.d.cts +29 -0
  2. package/dist/create-emitter-Ccqc-tkP.d.mts +29 -0
  3. package/dist/create-emitter-CdX9SXDY.mjs +32 -0
  4. package/dist/create-emitter-D5ApNfU0.cjs +38 -0
  5. package/dist/create-writer-Bd1D32Qr.d.cts +13 -0
  6. package/dist/create-writer-Du15htg7.mjs +48 -0
  7. package/dist/create-writer-Dz3qETzl.d.mts +13 -0
  8. package/dist/create-writer-gvbqS_Gu.cjs +87 -0
  9. package/dist/helpers/create-emitter.cjs +2 -32
  10. package/dist/helpers/create-emitter.d.cts +1 -28
  11. package/dist/helpers/create-emitter.d.mts +1 -28
  12. package/dist/helpers/create-emitter.mjs +1 -30
  13. package/dist/helpers/create-writer.cjs +2 -40
  14. package/dist/helpers/create-writer.d.cts +2 -12
  15. package/dist/helpers/create-writer.d.mts +2 -12
  16. package/dist/helpers/create-writer.mjs +1 -37
  17. package/dist/helpers/index.cjs +5 -4
  18. package/dist/helpers/index.d.cts +4 -2
  19. package/dist/helpers/index.d.mts +4 -2
  20. package/dist/helpers/index.mjs +3 -2
  21. package/dist/helpers-y2jvHwgF.mjs +1 -0
  22. package/dist/helpers-yB1XkvQI.cjs +0 -0
  23. package/dist/index-BL32-cvv.d.cts +1 -0
  24. package/dist/index-BR1oNnaF.d.cts +1 -0
  25. package/dist/index-Bk0eNZmQ.d.mts +1 -0
  26. package/dist/index-DNLi60D-.d.mts +1 -0
  27. package/dist/index.cjs +45 -12
  28. package/dist/index.d.cts +5 -4
  29. package/dist/index.d.mts +5 -6
  30. package/dist/index.mjs +38 -4
  31. package/dist/plugin-B0q2kj8i.mjs +1 -0
  32. package/dist/plugin-CNYP7gBR.d.cts +1793 -0
  33. package/dist/plugin-Ckx8qAq8.cjs +0 -0
  34. package/dist/plugin-XODpqmNI.d.mts +1793 -0
  35. package/dist/types/index.cjs +2 -0
  36. package/dist/types/index.d.cts +2 -1
  37. package/dist/types/index.d.mts +2 -1
  38. package/dist/types/index.mjs +3 -0
  39. package/dist/types/plugin.cjs +1 -0
  40. package/dist/types/plugin.d.cts +1 -48
  41. package/dist/types/plugin.d.mts +1 -48
  42. package/dist/types/plugin.mjs +2 -0
  43. package/dist/types--fVOUYBq.mjs +1 -0
  44. package/dist/types-a8gm_IaQ.cjs +0 -0
  45. package/package.json +3 -3
  46. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  47. package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -13
  48. package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -12
  49. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -36
  50. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -35
  51. package/dist/powerlines/src/types/build.d.cts +0 -145
  52. package/dist/powerlines/src/types/build.d.mts +0 -145
  53. package/dist/powerlines/src/types/commands.d.cts +0 -8
  54. package/dist/powerlines/src/types/commands.d.mts +0 -8
  55. package/dist/powerlines/src/types/config.d.cts +0 -369
  56. package/dist/powerlines/src/types/config.d.mts +0 -369
  57. package/dist/powerlines/src/types/context.d.cts +0 -403
  58. package/dist/powerlines/src/types/context.d.mts +0 -403
  59. package/dist/powerlines/src/types/fs.d.cts +0 -486
  60. package/dist/powerlines/src/types/fs.d.mts +0 -486
  61. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  62. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  63. package/dist/powerlines/src/types/resolved.d.cts +0 -81
  64. package/dist/powerlines/src/types/resolved.d.mts +0 -81
  65. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  66. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
package/dist/index.cjs CHANGED
@@ -1,16 +1,49 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_paths = require('./powerlines/src/plugin-utils/paths.cjs');
4
- const require_helpers_create_emitter = require('./helpers/create-emitter.cjs');
5
- const require_helpers_create_writer = require('./helpers/create-writer.cjs');
6
- require('./helpers/index.cjs');
2
+ const require_create_writer = require('./create-writer-gvbqS_Gu.cjs');
3
+ const require_create_emitter = require('./create-emitter-D5ApNfU0.cjs');
4
+ require('./helpers-yB1XkvQI.cjs');
5
+ require('./plugin-Ckx8qAq8.cjs');
6
+ require('./types-a8gm_IaQ.cjs');
7
7
  let __content_collections_core = require("@content-collections/core");
8
8
  let __stryke_fs_exists = require("@stryke/fs/exists");
9
9
  let __stryke_path_join = require("@stryke/path/join");
10
10
  let defu = require("defu");
11
- defu = require_rolldown_runtime.__toESM(defu);
11
+ defu = require_create_writer.__toESM(defu);
12
12
  let node_crypto = require("node:crypto");
13
+ let __stryke_path_replace = require("@stryke/path/replace");
13
14
 
15
+ //#region ../powerlines/src/plugin-utils/paths.ts
16
+ /**
17
+ * Replaces tokens in the given path string with their corresponding values from the context.
18
+ *
19
+ * @remarks
20
+ * The following tokens are supported:
21
+ * - `{workspaceRoot}` - The root directory of the workspace.
22
+ * - `{root}` - The root directory of the project (same as `{projectRoot}`).
23
+ * - `{projectRoot}` - The root directory of the project (same as `{root}`).
24
+ * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
25
+ * - `{powerlinesPath}` - The directory where Powerlines is installed.
26
+ * - `{cachePath}` - The environment's directory for cached files.
27
+ * - `{dataPath}` - The environment's directory for data files.
28
+ * - `{logPath}` - The environment's directory for log files.
29
+ * - `{tempPath}` - The environment's directory for temporary files.
30
+ * - `{configPath}` - The environment's directory for configuration files.
31
+ * - `{outputPath}` - The configured output directory for the project.
32
+ * - `{buildPath}` - The configured distribution directory for the project.
33
+ * - `{artifactsPath}` - The configured directory for build artifacts.
34
+ * - `{builtinPath}` - The configured directory for generated built-in plugins.
35
+ * - `{entryPath}` - The configured directory for generated entry files.
36
+ *
37
+ * @param context - The context containing the values for the path tokens.
38
+ * @param path - The path string with tokens to replace.
39
+ * @returns The path string with tokens replaced by their corresponding values from the context.
40
+ */
41
+ function replacePathTokens(context, path) {
42
+ if (!path) return path;
43
+ 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));
44
+ }
45
+
46
+ //#endregion
14
47
  //#region src/index.ts
15
48
  /**
16
49
  * A Powerlines plugin to integrate Content Collections for code generation.
@@ -28,9 +61,9 @@ const plugin = (options) => {
28
61
  }) };
29
62
  },
30
63
  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);
33
- const emitter = require_helpers_create_emitter.createEmitter();
64
+ this.config.contentCollections.configFile ||= replacePathTokens(this, this.config.contentCollections.configFile);
65
+ this.config.contentCollections.outputPath ||= replacePathTokens(this, this.config.contentCollections.outputPath);
66
+ const emitter = require_create_emitter.createEmitter();
34
67
  const readConfiguration = (0, __content_collections_core.createConfigurationReader)();
35
68
  let configuration = {};
36
69
  try {
@@ -47,7 +80,7 @@ const plugin = (options) => {
47
80
  outputDirectory: this.config.contentCollections.outputPath || (0, __stryke_path_join.joinPaths)(this.builtinsPath, "content"),
48
81
  configuration
49
82
  });
50
- context.writer = require_helpers_create_writer.createWriter(this);
83
+ context.writer = require_create_writer.createWriter(this);
51
84
  this.contentCollections = {
52
85
  context,
53
86
  build: async () => (0, __content_collections_core.build)(context),
@@ -62,7 +95,7 @@ const plugin = (options) => {
62
95
  var src_default = plugin;
63
96
 
64
97
  //#endregion
65
- exports.createEmitter = require_helpers_create_emitter.createEmitter;
66
- exports.createWriter = require_helpers_create_writer.createWriter;
98
+ exports.createEmitter = require_create_emitter.createEmitter;
99
+ exports.createWriter = require_create_writer.createWriter;
67
100
  exports.default = src_default;
68
101
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,8 @@
1
- import { createEmitter } from "./helpers/create-emitter.cjs";
2
- import { Plugin } from "./powerlines/src/types/plugin.cjs";
3
- import { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig } from "./types/plugin.cjs";
4
- import { createWriter } from "./helpers/create-writer.cjs";
1
+ import { t as createEmitter } from "./create-emitter-Bk1iruR0.cjs";
2
+ import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, d as Plugin, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "./plugin-CNYP7gBR.cjs";
3
+ import { t as createWriter } from "./create-writer-Bd1D32Qr.cjs";
4
+ import "./index-BR1oNnaF.cjs";
5
+ import "./index-BL32-cvv.cjs";
5
6
 
6
7
  //#region src/index.d.ts
7
8
 
package/dist/index.d.mts CHANGED
@@ -1,9 +1,8 @@
1
- import { createEmitter } from "./helpers/create-emitter.mjs";
2
- import { Plugin } from "./powerlines/src/types/plugin.mjs";
3
- import { ContentCollectionsContext, ContentCollectionsPluginContext, ContentCollectionsPluginOptions, ContentCollectionsPluginResolvedConfig, ContentCollectionsPluginUserConfig, __ΩContentCollectionsContext, __ΩContentCollectionsPluginContext, __ΩContentCollectionsPluginOptions, __ΩContentCollectionsPluginResolvedConfig, __ΩContentCollectionsPluginUserConfig } from "./types/plugin.mjs";
4
- import { createWriter } from "./helpers/create-writer.mjs";
5
- import "./helpers/index.mjs";
6
- import "./types/index.mjs";
1
+ import { t as createEmitter } from "./create-emitter-Ccqc-tkP.mjs";
2
+ import { a as ContentCollectionsPluginUserConfig, c as __ΩContentCollectionsPluginOptions, d as Plugin, i as ContentCollectionsPluginResolvedConfig, l as __ΩContentCollectionsPluginResolvedConfig, n as ContentCollectionsPluginContext, o as __ΩContentCollectionsContext, r as ContentCollectionsPluginOptions, s as __ΩContentCollectionsPluginContext, t as ContentCollectionsContext, u as __ΩContentCollectionsPluginUserConfig } from "./plugin-XODpqmNI.mjs";
3
+ import { t as createWriter } from "./create-writer-Dz3qETzl.mjs";
4
+ import "./index-DNLi60D-.mjs";
5
+ import "./index-Bk0eNZmQ.mjs";
7
6
 
8
7
  //#region src/index.d.ts
9
8
 
package/dist/index.mjs CHANGED
@@ -1,13 +1,47 @@
1
- import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
2
- import { createEmitter } from "./helpers/create-emitter.mjs";
3
- import { createWriter } from "./helpers/create-writer.mjs";
4
- import "./helpers/index.mjs";
1
+ import { t as createEmitter } from "./create-emitter-CdX9SXDY.mjs";
2
+ import { t as createWriter } from "./create-writer-Du15htg7.mjs";
3
+ import "./helpers-y2jvHwgF.mjs";
4
+ import "./plugin-B0q2kj8i.mjs";
5
+ import "./types--fVOUYBq.mjs";
5
6
  import { build, createBuildContext, createConfigurationReader } from "@content-collections/core";
6
7
  import { existsSync } from "@stryke/fs/exists";
7
8
  import { joinPaths } from "@stryke/path/join";
8
9
  import defu from "defu";
9
10
  import { createHash } from "node:crypto";
11
+ import { replacePath } from "@stryke/path/replace";
10
12
 
13
+ //#region ../powerlines/src/plugin-utils/paths.ts
14
+ /**
15
+ * Replaces tokens in the given path string with their corresponding values from the context.
16
+ *
17
+ * @remarks
18
+ * The following tokens are supported:
19
+ * - `{workspaceRoot}` - The root directory of the workspace.
20
+ * - `{root}` - The root directory of the project (same as `{projectRoot}`).
21
+ * - `{projectRoot}` - The root directory of the project (same as `{root}`).
22
+ * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
23
+ * - `{powerlinesPath}` - The directory where Powerlines is installed.
24
+ * - `{cachePath}` - The environment's directory for cached files.
25
+ * - `{dataPath}` - The environment's directory for data files.
26
+ * - `{logPath}` - The environment's directory for log files.
27
+ * - `{tempPath}` - The environment's directory for temporary files.
28
+ * - `{configPath}` - The environment's directory for configuration files.
29
+ * - `{outputPath}` - The configured output directory for the project.
30
+ * - `{buildPath}` - The configured distribution directory for the project.
31
+ * - `{artifactsPath}` - The configured directory for build artifacts.
32
+ * - `{builtinPath}` - The configured directory for generated built-in plugins.
33
+ * - `{entryPath}` - The configured directory for generated entry files.
34
+ *
35
+ * @param context - The context containing the values for the path tokens.
36
+ * @param path - The path string with tokens to replace.
37
+ * @returns The path string with tokens replaced by their corresponding values from the context.
38
+ */
39
+ function replacePathTokens(context, path) {
40
+ if (!path) return path;
41
+ 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));
42
+ }
43
+
44
+ //#endregion
11
45
  //#region src/index.ts
12
46
  /**
13
47
  * A Powerlines plugin to integrate Content Collections for code generation.
@@ -0,0 +1 @@
1
+ export { };