@lukoweb/apitogo 0.1.56 → 0.1.57
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/dist/cli/cli.js +32 -3
- package/package.json +1 -1
- package/src/vite/plugin-theme.ts +41 -0
package/dist/cli/cli.js
CHANGED
|
@@ -1584,9 +1584,10 @@ var init_shadcn_registry = __esm({
|
|
|
1584
1584
|
});
|
|
1585
1585
|
|
|
1586
1586
|
// src/vite/plugin-theme.ts
|
|
1587
|
+
import { createRequire } from "node:module";
|
|
1587
1588
|
import path4 from "node:path";
|
|
1588
1589
|
import { normalizeTheme } from "shiki";
|
|
1589
|
-
var THEME_VARIABLES, uncamelize, processColorValue, generateCss, generateRegistryCss, processCustomCss, MAIN_REPLACE, DEFAULT_THEME_REPLACE, GOOGLE_FONTS, getGoogleFontUrl, processFont, processFontConfig, processFonts, virtualModuleId, resolvedVirtualModuleId, viteThemePlugin;
|
|
1590
|
+
var THEME_VARIABLES, uncamelize, processColorValue, generateCss, generateRegistryCss, processCustomCss, MAIN_REPLACE, DEFAULT_THEME_REPLACE, GOOGLE_FONTS, getGoogleFontUrl, processFont, processFontConfig, processFonts, MODULE_SOURCE_PACKAGES, resolveModuleSourceDirs, virtualModuleId, resolvedVirtualModuleId, viteThemePlugin;
|
|
1590
1591
|
var init_plugin_theme = __esm({
|
|
1591
1592
|
"src/vite/plugin-theme.ts"() {
|
|
1592
1593
|
init_loader();
|
|
@@ -1754,6 +1755,33 @@ var init_plugin_theme = __esm({
|
|
|
1754
1755
|
}
|
|
1755
1756
|
return { imports, families };
|
|
1756
1757
|
};
|
|
1758
|
+
MODULE_SOURCE_PACKAGES = [
|
|
1759
|
+
"@lukoweb/apitogo-module-landing",
|
|
1760
|
+
"@lukoweb/apitogo-module-user-panel"
|
|
1761
|
+
];
|
|
1762
|
+
resolveModuleSourceDirs = (config2) => {
|
|
1763
|
+
if (config2.__meta.mode === "internal") {
|
|
1764
|
+
return MODULE_SOURCE_PACKAGES.map(
|
|
1765
|
+
(pkg) => path4.join(
|
|
1766
|
+
config2.__meta.moduleDir,
|
|
1767
|
+
"..",
|
|
1768
|
+
pkg.replace("@lukoweb/apitogo-", ""),
|
|
1769
|
+
"src"
|
|
1770
|
+
)
|
|
1771
|
+
);
|
|
1772
|
+
}
|
|
1773
|
+
const require2 = createRequire(
|
|
1774
|
+
path4.join(config2.__meta.rootDir, "package.json")
|
|
1775
|
+
);
|
|
1776
|
+
const dirs = [];
|
|
1777
|
+
for (const pkg of MODULE_SOURCE_PACKAGES) {
|
|
1778
|
+
try {
|
|
1779
|
+
dirs.push(path4.dirname(require2.resolve(pkg)));
|
|
1780
|
+
} catch {
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
return dirs;
|
|
1784
|
+
};
|
|
1757
1785
|
virtualModuleId = "virtual:zudoku-theme.css";
|
|
1758
1786
|
resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
1759
1787
|
viteThemePlugin = () => {
|
|
@@ -1871,7 +1899,8 @@ ${rootVars.join("\n")}
|
|
|
1871
1899
|
[
|
|
1872
1900
|
config2.__meta.rootDir,
|
|
1873
1901
|
...config2.__meta.dependencies,
|
|
1874
|
-
...config2.__pluginDirs ?? []
|
|
1902
|
+
...config2.__pluginDirs ?? [],
|
|
1903
|
+
...resolveModuleSourceDirs(config2)
|
|
1875
1904
|
].map((file) => path4.relative(path4.dirname(id), file))
|
|
1876
1905
|
);
|
|
1877
1906
|
const code = [...files].map((file) => `@source "${file}";`);
|
|
@@ -5185,7 +5214,7 @@ import {
|
|
|
5185
5214
|
// package.json
|
|
5186
5215
|
var package_default = {
|
|
5187
5216
|
name: "@lukoweb/apitogo",
|
|
5188
|
-
version: "0.1.
|
|
5217
|
+
version: "0.1.57",
|
|
5189
5218
|
type: "module",
|
|
5190
5219
|
sideEffects: [
|
|
5191
5220
|
"**/*.css",
|
package/package.json
CHANGED
package/src/vite/plugin-theme.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { normalizeTheme, type ThemeRegistration } from "shiki";
|
|
3
4
|
import type { Plugin } from "vite";
|
|
5
|
+
import type { ConfigWithMeta } from "../config/loader.js";
|
|
4
6
|
import { getCurrentConfig } from "../config/loader.js";
|
|
5
7
|
import type {
|
|
6
8
|
FontConfig,
|
|
@@ -200,6 +202,44 @@ const processFonts = async (themeConfig: ZudokuConfig["theme"]) => {
|
|
|
200
202
|
return { imports, families };
|
|
201
203
|
};
|
|
202
204
|
|
|
205
|
+
const MODULE_SOURCE_PACKAGES = [
|
|
206
|
+
"@lukoweb/apitogo-module-landing",
|
|
207
|
+
"@lukoweb/apitogo-module-user-panel",
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Directories of module packages (landing, user panel) that use Tailwind
|
|
212
|
+
* utility classes. They live outside the Tailwind `source("..")` root set in
|
|
213
|
+
* main.css, so they must be added as explicit `@source` scan paths — otherwise
|
|
214
|
+
* their arbitrary-value utilities (e.g. the landing hero grid template and
|
|
215
|
+
* terminal card colors) are missing from the generated CSS.
|
|
216
|
+
*/
|
|
217
|
+
const resolveModuleSourceDirs = (config: ConfigWithMeta): string[] => {
|
|
218
|
+
if (config.__meta.mode === "internal") {
|
|
219
|
+
return MODULE_SOURCE_PACKAGES.map((pkg) =>
|
|
220
|
+
path.join(
|
|
221
|
+
config.__meta.moduleDir,
|
|
222
|
+
"..",
|
|
223
|
+
pkg.replace("@lukoweb/apitogo-", ""),
|
|
224
|
+
"src",
|
|
225
|
+
),
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const require = createRequire(
|
|
230
|
+
path.join(config.__meta.rootDir, "package.json"),
|
|
231
|
+
);
|
|
232
|
+
const dirs: string[] = [];
|
|
233
|
+
for (const pkg of MODULE_SOURCE_PACKAGES) {
|
|
234
|
+
try {
|
|
235
|
+
dirs.push(path.dirname(require.resolve(pkg)));
|
|
236
|
+
} catch {
|
|
237
|
+
// Module package not installed — nothing to scan.
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return dirs;
|
|
241
|
+
};
|
|
242
|
+
|
|
203
243
|
export const virtualModuleId = "virtual:zudoku-theme.css";
|
|
204
244
|
export const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
205
245
|
|
|
@@ -348,6 +388,7 @@ export const viteThemePlugin = (): Plugin => {
|
|
|
348
388
|
config.__meta.rootDir,
|
|
349
389
|
...config.__meta.dependencies,
|
|
350
390
|
...(config.__pluginDirs ?? []),
|
|
391
|
+
...resolveModuleSourceDirs(config),
|
|
351
392
|
].map((file) => path.relative(path.dirname(id), file)),
|
|
352
393
|
);
|
|
353
394
|
|