@powerlines/plugin-style-dictionary 0.3.21 → 0.3.23
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-BgAdqTbb.d.mts +1 -0
- package/dist/index-CEgs-Dz2.d.cts +1 -0
- package/dist/index.cjs +210 -13
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +173 -2
- package/dist/plugin-C3MaN5jp.mjs +1 -0
- package/dist/plugin-DHXHjv16.cjs +0 -0
- package/dist/plugin-DoaM1stj.d.cts +1861 -0
- package/dist/plugin-stDuO5l1.d.mts +1862 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -117
- package/dist/types/plugin.d.mts +1 -117
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-CTUnla4x.mjs +1 -0
- package/dist/types-DHkg7xmX.cjs +0 -0
- package/package.json +5 -5
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
- package/dist/powerlines/src/lib/entry.cjs +0 -12
- package/dist/powerlines/src/lib/entry.mjs +0 -14
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
- package/dist/powerlines/src/types/babel.d.mts +0 -2
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -147
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -369
- package/dist/powerlines/src/types/config.d.mts +0 -369
- package/dist/powerlines/src/types/context.d.cts +0 -403
- package/dist/powerlines/src/types/context.d.mts +0 -405
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -81
- package/dist/powerlines/src/types/resolved.d.mts +0 -82
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/style-dictionary/file-header.cjs +0 -15
- package/dist/style-dictionary/file-header.mjs +0 -14
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as __ΩStyleDictionaryPluginEnvironmentConfig, E as __ΩStyleDictionaryPluginUserConfig, S as __ΩStyleDictionaryPluginContext, T as __ΩStyleDictionaryPluginResolvedConfig, _ as __ΩCustomFormatsBuilder, a as CustomParsersBuilder, b as __ΩCustomTransformGroupsBuilder, c as CustomTransformsBuilder, d as StyleDictionaryPluginOptions, f as StyleDictionaryPluginResolvedConfig, g as __ΩCustomFiltersBuilder, h as __ΩCustomFileHeadersBuilder, i as CustomFormatsBuilder, l as StyleDictionaryPluginContext, m as __ΩCustomActionsBuilder, n as CustomFileHeadersBuilder, o as CustomPreprocessorsBuilder, p as StyleDictionaryPluginUserConfig, r as CustomFiltersBuilder, s as CustomTransformGroupsBuilder, t as CustomActionsBuilder, u as StyleDictionaryPluginEnvironmentConfig, v as __ΩCustomParsersBuilder, w as __ΩStyleDictionaryPluginOptions, x as __ΩCustomTransformsBuilder, y as __ΩCustomPreprocessorsBuilder } from "../plugin-DoaM1stj.cjs";
|
|
2
|
+
import "../index-CEgs-Dz2.cjs";
|
|
2
3
|
export { 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 };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as __ΩStyleDictionaryPluginEnvironmentConfig, E as __ΩStyleDictionaryPluginUserConfig, S as __ΩStyleDictionaryPluginContext, T as __ΩStyleDictionaryPluginResolvedConfig, _ as __ΩCustomFormatsBuilder, a as CustomParsersBuilder, b as __ΩCustomTransformGroupsBuilder, c as CustomTransformsBuilder, d as StyleDictionaryPluginOptions, f as StyleDictionaryPluginResolvedConfig, g as __ΩCustomFiltersBuilder, h as __ΩCustomFileHeadersBuilder, i as CustomFormatsBuilder, l as StyleDictionaryPluginContext, m as __ΩCustomActionsBuilder, n as CustomFileHeadersBuilder, o as CustomPreprocessorsBuilder, p as StyleDictionaryPluginUserConfig, r as CustomFiltersBuilder, s as CustomTransformGroupsBuilder, t as CustomActionsBuilder, u as StyleDictionaryPluginEnvironmentConfig, v as __ΩCustomParsersBuilder, w as __ΩStyleDictionaryPluginOptions, x as __ΩCustomTransformsBuilder, y as __ΩCustomPreprocessorsBuilder } from "../plugin-stDuO5l1.mjs";
|
|
2
|
+
import "../index-BgAdqTbb.mjs";
|
|
2
3
|
export { 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 };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-DHXHjv16.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,118 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ResolvedConfig } from "../powerlines/src/types/resolved.cjs";
|
|
3
|
-
import { PluginContext } from "../powerlines/src/types/context.cjs";
|
|
4
|
-
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
5
|
-
import StyleDictionary, { Config } from "style-dictionary";
|
|
6
|
-
import { Action, FileHeader, Filter, Format, Parser, PlatformConfig, Preprocessor, Transform } from "style-dictionary/types";
|
|
7
|
-
|
|
8
|
-
//#region src/types/plugin.d.ts
|
|
9
|
-
type StyleDictionaryExtensionBuilder<T> = (extensionContext: StyleDictionaryPluginContext) => Record<string, T>;
|
|
10
|
-
type CustomActionsBuilder = StyleDictionaryExtensionBuilder<Action>;
|
|
11
|
-
type CustomTransformsBuilder = StyleDictionaryExtensionBuilder<Transform>;
|
|
12
|
-
type CustomFormatsBuilder = StyleDictionaryExtensionBuilder<Format>;
|
|
13
|
-
type CustomTransformGroupsBuilder = StyleDictionaryExtensionBuilder<string[]>;
|
|
14
|
-
type CustomFileHeadersBuilder = StyleDictionaryExtensionBuilder<FileHeader>;
|
|
15
|
-
type CustomFiltersBuilder = StyleDictionaryExtensionBuilder<Filter>;
|
|
16
|
-
type CustomParsersBuilder = (extensionContext: StyleDictionaryPluginContext) => Parser[];
|
|
17
|
-
type CustomPreprocessorsBuilder = StyleDictionaryExtensionBuilder<Preprocessor>;
|
|
18
|
-
type StyleDictionaryPluginOptions = Omit<Config, "platforms"> & {
|
|
19
|
-
/**
|
|
20
|
-
* Whether to skip the Style Dictionary build process.
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* If set to `true`, the Style Dictionary build step will be skipped (ran during the "prepare" command), allowing for manual control over when the build occurs.
|
|
24
|
-
*
|
|
25
|
-
* @defaultValue false
|
|
26
|
-
*/
|
|
27
|
-
skipBuild?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Custom Style Dictionary actions to register.
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
33
|
-
*/
|
|
34
|
-
customActions?: TypeDefinitionParameter | CustomActionsBuilder;
|
|
35
|
-
/**
|
|
36
|
-
* Custom Style Dictionary file headers to register.
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
40
|
-
*/
|
|
41
|
-
customFileHeaders?: TypeDefinitionParameter | CustomFileHeadersBuilder;
|
|
42
|
-
/**
|
|
43
|
-
* Custom Style Dictionary filters to register.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
47
|
-
*/
|
|
48
|
-
customFilters?: TypeDefinitionParameter | CustomFiltersBuilder;
|
|
49
|
-
/**
|
|
50
|
-
* Custom Style Dictionary formats to register.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
54
|
-
*/
|
|
55
|
-
customFormats?: TypeDefinitionParameter | CustomFormatsBuilder;
|
|
56
|
-
/**
|
|
57
|
-
* Custom Style Dictionary preprocessors to register.
|
|
58
|
-
*
|
|
59
|
-
* @remarks
|
|
60
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
61
|
-
*/
|
|
62
|
-
customPreprocessors?: TypeDefinitionParameter | CustomPreprocessorsBuilder;
|
|
63
|
-
/**
|
|
64
|
-
* Custom Style Dictionary parsers to register.
|
|
65
|
-
*
|
|
66
|
-
* @remarks
|
|
67
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
68
|
-
*/
|
|
69
|
-
customParsers?: TypeDefinitionParameter | CustomParsersBuilder;
|
|
70
|
-
/**
|
|
71
|
-
* Custom Style Dictionary transform groups to register.
|
|
72
|
-
*
|
|
73
|
-
* @remarks
|
|
74
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
75
|
-
*/
|
|
76
|
-
customTransformGroups?: TypeDefinitionParameter | CustomTransformGroupsBuilder;
|
|
77
|
-
/**
|
|
78
|
-
* Custom Style Dictionary transforms to register.
|
|
79
|
-
*
|
|
80
|
-
* @remarks
|
|
81
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
82
|
-
*/
|
|
83
|
-
customTransforms?: TypeDefinitionParameter | CustomTransformsBuilder;
|
|
84
|
-
/**
|
|
85
|
-
* An existing Style Dictionary instance to use.
|
|
86
|
-
*
|
|
87
|
-
* @remarks
|
|
88
|
-
* If provided, this instance will be used instead of creating a new one.
|
|
89
|
-
*/
|
|
90
|
-
instance?: StyleDictionary;
|
|
91
|
-
};
|
|
92
|
-
type StyleDictionaryPluginEnvironmentConfig = EnvironmentConfig & PlatformConfig;
|
|
93
|
-
type StyleDictionaryPluginUserConfig = UserConfig & {
|
|
94
|
-
styleDictionary?: StyleDictionaryPluginOptions;
|
|
95
|
-
environments?: Record<string, StyleDictionaryPluginEnvironmentConfig>;
|
|
96
|
-
};
|
|
97
|
-
type StyleDictionaryPluginResolvedConfig = ResolvedConfig & {
|
|
98
|
-
styleDictionary: StyleDictionaryPluginOptions;
|
|
99
|
-
environments: Record<string, StyleDictionaryPluginEnvironmentConfig>;
|
|
100
|
-
};
|
|
101
|
-
type StyleDictionaryPluginContext<TResolvedConfig extends StyleDictionaryPluginResolvedConfig = StyleDictionaryPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
102
|
-
styleDictionary: StyleDictionary;
|
|
103
|
-
};
|
|
104
|
-
declare type __ΩCustomActionsBuilder = any[];
|
|
105
|
-
declare type __ΩCustomTransformsBuilder = any[];
|
|
106
|
-
declare type __ΩCustomFormatsBuilder = any[];
|
|
107
|
-
declare type __ΩCustomTransformGroupsBuilder = any[];
|
|
108
|
-
declare type __ΩCustomFileHeadersBuilder = any[];
|
|
109
|
-
declare type __ΩCustomFiltersBuilder = any[];
|
|
110
|
-
declare type __ΩCustomParsersBuilder = any[];
|
|
111
|
-
declare type __ΩCustomPreprocessorsBuilder = any[];
|
|
112
|
-
declare type __ΩStyleDictionaryPluginOptions = any[];
|
|
113
|
-
declare type __ΩStyleDictionaryPluginEnvironmentConfig = any[];
|
|
114
|
-
declare type __ΩStyleDictionaryPluginUserConfig = any[];
|
|
115
|
-
declare type __ΩStyleDictionaryPluginResolvedConfig = any[];
|
|
116
|
-
declare type __ΩStyleDictionaryPluginContext = any[];
|
|
117
|
-
//#endregion
|
|
1
|
+
import { C as __ΩStyleDictionaryPluginEnvironmentConfig, E as __ΩStyleDictionaryPluginUserConfig, S as __ΩStyleDictionaryPluginContext, T as __ΩStyleDictionaryPluginResolvedConfig, _ as __ΩCustomFormatsBuilder, a as CustomParsersBuilder, b as __ΩCustomTransformGroupsBuilder, c as CustomTransformsBuilder, d as StyleDictionaryPluginOptions, f as StyleDictionaryPluginResolvedConfig, g as __ΩCustomFiltersBuilder, h as __ΩCustomFileHeadersBuilder, i as CustomFormatsBuilder, l as StyleDictionaryPluginContext, m as __ΩCustomActionsBuilder, n as CustomFileHeadersBuilder, o as CustomPreprocessorsBuilder, p as StyleDictionaryPluginUserConfig, r as CustomFiltersBuilder, s as CustomTransformGroupsBuilder, t as CustomActionsBuilder, u as StyleDictionaryPluginEnvironmentConfig, v as __ΩCustomParsersBuilder, w as __ΩStyleDictionaryPluginOptions, x as __ΩCustomTransformsBuilder, y as __ΩCustomPreprocessorsBuilder } from "../plugin-DoaM1stj.cjs";
|
|
118
2
|
export { 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 };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,118 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
3
|
-
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
4
|
-
import StyleDictionary, { Config } from "style-dictionary";
|
|
5
|
-
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
6
|
-
import { Action, FileHeader, Filter, Format, Parser, PlatformConfig, Preprocessor, Transform } from "style-dictionary/types";
|
|
7
|
-
|
|
8
|
-
//#region src/types/plugin.d.ts
|
|
9
|
-
type StyleDictionaryExtensionBuilder<T> = (extensionContext: StyleDictionaryPluginContext) => Record<string, T>;
|
|
10
|
-
type CustomActionsBuilder = StyleDictionaryExtensionBuilder<Action>;
|
|
11
|
-
type CustomTransformsBuilder = StyleDictionaryExtensionBuilder<Transform>;
|
|
12
|
-
type CustomFormatsBuilder = StyleDictionaryExtensionBuilder<Format>;
|
|
13
|
-
type CustomTransformGroupsBuilder = StyleDictionaryExtensionBuilder<string[]>;
|
|
14
|
-
type CustomFileHeadersBuilder = StyleDictionaryExtensionBuilder<FileHeader>;
|
|
15
|
-
type CustomFiltersBuilder = StyleDictionaryExtensionBuilder<Filter>;
|
|
16
|
-
type CustomParsersBuilder = (extensionContext: StyleDictionaryPluginContext) => Parser[];
|
|
17
|
-
type CustomPreprocessorsBuilder = StyleDictionaryExtensionBuilder<Preprocessor>;
|
|
18
|
-
type StyleDictionaryPluginOptions = Omit<Config, "platforms"> & {
|
|
19
|
-
/**
|
|
20
|
-
* Whether to skip the Style Dictionary build process.
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* If set to `true`, the Style Dictionary build step will be skipped (ran during the "prepare" command), allowing for manual control over when the build occurs.
|
|
24
|
-
*
|
|
25
|
-
* @defaultValue false
|
|
26
|
-
*/
|
|
27
|
-
skipBuild?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Custom Style Dictionary actions to register.
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
33
|
-
*/
|
|
34
|
-
customActions?: TypeDefinitionParameter | CustomActionsBuilder;
|
|
35
|
-
/**
|
|
36
|
-
* Custom Style Dictionary file headers to register.
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
40
|
-
*/
|
|
41
|
-
customFileHeaders?: TypeDefinitionParameter | CustomFileHeadersBuilder;
|
|
42
|
-
/**
|
|
43
|
-
* Custom Style Dictionary filters to register.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
47
|
-
*/
|
|
48
|
-
customFilters?: TypeDefinitionParameter | CustomFiltersBuilder;
|
|
49
|
-
/**
|
|
50
|
-
* Custom Style Dictionary formats to register.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
54
|
-
*/
|
|
55
|
-
customFormats?: TypeDefinitionParameter | CustomFormatsBuilder;
|
|
56
|
-
/**
|
|
57
|
-
* Custom Style Dictionary preprocessors to register.
|
|
58
|
-
*
|
|
59
|
-
* @remarks
|
|
60
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
61
|
-
*/
|
|
62
|
-
customPreprocessors?: TypeDefinitionParameter | CustomPreprocessorsBuilder;
|
|
63
|
-
/**
|
|
64
|
-
* Custom Style Dictionary parsers to register.
|
|
65
|
-
*
|
|
66
|
-
* @remarks
|
|
67
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
68
|
-
*/
|
|
69
|
-
customParsers?: TypeDefinitionParameter | CustomParsersBuilder;
|
|
70
|
-
/**
|
|
71
|
-
* Custom Style Dictionary transform groups to register.
|
|
72
|
-
*
|
|
73
|
-
* @remarks
|
|
74
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
75
|
-
*/
|
|
76
|
-
customTransformGroups?: TypeDefinitionParameter | CustomTransformGroupsBuilder;
|
|
77
|
-
/**
|
|
78
|
-
* Custom Style Dictionary transforms to register.
|
|
79
|
-
*
|
|
80
|
-
* @remarks
|
|
81
|
-
* This value can be a {@link TypeDefinitionParameter} pointing to a module export or an actual builder function.
|
|
82
|
-
*/
|
|
83
|
-
customTransforms?: TypeDefinitionParameter | CustomTransformsBuilder;
|
|
84
|
-
/**
|
|
85
|
-
* An existing Style Dictionary instance to use.
|
|
86
|
-
*
|
|
87
|
-
* @remarks
|
|
88
|
-
* If provided, this instance will be used instead of creating a new one.
|
|
89
|
-
*/
|
|
90
|
-
instance?: StyleDictionary;
|
|
91
|
-
};
|
|
92
|
-
type StyleDictionaryPluginEnvironmentConfig = EnvironmentConfig & PlatformConfig;
|
|
93
|
-
type StyleDictionaryPluginUserConfig = UserConfig & {
|
|
94
|
-
styleDictionary?: StyleDictionaryPluginOptions;
|
|
95
|
-
environments?: Record<string, StyleDictionaryPluginEnvironmentConfig>;
|
|
96
|
-
};
|
|
97
|
-
type StyleDictionaryPluginResolvedConfig = ResolvedConfig & {
|
|
98
|
-
styleDictionary: StyleDictionaryPluginOptions;
|
|
99
|
-
environments: Record<string, StyleDictionaryPluginEnvironmentConfig>;
|
|
100
|
-
};
|
|
101
|
-
type StyleDictionaryPluginContext<TResolvedConfig extends StyleDictionaryPluginResolvedConfig = StyleDictionaryPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
102
|
-
styleDictionary: StyleDictionary;
|
|
103
|
-
};
|
|
104
|
-
declare type __ΩCustomActionsBuilder = any[];
|
|
105
|
-
declare type __ΩCustomTransformsBuilder = any[];
|
|
106
|
-
declare type __ΩCustomFormatsBuilder = any[];
|
|
107
|
-
declare type __ΩCustomTransformGroupsBuilder = any[];
|
|
108
|
-
declare type __ΩCustomFileHeadersBuilder = any[];
|
|
109
|
-
declare type __ΩCustomFiltersBuilder = any[];
|
|
110
|
-
declare type __ΩCustomParsersBuilder = any[];
|
|
111
|
-
declare type __ΩCustomPreprocessorsBuilder = any[];
|
|
112
|
-
declare type __ΩStyleDictionaryPluginOptions = any[];
|
|
113
|
-
declare type __ΩStyleDictionaryPluginEnvironmentConfig = any[];
|
|
114
|
-
declare type __ΩStyleDictionaryPluginUserConfig = any[];
|
|
115
|
-
declare type __ΩStyleDictionaryPluginResolvedConfig = any[];
|
|
116
|
-
declare type __ΩStyleDictionaryPluginContext = any[];
|
|
117
|
-
//#endregion
|
|
1
|
+
import { C as __ΩStyleDictionaryPluginEnvironmentConfig, E as __ΩStyleDictionaryPluginUserConfig, S as __ΩStyleDictionaryPluginContext, T as __ΩStyleDictionaryPluginResolvedConfig, _ as __ΩCustomFormatsBuilder, a as CustomParsersBuilder, b as __ΩCustomTransformGroupsBuilder, c as CustomTransformsBuilder, d as StyleDictionaryPluginOptions, f as StyleDictionaryPluginResolvedConfig, g as __ΩCustomFiltersBuilder, h as __ΩCustomFileHeadersBuilder, i as CustomFormatsBuilder, l as StyleDictionaryPluginContext, m as __ΩCustomActionsBuilder, n as CustomFileHeadersBuilder, o as CustomPreprocessorsBuilder, p as StyleDictionaryPluginUserConfig, r as CustomFiltersBuilder, s as CustomTransformGroupsBuilder, t as CustomActionsBuilder, u as StyleDictionaryPluginEnvironmentConfig, v as __ΩCustomParsersBuilder, w as __ΩStyleDictionaryPluginOptions, x as __ΩCustomTransformsBuilder, y as __ΩCustomPreprocessorsBuilder } from "../plugin-stDuO5l1.mjs";
|
|
118
2
|
export { 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 };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-style-dictionary",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code with Style Dictionary.",
|
|
6
6
|
"repository": {
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
"@stryke/types": "^0.10.29",
|
|
128
128
|
"defu": "^6.1.4",
|
|
129
129
|
"jiti": "^2.6.1",
|
|
130
|
-
"powerlines": "^0.36.
|
|
130
|
+
"powerlines": "^0.36.26",
|
|
131
131
|
"style-dictionary": "^5.1.1"
|
|
132
132
|
},
|
|
133
133
|
"devDependencies": {
|
|
134
|
-
"@powerlines/nx": "^0.11.
|
|
135
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
134
|
+
"@powerlines/nx": "^0.11.52",
|
|
135
|
+
"@powerlines/plugin-plugin": "^0.12.74",
|
|
136
136
|
"@types/node": "^24.10.4"
|
|
137
137
|
},
|
|
138
138
|
"publishConfig": { "access": "public" },
|
|
139
|
-
"gitHead": "
|
|
139
|
+
"gitHead": "a703a2dd9be6175a67a9bf4847d0217be4e920af"
|
|
140
140
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
exports.__toESM = __toESM;
|
|
@@ -1,102 +0,0 @@
|
|
|
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.builtins.reduce((ret, id) => {
|
|
58
|
-
if (!ret[id]) {
|
|
59
|
-
const path = context.fs.ids[id];
|
|
60
|
-
if (path) ret[id] = path;
|
|
61
|
-
}
|
|
62
|
-
return ret;
|
|
63
|
-
}, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
|
|
64
|
-
if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
|
|
65
|
-
return ret;
|
|
66
|
-
}, {}) : context.config.build.alias : {}),
|
|
67
|
-
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
|
|
68
|
-
}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build.override, [
|
|
69
|
-
"alias",
|
|
70
|
-
"inject",
|
|
71
|
-
"external",
|
|
72
|
-
"noExternal",
|
|
73
|
-
"skipNodeModulesBundle",
|
|
74
|
-
"extensions"
|
|
75
|
-
]) : {}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build, [
|
|
76
|
-
"alias",
|
|
77
|
-
"inject",
|
|
78
|
-
"external",
|
|
79
|
-
"noExternal",
|
|
80
|
-
"skipNodeModulesBundle",
|
|
81
|
-
"extensions",
|
|
82
|
-
"variant",
|
|
83
|
-
"override"
|
|
84
|
-
]) : {}, {
|
|
85
|
-
mainFields: context.config.build.mainFields,
|
|
86
|
-
conditions: context.config.build.conditions,
|
|
87
|
-
define: context.config.build.define,
|
|
88
|
-
resolveExtensions: context.config.build.extensions,
|
|
89
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
90
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
91
|
-
platform: context.config.build.platform,
|
|
92
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
93
|
-
outdir: context.config.output.buildPath,
|
|
94
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
95
|
-
minify: context.config.mode !== "development",
|
|
96
|
-
metafile: context.config.mode === "development",
|
|
97
|
-
sourcemap: context.config.mode === "development"
|
|
98
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
exports.extractESBuildConfig = extractESBuildConfig;
|
|
@@ -1,100 +0,0 @@
|
|
|
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.builtins.reduce((ret, id) => {
|
|
56
|
-
if (!ret[id]) {
|
|
57
|
-
const path = context.fs.ids[id];
|
|
58
|
-
if (path) ret[id] = path;
|
|
59
|
-
}
|
|
60
|
-
return ret;
|
|
61
|
-
}, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
|
|
62
|
-
if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
|
|
63
|
-
return ret;
|
|
64
|
-
}, {}) : context.config.build.alias : {}),
|
|
65
|
-
inject: inject && Object.keys(inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
|
|
66
|
-
}, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
|
|
67
|
-
"alias",
|
|
68
|
-
"inject",
|
|
69
|
-
"external",
|
|
70
|
-
"noExternal",
|
|
71
|
-
"skipNodeModulesBundle",
|
|
72
|
-
"extensions"
|
|
73
|
-
]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
|
|
74
|
-
"alias",
|
|
75
|
-
"inject",
|
|
76
|
-
"external",
|
|
77
|
-
"noExternal",
|
|
78
|
-
"skipNodeModulesBundle",
|
|
79
|
-
"extensions",
|
|
80
|
-
"variant",
|
|
81
|
-
"override"
|
|
82
|
-
]) : {}, {
|
|
83
|
-
mainFields: context.config.build.mainFields,
|
|
84
|
-
conditions: context.config.build.conditions,
|
|
85
|
-
define: context.config.build.define,
|
|
86
|
-
resolveExtensions: context.config.build.extensions,
|
|
87
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
88
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
89
|
-
platform: context.config.build.platform,
|
|
90
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
91
|
-
outdir: context.config.output.buildPath,
|
|
92
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
93
|
-
minify: context.config.mode !== "development",
|
|
94
|
-
metafile: context.config.mode === "development",
|
|
95
|
-
sourcemap: context.config.mode === "development"
|
|
96
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
//#endregion
|
|
100
|
-
export { extractESBuildConfig };
|
|
@@ -1,12 +0,0 @@
|
|
|
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/fs/is-file");
|
|
9
|
-
require("@stryke/fs/list-files");
|
|
10
|
-
require("@stryke/hash/murmurhash");
|
|
11
|
-
require("@stryke/helpers/get-unique");
|
|
12
|
-
require("@stryke/path/append");
|
|
@@ -1,14 +0,0 @@
|
|
|
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/fs/is-file";
|
|
9
|
-
import "@stryke/fs/list-files";
|
|
10
|
-
import "@stryke/hash/murmurhash";
|
|
11
|
-
import "@stryke/helpers/get-unique";
|
|
12
|
-
import "@stryke/path/append";
|
|
13
|
-
|
|
14
|
-
export { };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_esbuild = require('../build/esbuild.cjs');
|
|
3
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
4
|
-
let esbuild = require("esbuild");
|
|
5
|
-
|
|
6
|
-
//#region ../powerlines/src/lib/utilities/bundle.ts
|
|
7
|
-
/**
|
|
8
|
-
* Bundle a type definition to a module.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The context object containing the environment paths.
|
|
11
|
-
* @param file - The file path to bundle.
|
|
12
|
-
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
13
|
-
* @returns A promise that resolves to the bundled module.
|
|
14
|
-
*/
|
|
15
|
-
async function bundle(context, file, overrides = {}) {
|
|
16
|
-
const path = await context.fs.resolve(file);
|
|
17
|
-
if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
18
|
-
const result = await (0, esbuild.build)({
|
|
19
|
-
...require_esbuild.extractESBuildConfig(context),
|
|
20
|
-
entryPoints: [path],
|
|
21
|
-
write: false,
|
|
22
|
-
sourcemap: false,
|
|
23
|
-
splitting: false,
|
|
24
|
-
treeShaking: false,
|
|
25
|
-
bundle: true,
|
|
26
|
-
...overrides
|
|
27
|
-
});
|
|
28
|
-
if (result.errors.length > 0) throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
|
|
29
|
-
if (result.warnings.length > 0) context.log(__storm_software_config_tools_types.LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
|
|
30
|
-
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.`);
|
|
31
|
-
return result.outputFiles.filter(Boolean)[0];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
exports.bundle = bundle;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { extractESBuildConfig } from "../build/esbuild.mjs";
|
|
2
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
|
-
import { build } from "esbuild";
|
|
4
|
-
|
|
5
|
-
//#region ../powerlines/src/lib/utilities/bundle.ts
|
|
6
|
-
/**
|
|
7
|
-
* Bundle a type definition to a module.
|
|
8
|
-
*
|
|
9
|
-
* @param context - The context object containing the environment paths.
|
|
10
|
-
* @param file - The file path to bundle.
|
|
11
|
-
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
12
|
-
* @returns A promise that resolves to the bundled module.
|
|
13
|
-
*/
|
|
14
|
-
async function bundle(context, file, overrides = {}) {
|
|
15
|
-
const path = await context.fs.resolve(file);
|
|
16
|
-
if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
17
|
-
const result = await build({
|
|
18
|
-
...extractESBuildConfig(context),
|
|
19
|
-
entryPoints: [path],
|
|
20
|
-
write: false,
|
|
21
|
-
sourcemap: false,
|
|
22
|
-
splitting: false,
|
|
23
|
-
treeShaking: false,
|
|
24
|
-
bundle: true,
|
|
25
|
-
...overrides
|
|
26
|
-
});
|
|
27
|
-
if (result.errors.length > 0) throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
|
|
28
|
-
if (result.warnings.length > 0) context.log(LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
|
|
29
|
-
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.`);
|
|
30
|
-
return result.outputFiles.filter(Boolean)[0];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
|
-
export { bundle };
|