svelte-ag 1.0.41 → 1.0.43

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.
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin-component-source-collector.d.ts","sourceRoot":"","sources":["../../../src/lib/vite/vite-plugin-component-source-collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAMnD,UAAU,OAAO;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAKD,wBAA8B,wBAAwB,CAAC,IAAI,GAAE,OAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,CAoK5G"}
1
+ {"version":3,"file":"vite-plugin-component-source-collector.d.ts","sourceRoot":"","sources":["../../../src/lib/vite/vite-plugin-component-source-collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAMnD,UAAU,OAAO;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAWD,wBAA8B,wBAAwB,CAAC,IAAI,GAAE,OAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,CAqK5G"}
@@ -4,6 +4,12 @@ import { resolve, join, relative, dirname } from 'path';
4
4
  import { open } from 'fs/promises';
5
5
  /** All unique component directories */
6
6
  const componentFiles = new Set();
7
+ let firstRound = true;
8
+ function ensureDotRelative(filePath) {
9
+ if (filePath.startsWith('.'))
10
+ return filePath;
11
+ return `./${filePath}`;
12
+ }
7
13
  export default async function componentSourceCollector(opts = { safePackages: [] }) {
8
14
  // constants
9
15
  const outFileName = opts.outputFile ?? 'component-sources.css';
@@ -13,7 +19,6 @@ export default async function componentSourceCollector(opts = { safePackages: []
13
19
  let root = undefined;
14
20
  // state
15
21
  let config;
16
- let firstRound = true;
17
22
  let initialTransformDone = false;
18
23
  let initialTransformTimer = null;
19
24
  // init
@@ -30,7 +35,7 @@ export default async function componentSourceCollector(opts = { safePackages: []
30
35
  const relativeFilePath = relative(dirname(outputFilePath), cleanedFileName);
31
36
  if (relativeFilePath !== outFileName) {
32
37
  // Dont add itself
33
- componentFiles.add(relativeFilePath);
38
+ componentFiles.add(ensureDotRelative(relativeFilePath));
34
39
  }
35
40
  }
36
41
  }
@@ -69,8 +74,10 @@ export default async function componentSourceCollector(opts = { safePackages: []
69
74
  config = resolved;
70
75
  root = config.root;
71
76
  outputFilePath = resolve(root, outFileName);
77
+ console.log('tailwind-sources:configResolved: Command is', config.command);
72
78
  await touch(outputFilePath);
73
79
  if (config.command === 'build' && firstRound) {
80
+ console.log('tailwind-sources: Clearing files list');
74
81
  componentFiles.clear();
75
82
  firstRound = false;
76
83
  }
@@ -81,7 +88,6 @@ export default async function componentSourceCollector(opts = { safePackages: []
81
88
  // console.log('config resolved', componentFiles);
82
89
  }
83
90
  }
84
- console.log('tailwind-sources:configResolved:command', config.command);
85
91
  },
86
92
  /**
87
93
  * Reset list on lock file changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-ag",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Useful svelte components",
5
5
  "bugs": "https://github.com/ageorgeh/svelte-ag/issues",
6
6
  "repository": {
@@ -70,7 +70,7 @@
70
70
  "@iconify/tailwind4": "^1.2.1",
71
71
  "@iconify/types": "^2.0.0",
72
72
  "@internationalized/date": "^3.12.0",
73
- "@lucide/svelte": "^0.576.0",
73
+ "@lucide/svelte": "^0.577.0",
74
74
  "@playwright/test": "1.57.0",
75
75
  "@sveltejs/kit": "^2.53.4",
76
76
  "@sveltejs/package": "^2.5.7",
@@ -23,6 +23,12 @@ interface Options {
23
23
 
24
24
  /** All unique component directories */
25
25
  const componentFiles = new Set<string>();
26
+ let firstRound = true;
27
+
28
+ function ensureDotRelative(filePath: string): string {
29
+ if (filePath.startsWith('.')) return filePath;
30
+ return `./${filePath}`;
31
+ }
26
32
 
27
33
  export default async function componentSourceCollector(opts: Options = { safePackages: [] }): Promise<Plugin> {
28
34
  // constants
@@ -35,7 +41,6 @@ export default async function componentSourceCollector(opts: Options = { safePac
35
41
 
36
42
  // state
37
43
  let config: ResolvedConfig;
38
- let firstRound = true;
39
44
  let initialTransformDone = false;
40
45
  let initialTransformTimer: NodeJS.Timeout | null = null;
41
46
 
@@ -57,7 +62,7 @@ export default async function componentSourceCollector(opts: Options = { safePac
57
62
 
58
63
  if (relativeFilePath !== outFileName) {
59
64
  // Dont add itself
60
- componentFiles.add(relativeFilePath);
65
+ componentFiles.add(ensureDotRelative(relativeFilePath));
61
66
  }
62
67
  }
63
68
  }
@@ -102,9 +107,12 @@ export default async function componentSourceCollector(opts: Options = { safePac
102
107
  root = config.root;
103
108
  outputFilePath = resolve(root, outFileName);
104
109
 
110
+ console.log('tailwind-sources:configResolved: Command is', config.command);
111
+
105
112
  await touch(outputFilePath);
106
113
 
107
114
  if (config.command === 'build' && firstRound) {
115
+ console.log('tailwind-sources: Clearing files list');
108
116
  componentFiles.clear();
109
117
  firstRound = false;
110
118
  } else if (config.command === 'serve') {
@@ -114,7 +122,6 @@ export default async function componentSourceCollector(opts: Options = { safePac
114
122
  // console.log('config resolved', componentFiles);
115
123
  }
116
124
  }
117
- console.log('tailwind-sources:configResolved:command', config.command);
118
125
  },
119
126
 
120
127
  /**