comment-variables 1.2.2 → 1.2.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.
@@ -45,7 +45,7 @@ const data = {
45
45
  // ownAliasKey: "LEVELONE#LEVELTWO#OWNALIASKEY", // errors, is its own key/alias
46
46
  // key: "key not allowed", // errors, "key", "value" and "placeholder" not allowed
47
47
  // value: "value not allowed", // errors, "key", "value" and "placeholder" not allowed
48
- // placeholder: "placeholder not allowed", // errors, "key", "value" and "placeholder" not allowed
48
+ placeholder: "placeholder now allowed", // doesn't error, "placeholder" is now allowed
49
49
  // noConcat: "no" + "concat", // errors, unrecognized value
50
50
 
51
51
  // already error via regex, but now enhanced:
@@ -20,6 +20,10 @@
20
20
  "composedVariableAlias": {
21
21
  "value": "Level three. Level three.",
22
22
  "key": "LEVELONE#LEVELTWO#COMPOSEDVARIABLEALIAS"
23
+ },
24
+ "placeholder": {
25
+ "value": "placeholder now allowed",
26
+ "key": "LEVELONE#LEVELTWO#PLACEHOLDER"
23
27
  }
24
28
  }
25
29
  },
@@ -32,4 +32,4 @@ const config = {
32
32
 
33
33
  export default config;
34
34
 
35
- // Once you've grasped these concepts, simply rename this file and its JSON counterpart to `comments.config.js` and `comments.config.json` respectively and you're good to go. (If you're using the extension, make sure to run VS Code's "Developer: Reload Window" command for the extension to operate based on your new `comments.config.js` file.)
35
+ // Once you've grasped these concepts, simply rename this file, its JSON counterpart and its `.mjs` counterpart to `comments.config.js`, `comments.config.json` and `comments.config.mjs` respectively and you're good to go. (If you're using the extension, make sure to run VS Code's "Developer: Reload Window" command for the extension to operate based on your new `comments.config.js` file.)
package/library/index.js CHANGED
@@ -16,6 +16,10 @@ import resolveConfig, {
16
16
  cwd,
17
17
  knownIgnores,
18
18
  makeResolvedConfigData,
19
+ makeJsonData,
20
+ makeMjsData,
21
+ makeJsonPathLog,
22
+ makeMjsPathLog,
19
23
  } from "comment-variables-resolve-config";
20
24
 
21
25
  import { hasPackageJson, hasGitFolder } from "./_commons/constants/bases.js";
@@ -187,23 +191,17 @@ if (!makeResolvedConfigDataResults.success) {
187
191
 
188
192
  const resolvedConfigData = makeResolvedConfigDataResults.resolvedConfigData;
189
193
 
190
- const jsonData = JSON.stringify(resolvedConfigData, null, 2);
194
+ const jsonData = makeJsonData(resolvedConfigData);
191
195
  fs.writeFileSync(jsonPath, jsonData, "utf8");
192
196
 
193
- console.log(`JSON resolved config data written to: \n${jsonPath}`);
197
+ console.log(makeJsonPathLog(jsonPath));
194
198
 
195
199
  // NEW!! comments.config.mjs to directly access resolvedConfigData.
196
200
 
197
- const mjsData = `/** @typedef {${JSON.stringify(
198
- resolvedConfigData
199
- )}} ResolvedConfigData */\n\n/** @type {ResolvedConfigData} */\nexport const resolvedConfigData = ${JSON.stringify(
200
- resolvedConfigData,
201
- null,
202
- 2
203
- )}`;
201
+ const mjsData = makeMjsData(resolvedConfigData);
204
202
  fs.writeFileSync(mjsPath, mjsData, "utf8");
205
203
 
206
- console.log(`MJS resolved config data written to: \n${mjsPath}`);
204
+ console.log(makeMjsPathLog(mjsPath));
207
205
 
208
206
  // ADDRESSES THE CORE COMMANDS "resolve", "compress", AND "placeholders".
209
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comment-variables",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "A CLI tool for configuring, managing and maintaining JavaScript comments as JavaScript variables.",
5
5
  "bin": {
6
6
  "comment-variables": "./library/index.js",
@@ -30,7 +30,7 @@
30
30
  "type": "module",
31
31
  "dependencies": {
32
32
  "@eslint/markdown": "^6.5.0",
33
- "comment-variables-resolve-config": "^1.14.6",
33
+ "comment-variables-resolve-config": "^1.14.9",
34
34
  "eslint": "^9.29.0"
35
35
  },
36
36
  "devDependencies": {