solidui-cli 0.5.0 → 0.6.1
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 +10 -30
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { log as log2, spinner as spinner2 } from "@clack/prompts";
|
|
|
11
11
|
import chalk from "chalk";
|
|
12
12
|
import prompts from "prompts";
|
|
13
13
|
|
|
14
|
-
// ../../node_modules/.pnpm/valibot@0.
|
|
14
|
+
// ../../node_modules/.pnpm/valibot@0.30.0/node_modules/valibot/dist/index.js
|
|
15
15
|
var ValiError = class extends Error {
|
|
16
16
|
issues;
|
|
17
17
|
/**
|
|
@@ -51,8 +51,8 @@ var store4;
|
|
|
51
51
|
function getSpecificMessage(reference, lang) {
|
|
52
52
|
return store4?.get(reference)?.get(lang);
|
|
53
53
|
}
|
|
54
|
-
function i18n(context, reference, config, issue) {
|
|
55
|
-
const message = context.message ?? getSpecificMessage(reference, issue.lang) ?? (
|
|
54
|
+
function i18n(schema, context, reference, config, issue) {
|
|
55
|
+
const message = context.message ?? getSpecificMessage(reference, issue.lang) ?? (schema ? getSchemaMessage(issue.lang) : null) ?? config?.message ?? getGlobalMessage(issue.lang) ?? issue.message;
|
|
56
56
|
return typeof message === "function" ? message(issue) : message;
|
|
57
57
|
}
|
|
58
58
|
function schemaResult(typed, output, issues) {
|
|
@@ -82,6 +82,7 @@ function pipeIssue(context, config, issue) {
|
|
|
82
82
|
skipPipe: config?.skipPipe
|
|
83
83
|
};
|
|
84
84
|
schemaIssue2.message = i18n(
|
|
85
|
+
false,
|
|
85
86
|
issue.context,
|
|
86
87
|
issue.reference,
|
|
87
88
|
config,
|
|
@@ -136,7 +137,7 @@ function schemaIssue(context, reference, input, config, other) {
|
|
|
136
137
|
abortPipeEarly: config?.abortPipeEarly,
|
|
137
138
|
skipPipe: config?.skipPipe
|
|
138
139
|
};
|
|
139
|
-
issue.message = i18n(context, reference, config, issue);
|
|
140
|
+
issue.message = i18n(true, context, reference, config, issue);
|
|
140
141
|
return { typed: false, output: input, issues: [issue] };
|
|
141
142
|
}
|
|
142
143
|
function boolean(arg1, arg2) {
|
|
@@ -348,6 +349,7 @@ var ROOT_CSS = `@tailwind base;
|
|
|
348
349
|
--radius: 0.5rem;
|
|
349
350
|
}
|
|
350
351
|
|
|
352
|
+
.dark,
|
|
351
353
|
[data-kb-theme="dark"] {
|
|
352
354
|
--background: 240 10% 3.9%;
|
|
353
355
|
--foreground: 0 0% 98%;
|
|
@@ -411,12 +413,12 @@ var ROOT_CSS = `@tailwind base;
|
|
|
411
413
|
@apply px-4;
|
|
412
414
|
}
|
|
413
415
|
}`;
|
|
414
|
-
var
|
|
416
|
+
var TAILWIND_CONFIG = `const {fontFamily} = require("tailwindcss/defaultTheme")
|
|
415
417
|
|
|
416
418
|
/**@type {import("tailwindcss").Config} */
|
|
417
419
|
module.exports = {
|
|
418
420
|
darkMode: ["class", '[data-kb-theme="dark"]'],
|
|
419
|
-
content: ["./src/**/*.{
|
|
421
|
+
content: ["./src/**/*.{ts,tsx}"],
|
|
420
422
|
theme: {
|
|
421
423
|
container: {
|
|
422
424
|
center: true,
|
|
@@ -514,14 +516,6 @@ module.exports = {
|
|
|
514
516
|
},
|
|
515
517
|
plugins: [require("tailwindcss-animate")]
|
|
516
518
|
}`;
|
|
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
519
|
|
|
526
520
|
// src/lib/transformImports.ts
|
|
527
521
|
function transformImports(source, config) {
|
|
@@ -743,7 +737,7 @@ async function add(componentNames) {
|
|
|
743
737
|
// src/commands/init.ts
|
|
744
738
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFile, writeFileSync as writeFileSync2 } from "fs";
|
|
745
739
|
import { cwd as cwd2 } from "process";
|
|
746
|
-
import {
|
|
740
|
+
import { confirm, log as log3, select, spinner as spinner3, text } from "@clack/prompts";
|
|
747
741
|
async function init() {
|
|
748
742
|
const isTypescript = await confirm({
|
|
749
743
|
message: "Would you like to use TypeScript? (recommended)",
|
|
@@ -751,7 +745,7 @@ async function init() {
|
|
|
751
745
|
});
|
|
752
746
|
const globalCssDir = await text({
|
|
753
747
|
message: "Where is your global CSS file?",
|
|
754
|
-
initialValue: "src/
|
|
748
|
+
initialValue: "src/app.css"
|
|
755
749
|
});
|
|
756
750
|
const tailwindConfigDir = await text({
|
|
757
751
|
message: "Where is your tailwind.config.js located?",
|
|
@@ -775,7 +769,6 @@ async function init() {
|
|
|
775
769
|
saveConfig(config);
|
|
776
770
|
writeTsconfig(config.aliases.path);
|
|
777
771
|
writeUtils();
|
|
778
|
-
await writeUIPreset();
|
|
779
772
|
await writeTailwindConfig(config.tailwind.config);
|
|
780
773
|
await writeCSS(config.tailwind.css);
|
|
781
774
|
log3.success("Project configuration completed.");
|
|
@@ -834,19 +827,6 @@ function saveConfig(config) {
|
|
|
834
827
|
});
|
|
835
828
|
indicator.stop("ui.config.json successfully created!");
|
|
836
829
|
}
|
|
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
830
|
async function writeTailwindConfig(tailwindConfigDir) {
|
|
851
831
|
const indicator = spinner3();
|
|
852
832
|
indicator.start("Configuring tailwind.config.cjs to support Solid UI Components...");
|