lapikit 0.0.0-insiders.3c9e1ba → 0.0.0-insiders.3dd6cd6

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.
@@ -1 +1 @@
1
- export declare function css(configuration: any): void;
1
+ export declare function css(configuration: any): Promise<void>;
@@ -7,11 +7,12 @@ import path from 'path';
7
7
  const __filename = fileURLToPath(import.meta.url);
8
8
  const __dirname = dirname(__filename);
9
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
- export function css(configuration) {
11
- // console.log('VALUE configuration', configuration);
10
+ export async function css(configuration) {
11
+ console.log('VALUE configuration', configuration);
12
+ console.log('configuration?.theme?.themes', configuration?.theme?.themes);
12
13
  // states
13
14
  const defaultTheme = configuration?.theme?.defaultTheme || preset.theme.defaultTheme;
14
- const themesMerged = deepMerge(configuration?.theme?.themes || {}, preset.theme.themes);
15
+ const themesMerged = deepMerge(preset.theme.themes, configuration?.theme?.themes || {});
15
16
  let response = '';
16
17
  console.log('VALUE themesMerged', themesMerged);
17
18
  for (const [name, values] of Object.entries(themesMerged)) {
@@ -20,12 +21,12 @@ export function css(configuration) {
20
21
  const ref = values?.dark ? preset.theme.themes.dark : preset.theme.themes.light;
21
22
  // colors
22
23
  css += ` color-scheme: ${values?.dark ? 'dark' : 'light'};\n`;
23
- for (const [varName, varValue] of Object.entries(deepMerge(values?.colors, ref.colors) || {})) {
24
+ for (const [varName, varValue] of Object.entries(deepMerge(ref.colors, values?.colors) || {})) {
24
25
  css += ` --system-${varName}: ${varValue};\n`;
25
26
  }
26
27
  // console.log('VALUE', values, deepMerge(values?.variables, ref.variables));
27
28
  // variables
28
- for (const [name, varValue] of Object.entries(deepMerge(values?.variables, ref.variables) || {})) {
29
+ for (const [name, varValue] of Object.entries(deepMerge(ref.variables, values?.variables) || {})) {
29
30
  css += ` --kit-${name}: ${varValue};\n`;
30
31
  }
31
32
  css += '}\n';
@@ -29,8 +29,8 @@ async function getLapikitConfig(filePath) {
29
29
  export async function lapikit({ config } = {}) {
30
30
  if (config) {
31
31
  const value = getLapikitConfig(config);
32
- console.log(value);
33
- css(value);
32
+ // console.log(value);
33
+ await css(value);
34
34
  }
35
35
  return {
36
36
  name: 'lapikit/vite.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapikit",
3
- "version": "0.0.0-insiders.3c9e1ba",
3
+ "version": "0.0.0-insiders.3dd6cd6",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"