vueless 0.0.787 → 0.0.789
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/copy.js
CHANGED
|
@@ -38,7 +38,7 @@ export async function copyVuelessComponent(options) {
|
|
|
38
38
|
const isComponentExists = newComponentName in COMPONENTS || existsSync(destPath);
|
|
39
39
|
|
|
40
40
|
if (isComponentExists) {
|
|
41
|
-
throw new Error(`Component with name ${newComponentName}
|
|
41
|
+
throw new Error(`Component with name ${newComponentName} already exists.`);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
await cp(sourceComponentPath, destPath, { recursive: true });
|
|
@@ -46,7 +46,7 @@ export async function copyVuelessComponent(options) {
|
|
|
46
46
|
|
|
47
47
|
const successMessage = styleText(
|
|
48
48
|
"green",
|
|
49
|
-
`
|
|
49
|
+
`The '${componentName}' was successfully copied into the '${destPath}' directory.`,
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
console.log(successMessage);
|
package/bin/commands/create.js
CHANGED
|
@@ -32,7 +32,7 @@ export async function createVuelessComponent(options) {
|
|
|
32
32
|
const isComponentExists = componentName in COMPONENTS || existsSync(destPath);
|
|
33
33
|
|
|
34
34
|
if (isComponentExists) {
|
|
35
|
-
throw new Error(`Component with name ${componentName}
|
|
35
|
+
throw new Error(`Component with name ${componentName} already exists.`);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
await cp(boilerplatePath, destPath, { recursive: true });
|
|
@@ -41,7 +41,7 @@ export async function createVuelessComponent(options) {
|
|
|
41
41
|
|
|
42
42
|
const successMessage = styleText(
|
|
43
43
|
"green",
|
|
44
|
-
`
|
|
44
|
+
`The '${componentName}' was successfully created in the '${destPath}' directory.`,
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
console.log(successMessage);
|
package/bin/commands/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { vuelessInit } from "./init.js";
|
|
2
2
|
import { createVuelessComponent } from "./create.js";
|
|
3
3
|
import { copyVuelessComponent } from "./copy.js";
|
|
4
4
|
|
|
5
5
|
export const commands = {
|
|
6
|
-
init:
|
|
6
|
+
init: vuelessInit,
|
|
7
7
|
create: createVuelessComponent,
|
|
8
8
|
copy: copyVuelessComponent,
|
|
9
9
|
};
|
package/bin/commands/init.js
CHANGED
|
@@ -8,27 +8,27 @@ import { styleText } from "node:util";
|
|
|
8
8
|
import { DEFAULT_VUELESS_CONFIG_CONTNET } from "../constants.js";
|
|
9
9
|
import { JAVASCRIPT_EXT, TYPESCRIPT_EXT, VUELESS_CONFIG_FILE_NAME } from "../../constants.js";
|
|
10
10
|
|
|
11
|
-
const destPath = path.join(cwd(), VUELESS_CONFIG_FILE_NAME);
|
|
12
|
-
|
|
13
11
|
const vuelessInitOptions = ["--ts", "--js"];
|
|
14
12
|
|
|
15
|
-
export async function
|
|
13
|
+
export async function vuelessInit(options) {
|
|
16
14
|
const isValidOptions = options.every((option) => vuelessInitOptions.includes(option));
|
|
17
15
|
|
|
18
16
|
if (options.length && !isValidOptions) {
|
|
19
|
-
throw new Error("
|
|
17
|
+
throw new Error("Invalid options were provided.");
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
const fileExt = options.includes("--ts") ? TYPESCRIPT_EXT : JAVASCRIPT_EXT;
|
|
23
|
-
const formattedDestPath = path.format({
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const formattedDestPath = path.format({
|
|
22
|
+
dir: cwd(),
|
|
23
|
+
name: VUELESS_CONFIG_FILE_NAME,
|
|
24
|
+
ext: fileExt,
|
|
25
|
+
});
|
|
26
26
|
|
|
27
27
|
await writeFile(formattedDestPath, DEFAULT_VUELESS_CONFIG_CONTNET, "utf-8");
|
|
28
28
|
|
|
29
29
|
const successMessage = styleText(
|
|
30
30
|
"green",
|
|
31
|
-
`
|
|
31
|
+
`The '${formattedDestPath.split(path.sep).at(-1)}' was created in the project root directory.`,
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
console.log(successMessage);
|
package/package.json
CHANGED
|
@@ -19,6 +19,8 @@ interface ULabelArgs extends Props {
|
|
|
19
19
|
enum: "align" | "size";
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
const argTypes = getArgTypes(ULabel.__name);
|
|
23
|
+
|
|
22
24
|
export default {
|
|
23
25
|
id: "3210",
|
|
24
26
|
title: "Form Inputs & Controls / Label",
|
|
@@ -28,7 +30,13 @@ export default {
|
|
|
28
30
|
description: "We'll never share your email with anyone else.",
|
|
29
31
|
},
|
|
30
32
|
argTypes: {
|
|
31
|
-
...
|
|
33
|
+
...argTypes,
|
|
34
|
+
align: {
|
|
35
|
+
...argTypes?.align,
|
|
36
|
+
options: (argTypes?.align?.table?.type?.summary as string)
|
|
37
|
+
?.split(" | ")
|
|
38
|
+
?.filter((option) => option !== "topInside"),
|
|
39
|
+
},
|
|
32
40
|
},
|
|
33
41
|
parameters: {
|
|
34
42
|
docs: {
|