vueless 0.0.796 → 0.0.798
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/bin/commands/init.js +2 -2
- package/bin/constants.js +16 -15
- package/index.ts +1 -1
- package/package.json +1 -1
- package/utils/storybook.ts +21 -21
package/bin/commands/init.js
CHANGED
|
@@ -6,7 +6,7 @@ import { existsSync } from "node:fs";
|
|
|
6
6
|
import { writeFile, rename } from "node:fs/promises";
|
|
7
7
|
import { styleText } from "node:util";
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { DEFAULT_VUELESS_CONFIG_CONTENT } from "../constants.js";
|
|
10
10
|
import { JAVASCRIPT_EXT, TYPESCRIPT_EXT, VUELESS_CONFIG_FILE_NAME } from "../../constants.js";
|
|
11
11
|
|
|
12
12
|
const vuelessInitOptions = ["--ts", "--js"];
|
|
@@ -40,7 +40,7 @@ export async function vuelessInit(options) {
|
|
|
40
40
|
console.warn(warnMessage);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
await writeFile(formattedDestPath,
|
|
43
|
+
await writeFile(formattedDestPath, DEFAULT_VUELESS_CONFIG_CONTENT, "utf-8");
|
|
44
44
|
|
|
45
45
|
const successMessage = styleText(
|
|
46
46
|
"green",
|
package/bin/constants.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
export const SRC_COMPONENTS_PATH = "/src/components";
|
|
2
2
|
export const COMPONENTS_PATH = "/components";
|
|
3
|
-
export const
|
|
3
|
+
export const DEFAULT_VUELESS_CONFIG_CONTENT = `
|
|
4
4
|
export default {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* Global settings.
|
|
7
|
+
*/
|
|
8
8
|
strategy: "merge",
|
|
9
9
|
brand: "grayscale",
|
|
10
10
|
gray: "cool",
|
|
11
|
-
darkMode: "auto",
|
|
12
11
|
outline: 2,
|
|
13
12
|
rounding: 8,
|
|
13
|
+
colorMode: "auto",
|
|
14
|
+
baseClasses: ``,
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
* Directive settings.
|
|
18
|
+
*/
|
|
18
19
|
directives: {},
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
* Component settings.
|
|
23
|
+
*/
|
|
23
24
|
components: /*tw*/ {},
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
* Tailwind CSS theme config.
|
|
28
|
+
* https://tailwindcss.com/docs/theme
|
|
29
|
+
*/
|
|
29
30
|
tailwindTheme: {
|
|
30
31
|
extend: {
|
|
31
32
|
colors: {},
|
|
@@ -33,10 +34,10 @@ export default {
|
|
|
33
34
|
},
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
* Custom classes TailwindMerge settings.
|
|
38
|
+
* All lists of rules available here:
|
|
39
|
+
* https://github.com/dcastil/tailwind-merge/blob/v2.3.0/src/lib/default-config.ts
|
|
40
|
+
*/
|
|
40
41
|
tailwindMerge: {},
|
|
41
42
|
};
|
|
42
43
|
`;
|
package/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { CreateVuelessOptions } from "./types.ts"
|
|
|
9
9
|
|
|
10
10
|
export { setTheme } from "./utils/theme.ts";
|
|
11
11
|
export { cx, cva, compose, getDefaults } from "./utils/ui.ts";
|
|
12
|
-
export { getArgTypes, getSlotNames, getSlotsFragment, getSource } from "./utils/storybook.ts";
|
|
12
|
+
export { getArgTypes, getSlotNames, getSlotsFragment, getSource, getDocsDescription } from "./utils/storybook.ts";
|
|
13
13
|
export { isSSR, isCSR, getRandomId, setTitle, createDebounce, hasSlotContent } from "./utils/helper.ts";
|
|
14
14
|
export { isMac, isPWA, isIOS, isAndroid, isMobileApp, isWindows } from "./utils/platform.ts";
|
|
15
15
|
export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n.ts";
|
package/package.json
CHANGED
package/utils/storybook.ts
CHANGED
|
@@ -61,27 +61,6 @@ export function getSlotNames(componentName: string | undefined) {
|
|
|
61
61
|
return getComponentData(componentName as ComponentNames)?.slots?.map((item) => item.name);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* Create story param config to show component description with a link on GitHub.
|
|
66
|
-
*/
|
|
67
|
-
export function getDocsDescription(componentName: string | undefined) {
|
|
68
|
-
if (!componentName) {
|
|
69
|
-
return {};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
let viewOnGitHub = "";
|
|
73
|
-
|
|
74
|
-
if (COMPONENTS[componentName as ComponentNames]) {
|
|
75
|
-
viewOnGitHub = `| <a href="https://github.com/vuelessjs/vueless/tree/main/src/${COMPONENTS[componentName as ComponentNames]}" target="_blank">View on GitHub</a>`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
description: {
|
|
80
|
-
component: `The \`${componentName}\` component. ${viewOnGitHub}`,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
64
|
export function getArgTypes(componentName: string | undefined) {
|
|
86
65
|
if (!componentName) return;
|
|
87
66
|
|
|
@@ -324,3 +303,24 @@ export function getSlotsFragment(defaultTemplate: string) {
|
|
|
324
303
|
</template>
|
|
325
304
|
`;
|
|
326
305
|
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Create story param config to show component description with a link on GitHub.
|
|
309
|
+
*/
|
|
310
|
+
export function getDocsDescription(componentName: string | undefined) {
|
|
311
|
+
if (!componentName) {
|
|
312
|
+
return {};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
let viewOnGitHub = "";
|
|
316
|
+
|
|
317
|
+
if (COMPONENTS[componentName as ComponentNames]) {
|
|
318
|
+
viewOnGitHub = `| <a href="https://github.com/vuelessjs/vueless/tree/main/src/${COMPONENTS[componentName as ComponentNames]}" target="_blank">View on GitHub</a>`;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return {
|
|
322
|
+
description: {
|
|
323
|
+
component: `The \`${componentName}\` component. ${viewOnGitHub}`,
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
}
|