mage-obsidian 1.0.9 → 1.0.11

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": "mage-obsidian",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Mage Obsidian Ultis",
5
5
  "main": "./src/scripts/buildThemes.js",
6
6
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  import themeResolver from './themeResolverSync.js';
2
2
  import path from 'node:path';
3
3
  import { MODULE_WEB_PATH, THEME_CSS_FOLDER, THEME_MODULE_WEB_PATH } from '../config/default.js';
4
- import { resolveFileByTheme } from './moduleResolver.js';
4
+ import { resolveFileByTheme, getAllJsVueFilesWithInheritanceCached } from './moduleResolver.js';
5
5
  import configResolver from './configResolver.js';
6
6
  import fs from 'node:fs/promises';
7
7
 
@@ -35,11 +35,21 @@ function resolveModuleCssSourcePath(moduleName, themeName) {
35
35
  return moduleConfigSourcePath;
36
36
  }
37
37
 
38
+ async function getVueComponentsSource(themeName) {
39
+ const vueComponents = await getAllJsVueFilesWithInheritanceCached(themeName);
40
+ // split with @source al inicio
41
+ const vueComponentSources = Object.entries(vueComponents).map(([name, url]) => {
42
+ return `@source "${url}";\n`;
43
+ })
44
+ return vueComponentSources.join('');
45
+ }
46
+
38
47
  async function getCssImports(themeName) {
39
48
  const themeConfig = themeResolver.getThemeConfig(themeName);
40
49
  const excludedModules = new Set(themeConfig.ignoredCssFromModules || []);
41
50
  const modulesConfig = getModulesConfigArray();
42
51
 
52
+ let cssSource = await getVueComponentsSource(themeName);
43
53
  let cssImports = '';
44
54
 
45
55
  if (themeConfig.ignoredCssFromModules !== 'all') {
@@ -57,7 +67,7 @@ async function getCssImports(themeName) {
57
67
  }
58
68
 
59
69
  cssImports += await getThemeImports(themeName);
60
- return cssImports;
70
+ return `${cssSource}\n${cssImports}`;
61
71
  }
62
72
 
63
73
  export default getCssImports;
@@ -186,5 +186,5 @@ export default {
186
186
  resolveFileByTheme
187
187
  };
188
188
 
189
- export { getModuleConfigByThemeConfig, resolveFileByTheme };
189
+ export { getModuleConfigByThemeConfig, resolveFileByTheme, getAllJsVueFilesWithInheritance, getAllJsVueFilesWithInheritanceCached };
190
190
 
@@ -10,7 +10,7 @@ export default async (themeName) => {
10
10
  execSync('rm -rf .precompiled/*', { stdio: 'inherit' });
11
11
  execSync(`mkdir -p .precompiled/${themeName}`, { stdio: 'inherit' });
12
12
  console.log('Generating precompiled files');
13
- await precompileCss(themeName);
14
13
  await precompileJs(themeName);
14
+ await precompileCss(themeName);
15
15
  isPrecompiled = true;
16
16
  }