@powerlines/plugin-style-dictionary 0.3.123 → 0.3.124

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 (42) hide show
  1. package/dist/index.cjs +10 -10
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.mjs +2 -2
  4. package/dist/{packages/powerlines → powerlines}/src/internal/helpers/hooks.d.mts +2 -0
  5. package/dist/powerlines/src/lib/build/esbuild.cjs +93 -0
  6. package/dist/powerlines/src/lib/build/esbuild.mjs +91 -0
  7. package/dist/powerlines/src/lib/entry.cjs +11 -0
  8. package/dist/powerlines/src/lib/entry.mjs +13 -0
  9. package/dist/powerlines/src/lib/logger.cjs +41 -0
  10. package/dist/powerlines/src/lib/logger.mjs +39 -0
  11. package/dist/powerlines/src/lib/unplugin/helpers.cjs +3 -0
  12. package/dist/powerlines/src/lib/unplugin/helpers.mjs +5 -0
  13. package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +66 -0
  14. package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +65 -0
  15. package/dist/powerlines/src/lib/unplugin/plugin.cjs +46 -0
  16. package/dist/powerlines/src/lib/unplugin/plugin.mjs +45 -0
  17. package/dist/powerlines/src/lib/utilities/bundle.cjs +42 -0
  18. package/dist/powerlines/src/lib/utilities/bundle.mjs +40 -0
  19. package/dist/powerlines/src/lib/utilities/resolve.cjs +50 -0
  20. package/dist/powerlines/src/lib/utilities/resolve.mjs +49 -0
  21. package/dist/powerlines/src/lib/utilities/source-file.cjs +5 -0
  22. package/dist/powerlines/src/lib/utilities/source-file.mjs +6 -0
  23. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  24. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
  25. package/dist/powerlines/src/types/babel.d.mts +2 -0
  26. package/dist/powerlines/src/types/build.cjs +21 -0
  27. package/dist/{packages/powerlines → powerlines}/src/types/build.d.mts +6 -6
  28. package/dist/powerlines/src/types/build.mjs +21 -0
  29. package/dist/{packages/powerlines → powerlines}/src/types/commands.d.mts +1 -0
  30. package/dist/{packages/powerlines → powerlines}/src/types/config.d.mts +2 -2
  31. package/dist/{packages/powerlines → powerlines}/src/types/context.d.mts +2 -2
  32. package/dist/{packages/powerlines → powerlines}/src/types/plugin.d.mts +1 -1
  33. package/dist/{packages/powerlines → powerlines}/src/types/unplugin.d.mts +2 -1
  34. package/dist/types/plugin.d.mts +3 -3
  35. package/package.json +3 -3
  36. package/dist/node_modules/.pnpm/@storm-software_config-tools@1.189.0_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.cjs +0 -16
  37. package/dist/node_modules/.pnpm/@storm-software_config-tools@1.189.0_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.mjs +0 -15
  38. /package/dist/{packages/powerlines → powerlines}/src/types/api.d.mts +0 -0
  39. /package/dist/{packages/powerlines → powerlines}/src/types/fs.d.mts +0 -0
  40. /package/dist/{packages/powerlines → powerlines}/src/types/hooks.d.mts +0 -0
  41. /package/dist/{packages/powerlines → powerlines}/src/types/resolved.d.mts +0 -0
  42. /package/dist/{packages/powerlines → powerlines}/src/types/tsconfig.d.mts +0 -0
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_chunk_POXTJ6GF = require('./node_modules/.pnpm/@storm-software_config-tools@1.189.0_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.cjs');
3
+ const require_resolve = require('./powerlines/src/lib/utilities/resolve.cjs');
4
4
  const require_file_header = require('./style-dictionary/file-header.cjs');
5
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
5
6
  let __stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
6
7
  let defu = require("defu");
7
8
  defu = require_rolldown_runtime.__toESM(defu);
8
- let powerlines_lib_utilities_resolve = require("powerlines/lib/utilities/resolve");
9
9
  let style_dictionary = require("style-dictionary");
10
10
  style_dictionary = require_rolldown_runtime.__toESM(style_dictionary);
11
11
 
@@ -21,7 +21,7 @@ const plugin = (options = {}) => {
21
21
  name: "style-dictionary",
22
22
  config() {
23
23
  return { styleDictionary: (0, defu.default)(options, {
24
- log: { verbosity: this.config.logLevel === require_chunk_POXTJ6GF.LogLevelLabel.TRACE ? "verbose" : this.config.logLevel === require_chunk_POXTJ6GF.LogLevelLabel.DEBUG ? "default" : "silent" },
24
+ log: { verbosity: this.config.logLevel === __storm_software_config_tools_types.LogLevelLabel.TRACE ? "verbose" : this.config.logLevel === __storm_software_config_tools_types.LogLevelLabel.DEBUG ? "default" : "silent" },
25
25
  fileHeader: "powerlines/file-header"
26
26
  }) };
27
27
  },
@@ -31,7 +31,7 @@ const plugin = (options = {}) => {
31
31
  if (this.config.styleDictionary.customActions) {
32
32
  let builder;
33
33
  if ((0, __stryke_type_checks_is_function.isFunction)(this.config.styleDictionary.customActions)) builder = this.config.styleDictionary.customActions;
34
- else builder = await (0, powerlines_lib_utilities_resolve.resolve)(this, this.config.styleDictionary.customActions);
34
+ else builder = await require_resolve.resolve(this, this.config.styleDictionary.customActions);
35
35
  Object.entries((0, __stryke_type_checks_is_function.isFunction)(builder) ? builder(this) : builder).forEach(([name, action]) => {
36
36
  this.styleDictionary.registerAction({
37
37
  ...action,
@@ -42,7 +42,7 @@ const plugin = (options = {}) => {
42
42
  if (this.config.styleDictionary.customFileHeaders) {
43
43
  let builder;
44
44
  if ((0, __stryke_type_checks_is_function.isFunction)(this.config.styleDictionary.customFileHeaders)) builder = this.config.styleDictionary.customFileHeaders;
45
- else builder = await (0, powerlines_lib_utilities_resolve.resolve)(this, this.config.styleDictionary.customFileHeaders);
45
+ else builder = await require_resolve.resolve(this, this.config.styleDictionary.customFileHeaders);
46
46
  Object.entries((0, __stryke_type_checks_is_function.isFunction)(builder) ? builder(this) : builder).forEach(([name, fileHeader$1]) => {
47
47
  this.styleDictionary.registerFileHeader({
48
48
  name,
@@ -53,7 +53,7 @@ const plugin = (options = {}) => {
53
53
  if (this.config.styleDictionary.customFilters) {
54
54
  let builder;
55
55
  if ((0, __stryke_type_checks_is_function.isFunction)(this.config.styleDictionary.customFilters)) builder = this.config.styleDictionary.customFilters;
56
- else builder = await (0, powerlines_lib_utilities_resolve.resolve)(this, this.config.styleDictionary.customFilters);
56
+ else builder = await require_resolve.resolve(this, this.config.styleDictionary.customFilters);
57
57
  Object.entries((0, __stryke_type_checks_is_function.isFunction)(builder) ? builder(this) : builder).forEach(([name, filter]) => {
58
58
  this.styleDictionary.registerFilter({
59
59
  ...filter,
@@ -64,7 +64,7 @@ const plugin = (options = {}) => {
64
64
  if (this.config.styleDictionary.customPreprocessors) {
65
65
  let builder;
66
66
  if ((0, __stryke_type_checks_is_function.isFunction)(this.config.styleDictionary.customPreprocessors)) builder = this.config.styleDictionary.customPreprocessors;
67
- else builder = await (0, powerlines_lib_utilities_resolve.resolve)(this, this.config.styleDictionary.customPreprocessors);
67
+ else builder = await require_resolve.resolve(this, this.config.styleDictionary.customPreprocessors);
68
68
  Object.entries((0, __stryke_type_checks_is_function.isFunction)(builder) ? builder(this) : builder).forEach(([name, preprocessor]) => {
69
69
  this.styleDictionary.registerPreprocessor({
70
70
  ...preprocessor,
@@ -75,7 +75,7 @@ const plugin = (options = {}) => {
75
75
  if (this.config.styleDictionary.customParsers) {
76
76
  let builder;
77
77
  if ((0, __stryke_type_checks_is_function.isFunction)(this.config.styleDictionary.customParsers)) builder = this.config.styleDictionary.customParsers;
78
- else builder = await (0, powerlines_lib_utilities_resolve.resolve)(this, this.config.styleDictionary.customParsers);
78
+ else builder = await require_resolve.resolve(this, this.config.styleDictionary.customParsers);
79
79
  Object.entries((0, __stryke_type_checks_is_function.isFunction)(builder) ? builder(this) : builder).forEach(([name, parser]) => {
80
80
  this.styleDictionary.registerParser({
81
81
  ...parser,
@@ -86,7 +86,7 @@ const plugin = (options = {}) => {
86
86
  if (this.config.styleDictionary.customTransforms) {
87
87
  let builder;
88
88
  if ((0, __stryke_type_checks_is_function.isFunction)(this.config.styleDictionary.customTransforms)) builder = this.config.styleDictionary.customTransforms;
89
- else builder = await (0, powerlines_lib_utilities_resolve.resolve)(this, this.config.styleDictionary.customTransforms);
89
+ else builder = await require_resolve.resolve(this, this.config.styleDictionary.customTransforms);
90
90
  Object.entries((0, __stryke_type_checks_is_function.isFunction)(builder) ? builder(this) : builder).forEach(([name, transform]) => {
91
91
  this.styleDictionary.registerTransform({
92
92
  ...transform,
@@ -97,7 +97,7 @@ const plugin = (options = {}) => {
97
97
  if (this.config.styleDictionary.customTransformGroups) {
98
98
  let builder;
99
99
  if ((0, __stryke_type_checks_is_function.isFunction)(this.config.styleDictionary.customTransformGroups)) builder = this.config.styleDictionary.customTransformGroups;
100
- else builder = await (0, powerlines_lib_utilities_resolve.resolve)(this, this.config.styleDictionary.customTransformGroups);
100
+ else builder = await require_resolve.resolve(this, this.config.styleDictionary.customTransformGroups);
101
101
  Object.entries((0, __stryke_type_checks_is_function.isFunction)(builder) ? builder(this) : builder).forEach(([name, transformGroup]) => {
102
102
  this.styleDictionary.registerTransformGroup({
103
103
  name,
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Plugin } from "./packages/powerlines/src/types/plugin.mjs";
1
+ import { Plugin } from "./powerlines/src/types/plugin.mjs";
2
2
  import { CustomActionsBuilder, CustomFileHeadersBuilder, CustomFiltersBuilder, CustomFormatsBuilder, CustomParsersBuilder, CustomPreprocessorsBuilder, CustomTransformGroupsBuilder, CustomTransformsBuilder, StyleDictionaryPluginContext, StyleDictionaryPluginEnvironmentConfig, StyleDictionaryPluginOptions, StyleDictionaryPluginResolvedConfig, StyleDictionaryPluginUserConfig, __ΩCustomActionsBuilder, __ΩCustomFileHeadersBuilder, __ΩCustomFiltersBuilder, __ΩCustomFormatsBuilder, __ΩCustomParsersBuilder, __ΩCustomPreprocessorsBuilder, __ΩCustomTransformGroupsBuilder, __ΩCustomTransformsBuilder, __ΩStyleDictionaryPluginContext, __ΩStyleDictionaryPluginEnvironmentConfig, __ΩStyleDictionaryPluginOptions, __ΩStyleDictionaryPluginResolvedConfig, __ΩStyleDictionaryPluginUserConfig } from "./types/plugin.mjs";
3
3
  import "./types/index.mjs";
4
4
 
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { LogLevelLabel } from "./node_modules/.pnpm/@storm-software_config-tools@1.189.0_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.mjs";
1
+ import { resolve } from "./powerlines/src/lib/utilities/resolve.mjs";
2
2
  import { fileHeader } from "./style-dictionary/file-header.mjs";
3
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
3
4
  import { isFunction } from "@stryke/type-checks/is-function";
4
5
  import defu from "defu";
5
- import { resolve } from "powerlines/lib/utilities/resolve";
6
6
  import StyleDictionary from "style-dictionary";
7
7
 
8
8
  //#region src/index.ts
@@ -1,3 +1,5 @@
1
+ import "../../types/hooks.mjs";
2
+ import "../../types/resolved.mjs";
1
3
  import { SelectHooksOptions } from "../../types/context.mjs";
2
4
  import { MaybePromise } from "@stryke/types/base";
3
5
 
@@ -0,0 +1,93 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ require('../entry.cjs');
3
+ let defu = require("defu");
4
+ defu = require_rolldown_runtime.__toESM(defu);
5
+ let __stryke_helpers_omit = require("@stryke/helpers/omit");
6
+ let __stryke_path_join_paths = require("@stryke/path/join-paths");
7
+ require("@stryke/path/replace");
8
+ let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
9
+ require("@stryke/type-checks/is-string");
10
+
11
+ //#region ../powerlines/src/lib/build/esbuild.ts
12
+ const DEFAULT_ESBUILD_CONFIG = {
13
+ target: "esnext",
14
+ platform: "neutral",
15
+ format: "esm",
16
+ write: true,
17
+ minify: true,
18
+ sourcemap: false,
19
+ bundle: true,
20
+ treeShaking: true,
21
+ keepNames: true,
22
+ splitting: true,
23
+ logLevel: "silent"
24
+ };
25
+ /**
26
+ * Resolves the esbuild options.
27
+ *
28
+ * @param context - The build context.
29
+ * @returns The resolved esbuild options.
30
+ */
31
+ function extractESBuildConfig(context) {
32
+ const inject = context.config.build.override.inject ?? context.config.build.inject;
33
+ if (inject && Object.keys(inject).length > 0) context.fs.writeSync((0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
34
+ if (value) if (Array.isArray(value)) {
35
+ if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) {
36
+ if (value.length === 1) return `
37
+ import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
38
+ export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
39
+ else if (value.length > 1) return `
40
+ import ${value[1] === "*" ? `* as ${(0, __stryke_string_format_camel_case.camelCase)(key)}` : `{ ${value[1]} as ${(0, __stryke_string_format_camel_case.camelCase)(key)} }`} from "${value[0]}";
41
+ export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
42
+ } else if (value.length === 1) return `
43
+ import ${key} from "${value[0]}";
44
+ export { ${key} };`;
45
+ else if (value.length > 1) return `
46
+ import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
47
+ export { ${key} };`;
48
+ } else if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) return `
49
+ import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
50
+ export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
51
+ else return `
52
+ import ${key} from "${value}";
53
+ export { ${key} };`;
54
+ return "";
55
+ }).join("\n"));
56
+ return (0, defu.default)({
57
+ alias: context.alias,
58
+ inject: inject && Object.keys(inject).length > 0 ? [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
59
+ }, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build.override, [
60
+ "alias",
61
+ "inject",
62
+ "external",
63
+ "noExternal",
64
+ "skipNodeModulesBundle",
65
+ "extensions"
66
+ ]) : {}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build, [
67
+ "alias",
68
+ "inject",
69
+ "external",
70
+ "noExternal",
71
+ "skipNodeModulesBundle",
72
+ "extensions",
73
+ "variant",
74
+ "override"
75
+ ]) : {}, {
76
+ mainFields: context.config.build.mainFields,
77
+ conditions: context.config.build.conditions,
78
+ define: context.config.build.define,
79
+ resolveExtensions: context.config.build.extensions,
80
+ packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
81
+ format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
82
+ platform: context.config.build.platform,
83
+ treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
84
+ outdir: context.config.output.buildPath,
85
+ tsconfig: context.tsconfig.tsconfigFilePath,
86
+ minify: context.config.mode !== "development",
87
+ metafile: context.config.mode === "development",
88
+ sourcemap: context.config.mode === "development"
89
+ }, DEFAULT_ESBUILD_CONFIG);
90
+ }
91
+
92
+ //#endregion
93
+ exports.extractESBuildConfig = extractESBuildConfig;
@@ -0,0 +1,91 @@
1
+ import "../entry.mjs";
2
+ import defu from "defu";
3
+ import { omit } from "@stryke/helpers/omit";
4
+ import { joinPaths } from "@stryke/path/join-paths";
5
+ import "@stryke/path/replace";
6
+ import { camelCase } from "@stryke/string-format/camel-case";
7
+ import "@stryke/type-checks/is-string";
8
+
9
+ //#region ../powerlines/src/lib/build/esbuild.ts
10
+ const DEFAULT_ESBUILD_CONFIG = {
11
+ target: "esnext",
12
+ platform: "neutral",
13
+ format: "esm",
14
+ write: true,
15
+ minify: true,
16
+ sourcemap: false,
17
+ bundle: true,
18
+ treeShaking: true,
19
+ keepNames: true,
20
+ splitting: true,
21
+ logLevel: "silent"
22
+ };
23
+ /**
24
+ * Resolves the esbuild options.
25
+ *
26
+ * @param context - The build context.
27
+ * @returns The resolved esbuild options.
28
+ */
29
+ function extractESBuildConfig(context) {
30
+ const inject = context.config.build.override.inject ?? context.config.build.inject;
31
+ if (inject && Object.keys(inject).length > 0) context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
32
+ if (value) if (Array.isArray(value)) {
33
+ if (camelCase(key) !== key) {
34
+ if (value.length === 1) return `
35
+ import ${camelCase(key)} from "${value[0]}";
36
+ export { ${camelCase(key)} as "${key}" }`;
37
+ else if (value.length > 1) return `
38
+ import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
39
+ export { ${camelCase(key)} as "${key}" }`;
40
+ } else if (value.length === 1) return `
41
+ import ${key} from "${value[0]}";
42
+ export { ${key} };`;
43
+ else if (value.length > 1) return `
44
+ import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
45
+ export { ${key} };`;
46
+ } else if (camelCase(key) !== key) return `
47
+ import ${camelCase(key)} from "${value[0]}";
48
+ export { ${camelCase(key)} as "${key}" }`;
49
+ else return `
50
+ import ${key} from "${value}";
51
+ export { ${key} };`;
52
+ return "";
53
+ }).join("\n"));
54
+ return defu({
55
+ alias: context.alias,
56
+ inject: inject && Object.keys(inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
57
+ }, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
58
+ "alias",
59
+ "inject",
60
+ "external",
61
+ "noExternal",
62
+ "skipNodeModulesBundle",
63
+ "extensions"
64
+ ]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
65
+ "alias",
66
+ "inject",
67
+ "external",
68
+ "noExternal",
69
+ "skipNodeModulesBundle",
70
+ "extensions",
71
+ "variant",
72
+ "override"
73
+ ]) : {}, {
74
+ mainFields: context.config.build.mainFields,
75
+ conditions: context.config.build.conditions,
76
+ define: context.config.build.define,
77
+ resolveExtensions: context.config.build.extensions,
78
+ packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
79
+ format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
80
+ platform: context.config.build.platform,
81
+ treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
82
+ outdir: context.config.output.buildPath,
83
+ tsconfig: context.tsconfig.tsconfigFilePath,
84
+ minify: context.config.mode !== "development",
85
+ metafile: context.config.mode === "development",
86
+ sourcemap: context.config.mode === "development"
87
+ }, DEFAULT_ESBUILD_CONFIG);
88
+ }
89
+
90
+ //#endregion
91
+ export { extractESBuildConfig };
@@ -0,0 +1,11 @@
1
+ require('../plugin-utils/paths.cjs');
2
+ let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
3
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
4
+ let __stryke_path_join_paths = require("@stryke/path/join-paths");
5
+ require("@stryke/path/replace");
6
+ require("@stryke/type-checks/is-string");
7
+ require("@stryke/convert/to-array");
8
+ require("@stryke/hash/murmurhash");
9
+ require("@stryke/helpers/get-unique");
10
+ require("@stryke/path/append");
11
+ require("@stryke/path/is-type");
@@ -0,0 +1,13 @@
1
+ import "../plugin-utils/paths.mjs";
2
+ import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+ import { joinPaths } from "@stryke/path/join-paths";
5
+ import "@stryke/path/replace";
6
+ import "@stryke/type-checks/is-string";
7
+ import "@stryke/convert/to-array";
8
+ import "@stryke/hash/murmurhash";
9
+ import "@stryke/helpers/get-unique";
10
+ import "@stryke/path/append";
11
+ import "@stryke/path/is-type";
12
+
13
+ export { };
@@ -0,0 +1,41 @@
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
3
+ let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
4
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
5
+ require("@storm-software/config-tools/logger");
6
+ require("@storm-software/config-tools/utilities/colors");
7
+ require("@stryke/helpers/noop");
8
+ let chalk = require("chalk");
9
+ chalk = require_rolldown_runtime.__toESM(chalk);
10
+
11
+ //#region ../powerlines/src/lib/logger.ts
12
+ const BADGE_COLORS = [
13
+ "#00A0DD",
14
+ "#6FCE4E",
15
+ "#FBBF24",
16
+ "#F43F5E",
17
+ "#3B82F6",
18
+ "#A855F7",
19
+ "#469592",
20
+ "#288EDF",
21
+ "#D8B4FE",
22
+ "#10B981",
23
+ "#EF4444",
24
+ "#F0EC56",
25
+ "#F472B6",
26
+ "#22D3EE",
27
+ "#EAB308",
28
+ "#84CC16",
29
+ "#F87171",
30
+ "#0EA5E9",
31
+ "#D946EF",
32
+ "#FACC15",
33
+ "#34D399",
34
+ "#8B5CF6"
35
+ ];
36
+ const extendLog = (logFn, name) => {
37
+ return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
38
+ };
39
+
40
+ //#endregion
41
+ exports.extendLog = extendLog;
@@ -0,0 +1,39 @@
1
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
2
+ import { kebabCase } from "@stryke/string-format/kebab-case";
3
+ import { titleCase } from "@stryke/string-format/title-case";
4
+ import "@storm-software/config-tools/logger";
5
+ import "@storm-software/config-tools/utilities/colors";
6
+ import "@stryke/helpers/noop";
7
+ import chalk from "chalk";
8
+
9
+ //#region ../powerlines/src/lib/logger.ts
10
+ const BADGE_COLORS = [
11
+ "#00A0DD",
12
+ "#6FCE4E",
13
+ "#FBBF24",
14
+ "#F43F5E",
15
+ "#3B82F6",
16
+ "#A855F7",
17
+ "#469592",
18
+ "#288EDF",
19
+ "#D8B4FE",
20
+ "#10B981",
21
+ "#EF4444",
22
+ "#F0EC56",
23
+ "#F472B6",
24
+ "#22D3EE",
25
+ "#EAB308",
26
+ "#84CC16",
27
+ "#F87171",
28
+ "#0EA5E9",
29
+ "#D946EF",
30
+ "#FACC15",
31
+ "#34D399",
32
+ "#8B5CF6"
33
+ ];
34
+ const extendLog = (logFn, name) => {
35
+ return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
36
+ };
37
+
38
+ //#endregion
39
+ export { extendLog };
@@ -0,0 +1,3 @@
1
+ require('../../types/build.cjs');
2
+ let defu = require("defu");
3
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
@@ -0,0 +1,5 @@
1
+ import "../../types/build.mjs";
2
+ import "defu";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+
5
+ export { };
@@ -0,0 +1,66 @@
1
+
2
+ //#region ../powerlines/src/lib/unplugin/module-resolution.ts
3
+ /**
4
+ * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.
5
+ *
6
+ * @remarks
7
+ * This includes the `resolveId` and `load` hooks.
8
+ *
9
+ * @see https://rollupjs.org/plugin-development/#resolveid
10
+ * @see https://rollupjs.org/plugin-development/#load
11
+ *
12
+ * @param context - The plugin context.
13
+ * @returns The module resolution hooks (`resolveId` and `load`).
14
+ */
15
+ function createUnpluginModuleResolutionFunctions(context) {
16
+ const ctx = context;
17
+ async function resolveId(id, importer, opts = { isEntry: false }) {
18
+ let result = await ctx.$$internal.callHook("resolveId", {
19
+ sequential: true,
20
+ result: "first",
21
+ order: "pre"
22
+ }, id, importer, opts);
23
+ if (result) return result;
24
+ result = await ctx.$$internal.callHook("resolveId", {
25
+ sequential: true,
26
+ result: "first",
27
+ order: "normal"
28
+ }, id, importer, opts);
29
+ if (result) return result;
30
+ result = await ctx.resolve(id, importer, opts);
31
+ if (result) return result;
32
+ return ctx.$$internal.callHook("resolveId", {
33
+ sequential: true,
34
+ result: "first",
35
+ order: "post"
36
+ }, id, importer, opts);
37
+ }
38
+ async function load(id) {
39
+ let result = await ctx.$$internal.callHook("load", {
40
+ sequential: true,
41
+ result: "first",
42
+ order: "pre"
43
+ }, id);
44
+ if (result) return result;
45
+ result = await ctx.$$internal.callHook("load", {
46
+ sequential: true,
47
+ result: "first",
48
+ order: "normal"
49
+ }, id);
50
+ if (result) return result;
51
+ result = await ctx.load(id);
52
+ if (result) return result;
53
+ return ctx.$$internal.callHook("load", {
54
+ sequential: true,
55
+ result: "first",
56
+ order: "post"
57
+ }, id);
58
+ }
59
+ return {
60
+ resolveId,
61
+ load
62
+ };
63
+ }
64
+
65
+ //#endregion
66
+ exports.createUnpluginModuleResolutionFunctions = createUnpluginModuleResolutionFunctions;
@@ -0,0 +1,65 @@
1
+ //#region ../powerlines/src/lib/unplugin/module-resolution.ts
2
+ /**
3
+ * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.
4
+ *
5
+ * @remarks
6
+ * This includes the `resolveId` and `load` hooks.
7
+ *
8
+ * @see https://rollupjs.org/plugin-development/#resolveid
9
+ * @see https://rollupjs.org/plugin-development/#load
10
+ *
11
+ * @param context - The plugin context.
12
+ * @returns The module resolution hooks (`resolveId` and `load`).
13
+ */
14
+ function createUnpluginModuleResolutionFunctions(context) {
15
+ const ctx = context;
16
+ async function resolveId(id, importer, opts = { isEntry: false }) {
17
+ let result = await ctx.$$internal.callHook("resolveId", {
18
+ sequential: true,
19
+ result: "first",
20
+ order: "pre"
21
+ }, id, importer, opts);
22
+ if (result) return result;
23
+ result = await ctx.$$internal.callHook("resolveId", {
24
+ sequential: true,
25
+ result: "first",
26
+ order: "normal"
27
+ }, id, importer, opts);
28
+ if (result) return result;
29
+ result = await ctx.resolve(id, importer, opts);
30
+ if (result) return result;
31
+ return ctx.$$internal.callHook("resolveId", {
32
+ sequential: true,
33
+ result: "first",
34
+ order: "post"
35
+ }, id, importer, opts);
36
+ }
37
+ async function load(id) {
38
+ let result = await ctx.$$internal.callHook("load", {
39
+ sequential: true,
40
+ result: "first",
41
+ order: "pre"
42
+ }, id);
43
+ if (result) return result;
44
+ result = await ctx.$$internal.callHook("load", {
45
+ sequential: true,
46
+ result: "first",
47
+ order: "normal"
48
+ }, id);
49
+ if (result) return result;
50
+ result = await ctx.load(id);
51
+ if (result) return result;
52
+ return ctx.$$internal.callHook("load", {
53
+ sequential: true,
54
+ result: "first",
55
+ order: "post"
56
+ }, id);
57
+ }
58
+ return {
59
+ resolveId,
60
+ load
61
+ };
62
+ }
63
+
64
+ //#endregion
65
+ export { createUnpluginModuleResolutionFunctions };
@@ -0,0 +1,46 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_logger = require('../logger.cjs');
3
+ require('../utilities/source-file.cjs');
4
+ require('./helpers.cjs');
5
+ const require_module_resolution = require('./module-resolution.cjs');
6
+ let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
7
+ let unplugin = require("unplugin");
8
+ let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
9
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
10
+
11
+ //#region ../powerlines/src/lib/unplugin/plugin.ts
12
+ /**
13
+ * Creates a Powerlines unplugin instance.
14
+ *
15
+ * @param context - The plugin context.
16
+ * @returns The unplugin instance.
17
+ */
18
+ function createUnpluginResolver(context, name = "unplugin") {
19
+ const ctx = context;
20
+ (0, unplugin.setParseImpl)(ctx.parse);
21
+ return () => {
22
+ const log = require_logger.extendLog(ctx.log, name);
23
+ log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, `Initializing ${name.toLowerCase() === "unplugin" ? "Unplugin" : `${(0, __stryke_string_format_title_case.titleCase)(name)} - Unplugin`} plugin`);
24
+ try {
25
+ const { resolveId, load } = require_module_resolution.createUnpluginModuleResolutionFunctions(context);
26
+ return {
27
+ name: name.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${(0, __stryke_string_format_kebab_case.kebabCase)(name)}`,
28
+ api: ctx.$$internal.api,
29
+ resolveId: {
30
+ filter: { id: { include: [/.*/] } },
31
+ handler: resolveId
32
+ },
33
+ load: {
34
+ filter: { id: { include: [/.*/] } },
35
+ handler: load
36
+ }
37
+ };
38
+ } catch (error) {
39
+ log(__storm_software_config_tools_types.LogLevelLabel.FATAL, error?.message);
40
+ throw error;
41
+ }
42
+ };
43
+ }
44
+
45
+ //#endregion
46
+ exports.createUnpluginResolver = createUnpluginResolver;
@@ -0,0 +1,45 @@
1
+ import { extendLog } from "../logger.mjs";
2
+ import "../utilities/source-file.mjs";
3
+ import "./helpers.mjs";
4
+ import { createUnpluginModuleResolutionFunctions } from "./module-resolution.mjs";
5
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
6
+ import { setParseImpl } from "unplugin";
7
+ import { kebabCase } from "@stryke/string-format/kebab-case";
8
+ import { titleCase } from "@stryke/string-format/title-case";
9
+
10
+ //#region ../powerlines/src/lib/unplugin/plugin.ts
11
+ /**
12
+ * Creates a Powerlines unplugin instance.
13
+ *
14
+ * @param context - The plugin context.
15
+ * @returns The unplugin instance.
16
+ */
17
+ function createUnpluginResolver(context, name = "unplugin") {
18
+ const ctx = context;
19
+ setParseImpl(ctx.parse);
20
+ return () => {
21
+ const log = extendLog(ctx.log, name);
22
+ log(LogLevelLabel.DEBUG, `Initializing ${name.toLowerCase() === "unplugin" ? "Unplugin" : `${titleCase(name)} - Unplugin`} plugin`);
23
+ try {
24
+ const { resolveId, load } = createUnpluginModuleResolutionFunctions(context);
25
+ return {
26
+ name: name.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${kebabCase(name)}`,
27
+ api: ctx.$$internal.api,
28
+ resolveId: {
29
+ filter: { id: { include: [/.*/] } },
30
+ handler: resolveId
31
+ },
32
+ load: {
33
+ filter: { id: { include: [/.*/] } },
34
+ handler: load
35
+ }
36
+ };
37
+ } catch (error) {
38
+ log(LogLevelLabel.FATAL, error?.message);
39
+ throw error;
40
+ }
41
+ };
42
+ }
43
+
44
+ //#endregion
45
+ export { createUnpluginResolver };
@@ -0,0 +1,42 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_esbuild = require('../build/esbuild.cjs');
3
+ const require_plugin = require('../unplugin/plugin.cjs');
4
+ let defu = require("defu");
5
+ defu = require_rolldown_runtime.__toESM(defu);
6
+ let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
7
+ let esbuild = require("esbuild");
8
+ let unplugin = require("unplugin");
9
+
10
+ //#region ../powerlines/src/lib/utilities/bundle.ts
11
+ /**
12
+ * Bundle a type definition to a module.
13
+ *
14
+ * @param context - The context object containing the environment paths.
15
+ * @param file - The file path to bundle.
16
+ * @param overrides - Optional overrides for the ESBuild configuration.
17
+ * @returns A promise that resolves to the bundled module.
18
+ */
19
+ async function bundle(context, file, overrides = {}) {
20
+ const path = await context.fs.resolve(file);
21
+ if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
22
+ const result = await (0, esbuild.build)((0, defu.default)({
23
+ ...require_esbuild.extractESBuildConfig(context),
24
+ entryPoints: [path],
25
+ write: false,
26
+ sourcemap: false,
27
+ splitting: false,
28
+ treeShaking: false,
29
+ bundle: true,
30
+ packages: "bundle",
31
+ platform: "node",
32
+ logLevel: "silent",
33
+ ...overrides
34
+ }, { plugins: [(0, unplugin.createEsbuildPlugin)(require_plugin.createUnpluginResolver(context, `${(0, __stryke_path_file_path_fns.findFileName)(file)} Bundler`))({})] }));
35
+ if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
36
+ if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
37
+ if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
38
+ return result.outputFiles.filter(Boolean)[0];
39
+ }
40
+
41
+ //#endregion
42
+ exports.bundle = bundle;
@@ -0,0 +1,40 @@
1
+ import { extractESBuildConfig } from "../build/esbuild.mjs";
2
+ import { createUnpluginResolver } from "../unplugin/plugin.mjs";
3
+ import defu from "defu";
4
+ import { findFileName } from "@stryke/path/file-path-fns";
5
+ import { build } from "esbuild";
6
+ import { createEsbuildPlugin } from "unplugin";
7
+
8
+ //#region ../powerlines/src/lib/utilities/bundle.ts
9
+ /**
10
+ * Bundle a type definition to a module.
11
+ *
12
+ * @param context - The context object containing the environment paths.
13
+ * @param file - The file path to bundle.
14
+ * @param overrides - Optional overrides for the ESBuild configuration.
15
+ * @returns A promise that resolves to the bundled module.
16
+ */
17
+ async function bundle(context, file, overrides = {}) {
18
+ const path = await context.fs.resolve(file);
19
+ if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
20
+ const result = await build(defu({
21
+ ...extractESBuildConfig(context),
22
+ entryPoints: [path],
23
+ write: false,
24
+ sourcemap: false,
25
+ splitting: false,
26
+ treeShaking: false,
27
+ bundle: true,
28
+ packages: "bundle",
29
+ platform: "node",
30
+ logLevel: "silent",
31
+ ...overrides
32
+ }, { plugins: [createEsbuildPlugin(createUnpluginResolver(context, `${findFileName(file)} Bundler`))({})] }));
33
+ if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
34
+ if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
35
+ if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
36
+ return result.outputFiles.filter(Boolean)[0];
37
+ }
38
+
39
+ //#endregion
40
+ export { bundle };
@@ -0,0 +1,50 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_bundle = require('./bundle.cjs');
3
+ let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
4
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
5
+
6
+ //#region ../powerlines/src/lib/utilities/resolve.ts
7
+ /**
8
+ * Compiles a type definition to a module.
9
+ *
10
+ * @param context - The context object containing the environment paths.
11
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
+ * @param overrides - Optional overrides for the ESBuild configuration.
13
+ * @returns A promise that resolves to the compiled module.
14
+ */
15
+ async function resolve(context, type, overrides = {}) {
16
+ let typeDefinition;
17
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(type)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(type);
18
+ else typeDefinition = type;
19
+ const result = await require_bundle.bundle(context, typeDefinition.file, overrides);
20
+ let resolved;
21
+ try {
22
+ resolved = await context.resolver.evalModule(result.text, {
23
+ filename: result.path,
24
+ forceTranspile: true
25
+ });
26
+ } catch (error) {
27
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
28
+ const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
29
+ throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
30
+
31
+ Bundle output for module:
32
+ ${result.text}` : ""}`);
33
+ }
34
+ throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
35
+
36
+ Bundle output for module:
37
+ ${result.text}` : ""}`);
38
+ }
39
+ let exportName = typeDefinition.name;
40
+ if (!exportName) exportName = "default";
41
+ const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
42
+ if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}${context.config.logLevel === "debug" ? `
43
+
44
+ Bundle output for module:
45
+ ${result.text}` : ""}`);
46
+ return resolvedExport;
47
+ }
48
+
49
+ //#endregion
50
+ exports.resolve = resolve;
@@ -0,0 +1,49 @@
1
+ import { bundle } from "./bundle.mjs";
2
+ import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+
5
+ //#region ../powerlines/src/lib/utilities/resolve.ts
6
+ /**
7
+ * Compiles a type definition to a module.
8
+ *
9
+ * @param context - The context object containing the environment paths.
10
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
11
+ * @param overrides - Optional overrides for the ESBuild configuration.
12
+ * @returns A promise that resolves to the compiled module.
13
+ */
14
+ async function resolve(context, type, overrides = {}) {
15
+ let typeDefinition;
16
+ if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
17
+ else typeDefinition = type;
18
+ const result = await bundle(context, typeDefinition.file, overrides);
19
+ let resolved;
20
+ try {
21
+ resolved = await context.resolver.evalModule(result.text, {
22
+ filename: result.path,
23
+ forceTranspile: true
24
+ });
25
+ } catch (error) {
26
+ if (isSetString(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
27
+ const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
28
+ throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
29
+
30
+ Bundle output for module:
31
+ ${result.text}` : ""}`);
32
+ }
33
+ throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
34
+
35
+ Bundle output for module:
36
+ ${result.text}` : ""}`);
37
+ }
38
+ let exportName = typeDefinition.name;
39
+ if (!exportName) exportName = "default";
40
+ const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
41
+ if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}${context.config.logLevel === "debug" ? `
42
+
43
+ Bundle output for module:
44
+ ${result.text}` : ""}`);
45
+ return resolvedExport;
46
+ }
47
+
48
+ //#endregion
49
+ export { resolve };
@@ -0,0 +1,5 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ require("@stryke/type-checks/is-string");
3
+ require("@stryke/fs/read-file");
4
+ require("@stryke/type-checks/is-set-object");
5
+ require("magic-string");
@@ -0,0 +1,6 @@
1
+ import "@stryke/type-checks/is-string";
2
+ import "@stryke/fs/read-file";
3
+ import "@stryke/type-checks/is-set-object";
4
+ import "magic-string";
5
+
6
+ export { };
@@ -0,0 +1 @@
1
+ require("@stryke/path/replace");
@@ -0,0 +1,3 @@
1
+ import "@stryke/path/replace";
2
+
3
+ export { };
@@ -0,0 +1,2 @@
1
+ import "./config.mjs";
2
+ import "./context.mjs";
@@ -0,0 +1,21 @@
1
+
2
+ //#region ../powerlines/src/types/build.ts
3
+ const UNPLUGIN_BUILDER_VARIANTS = [
4
+ "rollup",
5
+ "webpack",
6
+ "rspack",
7
+ "vite",
8
+ "esbuild",
9
+ "farm",
10
+ "unloader",
11
+ "rolldown",
12
+ "bun"
13
+ ];
14
+ const BUILDER_VARIANTS = [
15
+ ...UNPLUGIN_BUILDER_VARIANTS,
16
+ "tsup",
17
+ "tsdown",
18
+ "unbuild"
19
+ ];
20
+
21
+ //#endregion
@@ -1,9 +1,9 @@
1
+ import { BuildOptions } from "esbuild";
1
2
  import { OutputOptions, RollupOptions } from "rollup";
2
3
  import { UserConfig } from "@farmfe/core";
3
4
  import { Configuration } from "@rspack/core";
4
- import { BuildOptions } from "@storm-software/tsup/types";
5
+ import { BuildOptions as BuildOptions$1 } from "@storm-software/tsup/types";
5
6
  import { UnbuildOptions } from "@storm-software/unbuild/types";
6
- import { BuildOptions as BuildOptions$1 } from "esbuild";
7
7
  import { RolldownOptions } from "rolldown";
8
8
  import { UserConfig as UserConfig$1 } from "tsdown";
9
9
  import { DepOptimizationOptions, UserConfig as UserConfig$2 } from "vite";
@@ -153,8 +153,8 @@ interface BuildConfig {
153
153
  override?: Record<string, any>;
154
154
  }
155
155
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
156
- type ESBuildBuildConfig = Omit<BuildOptions$1, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
157
- type ESBuildResolvedBuildConfig = Omit<BuildOptions$1, "inject"> & BuildResolvedConfig;
156
+ type ESBuildBuildConfig = Omit<BuildOptions, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
157
+ type ESBuildResolvedBuildConfig = Omit<BuildOptions, "inject"> & BuildResolvedConfig;
158
158
  type ViteBuildConfig = Omit<UserConfig$2, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig & {
159
159
  /**
160
160
  * Optimize deps config
@@ -173,8 +173,8 @@ type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "o
173
173
  type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
174
174
  type RolldownBuildConfig = Omit<RolldownOptions, "input" | "external" | "tsconfig" | "logLevel" | "output"> & BuildConfig;
175
175
  type RolldownResolvedBuildConfig = RolldownOptions & BuildResolvedConfig;
176
- type TsupBuildConfig = Partial<Omit<BuildOptions, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
177
- type TsupResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
176
+ type TsupBuildConfig = Partial<Omit<BuildOptions$1, "userOptions" | "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "clean" | "env" | "entry" | "entryPoints" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
177
+ type TsupResolvedBuildConfig = BuildOptions$1 & BuildResolvedConfig;
178
178
  type TsdownBuildConfig = Partial<Omit<UserConfig$1, "name" | "outDir" | "clean" | "cwd" | "tsconfig" | "publicDir" | "copy" | "alias" | "format" | "platform" | "env" | "define" | "entry" | "external" | "noExternal" | "skipNodeModulesBundle">> & BuildConfig;
179
179
  type TsdownResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
180
180
  type UnbuildBuildConfig = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">> & BuildConfig;
@@ -0,0 +1,21 @@
1
+ //#region ../powerlines/src/types/build.ts
2
+ const UNPLUGIN_BUILDER_VARIANTS = [
3
+ "rollup",
4
+ "webpack",
5
+ "rspack",
6
+ "vite",
7
+ "esbuild",
8
+ "farm",
9
+ "unloader",
10
+ "rolldown",
11
+ "bun"
12
+ ];
13
+ const BUILDER_VARIANTS = [
14
+ ...UNPLUGIN_BUILDER_VARIANTS,
15
+ "tsup",
16
+ "tsdown",
17
+ "unbuild"
18
+ ];
19
+
20
+ //#endregion
21
+ export { };
@@ -1,3 +1,4 @@
1
+ import "./context.mjs";
1
2
  import { ArrayValues } from "@stryke/types/array";
2
3
  import { MaybePromise } from "@stryke/types/base";
3
4
 
@@ -1,19 +1,19 @@
1
1
  import { BuildConfig, BuildResolvedConfig, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
2
+ import "./babel.mjs";
2
3
  import { StoragePort, StoragePreset } from "./fs.mjs";
3
4
  import { TSConfig } from "./tsconfig.mjs";
4
5
  import { PluginContext } from "./context.mjs";
5
6
  import { Plugin } from "./plugin.mjs";
7
+ import { LogLevelLabel } from "@storm-software/config-tools/types";
6
8
  import { MaybePromise } from "@stryke/types/base";
7
9
  import { PreviewOptions } from "vite";
8
10
  import { Format } from "@storm-software/build-tools/types";
9
- import { LogLevelLabel } from "@storm-software/config-tools/types";
10
11
  import { StormWorkspaceConfig } from "@storm-software/config/types";
11
12
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
12
13
  import { AssetGlob } from "@stryke/types/file";
13
14
  import { DateString } from "compatx";
14
15
 
15
16
  //#region ../powerlines/src/types/config.d.ts
16
-
17
17
  type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
18
18
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
19
19
  /**
@@ -4,13 +4,13 @@ import { InlineConfig, LogFn, UserConfig, WorkspaceConfig } from "./config.mjs";
4
4
  import { HooksList, InferHooksListItem } from "./hooks.mjs";
5
5
  import { EnvironmentResolvedConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "./resolved.mjs";
6
6
  import { Plugin } from "./plugin.mjs";
7
- import { NonUndefined } from "@stryke/types/base";
8
7
  import { ExternalIdResult, UnpluginBuildContext, UnpluginContext, UnpluginMessage } from "unplugin";
8
+ import { SourceMap } from "magic-string";
9
+ import { NonUndefined } from "@stryke/types/base";
9
10
  import { EnvPaths } from "@stryke/env/get-env-paths";
10
11
  import { FetchRequestOptions } from "@stryke/http/fetch";
11
12
  import { PackageJson } from "@stryke/types/package-json";
12
13
  import { Jiti } from "jiti";
13
- import { SourceMap } from "magic-string";
14
14
  import { ParseResult, ParserOptions } from "oxc-parser";
15
15
  import { Range } from "semver";
16
16
  import { RequestInfo, Response } from "undici";
@@ -4,10 +4,10 @@ import { EnvironmentResolvedConfig, ResolvedConfig } from "./resolved.mjs";
4
4
  import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
5
5
  import { CommandType } from "./commands.mjs";
6
6
  import { InferUnpluginOptions } from "./unplugin.mjs";
7
+ import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
7
8
  import { ArrayValues } from "@stryke/types/array";
8
9
  import { AnyFunction, MaybePromise } from "@stryke/types/base";
9
10
  import { LoadResult } from "rollup";
10
- import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
11
11
 
12
12
  //#region ../powerlines/src/types/plugin.d.ts
13
13
  interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
@@ -1,10 +1,11 @@
1
1
  import { BuilderVariant, InferUnpluginVariant, UnpluginBuilderVariant } from "./build.mjs";
2
+ import "./config.mjs";
2
3
  import { InferResolvedConfig } from "./resolved.mjs";
3
4
  import { Context } from "./context.mjs";
4
5
  import { API } from "./api.mjs";
5
6
  import { PluginHook } from "./plugin.mjs";
6
- import { MaybePromise } from "@stryke/types/base";
7
7
  import { HookFilter, UnpluginOptions } from "unplugin";
8
+ import { MaybePromise } from "@stryke/types/base";
8
9
 
9
10
  //#region ../powerlines/src/types/unplugin.d.ts
10
11
  interface UnpluginOptions$1<TUnpluginBuilderVariant extends UnpluginBuilderVariant = UnpluginBuilderVariant> extends UnpluginOptions {
@@ -1,6 +1,6 @@
1
- import { EnvironmentConfig, UserConfig } from "../packages/powerlines/src/types/config.mjs";
2
- import { ResolvedConfig } from "../packages/powerlines/src/types/resolved.mjs";
3
- import { PluginContext } from "../packages/powerlines/src/types/context.mjs";
1
+ import { EnvironmentConfig, UserConfig } from "../powerlines/src/types/config.mjs";
2
+ import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
3
+ import { PluginContext } from "../powerlines/src/types/context.mjs";
4
4
  import StyleDictionary, { Config } from "style-dictionary";
5
5
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
6
6
  import { Action, FileHeader, Filter, Format, Parser, PlatformConfig, Preprocessor, Transform } from "style-dictionary/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-style-dictionary",
3
- "version": "0.3.123",
3
+ "version": "0.3.124",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code with Style Dictionary.",
6
6
  "repository": {
@@ -131,9 +131,9 @@
131
131
  "style-dictionary": "^5.2.0"
132
132
  },
133
133
  "devDependencies": {
134
- "@powerlines/plugin-plugin": "^0.12.173",
134
+ "@powerlines/plugin-plugin": "^0.12.174",
135
135
  "@types/node": "^24.10.9"
136
136
  },
137
137
  "publishConfig": { "access": "public" },
138
- "gitHead": "f7483367fc2dba244e8d11af31db5b1071e0a888"
138
+ "gitHead": "2852dab8ff7cad2d1aa4a44d7fd2479d62f65d47"
139
139
  }
@@ -1,16 +0,0 @@
1
-
2
- //#region ../../node_modules/.pnpm/@storm-software+config-tools@1.189.0_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.js
3
- var LogLevelLabel = {
4
- SILENT: "silent",
5
- FATAL: "fatal",
6
- ERROR: "error",
7
- WARN: "warn",
8
- SUCCESS: "success",
9
- INFO: "info",
10
- DEBUG: "debug",
11
- TRACE: "trace",
12
- ALL: "all"
13
- };
14
-
15
- //#endregion
16
- exports.LogLevelLabel = LogLevelLabel;
@@ -1,15 +0,0 @@
1
- //#region ../../node_modules/.pnpm/@storm-software+config-tools@1.189.0_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.js
2
- var LogLevelLabel = {
3
- SILENT: "silent",
4
- FATAL: "fatal",
5
- ERROR: "error",
6
- WARN: "warn",
7
- SUCCESS: "success",
8
- INFO: "info",
9
- DEBUG: "debug",
10
- TRACE: "trace",
11
- ALL: "all"
12
- };
13
-
14
- //#endregion
15
- export { LogLevelLabel };