@powerlines/plugin-style-dictionary 0.3.584 → 0.3.587
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/README.md +38 -0
- package/dist/index.cjs +5 -9
- package/dist/index.d.cts +0 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -2
- package/dist/index.mjs +3 -6
- package/dist/types/plugin.d.cts +0 -2
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +0 -2
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -74,6 +74,44 @@ A Powerlines plugin to generate project code with [Style Dictionary](https://amz
|
|
|
74
74
|
|
|
75
75
|
<!-- END doctoc -->
|
|
76
76
|
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+
- Generates project code and design tokens with [Style Dictionary](https://amzn.github.io/style-dictionary/#/)
|
|
80
|
+
- Uses token sources from the Style Dictionary `source` / `include` paths with no options needed
|
|
81
|
+
- Accepts tokens passed directly via the `tokens` option
|
|
82
|
+
- Runs during the `prepare` command, or manually with `skipBuild: true`
|
|
83
|
+
|
|
84
|
+
## Usage
|
|
85
|
+
|
|
86
|
+
Install the plugin:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pnpm add @powerlines/plugin-style-dictionary
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Register it in `powerlines.config.ts`:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { plugin as styleDictionary } from "@powerlines/plugin-style-dictionary";
|
|
96
|
+
import { defineConfig } from "powerlines/config";
|
|
97
|
+
|
|
98
|
+
export default defineConfig({
|
|
99
|
+
plugins: [styleDictionary()]
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Run the `prepare` command to build the tokens. To pass tokens directly:
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
export default defineConfig({
|
|
107
|
+
plugins: [
|
|
108
|
+
styleDictionary({
|
|
109
|
+
tokens: { color: { brand: { value: "#1fb2a6" } } }
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
77
115
|
## Installing
|
|
78
116
|
|
|
79
117
|
Using [pnpm](http://pnpm.io):
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -25,8 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
enumerable: true
|
|
26
26
|
}) : target, mod));
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
require('./types/index.cjs');
|
|
28
|
+
require("./types/index.cjs");
|
|
30
29
|
let _power_plant_style_dictionary = require("@power-plant/style-dictionary");
|
|
31
30
|
_power_plant_style_dictionary = __toESM(_power_plant_style_dictionary, 1);
|
|
32
31
|
let _powerlines_plugin_power_plant = require("@powerlines/plugin-power-plant");
|
|
@@ -37,7 +36,7 @@ let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function")
|
|
|
37
36
|
let powerlines_schema = require("powerlines/schema");
|
|
38
37
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
// src/style-dictionary/file-header.ts
|
|
41
40
|
const fileHeader = (context) => ({
|
|
42
41
|
name: "powerlines/file-header",
|
|
43
42
|
fileHeader: (defaultMessages = []) => {
|
|
@@ -49,8 +48,7 @@ const fileHeader = (context) => ({
|
|
|
49
48
|
}
|
|
50
49
|
});
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
//#region src/helpers/resolve-hooks.ts
|
|
51
|
+
// src/helpers/resolve-hooks.ts
|
|
54
52
|
async function resolveBuilder(context, input) {
|
|
55
53
|
if ((0, _stryke_type_checks_is_function.isFunction)(input)) return input;
|
|
56
54
|
return (0, powerlines_schema.resolve)(context, input);
|
|
@@ -136,8 +134,7 @@ async function resolveStyleDictionaryHooks(context, options) {
|
|
|
136
134
|
return hooks;
|
|
137
135
|
}
|
|
138
136
|
|
|
139
|
-
|
|
140
|
-
//#region src/index.ts
|
|
137
|
+
// src/index.ts
|
|
141
138
|
/**
|
|
142
139
|
* A Powerlines plugin to integrate Style Dictionary for code generation via Power Plant.
|
|
143
140
|
*
|
|
@@ -187,5 +184,4 @@ const plugin = (options = {}) => {
|
|
|
187
184
|
}];
|
|
188
185
|
};
|
|
189
186
|
|
|
190
|
-
//#endregion
|
|
191
187
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CustomActionsBuilder, CustomFileHeadersBuilder, CustomFiltersBuilder, CustomFormatsBuilder, CustomParsersBuilder, CustomPreprocessorsBuilder, CustomTransformGroupsBuilder, CustomTransformsBuilder, StyleDictionaryPluginContext, StyleDictionaryPluginEnvironmentConfig, StyleDictionaryPluginOptions, StyleDictionaryPluginResolvedConfig, StyleDictionaryPluginUserConfig } from "./types/plugin.cjs";
|
|
2
2
|
import "./types/index.cjs";
|
|
3
3
|
import { Plugin } from "powerlines";
|
|
4
|
-
//#region src/index.d.ts
|
|
5
4
|
declare module "powerlines" {
|
|
6
5
|
interface Config {
|
|
7
6
|
styleDictionary?: StyleDictionaryPluginOptions;
|
|
@@ -14,6 +13,5 @@ declare module "powerlines" {
|
|
|
14
13
|
* @returns Powerlines plugin instances.
|
|
15
14
|
*/
|
|
16
15
|
declare const plugin: <TContext extends StyleDictionaryPluginContext = StyleDictionaryPluginContext>(options?: StyleDictionaryPluginOptions) => Plugin<TContext>[];
|
|
17
|
-
//#endregion
|
|
18
16
|
export { CustomActionsBuilder, CustomFileHeadersBuilder, CustomFiltersBuilder, CustomFormatsBuilder, CustomParsersBuilder, CustomPreprocessorsBuilder, CustomTransformGroupsBuilder, CustomTransformsBuilder, StyleDictionaryPluginContext, StyleDictionaryPluginEnvironmentConfig, StyleDictionaryPluginOptions, StyleDictionaryPluginResolvedConfig, StyleDictionaryPluginUserConfig, plugin };
|
|
19
17
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;YAmCY;IACR,kBAAkB;;;;;;;;;cAUT,SACX,iBAAiB,+BAA+B,8BAEhD,UAAS,iCACR,OAAO"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CustomActionsBuilder, CustomFileHeadersBuilder, CustomFiltersBuilder, CustomFormatsBuilder, CustomParsersBuilder, CustomPreprocessorsBuilder, CustomTransformGroupsBuilder, CustomTransformsBuilder, StyleDictionaryPluginContext, StyleDictionaryPluginEnvironmentConfig, StyleDictionaryPluginOptions, StyleDictionaryPluginResolvedConfig, StyleDictionaryPluginUserConfig } from "./types/plugin.mjs";
|
|
2
2
|
import "./types/index.mjs";
|
|
3
3
|
import { Plugin } from "powerlines";
|
|
4
|
-
//#region src/index.d.ts
|
|
5
4
|
declare module "powerlines" {
|
|
6
5
|
interface Config {
|
|
7
6
|
styleDictionary?: StyleDictionaryPluginOptions;
|
|
@@ -14,6 +13,5 @@ declare module "powerlines" {
|
|
|
14
13
|
* @returns Powerlines plugin instances.
|
|
15
14
|
*/
|
|
16
15
|
declare const plugin: <TContext extends StyleDictionaryPluginContext = StyleDictionaryPluginContext>(options?: StyleDictionaryPluginOptions) => Plugin<TContext>[];
|
|
17
|
-
//#endregion
|
|
18
16
|
export { CustomActionsBuilder, CustomFileHeadersBuilder, CustomFiltersBuilder, CustomFormatsBuilder, CustomParsersBuilder, CustomPreprocessorsBuilder, CustomTransformGroupsBuilder, CustomTransformsBuilder, StyleDictionaryPluginContext, StyleDictionaryPluginEnvironmentConfig, StyleDictionaryPluginOptions, StyleDictionaryPluginResolvedConfig, StyleDictionaryPluginUserConfig, plugin };
|
|
19
17
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { isFunction } from "@stryke/type-checks/is-function";
|
|
|
7
7
|
import { resolve } from "powerlines/schema";
|
|
8
8
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/style-dictionary/file-header.ts
|
|
11
11
|
const fileHeader = (context) => ({
|
|
12
12
|
name: "powerlines/file-header",
|
|
13
13
|
fileHeader: (defaultMessages = []) => {
|
|
@@ -19,8 +19,7 @@ const fileHeader = (context) => ({
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
//#region src/helpers/resolve-hooks.ts
|
|
22
|
+
// src/helpers/resolve-hooks.ts
|
|
24
23
|
async function resolveBuilder(context, input) {
|
|
25
24
|
if (isFunction(input)) return input;
|
|
26
25
|
return resolve(context, input);
|
|
@@ -106,8 +105,7 @@ async function resolveStyleDictionaryHooks(context, options) {
|
|
|
106
105
|
return hooks;
|
|
107
106
|
}
|
|
108
107
|
|
|
109
|
-
|
|
110
|
-
//#region src/index.ts
|
|
108
|
+
// src/index.ts
|
|
111
109
|
/**
|
|
112
110
|
* A Powerlines plugin to integrate Style Dictionary for code generation via Power Plant.
|
|
113
111
|
*
|
|
@@ -157,6 +155,5 @@ const plugin = (options = {}) => {
|
|
|
157
155
|
}];
|
|
158
156
|
};
|
|
159
157
|
|
|
160
|
-
//#endregion
|
|
161
158
|
export { plugin };
|
|
162
159
|
//# sourceMappingURL=index.mjs.map
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -3,7 +3,6 @@ import { Options } from "@power-plant/style-dictionary";
|
|
|
3
3
|
import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
|
|
4
4
|
import { FileReferenceInput } from "@stryke/types/configuration";
|
|
5
5
|
import { Action, DesignTokens, FileHeader, Filter, Format, Parser, PlatformConfig, Preprocessor, Transform } from "style-dictionary/types";
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
6
|
type StyleDictionaryExtensionBuilder<T> = (extensionContext: StyleDictionaryPluginContext) => Record<string, T>;
|
|
8
7
|
type CustomActionsBuilder = StyleDictionaryExtensionBuilder<Action>;
|
|
9
8
|
type CustomTransformsBuilder = StyleDictionaryExtensionBuilder<Transform>;
|
|
@@ -98,6 +97,5 @@ type StyleDictionaryPluginResolvedConfig = ResolvedConfig & PowerPlantPluginReso
|
|
|
98
97
|
environments: Record<string, StyleDictionaryPluginEnvironmentConfig>;
|
|
99
98
|
};
|
|
100
99
|
type StyleDictionaryPluginContext<TResolvedConfig extends StyleDictionaryPluginResolvedConfig = StyleDictionaryPluginResolvedConfig> = PowerPlantPluginContext<DesignTokens, Options, TResolvedConfig>;
|
|
101
|
-
//#endregion
|
|
102
100
|
export { CustomActionsBuilder, CustomFileHeadersBuilder, CustomFiltersBuilder, CustomFormatsBuilder, CustomParsersBuilder, CustomPreprocessorsBuilder, CustomTransformGroupsBuilder, CustomTransformsBuilder, StyleDictionaryPluginContext, StyleDictionaryPluginEnvironmentConfig, StyleDictionaryPluginOptions, StyleDictionaryPluginResolvedConfig, StyleDictionaryPluginUserConfig };
|
|
103
101
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":["PowerPlantStyleDictionaryOptions"],"sources":["../../src/types/plugin.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":["PowerPlantStyleDictionaryOptions"],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;KAqCK,gCAAgC,MACnC,kBAAkB,iCACf,eAAe;KAER,uBAAuB,gCAAgC;KACvD,0BACV,gCAAgC;KACtB,uBAAuB,gCAAgC;KACvD,+BAA+B;KAG/B,2BACV,gCAAgC;KACtB,uBAAuB,gCAAgC;KACvD,wBACV,kBAAkB,iCACf;KACO,6BACV,gCAAgC;KAEtB,+BAA+BA;;;;;;;;EAQzC,SAAS;;;;;;;;;EAUT;;;;;;;EAQA,gBAAgB,qBAAqB;;;;;;;EAQrC,oBAAoB,qBAAqB;;;;;;;EAQzC,gBAAgB,qBAAqB;;;;;;;EAQrC,gBAAgB,qBAAqB;;;;;;;EAQrC,sBAAsB,qBAAqB;;;;;;;EAQ3C,gBAAgB,qBAAqB;;;;;;;EAQrC,wBAAwB,qBAAqB;;;;;;;EAQ7C,mBAAmB,qBAAqB;;KAG9B,yCAAyC,oBACnD;KAEU,kCAAkC;EAC5C,kBAAkB;EAClB,eAAe,eAAe;;KAGpB,sCAAsC,iBAChD,+BAA+B,cAAcA;EAC3C,iBAAiB;EACjB,cAAc,eAAe;;KAGrB,6BACV,wBAAwB,sCACtB,uCACA,wBACF,cACAA,SACA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -3,7 +3,6 @@ import { EnvironmentConfig, ResolvedConfig, UserConfig } from "powerlines";
|
|
|
3
3
|
import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
|
|
4
4
|
import { FileReferenceInput } from "@stryke/types/configuration";
|
|
5
5
|
import { Action, DesignTokens, FileHeader, Filter, Format, Parser, PlatformConfig, Preprocessor, Transform } from "style-dictionary/types";
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
6
|
type StyleDictionaryExtensionBuilder<T> = (extensionContext: StyleDictionaryPluginContext) => Record<string, T>;
|
|
8
7
|
type CustomActionsBuilder = StyleDictionaryExtensionBuilder<Action>;
|
|
9
8
|
type CustomTransformsBuilder = StyleDictionaryExtensionBuilder<Transform>;
|
|
@@ -98,6 +97,5 @@ type StyleDictionaryPluginResolvedConfig = ResolvedConfig & PowerPlantPluginReso
|
|
|
98
97
|
environments: Record<string, StyleDictionaryPluginEnvironmentConfig>;
|
|
99
98
|
};
|
|
100
99
|
type StyleDictionaryPluginContext<TResolvedConfig extends StyleDictionaryPluginResolvedConfig = StyleDictionaryPluginResolvedConfig> = PowerPlantPluginContext<DesignTokens, Options, TResolvedConfig>;
|
|
101
|
-
//#endregion
|
|
102
100
|
export { CustomActionsBuilder, CustomFileHeadersBuilder, CustomFiltersBuilder, CustomFormatsBuilder, CustomParsersBuilder, CustomPreprocessorsBuilder, CustomTransformGroupsBuilder, CustomTransformsBuilder, StyleDictionaryPluginContext, StyleDictionaryPluginEnvironmentConfig, StyleDictionaryPluginOptions, StyleDictionaryPluginResolvedConfig, StyleDictionaryPluginUserConfig };
|
|
103
101
|
//# sourceMappingURL=plugin.d.mts.map
|
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.587",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Powerlines plugin to generate project code with Style Dictionary.",
|
|
6
6
|
"keywords": [
|
|
@@ -95,21 +95,21 @@
|
|
|
95
95
|
"typings": "dist/index.d.mts",
|
|
96
96
|
"files": ["dist"],
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@power-plant/core": "^0.0.
|
|
99
|
-
"@power-plant/style-dictionary": "^0.0.
|
|
100
|
-
"@powerlines/plugin-power-plant": "^0.1.
|
|
101
|
-
"@storm-software/config-tools": "^1.190.
|
|
98
|
+
"@power-plant/core": "^0.0.98",
|
|
99
|
+
"@power-plant/style-dictionary": "^0.0.83",
|
|
100
|
+
"@powerlines/plugin-power-plant": "^0.1.74",
|
|
101
|
+
"@storm-software/config-tools": "^1.190.154",
|
|
102
102
|
"@stryke/string-format": "^0.17.58",
|
|
103
103
|
"@stryke/type-checks": "^0.6.49",
|
|
104
104
|
"@stryke/types": "^0.12.44",
|
|
105
105
|
"defu": "^6.1.7",
|
|
106
|
-
"powerlines": "^0.47.
|
|
107
|
-
"style-dictionary": "^5.
|
|
106
|
+
"powerlines": "^0.47.217",
|
|
107
|
+
"style-dictionary": "^5.7.0"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
110
|
+
"@powerlines/plugin-plugin": "^0.12.630",
|
|
111
111
|
"@types/node": "^25.9.9"
|
|
112
112
|
},
|
|
113
113
|
"publishConfig": { "access": "public" },
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "bb4e1f2b32a8bb9d20559ca7c3df3a2f30a0d14e"
|
|
115
115
|
}
|