vueless 0.0.637 → 0.0.638

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.637",
3
+ "version": "0.0.638",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -22,9 +22,8 @@ import {
22
22
  GRAYSCALE_COLOR,
23
23
  } from "./constants.js";
24
24
 
25
- const isStrategyOverride = process.env.VUELESS_STRATEGY === "override";
26
- const brandColor = process.env.VUELESS_BRAND || DEFAULT_BRAND_COLOR;
27
- const grayColor = process.env.VUELESS_GRAY || DEFAULT_GRAY_COLOR;
25
+ const globalSettings = process.env.VUELESS_GLOBAL_SETTINGS || {};
26
+ const isStrategyOverride = globalSettings.strategy === "override";
28
27
 
29
28
  /**
30
29
  * Vueless Tailwind CSS `content` config.
@@ -106,15 +105,16 @@ export const vuelessTailwindConfig = {
106
105
  },
107
106
  configViewer: {
108
107
  themeReplacements: {
109
- // TODO: Set colors from vueless.config.{js|ts} if it present.
110
- "var(--vl-ring)": DEFAULT_RING,
111
- "var(--vl-ring-offset)": DEFAULT_RING_OFFSET,
112
- "var(--vl-ring-offset-color)": DEFAULT_RING_OFFSET_COLOR_LIGHT,
113
- "var(--vl-rounding-sm)": DEFAULT_ROUNDING_SM,
114
- "var(--vl-rounding)": DEFAULT_ROUNDING,
115
- "var(--vl-rounding-lg)": DEFAULT_ROUNDING_LG,
116
- ...getReplacementColors(GRAY_COLOR, grayColor),
117
- ...getReplacementColors(BRAND_COLOR, brandColor),
108
+ /* eslint-disable prettier/prettier */
109
+ "var(--vl-ring)": globalSettings.ring || DEFAULT_RING,
110
+ "var(--vl-ring-offset)": globalSettings.ringOffset || DEFAULT_RING_OFFSET,
111
+ "var(--vl-ring-offset-color)": globalSettings.ringOffsetColorLight || DEFAULT_RING_OFFSET_COLOR_LIGHT,
112
+ "var(--vl-rounding-sm)": globalSettings.roundingSm || DEFAULT_ROUNDING_SM,
113
+ "var(--vl-rounding)": globalSettings.ring || DEFAULT_ROUNDING,
114
+ "var(--vl-rounding-lg)": globalSettings.roundingLg || DEFAULT_ROUNDING_LG,
115
+ ...getReplacementColors(GRAY_COLOR, globalSettings.gray || DEFAULT_GRAY_COLOR),
116
+ ...getReplacementColors(BRAND_COLOR, globalSettings.brand || DEFAULT_BRAND_COLOR),
117
+ /* eslint-enable prettier/prettier */
118
118
  },
119
119
  },
120
120
  },
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { merge } from "lodash-es";
2
+ import { merge, cloneDeep } from "lodash-es";
3
3
  import { existsSync } from "node:fs";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { extendTailwindMerge } from "tailwind-merge";
@@ -11,17 +11,17 @@ import { createGetMergedConfig } from "./mergeConfigs.js";
11
11
  import { getComponentDefaultConfig, getDirFiles } from "./helper.js";
12
12
  import {
13
13
  COMPONENTS,
14
- BRAND_COLORS,
15
- BRAND_COLOR,
16
14
  GRAY_COLOR,
15
+ BRAND_COLOR,
16
+ BRAND_COLORS,
17
+ STRATEGY_TYPE,
18
+ SYSTEM_CONFIG_KEY,
17
19
  DYNAMIC_COLOR_PATTERN,
18
- TAILWIND_VARIANT_DELIMITER,
19
20
  TAILWIND_MERGE_EXTENSION,
20
- NESTED_COMPONENT_PATTERN_REG_EXP,
21
+ TAILWIND_VARIANT_DELIMITER,
21
22
  TAILWIND_COLOR_OPACITY_DELIMITER,
23
+ NESTED_COMPONENT_PATTERN_REG_EXP,
22
24
  TAILWIND_VARIANT_DELIMITER_REG_EXP,
23
- STRATEGY_TYPE,
24
- SYSTEM_CONFIG_KEY,
25
25
  } from "../../constants.js";
26
26
 
27
27
  const cwd = process.cwd();
@@ -106,8 +106,14 @@ export async function createTailwindSafelist({ mode, env, debug, targetFiles = [
106
106
  console.log("VUELESS_SAFELIST", mergedSafelist);
107
107
  }
108
108
 
109
+ const globalSettings = cloneDeep(vuelessConfig);
110
+
111
+ delete globalSettings.component;
112
+ delete globalSettings.directive;
113
+ delete globalSettings.tailwindMerge;
114
+
115
+ process.env.VUELESS_GLOBAL_SETTINGS = globalSettings;
109
116
  process.env.VUELESS_SAFELIST = JSON.stringify(mergedSafelist);
110
- process.env.VUELESS_STRATEGY = vuelessConfig.strategy || "";
111
117
  }
112
118
 
113
119
  function getSafelistClasses(config) {