solidui-cli 0.5.0 → 0.6.0
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/index.js +5 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -348,6 +348,7 @@ var ROOT_CSS = `@tailwind base;
|
|
|
348
348
|
--radius: 0.5rem;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
.dark,
|
|
351
352
|
[data-kb-theme="dark"] {
|
|
352
353
|
--background: 240 10% 3.9%;
|
|
353
354
|
--foreground: 0 0% 98%;
|
|
@@ -411,12 +412,12 @@ var ROOT_CSS = `@tailwind base;
|
|
|
411
412
|
@apply px-4;
|
|
412
413
|
}
|
|
413
414
|
}`;
|
|
414
|
-
var
|
|
415
|
+
var TAILWIND_CONFIG = `const {fontFamily} = require("tailwindcss/defaultTheme")
|
|
415
416
|
|
|
416
417
|
/**@type {import("tailwindcss").Config} */
|
|
417
418
|
module.exports = {
|
|
418
419
|
darkMode: ["class", '[data-kb-theme="dark"]'],
|
|
419
|
-
content: ["./src/**/*.{
|
|
420
|
+
content: ["./src/**/*.{ts,tsx}"],
|
|
420
421
|
theme: {
|
|
421
422
|
container: {
|
|
422
423
|
center: true,
|
|
@@ -514,14 +515,6 @@ module.exports = {
|
|
|
514
515
|
},
|
|
515
516
|
plugins: [require("tailwindcss-animate")]
|
|
516
517
|
}`;
|
|
517
|
-
var TAILWIND_CONFIG = `/** @type {import('tailwindcss').Config} */
|
|
518
|
-
export default {
|
|
519
|
-
darkMode: ["class"],
|
|
520
|
-
content: [
|
|
521
|
-
"./src/**/*.{html,js,jsx,md,mdx,ts,tsx}"
|
|
522
|
-
],
|
|
523
|
-
presets: [require("./ui.preset.js")]
|
|
524
|
-
}`;
|
|
525
518
|
|
|
526
519
|
// src/lib/transformImports.ts
|
|
527
520
|
function transformImports(source, config) {
|
|
@@ -743,7 +736,7 @@ async function add(componentNames) {
|
|
|
743
736
|
// src/commands/init.ts
|
|
744
737
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFile, writeFileSync as writeFileSync2 } from "fs";
|
|
745
738
|
import { cwd as cwd2 } from "process";
|
|
746
|
-
import {
|
|
739
|
+
import { confirm, log as log3, select, spinner as spinner3, text } from "@clack/prompts";
|
|
747
740
|
async function init() {
|
|
748
741
|
const isTypescript = await confirm({
|
|
749
742
|
message: "Would you like to use TypeScript? (recommended)",
|
|
@@ -751,7 +744,7 @@ async function init() {
|
|
|
751
744
|
});
|
|
752
745
|
const globalCssDir = await text({
|
|
753
746
|
message: "Where is your global CSS file?",
|
|
754
|
-
initialValue: "src/
|
|
747
|
+
initialValue: "src/app.css"
|
|
755
748
|
});
|
|
756
749
|
const tailwindConfigDir = await text({
|
|
757
750
|
message: "Where is your tailwind.config.js located?",
|
|
@@ -775,7 +768,6 @@ async function init() {
|
|
|
775
768
|
saveConfig(config);
|
|
776
769
|
writeTsconfig(config.aliases.path);
|
|
777
770
|
writeUtils();
|
|
778
|
-
await writeUIPreset();
|
|
779
771
|
await writeTailwindConfig(config.tailwind.config);
|
|
780
772
|
await writeCSS(config.tailwind.css);
|
|
781
773
|
log3.success("Project configuration completed.");
|
|
@@ -834,19 +826,6 @@ function saveConfig(config) {
|
|
|
834
826
|
});
|
|
835
827
|
indicator.stop("ui.config.json successfully created!");
|
|
836
828
|
}
|
|
837
|
-
async function writeUIPreset() {
|
|
838
|
-
const indicator = spinner3();
|
|
839
|
-
indicator.start("Writing Solid UI Components tailwind preset...");
|
|
840
|
-
try {
|
|
841
|
-
writeFile("ui.preset.js", TAILWIND_PRESET, (error) => {
|
|
842
|
-
if (error)
|
|
843
|
-
log3.error(`There was an error while writing the ui.preset.js: ${error}`);
|
|
844
|
-
});
|
|
845
|
-
} catch (error) {
|
|
846
|
-
log3.error(`Sorry, something went wrong while getting the tailwind presets: ${error}`);
|
|
847
|
-
}
|
|
848
|
-
indicator.stop("ui.preset.js successfully created!");
|
|
849
|
-
}
|
|
850
829
|
async function writeTailwindConfig(tailwindConfigDir) {
|
|
851
830
|
const indicator = spinner3();
|
|
852
831
|
indicator.start("Configuring tailwind.config.cjs to support Solid UI Components...");
|