css-typed-vars 0.4.1 → 0.4.2

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.
@@ -3,7 +3,7 @@ import {
3
3
  generateDeclaration,
4
4
  generateJs,
5
5
  scanVarNames
6
- } from "./chunk-B6LVS5G7.js";
6
+ } from "./chunk-Y6U2ERL3.js";
7
7
 
8
8
  // src/unplugin.ts
9
9
  import { createUnplugin } from "unplugin";
@@ -3,7 +3,7 @@ import {
3
3
  generateDeclaration,
4
4
  generateJs,
5
5
  scanVarNames
6
- } from "./chunk-B6LVS5G7.js";
6
+ } from "./chunk-Y6U2ERL3.js";
7
7
 
8
8
  // src/index.ts
9
9
  import { writeFile, mkdir } from "fs/promises";
@@ -40,7 +40,7 @@ async function scanVarNames(patterns, exclude, selectors) {
40
40
  }
41
41
  })
42
42
  );
43
- return [...all];
43
+ return [...all].sort();
44
44
  }
45
45
 
46
46
  // src/generator.ts
package/dist/cli.cjs CHANGED
@@ -74,7 +74,7 @@ async function scanVarNames(patterns, exclude, selectors) {
74
74
  }
75
75
  })
76
76
  );
77
- return [...all];
77
+ return [...all].sort();
78
78
  }
79
79
 
80
80
  // src/generator.ts
@@ -159,6 +159,13 @@ var getArg = (flag) => {
159
159
  const i = args.indexOf(flag);
160
160
  return i !== -1 ? args[i + 1] : void 0;
161
161
  };
162
+ var getArgs = (flag) => {
163
+ const result = [];
164
+ for (let i = 0; i < args.length - 1; i++) {
165
+ if (args[i] === flag) result.push(args[i + 1]);
166
+ }
167
+ return result;
168
+ };
162
169
  var watchMode = args.includes("--watch");
163
170
  async function loadConfig() {
164
171
  const candidates = [
@@ -197,8 +204,8 @@ async function main() {
197
204
  const exclude = getArg("--exclude") ?? config.exclude;
198
205
  const prefix = getArg("--prefix") ?? config.prefix;
199
206
  const naming = getArg("--naming") ?? config.naming;
200
- const selectorArg = getArg("--selector");
201
- const selectors = selectorArg ? [selectorArg] : config.selectors;
207
+ const selectorArgs = getArgs("--selector");
208
+ const selectors = selectorArgs.length > 0 ? selectorArgs : config.selectors;
202
209
  if (!input || !output) {
203
210
  console.error("Usage: css-typed-vars --input <glob> --output <file> [--watch]");
204
211
  console.error("Or add a css-typed-vars.config.js file with input and output fields.");
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  generate
4
- } from "./chunk-Z7K77FZI.js";
5
- import "./chunk-B6LVS5G7.js";
4
+ } from "./chunk-CCFKX6NQ.js";
5
+ import "./chunk-Y6U2ERL3.js";
6
6
 
7
7
  // src/cli.ts
8
8
  import { readFile } from "fs/promises";
@@ -14,6 +14,13 @@ var getArg = (flag) => {
14
14
  const i = args.indexOf(flag);
15
15
  return i !== -1 ? args[i + 1] : void 0;
16
16
  };
17
+ var getArgs = (flag) => {
18
+ const result = [];
19
+ for (let i = 0; i < args.length - 1; i++) {
20
+ if (args[i] === flag) result.push(args[i + 1]);
21
+ }
22
+ return result;
23
+ };
17
24
  var watchMode = args.includes("--watch");
18
25
  async function loadConfig() {
19
26
  const candidates = [
@@ -52,8 +59,8 @@ async function main() {
52
59
  const exclude = getArg("--exclude") ?? config.exclude;
53
60
  const prefix = getArg("--prefix") ?? config.prefix;
54
61
  const naming = getArg("--naming") ?? config.naming;
55
- const selectorArg = getArg("--selector");
56
- const selectors = selectorArg ? [selectorArg] : config.selectors;
62
+ const selectorArgs = getArgs("--selector");
63
+ const selectors = selectorArgs.length > 0 ? selectorArgs : config.selectors;
57
64
  if (!input || !output) {
58
65
  console.error("Usage: css-typed-vars --input <glob> --output <file> [--watch]");
59
66
  console.error("Or add a css-typed-vars.config.js file with input and output fields.");
package/dist/esbuild.cjs CHANGED
@@ -76,7 +76,7 @@ async function scanVarNames(patterns, exclude, selectors) {
76
76
  }
77
77
  })
78
78
  );
79
- return [...all];
79
+ return [...all].sort();
80
80
  }
81
81
 
82
82
  // src/generator.ts
package/dist/esbuild.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-PKKMLIWX.js";
4
- import "./chunk-B6LVS5G7.js";
3
+ } from "./chunk-7PBWBCVY.js";
4
+ import "./chunk-Y6U2ERL3.js";
5
5
 
6
6
  // src/esbuild.ts
7
7
  var esbuild_default = unplugin_default.esbuild;
package/dist/index.cjs CHANGED
@@ -78,7 +78,7 @@ async function scanVarNames(patterns, exclude, selectors) {
78
78
  }
79
79
  })
80
80
  );
81
- return [...all];
81
+ return [...all].sort();
82
82
  }
83
83
 
84
84
  // src/generator.ts
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-Z7K77FZI.js";
3
+ } from "./chunk-CCFKX6NQ.js";
4
4
  import {
5
5
  generateCode,
6
6
  generateDeclaration,
7
7
  generateJs,
8
8
  parseVarNames,
9
9
  scanVarNames
10
- } from "./chunk-B6LVS5G7.js";
10
+ } from "./chunk-Y6U2ERL3.js";
11
11
  export {
12
12
  generate,
13
13
  generateCode,
package/dist/rollup.cjs CHANGED
@@ -76,7 +76,7 @@ async function scanVarNames(patterns, exclude, selectors) {
76
76
  }
77
77
  })
78
78
  );
79
- return [...all];
79
+ return [...all].sort();
80
80
  }
81
81
 
82
82
  // src/generator.ts
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-PKKMLIWX.js";
4
- import "./chunk-B6LVS5G7.js";
3
+ } from "./chunk-7PBWBCVY.js";
4
+ import "./chunk-Y6U2ERL3.js";
5
5
 
6
6
  // src/rollup.ts
7
7
  var rollup_default = unplugin_default.rollup;
package/dist/unplugin.cjs CHANGED
@@ -74,7 +74,7 @@ async function scanVarNames(patterns, exclude, selectors) {
74
74
  }
75
75
  })
76
76
  );
77
- return [...all];
77
+ return [...all].sort();
78
78
  }
79
79
 
80
80
  // src/generator.ts
package/dist/unplugin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-PKKMLIWX.js";
4
- import "./chunk-B6LVS5G7.js";
3
+ } from "./chunk-7PBWBCVY.js";
4
+ import "./chunk-Y6U2ERL3.js";
5
5
  export {
6
6
  unplugin_default as default
7
7
  };
package/dist/vite.cjs CHANGED
@@ -76,7 +76,7 @@ async function scanVarNames(patterns, exclude, selectors) {
76
76
  }
77
77
  })
78
78
  );
79
- return [...all];
79
+ return [...all].sort();
80
80
  }
81
81
 
82
82
  // src/generator.ts
package/dist/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-PKKMLIWX.js";
4
- import "./chunk-B6LVS5G7.js";
3
+ } from "./chunk-7PBWBCVY.js";
4
+ import "./chunk-Y6U2ERL3.js";
5
5
 
6
6
  // src/vite.ts
7
7
  var vite_default = unplugin_default.vite;
package/dist/webpack.cjs CHANGED
@@ -76,7 +76,7 @@ async function scanVarNames(patterns, exclude, selectors) {
76
76
  }
77
77
  })
78
78
  );
79
- return [...all];
79
+ return [...all].sort();
80
80
  }
81
81
 
82
82
  // src/generator.ts
package/dist/webpack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-PKKMLIWX.js";
4
- import "./chunk-B6LVS5G7.js";
3
+ } from "./chunk-7PBWBCVY.js";
4
+ import "./chunk-Y6U2ERL3.js";
5
5
 
6
6
  // src/webpack.ts
7
7
  var webpack_default = unplugin_default.webpack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "css-typed-vars",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Generate TypeScript typed constants from CSS custom properties",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",