comment-variables 0.11.7 → 0.12.0

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.
@@ -216,3 +216,7 @@ export const placeholdersCommentsFlow = async (
216
216
  `✅ Made placeholders on ${total} file${total === 1 ? "" : "s"}.`
217
217
  );
218
218
  };
219
+
220
+ // export const variablesCommentsFlow = () => {
221
+
222
+ // }
package/library/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // The shebang (#!) is necessary to communicate with Unix-based systems, like Linux and macOS. On Windows, it is ignored, but npm tooling bridges the gap by generating wrappers that make the CLI work anyway.
3
3
 
4
4
  import path from "path";
5
+ import fs from "fs";
5
6
 
6
7
  import resolveConfig, {
7
8
  defaultConfigFileName,
@@ -9,6 +10,7 @@ import resolveConfig, {
9
10
  lintConfigImportsFlag,
10
11
  myIgnoresOnlyFlag,
11
12
  knownIgnores,
13
+ makeResolvedConfigData,
12
14
  } from "comment-variables-resolve-config";
13
15
 
14
16
  import {
@@ -124,6 +126,22 @@ const ignores = myIgnoresOnly ? rawIgnores : [...rawIgnores, ...knownIgnores];
124
126
 
125
127
  skipDetails || console.log("Ignores are:", ignores);
126
128
 
129
+ // NEW: AUTOMATICALLY GENERATE THE JSON OUTPUT OF YOUR RESOLVED CONFIG DATA.
130
+
131
+ const makeResolvedConfigDataResults =
132
+ makeResolvedConfigData(resolveConfigResults);
133
+ if (!makeResolvedConfigDataResults.success) {
134
+ makeResolvedConfigDataResults.errors.forEach((e) => logError(e));
135
+ exitDueToFailure();
136
+ }
137
+
138
+ const resolvedConfigData = makeResolvedConfigDataResults.resolvedConfigData;
139
+ const jsonPath = resolveConfigResults.configPath.replace(/\.js$/, ".json");
140
+ const jsonData = JSON.stringify(resolvedConfigData, null, 2);
141
+ fs.writeFileSync(jsonPath, jsonData, "utf8");
142
+
143
+ console.log(`JSON resolved config data written to: \n${jsonPath}`);
144
+
127
145
  // ADDRESSES THE CORE COMMANDS "resolve" AND "compress".
128
146
 
129
147
  switch (coreCommand) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comment-variables",
3
- "version": "0.11.7",
3
+ "version": "0.12.0",
4
4
  "description": "A CLI tool for configuring, managing and maintaining JavaScript comments as JavaScript variables.",
5
5
  "bin": {
6
6
  "jscomments": "./library/index.js",
@@ -26,7 +26,7 @@
26
26
  "type": "module",
27
27
  "dependencies": {
28
28
  "@eslint/markdown": "^6.5.0",
29
- "comment-variables-resolve-config": "^1.7.3",
29
+ "comment-variables-resolve-config": "^1.9.1",
30
30
  "eslint": "^9.29.0"
31
31
  },
32
32
  "devDependencies": {