comment-variables 1.6.1 → 2.0.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.
- package/README.md +0 -2
- package/comments.config.js +7 -7
- package/comments.config.json +139 -61
- package/library/_commons/rules/compress.js +1 -1
- package/library/_commons/rules/resolve.js +1 -1
- package/library/_commons/utilities/flows.js +13 -14
- package/library/index.js +15 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -218,5 +218,3 @@ export default config;
|
|
|
218
218
|
And yes, even comments within JavaScript and TypeScript blocks in Markdown files are addressed.
|
|
219
219
|
|
|
220
220
|
_Leverage the power of JavaScript to programmatically design your JavaScript comments._
|
|
221
|
-
|
|
222
|
-
**The Comment Variables VS Code extension is available [here](https://comvar.lemonsqueezy.com/buy/723b0220-ea5d-4b0a-835a-f0843e431639).**
|
package/comments.config.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// import {
|
|
2
|
-
// coreData as data,
|
|
3
|
-
// composedVariablesExclusives,
|
|
4
|
-
// variations,
|
|
5
|
-
// } from "./jscomments/core/data.js";
|
|
6
1
|
import {
|
|
7
|
-
|
|
2
|
+
coreData as data,
|
|
8
3
|
composedVariablesExclusives,
|
|
9
4
|
variations,
|
|
10
|
-
} from "./jscomments/
|
|
5
|
+
} from "./jscomments/core/data.js";
|
|
6
|
+
// import {
|
|
7
|
+
// variationsData as data,
|
|
8
|
+
// composedVariablesExclusives,
|
|
9
|
+
// variations,
|
|
10
|
+
// } from "./jscomments/variations/data.js";
|
|
11
11
|
|
|
12
12
|
const ignores = ["README.md", "generate.template.js", "generate.example.js"];
|
|
13
13
|
|
package/comments.config.json
CHANGED
|
@@ -1,70 +1,148 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"value": "Hello goodbye. Hello.",
|
|
29
|
-
"key": "EN#COMPOSEDWITHALIAS"
|
|
30
|
-
},
|
|
31
|
-
"_testFunction": {
|
|
32
|
-
"value": "A test function, with its JSDoc appropriately shifting between English and French.",
|
|
33
|
-
"key": "EN#_TESTFUNCTION"
|
|
2
|
+
"levelOne": {
|
|
3
|
+
"levelTwo": {
|
|
4
|
+
"levelThree": {
|
|
5
|
+
"value": "Level three.",
|
|
6
|
+
"key": "LEVELONE#LEVELTWO#LEVELTHREE"
|
|
7
|
+
},
|
|
8
|
+
"stillLevelThree": {
|
|
9
|
+
"value": "Level three.",
|
|
10
|
+
"key": "LEVELONE#LEVELTWO#STILLLEVELTHREE"
|
|
11
|
+
},
|
|
12
|
+
"otherLevelThree": {
|
|
13
|
+
"value": "Level three.",
|
|
14
|
+
"key": "LEVELONE#LEVELTWO#OTHERLEVELTHREE"
|
|
15
|
+
},
|
|
16
|
+
"composedVariable": {
|
|
17
|
+
"value": "Level three. Level three.",
|
|
18
|
+
"key": "LEVELONE#LEVELTWO#COMPOSEDVARIABLE"
|
|
19
|
+
},
|
|
20
|
+
"composedVariableAlias": {
|
|
21
|
+
"value": "Level three. Level three.",
|
|
22
|
+
"key": "LEVELONE#LEVELTWO#COMPOSEDVARIABLEALIAS"
|
|
23
|
+
},
|
|
24
|
+
"placeholder": {
|
|
25
|
+
"value": "placeholder now allowed",
|
|
26
|
+
"key": "LEVELONE#LEVELTWO#PLACEHOLDER"
|
|
27
|
+
}
|
|
34
28
|
}
|
|
35
29
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
30
|
+
"jsDoc": {
|
|
31
|
+
"definitions": {
|
|
32
|
+
"exitDueToFailure": {
|
|
33
|
+
"value": "Terminates the whole process with a 'failure' code (`1`).",
|
|
34
|
+
"key": "JSDOC#DEFINITIONS#EXITDUETOFAILURE"
|
|
35
|
+
},
|
|
36
|
+
"makeRuleResolve": {
|
|
37
|
+
"value": "The utility that creates the resolve rule based on the flattened config data, used to transform `$COMMENT` placeholders into actual comments.",
|
|
38
|
+
"key": "JSDOC#DEFINITIONS#MAKERULERESOLVE"
|
|
39
|
+
},
|
|
40
|
+
"makeRuleCompress": {
|
|
41
|
+
"value": "The utility that creates the compress rule based on the reversed flattened config data, used to transform actual comments into `$COMMENT` placeholders.",
|
|
42
|
+
"key": "JSDOC#DEFINITIONS#MAKERULECOMPRESS"
|
|
43
|
+
},
|
|
44
|
+
"coreCommentsFlow": {
|
|
45
|
+
"value": "The core flow at the heart of resolving and compressing comments.",
|
|
46
|
+
"key": "JSDOC#DEFINITIONS#CORECOMMENTSFLOW"
|
|
47
|
+
},
|
|
48
|
+
"resolveCommentsFlow": {
|
|
49
|
+
"value": "The flow that resolves `$COMMENT` placeholders into actual comments.",
|
|
50
|
+
"key": "JSDOC#DEFINITIONS#RESOLVECOMMENTSFLOW"
|
|
51
|
+
},
|
|
52
|
+
"compressCommentsFlow": {
|
|
53
|
+
"value": "The flow that compresses actual comments into `$COMMENT` placeholders.",
|
|
54
|
+
"key": "JSDOC#DEFINITIONS#COMPRESSCOMMENTSFLOW"
|
|
55
|
+
},
|
|
56
|
+
"placeholdersCommentsFlow": {
|
|
57
|
+
"value": "The flow that creates `$COMMENT` placeholders right next to where they're defined.",
|
|
58
|
+
"key": "JSDOC#DEFINITIONS#PLACEHOLDERSCOMMENTSFLOW"
|
|
59
|
+
},
|
|
60
|
+
"logError": {
|
|
61
|
+
"value": "Logs an error to the console depending on its type. (`\"error\"` or `\"warning\"`.)",
|
|
62
|
+
"key": "JSDOC#DEFINITIONS#LOGERROR"
|
|
63
|
+
}
|
|
56
64
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
65
|
+
"params": {
|
|
66
|
+
"flattenedConfigData": {
|
|
67
|
+
"value": "The flattened config data, with `$COMMENT` placeholders as keys and actual comments as values.",
|
|
68
|
+
"key": "JSDOC#PARAMS#FLATTENEDCONFIGDATA"
|
|
69
|
+
},
|
|
70
|
+
"reversedFlattenedConfigData": {
|
|
71
|
+
"value": "The reversed flattened config data, with actual comments as keys and `$COMMENT` placeholders as values.",
|
|
72
|
+
"key": "JSDOC#PARAMS#REVERSEDFLATTENEDCONFIGDATA"
|
|
73
|
+
},
|
|
74
|
+
"composedVariablesExclusives": {
|
|
75
|
+
"value": "The array of comment variables keys (implying their aliases as well) exclusively used to craft composed variables, that should be ignored by both the `resolve` and the `compress` commands.",
|
|
76
|
+
"key": "JSDOC#PARAMS#COMPOSEDVARIABLESEXCLUSIVES"
|
|
77
|
+
},
|
|
78
|
+
"aliases_flattenedKeys": {
|
|
79
|
+
"value": "The dictionary that connects aliases to their original flattened keys in case an encountered placeholder is actually an alias.",
|
|
80
|
+
"key": "JSDOC#PARAMS#ALIASES_FLATTENEDKEYS"
|
|
81
|
+
},
|
|
82
|
+
"ruleName": {
|
|
83
|
+
"value": "The name of the rule currently used. (Either `\"resolve\"` or `\"compress\"`.)",
|
|
84
|
+
"key": "JSDOC#PARAMS#RULENAME"
|
|
85
|
+
},
|
|
86
|
+
"ignores": {
|
|
87
|
+
"value": "The array of paths and globs for the flow's ESLint instance to ignore.",
|
|
88
|
+
"key": "JSDOC#PARAMS#IGNORES"
|
|
89
|
+
},
|
|
90
|
+
"eitherFlattenedConfigData": {
|
|
91
|
+
"value": "Either the flattened config data or the reversed flattened config data, since they share the same structure.",
|
|
92
|
+
"key": "JSDOC#PARAMS#EITHERFLATTENEDCONFIGDATA"
|
|
93
|
+
},
|
|
94
|
+
"error": {
|
|
95
|
+
"value": "The error object being handle for the logging.",
|
|
96
|
+
"key": "JSDOC#PARAMS#ERROR"
|
|
97
|
+
},
|
|
98
|
+
"options": {
|
|
99
|
+
"value": "The additional options as follows:",
|
|
100
|
+
"key": "JSDOC#PARAMS#OPTIONS"
|
|
101
|
+
},
|
|
102
|
+
"settings": {
|
|
103
|
+
"value": "The required settings as follows:",
|
|
104
|
+
"key": "JSDOC#PARAMS#SETTINGS"
|
|
105
|
+
},
|
|
106
|
+
"configPathIgnores": {
|
|
107
|
+
"value": "The array of paths linked to the config file, (named \"ignores\" given it is ignored by the \"compress\" and \"resolve\" commands).",
|
|
108
|
+
"key": "JSDOC#PARAMS#CONFIGPATHIGNORES"
|
|
109
|
+
},
|
|
110
|
+
"originalFlattenedConfigData": {
|
|
111
|
+
"value": "The original flattened config data, before changes to aliases variables and composed variables are applied.",
|
|
112
|
+
"key": "JSDOC#PARAMS#ORIGINALFLATTENEDCONFIGDATA"
|
|
113
|
+
},
|
|
114
|
+
"relativeMjsPath": {
|
|
115
|
+
"value": "The relative path of the generated `.mjs` file to be ignored in the \"placeholders\" process.",
|
|
116
|
+
"key": "JSDOC#PARAMS#RELATIVEMJSPATH"
|
|
117
|
+
},
|
|
118
|
+
"variations": {
|
|
119
|
+
"value": "A boolean that determines the format of the generated placeholders according to whether or not the config is enabling variations.",
|
|
120
|
+
"key": "JSDOC#PARAMS#VARIATIONS"
|
|
121
|
+
}
|
|
60
122
|
},
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
123
|
+
"returns": {
|
|
124
|
+
"exitDueToFailure": {
|
|
125
|
+
"value": "Never. (Somehow typing needs to be explicit for unreachable code inference.)",
|
|
126
|
+
"key": "JSDOC#RETURNS#EXITDUETOFAILURE"
|
|
127
|
+
},
|
|
128
|
+
"makeRuleResolve": {
|
|
129
|
+
"value": "The resolve rule based on the flattened config data.",
|
|
130
|
+
"key": "JSDOC#RETURNS#MAKERULERESOLVE"
|
|
131
|
+
},
|
|
132
|
+
"makeRuleCompress": {
|
|
133
|
+
"value": "The compress rule based on the reversed flattened config data.",
|
|
134
|
+
"key": "JSDOC#RETURNS#MAKERULECOMPRESS"
|
|
135
|
+
}
|
|
64
136
|
},
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
137
|
+
"constants": {
|
|
138
|
+
"sortedReversedFlattenedConfigData": {
|
|
139
|
+
"value": "The whole `reversedFlattenedConfigData` turned from an object to an array of key-value arrays sorted by the descending length of each key to prevent partial replacements.",
|
|
140
|
+
"key": "JSDOC#CONSTANTS#SORTEDREVERSEDFLATTENEDCONFIGDATA"
|
|
141
|
+
},
|
|
142
|
+
"composedVariablesExclusivesSet": {
|
|
143
|
+
"value": "A local Set out of composed variables exclusives for speed.",
|
|
144
|
+
"key": "JSDOC#CONSTANTS#COMPOSEDVARIABLESEXCLUSIVESSET"
|
|
145
|
+
}
|
|
68
146
|
}
|
|
69
147
|
}
|
|
70
148
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
const makeRule = (reversedFlattenedConfigData, composedVariablesExclusives) => {
|
|
14
14
|
/** $COMMENT#JSDOC#CONSTANTS#SORTEDREVERSEDFLATTENEDCONFIGDATA */
|
|
15
15
|
const sortedReversedFlattenedConfigData = Object.entries(
|
|
16
|
-
reversedFlattenedConfigData
|
|
16
|
+
reversedFlattenedConfigData,
|
|
17
17
|
).sort(([a], [b]) => b.length - a.length);
|
|
18
18
|
|
|
19
19
|
/** $COMMENT#JSDOC#CONSTANTS#COMPOSEDVARIABLESEXCLUSIVESSET */
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
const makeRule = (
|
|
14
14
|
flattenedConfigData,
|
|
15
15
|
composedVariablesExclusives,
|
|
16
|
-
aliases_flattenedKeys
|
|
16
|
+
aliases_flattenedKeys,
|
|
17
17
|
) => {
|
|
18
18
|
/** $COMMENT#JSDOC#CONSTANTS#COMPOSEDVARIABLESEXCLUSIVESSET */
|
|
19
19
|
const composedVariablesExclusivesSet = new Set(composedVariablesExclusives);
|
|
@@ -35,7 +35,7 @@ const coreCommentsFlow = async (
|
|
|
35
35
|
flattenedConfigData,
|
|
36
36
|
// NEW
|
|
37
37
|
composedVariablesExclusives,
|
|
38
|
-
aliases_flattenedKeys
|
|
38
|
+
aliases_flattenedKeys,
|
|
39
39
|
) => {
|
|
40
40
|
const eslint = new ESLint({
|
|
41
41
|
fix: true,
|
|
@@ -56,7 +56,7 @@ const coreCommentsFlow = async (
|
|
|
56
56
|
flattenedConfigData,
|
|
57
57
|
// NEW
|
|
58
58
|
composedVariablesExclusives,
|
|
59
|
-
aliases_flattenedKeys
|
|
59
|
+
aliases_flattenedKeys,
|
|
60
60
|
),
|
|
61
61
|
},
|
|
62
62
|
},
|
|
@@ -95,8 +95,8 @@ const coreCommentsFlow = async (
|
|
|
95
95
|
ruleName === resolveRuleName
|
|
96
96
|
? "Resolved"
|
|
97
97
|
: ruleName === compressRuleName
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
? "Compressed"
|
|
99
|
+
: "Unknown rule name'd";
|
|
100
100
|
|
|
101
101
|
const total = results.reduce((sum, r) => {
|
|
102
102
|
const add = r.output ? 1 : 0;
|
|
@@ -106,7 +106,7 @@ const coreCommentsFlow = async (
|
|
|
106
106
|
console.log(
|
|
107
107
|
`✅ ${resolvedOrCompressed} comments on ${total} file${
|
|
108
108
|
total === 1 ? "" : "s"
|
|
109
|
-
}
|
|
109
|
+
}.`,
|
|
110
110
|
);
|
|
111
111
|
};
|
|
112
112
|
|
|
@@ -124,14 +124,14 @@ export const resolveCommentsFlow = async (
|
|
|
124
124
|
ignores,
|
|
125
125
|
flattenedConfigData,
|
|
126
126
|
composedVariablesExclusives,
|
|
127
|
-
aliases_flattenedKeys
|
|
127
|
+
aliases_flattenedKeys,
|
|
128
128
|
) =>
|
|
129
129
|
coreCommentsFlow(
|
|
130
130
|
resolveRuleName,
|
|
131
131
|
ignores,
|
|
132
132
|
flattenedConfigData,
|
|
133
133
|
composedVariablesExclusives,
|
|
134
|
-
aliases_flattenedKeys
|
|
134
|
+
aliases_flattenedKeys,
|
|
135
135
|
);
|
|
136
136
|
|
|
137
137
|
/* compressCommentsFlow */
|
|
@@ -146,13 +146,13 @@ export const resolveCommentsFlow = async (
|
|
|
146
146
|
export const compressCommentsFlow = async (
|
|
147
147
|
ignores,
|
|
148
148
|
reversedFlattenedConfigData,
|
|
149
|
-
composedVariablesExclusives
|
|
149
|
+
composedVariablesExclusives,
|
|
150
150
|
) =>
|
|
151
151
|
coreCommentsFlow(
|
|
152
152
|
compressRuleName,
|
|
153
153
|
ignores,
|
|
154
154
|
reversedFlattenedConfigData,
|
|
155
|
-
composedVariablesExclusives
|
|
155
|
+
composedVariablesExclusives,
|
|
156
156
|
);
|
|
157
157
|
|
|
158
158
|
/* placeholdersCommentsFlow */
|
|
@@ -171,7 +171,7 @@ export const placeholdersCommentsFlow = async (
|
|
|
171
171
|
originalFlattenedConfigData,
|
|
172
172
|
aliases_flattenedKeys,
|
|
173
173
|
relativeMjsPath,
|
|
174
|
-
variations
|
|
174
|
+
variations,
|
|
175
175
|
) => {
|
|
176
176
|
/** @type {Record<string, string>} */
|
|
177
177
|
const composedValues_originalKeys = {};
|
|
@@ -230,9 +230,8 @@ export const placeholdersCommentsFlow = async (
|
|
|
230
230
|
],
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
const resultsForMakePlaceholders =
|
|
234
|
-
configPathIgnores
|
|
235
|
-
);
|
|
233
|
+
const resultsForMakePlaceholders =
|
|
234
|
+
await eslintForMakePlaceholders.lintFiles(configPathIgnores);
|
|
236
235
|
await ESLint.outputFixes(resultsForMakePlaceholders);
|
|
237
236
|
|
|
238
237
|
console.log("Results for placeholders are:", resultsForMakePlaceholders);
|
|
@@ -243,6 +242,6 @@ export const placeholdersCommentsFlow = async (
|
|
|
243
242
|
}, 0);
|
|
244
243
|
|
|
245
244
|
console.log(
|
|
246
|
-
`✅ Made placeholders on ${total} file${total === 1 ? "" : "s"}
|
|
245
|
+
`✅ Made placeholders on ${total} file${total === 1 ? "" : "s"}.`,
|
|
247
246
|
);
|
|
248
247
|
};
|
package/library/index.js
CHANGED
|
@@ -52,7 +52,7 @@ const skipDetails =
|
|
|
52
52
|
|
|
53
53
|
if (!hasPackageJson) {
|
|
54
54
|
console.error(
|
|
55
|
-
"ERROR. No package.json file found in this directory. Aborting to prevent accidental changes."
|
|
55
|
+
"ERROR. No package.json file found in this directory. Aborting to prevent accidental changes.",
|
|
56
56
|
);
|
|
57
57
|
exitDueToFailure();
|
|
58
58
|
}
|
|
@@ -60,7 +60,7 @@ skipDetails || console.log("package.json file noticed. Allowed to proceed.");
|
|
|
60
60
|
|
|
61
61
|
if (!hasGitFolder) {
|
|
62
62
|
console.error(
|
|
63
|
-
"ERROR. No git folder found in this directory. Aborting to prevent irreversible changes."
|
|
63
|
+
"ERROR. No git folder found in this directory. Aborting to prevent irreversible changes.",
|
|
64
64
|
);
|
|
65
65
|
exitDueToFailure();
|
|
66
66
|
}
|
|
@@ -84,7 +84,7 @@ let rawConfigPath = passedConfigPath ?? path.join(cwd, defaultConfigFileName);
|
|
|
84
84
|
|
|
85
85
|
if (!fs.existsSync(rawConfigPath)) {
|
|
86
86
|
console.log(
|
|
87
|
-
`No Comment Variables config file found at ${rawConfigPath}. Switching to tutorial mode
|
|
87
|
+
`No Comment Variables config file found at ${rawConfigPath}. Switching to tutorial mode.`,
|
|
88
88
|
);
|
|
89
89
|
|
|
90
90
|
/* TEST START (success) */
|
|
@@ -126,7 +126,7 @@ if (!fs.existsSync(rawConfigPath)) {
|
|
|
126
126
|
|
|
127
127
|
if (!classicOrAdvancedValue) {
|
|
128
128
|
console.error(
|
|
129
|
-
"ERROR. No template selected. Please select a template to begin using comment-variables via this CLI."
|
|
129
|
+
"ERROR. No template selected. Please select a template to begin using comment-variables via this CLI.",
|
|
130
130
|
);
|
|
131
131
|
exitDueToFailure();
|
|
132
132
|
}
|
|
@@ -141,7 +141,7 @@ if (!fs.existsSync(rawConfigPath)) {
|
|
|
141
141
|
|
|
142
142
|
default:
|
|
143
143
|
console.error(
|
|
144
|
-
"ERROR. No template selected. Please select a template to begin using comment-variables via this CLI. (Unreachable code.)" // copypasted same as classicOrAdvanced for now, since this is supposed to be unreachable code.
|
|
144
|
+
"ERROR. No template selected. Please select a template to begin using comment-variables via this CLI. (Unreachable code.)", // copypasted same as classicOrAdvanced for now, since this is supposed to be unreachable code.
|
|
145
145
|
);
|
|
146
146
|
exitDueToFailure();
|
|
147
147
|
}
|
|
@@ -225,7 +225,7 @@ skipDetails || console.log("Flattened config data is:", flattenedConfigData);
|
|
|
225
225
|
skipDetails ||
|
|
226
226
|
console.log(
|
|
227
227
|
"Reversed flattened config data is:",
|
|
228
|
-
reversedFlattenedConfigData
|
|
228
|
+
reversedFlattenedConfigData,
|
|
229
229
|
);
|
|
230
230
|
skipDetails || console.log("Aliases are:", aliases_flattenedKeys);
|
|
231
231
|
skipDetails || console.log("Config path is:", configPath);
|
|
@@ -235,7 +235,7 @@ skipDetails || console.log("myIgnoresOnly are:", myIgnoresOnly);
|
|
|
235
235
|
skipDetails ||
|
|
236
236
|
console.log(
|
|
237
237
|
"Composed variables exclusives are:",
|
|
238
|
-
composedVariablesExclusives
|
|
238
|
+
composedVariablesExclusives,
|
|
239
239
|
);
|
|
240
240
|
|
|
241
241
|
// ADDRESSES THE --lint-config-imports FLAG (lintConfigImports, no longer a flag), GIVEN THAT THE FILES IMPORTED BY THE CONFIG ARE IGNORED BY DEFAULT.
|
|
@@ -251,13 +251,13 @@ const rawConfigPathIgnores = lintConfigImports
|
|
|
251
251
|
|
|
252
252
|
// the ignore paths must be relative
|
|
253
253
|
const configPathIgnores = rawConfigPathIgnores.map((e) =>
|
|
254
|
-
path.relative(cwd, e)
|
|
254
|
+
path.relative(cwd, e),
|
|
255
255
|
);
|
|
256
256
|
|
|
257
257
|
skipDetails ||
|
|
258
258
|
console.log(
|
|
259
259
|
lintConfigImports ? "Config path ignore is:" : "Config path ignores are:",
|
|
260
|
-
configPathIgnores
|
|
260
|
+
configPathIgnores,
|
|
261
261
|
);
|
|
262
262
|
|
|
263
263
|
// ADDRESSES THE --my-ignores-only FLAG (myIgnoresOnly, no longer a flag, GIVEN THAT KNOWN IGNORES ARE IGNORED BY DEFAULT.
|
|
@@ -272,7 +272,7 @@ skipDetails || console.log("Ignores are:", ignores);
|
|
|
272
272
|
const makeResolvedConfigDataResults = makeResolvedConfigData(
|
|
273
273
|
configDataResultsData,
|
|
274
274
|
resolvedCoreData.flattenedConfigData,
|
|
275
|
-
resolvedCoreData.aliases_flattenedKeys
|
|
275
|
+
resolvedCoreData.aliases_flattenedKeys,
|
|
276
276
|
);
|
|
277
277
|
if (!makeResolvedConfigDataResults.success) {
|
|
278
278
|
makeResolvedConfigDataResults.errors.forEach((e) => logError(e));
|
|
@@ -302,7 +302,7 @@ switch (coreCommand) {
|
|
|
302
302
|
ignores,
|
|
303
303
|
flattenedConfigData,
|
|
304
304
|
composedVariablesExclusives,
|
|
305
|
-
aliases_flattenedKeys
|
|
305
|
+
aliases_flattenedKeys,
|
|
306
306
|
);
|
|
307
307
|
break;
|
|
308
308
|
case compressRuleName:
|
|
@@ -310,7 +310,7 @@ switch (coreCommand) {
|
|
|
310
310
|
await compressCommentsFlow(
|
|
311
311
|
ignores,
|
|
312
312
|
reversedFlattenedConfigData,
|
|
313
|
-
composedVariablesExclusives
|
|
313
|
+
composedVariablesExclusives,
|
|
314
314
|
);
|
|
315
315
|
break;
|
|
316
316
|
// I'm noticing I'm not even using valueLocations to create placeholders. Which is in fact more reliable because I'm appending the placeholders specifically to the object string values that I find instead of doing so from locations.
|
|
@@ -321,19 +321,19 @@ switch (coreCommand) {
|
|
|
321
321
|
resolvedCoreData.originalFlattenedConfigData,
|
|
322
322
|
resolvedCoreData.aliases_flattenedKeys,
|
|
323
323
|
path.relative(cwd, mjsPath),
|
|
324
|
-
resolveConfigResults.variations
|
|
324
|
+
resolveConfigResults.variations,
|
|
325
325
|
);
|
|
326
326
|
break;
|
|
327
327
|
default:
|
|
328
328
|
if (coreCommand && !coreCommand.startsWith("--"))
|
|
329
329
|
console.error(
|
|
330
|
-
`ERROR. Core command not recognized. Choose between "${resolveRuleName}" and "${compressRuleName}" or "${placeholdersRuleName}"
|
|
330
|
+
`ERROR. Core command not recognized. Choose between "${resolveRuleName}" and "${compressRuleName}" or "${placeholdersRuleName}".`,
|
|
331
331
|
);
|
|
332
332
|
else
|
|
333
333
|
console.log(
|
|
334
334
|
`If these settings are correct with you, feel free to initiate the command "${resolveRuleName}" to resolve comments, or "${compressRuleName}" to compress them back to their $COMMENT forms. You can also generate the placeholders at their definitions locations with the command "${placeholdersRuleName}".${
|
|
335
335
|
passedConfigPath ? " (And DON'T FORGET YOUR --config FLAG!)" : ""
|
|
336
|
-
}
|
|
336
|
+
}`,
|
|
337
337
|
);
|
|
338
338
|
break;
|
|
339
339
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comment-variables",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"type": "module",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@eslint/markdown": "^6.5.0",
|
|
35
|
-
"comment-variables-resolve-config": "^
|
|
35
|
+
"comment-variables-resolve-config": "^2.0.0",
|
|
36
36
|
"eslint": "^9.29.0",
|
|
37
37
|
"prompts": "^2.4.2"
|
|
38
38
|
},
|