vueless 0.0.797 → 0.0.799
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/index.ts +1 -1
- package/package.json +7 -3
- package/ui.button/UButton.test.ts +32 -0
- package/utils/storybook.ts +21 -21
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.799",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
6
6
|
"keywords": [
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
"release:major": "release-it major --ci --npm.publish --git.tag --github.release",
|
|
41
41
|
"lint": "eslint --no-fix src/ .storybook/",
|
|
42
42
|
"lint:fix": "eslint --fix src/ .storybook/",
|
|
43
|
-
"lint:ci": "eslint --no-fix --max-warnings=0"
|
|
43
|
+
"lint:ci": "eslint --no-fix --max-warnings=0",
|
|
44
|
+
"test": "vitest",
|
|
45
|
+
"test:ci": "vitest --run"
|
|
44
46
|
},
|
|
45
47
|
"bin": {
|
|
46
48
|
"vueless": "./bin/index.js"
|
|
@@ -63,10 +65,11 @@
|
|
|
63
65
|
"@types/jsdom": "^21.1.7",
|
|
64
66
|
"@types/lodash-es": "^4.17.12",
|
|
65
67
|
"@types/node": "^22.7.7",
|
|
66
|
-
"@vitejs/plugin-vue": "^5.
|
|
68
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
67
69
|
"@vitest/eslint-plugin": "^1.1.7",
|
|
68
70
|
"@vue/eslint-config-prettier": "^10.0.0",
|
|
69
71
|
"@vue/eslint-config-typescript": "^14.1.1",
|
|
72
|
+
"@vue/test-utils": "^2.4.6",
|
|
70
73
|
"@vue/tsconfig": "^0.5.1",
|
|
71
74
|
"@vueless/storybook": "^0.0.59",
|
|
72
75
|
"autoprefixer": "^10.4.19",
|
|
@@ -84,6 +87,7 @@
|
|
|
84
87
|
"typescript": "^5.6.3",
|
|
85
88
|
"vite": "6.0.9",
|
|
86
89
|
"vite-plugin-compression": "^0.5.1",
|
|
90
|
+
"vitest": "^3.0.5",
|
|
87
91
|
"vue": "^3.5.4",
|
|
88
92
|
"vue-i18n": "^10.0.4",
|
|
89
93
|
"vue-router": "^4.3.2",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { mount } from "@vue/test-utils";
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
|
|
4
|
+
import UButton from "./UButton.vue";
|
|
5
|
+
|
|
6
|
+
describe("UButton.vue", () => {
|
|
7
|
+
it("component renders", () => {
|
|
8
|
+
const label = "";
|
|
9
|
+
const result = "invisible";
|
|
10
|
+
|
|
11
|
+
const component = mount(UButton, {
|
|
12
|
+
props: {
|
|
13
|
+
label,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
expect(component.text()).toBe(result);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("renders the correct label", () => {
|
|
21
|
+
const label = "Button";
|
|
22
|
+
const result = label;
|
|
23
|
+
|
|
24
|
+
const component = mount(UButton, {
|
|
25
|
+
props: {
|
|
26
|
+
label,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
expect(component.text()).toContain(result);
|
|
31
|
+
});
|
|
32
|
+
});
|
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
|
+
}
|