vueless 0.0.816 → 0.0.818

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.
@@ -32,17 +32,18 @@ export async function copyVuelessComponent(options) {
32
32
 
33
33
  const isSrcDir = existsSync(path.join(cwd(), VUELESS_LOCAL_DIR));
34
34
  const destPath = isSrcDir
35
- ? path.join(cwd(), SRC_COMPONENTS_PATH, newComponentName)
36
- : path.join(cwd(), COMPONENTS_PATH, newComponentName);
35
+ ? path.join(SRC_COMPONENTS_PATH, newComponentName)
36
+ : path.join(COMPONENTS_PATH, newComponentName);
37
+ const absoluteDestPath = path.join(cwd(), destPath);
37
38
 
38
- const isComponentExists = newComponentName in COMPONENTS || existsSync(destPath);
39
+ const isComponentExists = newComponentName in COMPONENTS || existsSync(absoluteDestPath);
39
40
 
40
41
  if (isComponentExists) {
41
42
  throw new Error(`Component with name ${newComponentName} already exists.`);
42
43
  }
43
44
 
44
- await cp(sourceComponentPath, destPath, { recursive: true });
45
- await modifyCreatedComponent(destPath, componentName, newComponentName);
45
+ await cp(sourceComponentPath, absoluteDestPath, { recursive: true });
46
+ await modifyCreatedComponent(absoluteDestPath, componentName, newComponentName);
46
47
 
47
48
  const successMessage = styleText(
48
49
  "green",
@@ -26,18 +26,18 @@ export async function createVuelessComponent(options) {
26
26
 
27
27
  const isSrcDir = existsSync(path.join(cwd(), VUELESS_LOCAL_DIR));
28
28
  const destPath = isSrcDir
29
- ? path.join(cwd(), SRC_COMPONENTS_PATH, componentName)
30
- : path.join(cwd(), COMPONENTS_PATH, componentName);
29
+ ? path.join(SRC_COMPONENTS_PATH, componentName)
30
+ : path.join(COMPONENTS_PATH, componentName);
31
+ const absoluteDestPath = path.join(cwd(), destPath);
31
32
 
32
- const isComponentExists = componentName in COMPONENTS || existsSync(destPath);
33
+ const isComponentExists = componentName in COMPONENTS || existsSync(absoluteDestPath);
33
34
 
34
35
  if (isComponentExists) {
35
36
  throw new Error(`Component with name ${componentName} already exists.`);
36
37
  }
37
38
 
38
- await cp(boilerplatePath, destPath, { recursive: true });
39
-
40
- await modifyCreatedComponent(destPath, componentName);
39
+ await cp(boilerplatePath, absoluteDestPath, { recursive: true });
40
+ await modifyCreatedComponent(absoluteDestPath, componentName);
41
41
 
42
42
  const successMessage = styleText(
43
43
  "green",
package/bin/constants.js CHANGED
@@ -11,7 +11,7 @@ export default {
11
11
  outline: 2,
12
12
  rounding: 8,
13
13
  colorMode: "auto",
14
- baseClasses: ``,
14
+ baseClasses: "",
15
15
 
16
16
  /**
17
17
  * Directive settings.
@@ -12,6 +12,7 @@ export function replaceRelativeImports(componentName, filePath, fileContent) {
12
12
  function replaceRelativeLineImports(line, isTopLevelFile) {
13
13
  const importRegex = /import\s+(?:[\w\s{},*]+)\s+from\s+(['"])(\.\.?\/.*?)(\.[tj]s)?\1(?!\?)/g;
14
14
  const multiLineImportRegExp = /from\s+(['"])(\.\.?\/.*?)(\.[tj]s)?\1(?!\?)/g; // Matches import's "from" part
15
+ const relativePathStartRegExp = /(?:\.\.\/)+/g;
15
16
 
16
17
  const isTopLevelLocalImport = isTopLevelFile && !line.includes("../");
17
18
  const isInnerLocalImport =
@@ -27,31 +28,7 @@ function replaceRelativeLineImports(line, isTopLevelFile) {
27
28
  });
28
29
  }
29
30
 
30
- return line.replace(importRegex, (match, quote, oldPath, ext) => {
31
- const isDefaultImport = match.includes("{");
32
-
33
- if (!isDefaultImport) {
34
- match = defaultToNamedImport(match);
35
- }
36
-
37
- return match.replace(oldPath + (ext || ""), VUELESS_LIBRARY);
31
+ return line.replace(importRegex, (match) => {
32
+ return match.replaceAll(relativePathStartRegExp, `${VUELESS_LIBRARY}/`);
38
33
  });
39
34
  }
40
-
41
- function defaultToNamedImport(importString) {
42
- const splittedImport = importString.split(" ");
43
-
44
- return splittedImport
45
- .map((importStringToken) => {
46
- if (importStringToken.includes("import")) {
47
- return `${importStringToken} { `;
48
- }
49
-
50
- if (importStringToken.includes("from")) {
51
- return ` } ${importStringToken} `;
52
- }
53
-
54
- return importStringToken;
55
- })
56
- .join("");
57
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.816",
3
+ "version": "0.0.818",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -7,10 +7,10 @@ Each character in the table below can be used in `dateFormat` and `userFormat` o
7
7
  {`
8
8
  | Token | Description | Example |
9
9
  | ----- | --------------------------------------------------------- | ------------------------------------------------------------- |
10
- | r | Relative representation of the day | Today, tomorrow, yesterday
11
10
  | d | Day of the month, 2 digits with leading zeros | 01 to 31 |
12
11
  | D | A textual representation of a day | Mon through Sun |
13
- | l | A full textual representation of the day of the week | Sunday through Saturday |
12
+ | l | A full textual representation of the day of the week | Sunday Saturday |
13
+ | r | A full textual representation of the day of the week with relative representation of the day | Today, Tomorrow, Yesterday, Sunday – Saturday |
14
14
  | j | Day of the month without leading zeros | 1 to 31 |
15
15
  | w | Numeric representation of the day of the week | 0 (for Sunday) through 6 (for Saturday) |
16
16
  | W | Numeric representation of the week | 0 (first week of the year) through 52 (last week of the year) |