vueless 0.0.788 → 0.0.790
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
|
@@ -199,10 +199,13 @@ export default function useFormatCurrency(
|
|
|
199
199
|
0,
|
|
200
200
|
options.value.maxFractionDigits,
|
|
201
201
|
);
|
|
202
|
+
const actualMinFractionDigits = options.value.minFractionDigits
|
|
203
|
+
? options.value.minFractionDigits
|
|
204
|
+
: currentFraction.length;
|
|
202
205
|
|
|
203
206
|
const newFormattedValue = getFormattedValue(newRawValue, {
|
|
204
207
|
...options.value,
|
|
205
|
-
minFractionDigits:
|
|
208
|
+
minFractionDigits: actualMinFractionDigits,
|
|
206
209
|
});
|
|
207
210
|
|
|
208
211
|
if (Number.isNaN(newFormattedValue) || newFormattedValue.includes("NaN")) {
|