svelte-ag 1.0.0 → 1.0.4
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/dist/lib/vite/vite-plugin-component-source-collector.d.ts +4 -0
- package/dist/lib/vite/vite-plugin-component-source-collector.d.ts.map +1 -1
- package/dist/lib/vite/vite-plugin-component-source-collector.js +2 -2
- package/package.json +3 -3
- package/src/lib/vite/vite-plugin-component-source-collector.ts +7 -2
|
@@ -11,6 +11,10 @@ interface Options {
|
|
|
11
11
|
*/
|
|
12
12
|
include?: RegExp | RegExp[];
|
|
13
13
|
run: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* node_modules packages that can be added to the component list
|
|
16
|
+
*/
|
|
17
|
+
safePackages: string[];
|
|
14
18
|
}
|
|
15
19
|
export default function componentSourceCollector(opts?: Options): Plugin;
|
|
16
20
|
export {};
|
|
@@ -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;AAInD,UAAU,OAAO;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B,GAAG,EAAE,OAAO,CAAC;
|
|
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;AAInD,UAAU,OAAO;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B,GAAG,EAAE,OAAO,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,IAAI,GAAE,OAAyC,GAAG,MAAM,CA8GxG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writeIfDifferent } from 'ts-ag';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
export default function componentSourceCollector(opts = { run: true }) {
|
|
3
|
+
export default function componentSourceCollector(opts = { run: true, safePackages: [] }) {
|
|
4
4
|
if (opts.run === false)
|
|
5
5
|
return { name: 'disabled' };
|
|
6
6
|
const outFile = opts.outputFile ?? 'component-sources.css';
|
|
@@ -34,7 +34,7 @@ export default function componentSourceCollector(opts = { run: true }) {
|
|
|
34
34
|
const classRegex = /class(?:=|:)/;
|
|
35
35
|
const importRegex = /@import\s+['"]([^'"]+)['"]/g;
|
|
36
36
|
function shouldAdd(fileName) {
|
|
37
|
-
return !/\.pnpm|.vite/.test(fileName);
|
|
37
|
+
return !/\.pnpm|.vite/.test(fileName) || opts.safePackages.some((p) => fileName.includes(`node_modules/${p}`));
|
|
38
38
|
}
|
|
39
39
|
/** ---- plugin ----------------------------------------------------------- */
|
|
40
40
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-ag",
|
|
3
3
|
"description": "Useful svelte components",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"author": "Alexander Hornung",
|
|
6
6
|
"bugs": "https://github.com/ageorgeh/svelte-ag/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"radash": "12.1.1",
|
|
26
26
|
"devalue": "5.1.1",
|
|
27
27
|
"bottleneck": "2.19.5",
|
|
28
|
-
"ts-ag": "1.0.
|
|
28
|
+
"ts-ag": "1.0.4"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"svelte": "^5.28.2",
|
|
@@ -94,6 +94,6 @@
|
|
|
94
94
|
"publish:prerelease": "pnpm publish --tag dev --access public --no-git-checks --registry=https://registry.npmjs.org/ --json > ./publish.json",
|
|
95
95
|
"version:prerelease": "pnpm version prerelease --preid dev --no-git-tag-version",
|
|
96
96
|
"run-publish": "pnpm publish --access public --no-git-checks --registry=https://registry.npmjs.org/ --json > ./publish.json",
|
|
97
|
-
"run-version": "pnpm version --no-git-tag-version"
|
|
97
|
+
"run-version": "pnpm version patch --no-git-tag-version"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -15,9 +15,14 @@ interface Options {
|
|
|
15
15
|
include?: RegExp | RegExp[];
|
|
16
16
|
|
|
17
17
|
run: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* node_modules packages that can be added to the component list
|
|
21
|
+
*/
|
|
22
|
+
safePackages: string[];
|
|
18
23
|
}
|
|
19
24
|
|
|
20
|
-
export default function componentSourceCollector(opts: Options = { run: true }): Plugin {
|
|
25
|
+
export default function componentSourceCollector(opts: Options = { run: true, safePackages: [] }): Plugin {
|
|
21
26
|
if (opts.run === false) return { name: 'disabled' };
|
|
22
27
|
|
|
23
28
|
const outFile = opts.outputFile ?? 'component-sources.css';
|
|
@@ -57,7 +62,7 @@ export default function componentSourceCollector(opts: Options = { run: true }):
|
|
|
57
62
|
const importRegex = /@import\s+['"]([^'"]+)['"]/g;
|
|
58
63
|
|
|
59
64
|
function shouldAdd(fileName: string) {
|
|
60
|
-
return !/\.pnpm|.vite/.test(fileName);
|
|
65
|
+
return !/\.pnpm|.vite/.test(fileName) || opts.safePackages.some((p) => fileName.includes(`node_modules/${p}`));
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
/** ---- plugin ----------------------------------------------------------- */
|