vueless 0.0.122 → 0.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.122",
3
+ "version": "0.0.124",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -37,8 +37,8 @@
37
37
  "@release-it/bumper": "^6.0.1",
38
38
  "@vitejs/plugin-vue": "^5.0.4",
39
39
  "@vue/eslint-config-prettier": "^9.0.0",
40
- "@vueless/plugin-vite": "^0.0.19",
41
- "@vueless/storybook": "^0.0.22",
40
+ "@vueless/plugin-vite": "^0.0.20",
41
+ "@vueless/storybook": "^0.0.26",
42
42
  "@vueless/web-types": "^0.0.6",
43
43
  "autoprefixer": "^10.4.19",
44
44
  "cssnano": "^6.1.2",
@@ -2,11 +2,6 @@ import colors from "tailwindcss/colors.js";
2
2
  import forms from "@tailwindcss/forms";
3
3
  import { BRAND_COLORS, GRAY_COLORS, GRAYSCALE_COLOR } from "./constants/index.js";
4
4
 
5
- /* Load Vueless config from the project root. */
6
- import { createRequire } from "module";
7
- const require = createRequire(import.meta.url);
8
- const { default: vuelessConfig } = require(process.cwd() + "/vueless.config.js");
9
-
10
5
  /**
11
6
  * Generates preset for TailwindCSS base on Vueless config.
12
7
  * @returns {Object}
@@ -14,7 +9,7 @@ const { default: vuelessConfig } = require(process.cwd() + "/vueless.config.js")
14
9
  export function vuelessPreset() {
15
10
  const isProd = process.env.NODE_ENV === "production";
16
11
  const brandColor = twColorWithOpacity("--color-brand");
17
- const { brand, gray } = vuelessConfig;
12
+ const { brand, gray } = getVuelessConfig();
18
13
 
19
14
  let brandPalette = BRAND_COLORS.includes(brand) ? colors[brand] : colors.green;
20
15
  let grayPalette = GRAY_COLORS.includes(gray) ? colors[gray] : colors.zinc;
@@ -73,12 +68,20 @@ function twColorWithOpacity(variableName) {
73
68
  };
74
69
  }
75
70
 
71
+ /**
72
+ * Convert sting to object.
73
+ * @returns {Array} - TailwindCSS safelist.
74
+ */
75
+ function getVuelessConfig() {
76
+ return JSON.parse(process.env.VUELESS_CONFIG_JSON || "[]");
77
+ }
78
+
76
79
  /**
77
80
  * Convert sting patterns to RegExp.
78
81
  * @returns {Array} - TailwindCSS safelist.
79
82
  */
80
83
  function getSafelist() {
81
- return JSON.parse(process.env.SAFELIST_JSON || "[]").map((rule) => ({
84
+ return JSON.parse(process.env.VUELESS_SAFELIST_JSON || "[]").map((rule) => ({
82
85
  ...rule,
83
86
  pattern: new RegExp(rule.pattern),
84
87
  }));
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.122",
4
+ "version": "0.0.124",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",