comment-variables 0.12.0 → 0.12.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.
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ npm install -g comment-variables
|
|
|
6
6
|
|
|
7
7
|
## Commands
|
|
8
8
|
|
|
9
|
-
**`comment-variables` comes with three commands in this initial release:**
|
|
9
|
+
**`comment-variables` (alias `jscomments`) comes with three commands in this initial release:**
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
comment-variables
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Interacts with your `comments.config.js` default exported object to print all the parameters you need to be aware of before running `compress` or `resolve`. Also acts as a dry run validation check. If no error is printed, it means you can run `compress` or `resolve` safely, as long the printed parameters correspond to what you've expected from your defined config.
|
|
15
|
+
Interacts with your `comments.config.js` default exported object to print all the parameters you need to be aware of before running `compress` or `resolve`. Also acts as a dry run validation check. If no error is printed, it means you can run `compress` or `resolve` safely, as long the printed parameters correspond to what you've expected from your defined config. (Additionally creates a resolved version of your config data as a JSON file.)
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
comment-variables compress
|
|
@@ -75,7 +75,7 @@ const data = {
|
|
|
75
75
|
jsDoc: Object.freeze({
|
|
76
76
|
definitions: Object.freeze({
|
|
77
77
|
exitDueToFailure:
|
|
78
|
-
"Terminates the whole process with a 'failure' code (1)." /* $COMMENT#JSDOC#DEFINITIONS#EXITDUETOFAILURE */,
|
|
78
|
+
"Terminates the whole process with a 'failure' code (`1`)." /* $COMMENT#JSDOC#DEFINITIONS#EXITDUETOFAILURE */,
|
|
79
79
|
makeRuleResolve:
|
|
80
80
|
"The utility that creates the resolve rule based on the flattened config data, used to transform `$COMMENT` placeholders into actual comments." /* $COMMENT#JSDOC#DEFINITIONS#MAKERULERESOLVE */,
|
|
81
81
|
makeRuleCompress:
|
package/comments.config.js
CHANGED
|
@@ -2,7 +2,7 @@ const data = {
|
|
|
2
2
|
// for testing
|
|
3
3
|
levelOne: {
|
|
4
4
|
levelTwo: {
|
|
5
|
-
levelThree: "Level three." /* $COMMENT#LEVELONE#LEVELTWO#LEVELTHREE */, // New placeholder structure. Not as sexy, but first and foremost guaranteed to be functional appended right at the end of the value as a Block comment, and last but not least also guaranteed to not modify Value Locations in the process. So `comment
|
|
5
|
+
levelThree: "Level three." /* $COMMENT#LEVELONE#LEVELTWO#LEVELTHREE */, // New placeholder structure. Not as sexy, but first and foremost guaranteed to be functional appended right at the end of the value as a Block comment, and last but not least also guaranteed to not modify Value Locations in the process. So `comment-variables placeholders` it is, and this justifies enforcing strings only for values even outside of the use of the VS Code extension.
|
|
6
6
|
levelThreeEscape:
|
|
7
7
|
"Level three. \
|
|
8
8
|
fdff\
|
|
@@ -12,12 +12,20 @@ const data = {
|
|
|
12
12
|
otherLevelThree:
|
|
13
13
|
"LEVELONE#LEVELTWO#LEVELTHREE" /* $COMMENT#LEVELONE#LEVELTWO#OTHERLEVELTHREE */, // also an alias
|
|
14
14
|
composedVariable:
|
|
15
|
-
"$COMMENT#LEVELONE#LEVELTWO#LEVELTHREE $COMMENT#LEVELONE#LEVELTWO#STILLLEVELTHREE" /* $COMMENT#LEVELONE#LEVELTWO#COMPOSEDVARIABLE */, // This is a composed variable. What's the beauty in this? It allows for each comment variable to be its own single source of truth that can be reused still within the Comment Variables ecosystem. All while preventing the use of
|
|
15
|
+
"$COMMENT#LEVELONE#LEVELTWO#LEVELTHREE $COMMENT#LEVELONE#LEVELTWO#STILLLEVELTHREE" /* $COMMENT#LEVELONE#LEVELTWO#COMPOSEDVARIABLE */, // This is a composed variable. What's the beauty in this? It allows for each comment variable to be its own single source of truth that can be reused still within the Comment Variables ecosystem. All while preventing the use of Comment Variables placeholders as values in the config. AND as a matter of fact, it even works... with aliases.
|
|
16
16
|
composedVariableAlias:
|
|
17
17
|
"LEVELONE#LEVELTWO#COMPOSEDVARIABLE" /* $COMMENT#LEVELONE#LEVELTWO#COMPOSEDVARIABLEALIAS */, // The alias of a composed variable. SO just like composed variables can incorporate aliases, aliases can be aliases for composed variables.
|
|
18
18
|
|
|
19
19
|
// otherLevelThreeAlias:
|
|
20
20
|
// "LEVELONE#LEVELTWO#OTHERLEVELTHREE" /* $COMMENT#LEVELONE#LEVELTWO#LEVELTHREE */, // errors, can't be the alias of another alias
|
|
21
|
+
|
|
22
|
+
// composedOfAlias:
|
|
23
|
+
// "$COMMENT#LEVELONE#LEVELTWO#LEVELTHREE $COMMENT#LEVELONE#LEVELTWO#ALIASOFCOMPOSED" /* $COMMENT#LEVELONE#LEVELTWO#COMPOSEDOFALIAS */, // 1/2 already errored // ERROR. A potential composed variable cannot be used as the comment variable of another composed variable.
|
|
24
|
+
// aliasOfComposed:
|
|
25
|
+
// "LEVELONE#LEVELTWO#COMPOSEDOFALIAS" /* $COMMENT#LEVELONE#LEVELTWO#ALIASOFCOMPOSED */, // 2/2 What if an alias variable was a segment to a composed variable made of itself? // ERROR. The alias "LEVELONE#LEVELTWO#ALIASOFCOMPOSED" links to composed variable "$COMMENT#LEVELONE#LEVELTWO#LEVELTHREE $COMMENT#LEVELONE#LEVELTWO#ALIASOFCOMPOSED" that includes LEVELONE#LEVELTWO#ALIASOFCOMPOSED's placeholder as a segment.
|
|
26
|
+
|
|
27
|
+
// aliasInComposed:
|
|
28
|
+
// "$COMMENT#LEVELONE#LEVELTWO#LEVELTHREE $COMMENT#LEVELONE#LEVELTWO#ALIASINCOMPOSED", // What if a composed variable had its own value has one of its segments? Composed variables already cannot compose other composed variables. // errors, "ERROR. A potential composed variable cannot be used as the comment variable of another composed variable."
|
|
21
29
|
// wrongComposedVariable:
|
|
22
30
|
// "$COMMENT#LEVELONE#LEVELTWO#COMPOSEDVARIABLE $COMMENT#LEVELONE#LEVELTWO#STILLLEVELTHREE", // errors, can't make composed variables with composed variables
|
|
23
31
|
// wrongComposedVariableToo:
|
|
@@ -28,18 +36,21 @@ const data = {
|
|
|
28
36
|
// tooLevelThree: 2, // errors, value is invalid
|
|
29
37
|
// $levelThree: "Dollar sign", // errors, key as "$" character
|
|
30
38
|
// "#levelThree": "Hashtag", // errors, key as "#" character
|
|
31
|
-
// ".levelThree": "Punctuation", // errors, key is invalid
|
|
39
|
+
// ".levelThree": "Punctuation", // errors, key is invalid due to punctuation
|
|
32
40
|
// unrecognized: `Unrecognized value.`, // errors, is not a string literal
|
|
33
41
|
// emptyString: "", // errors, string is empty
|
|
34
42
|
// "": "emptyKey", // errors, key is empty caught by the regex
|
|
35
43
|
// ownAliasKey: "LEVELONE#LEVELTWO#OWNALIASKEY", // errors, is its own key/alias
|
|
44
|
+
// key: "key not allowed", // errors, "key", "value" and "placeholder" not allowed
|
|
45
|
+
// value: "value not allowed", // errors, "key", "value" and "placeholder" not allowed
|
|
46
|
+
// placeholder: "placeholder not allowed", // errors, "key", "value" and "placeholder" not allowed
|
|
36
47
|
},
|
|
37
48
|
},
|
|
38
49
|
// for deving
|
|
39
50
|
jsDoc: Object.freeze({
|
|
40
51
|
definitions: Object.freeze({
|
|
41
52
|
exitDueToFailure:
|
|
42
|
-
"Terminates the whole process with a 'failure' code (1)." /* $COMMENT#JSDOC#DEFINITIONS#EXITDUETOFAILURE */,
|
|
53
|
+
"Terminates the whole process with a 'failure' code (`1`)." /* $COMMENT#JSDOC#DEFINITIONS#EXITDUETOFAILURE */,
|
|
43
54
|
makeRuleResolve:
|
|
44
55
|
"The utility that creates the resolve rule based on the flattened config data, used to transform `$COMMENT` placeholders into actual comments." /* $COMMENT#JSDOC#DEFINITIONS#MAKERULERESOLVE */,
|
|
45
56
|
makeRuleCompress:
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"levelOne": {
|
|
3
|
+
"levelTwo": {
|
|
4
|
+
"levelThree": {
|
|
5
|
+
"value": "Level three.",
|
|
6
|
+
"key": "LEVELONE#LEVELTWO#LEVELTHREE",
|
|
7
|
+
"placeholder": "$COMMENT#LEVELONE#LEVELTWO#LEVELTHREE"
|
|
8
|
+
},
|
|
9
|
+
"levelThreeEscape": {
|
|
10
|
+
"value": "Level three. fdff",
|
|
11
|
+
"key": "LEVELONE#LEVELTWO#LEVELTHREEESCAPE",
|
|
12
|
+
"placeholder": "$COMMENT#LEVELONE#LEVELTWO#LEVELTHREEESCAPE"
|
|
13
|
+
},
|
|
14
|
+
"stillLevelThree": {
|
|
15
|
+
"value": "Level three.",
|
|
16
|
+
"key": "LEVELONE#LEVELTWO#STILLLEVELTHREE",
|
|
17
|
+
"placeholder": "$COMMENT#LEVELONE#LEVELTWO#STILLLEVELTHREE"
|
|
18
|
+
},
|
|
19
|
+
"otherLevelThree": {
|
|
20
|
+
"value": "Level three.",
|
|
21
|
+
"key": "LEVELONE#LEVELTWO#OTHERLEVELTHREE",
|
|
22
|
+
"placeholder": "$COMMENT#LEVELONE#LEVELTWO#OTHERLEVELTHREE"
|
|
23
|
+
},
|
|
24
|
+
"composedVariable": {
|
|
25
|
+
"value": "Level three. Level three.",
|
|
26
|
+
"key": "LEVELONE#LEVELTWO#COMPOSEDVARIABLE",
|
|
27
|
+
"placeholder": "$COMMENT#LEVELONE#LEVELTWO#COMPOSEDVARIABLE"
|
|
28
|
+
},
|
|
29
|
+
"composedVariableAlias": {
|
|
30
|
+
"value": "Level three. Level three.",
|
|
31
|
+
"key": "LEVELONE#LEVELTWO#COMPOSEDVARIABLEALIAS",
|
|
32
|
+
"placeholder": "$COMMENT#LEVELONE#LEVELTWO#COMPOSEDVARIABLEALIAS"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"jsDoc": {
|
|
37
|
+
"definitions": {
|
|
38
|
+
"exitDueToFailure": {
|
|
39
|
+
"value": "Terminates the whole process with a 'failure' code (`1`).",
|
|
40
|
+
"key": "JSDOC#DEFINITIONS#EXITDUETOFAILURE",
|
|
41
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#EXITDUETOFAILURE"
|
|
42
|
+
},
|
|
43
|
+
"makeRuleResolve": {
|
|
44
|
+
"value": "The utility that creates the resolve rule based on the flattened config data, used to transform `$COMMENT` placeholders into actual comments.",
|
|
45
|
+
"key": "JSDOC#DEFINITIONS#MAKERULERESOLVE",
|
|
46
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#MAKERULERESOLVE"
|
|
47
|
+
},
|
|
48
|
+
"makeRuleCompress": {
|
|
49
|
+
"value": "The utility that creates the compress rule based on the reversed flattened config data, used to transform actual comments into `$COMMENT` placeholders.",
|
|
50
|
+
"key": "JSDOC#DEFINITIONS#MAKERULECOMPRESS",
|
|
51
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#MAKERULECOMPRESS"
|
|
52
|
+
},
|
|
53
|
+
"coreCommentsFlow": {
|
|
54
|
+
"value": "The core flow at the heart of resolving and compressing comments.",
|
|
55
|
+
"key": "JSDOC#DEFINITIONS#CORECOMMENTSFLOW",
|
|
56
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#CORECOMMENTSFLOW"
|
|
57
|
+
},
|
|
58
|
+
"resolveCommentsFlow": {
|
|
59
|
+
"value": "The flow that resolves `$COMMENT` placeholders into actual comments.",
|
|
60
|
+
"key": "JSDOC#DEFINITIONS#RESOLVECOMMENTSFLOW",
|
|
61
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#RESOLVECOMMENTSFLOW"
|
|
62
|
+
},
|
|
63
|
+
"compressCommentsFlow": {
|
|
64
|
+
"value": "The flow that compresses actual comments into `$COMMENT` placeholders.",
|
|
65
|
+
"key": "JSDOC#DEFINITIONS#COMPRESSCOMMENTSFLOW",
|
|
66
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#COMPRESSCOMMENTSFLOW"
|
|
67
|
+
},
|
|
68
|
+
"placeholdersCommentsFlow": {
|
|
69
|
+
"value": "The flow that creates `$COMMENT` placeholders right next to where they're defined.",
|
|
70
|
+
"key": "JSDOC#DEFINITIONS#PLACEHOLDERSCOMMENTSFLOW",
|
|
71
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#PLACEHOLDERSCOMMENTSFLOW"
|
|
72
|
+
},
|
|
73
|
+
"logError": {
|
|
74
|
+
"value": "Logs an error to the console depending on its type. (`\"error\"` or `\"warning\"`.)",
|
|
75
|
+
"key": "JSDOC#DEFINITIONS#LOGERROR",
|
|
76
|
+
"placeholder": "$COMMENT#JSDOC#DEFINITIONS#LOGERROR"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"params": {
|
|
80
|
+
"flattenedConfigData": {
|
|
81
|
+
"value": "The flattened config data, with `$COMMENT` placeholders as keys and actual comments as values.",
|
|
82
|
+
"key": "JSDOC#PARAMS#FLATTENEDCONFIGDATA",
|
|
83
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#FLATTENEDCONFIGDATA"
|
|
84
|
+
},
|
|
85
|
+
"reversedFlattenedConfigData": {
|
|
86
|
+
"value": "The reversed flattened config data, with actual comments as keys and `$COMMENT` placeholders as values.",
|
|
87
|
+
"key": "JSDOC#PARAMS#REVERSEDFLATTENEDCONFIGDATA",
|
|
88
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#REVERSEDFLATTENEDCONFIGDATA"
|
|
89
|
+
},
|
|
90
|
+
"aliases_flattenedKeys": {
|
|
91
|
+
"value": "The dictionary that connects aliases to their original flattened keys in case an encountered placeholder is actually an alias.",
|
|
92
|
+
"key": "JSDOC#PARAMS#ALIASES_FLATTENEDKEYS",
|
|
93
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#ALIASES_FLATTENEDKEYS"
|
|
94
|
+
},
|
|
95
|
+
"ruleName": {
|
|
96
|
+
"value": "The name of the rule currently used. (Either `\"resolve\"` or `\"compress\"`.)",
|
|
97
|
+
"key": "JSDOC#PARAMS#RULENAME",
|
|
98
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#RULENAME"
|
|
99
|
+
},
|
|
100
|
+
"ignores": {
|
|
101
|
+
"value": "The array of paths and globs for the flow's ESLint instance to ignore.",
|
|
102
|
+
"key": "JSDOC#PARAMS#IGNORES",
|
|
103
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#IGNORES"
|
|
104
|
+
},
|
|
105
|
+
"eitherFlattenedConfigData": {
|
|
106
|
+
"value": "Either the flattened config data or the reversed flattened config data, since they share the same structure.",
|
|
107
|
+
"key": "JSDOC#PARAMS#EITHERFLATTENEDCONFIGDATA",
|
|
108
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#EITHERFLATTENEDCONFIGDATA"
|
|
109
|
+
},
|
|
110
|
+
"error": {
|
|
111
|
+
"value": "The error object being handle for the logging.",
|
|
112
|
+
"key": "JSDOC#PARAMS#ERROR",
|
|
113
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#ERROR"
|
|
114
|
+
},
|
|
115
|
+
"options": {
|
|
116
|
+
"value": "The additional options as follows:",
|
|
117
|
+
"key": "JSDOC#PARAMS#OPTIONS",
|
|
118
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#OPTIONS"
|
|
119
|
+
},
|
|
120
|
+
"settings": {
|
|
121
|
+
"value": "The required settings as follows:",
|
|
122
|
+
"key": "JSDOC#PARAMS#SETTINGS",
|
|
123
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#SETTINGS"
|
|
124
|
+
},
|
|
125
|
+
"configPathIgnores": {
|
|
126
|
+
"value": "The array of paths linked to the config file, (named \"ignores\" given it is ignored by the \"compress\" and \"resolve\" commands).",
|
|
127
|
+
"key": "JSDOC#PARAMS#CONFIGPATHIGNORES",
|
|
128
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#CONFIGPATHIGNORES"
|
|
129
|
+
},
|
|
130
|
+
"originalFlattenedConfigData": {
|
|
131
|
+
"value": "The original flattened config data, before changes to Aliases Variables and Composed Variables are applied.",
|
|
132
|
+
"key": "JSDOC#PARAMS#ORIGINALFLATTENEDCONFIGDATA",
|
|
133
|
+
"placeholder": "$COMMENT#JSDOC#PARAMS#ORIGINALFLATTENEDCONFIGDATA"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"returns": {
|
|
137
|
+
"exitDueToFailure": {
|
|
138
|
+
"value": "Never. (Somehow typing needs to be explicit for unreachable code inference.)",
|
|
139
|
+
"key": "JSDOC#RETURNS#EXITDUETOFAILURE",
|
|
140
|
+
"placeholder": "$COMMENT#JSDOC#RETURNS#EXITDUETOFAILURE"
|
|
141
|
+
},
|
|
142
|
+
"makeRuleResolve": {
|
|
143
|
+
"value": "The resolve rule based on the flattened config data.",
|
|
144
|
+
"key": "JSDOC#RETURNS#MAKERULERESOLVE",
|
|
145
|
+
"placeholder": "$COMMENT#JSDOC#RETURNS#MAKERULERESOLVE"
|
|
146
|
+
},
|
|
147
|
+
"makeRuleCompress": {
|
|
148
|
+
"value": "The compress rule based on the reversed flattened config data.",
|
|
149
|
+
"key": "JSDOC#RETURNS#MAKERULECOMPRESS",
|
|
150
|
+
"placeholder": "$COMMENT#JSDOC#RETURNS#MAKERULECOMPRESS"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
* @returns $COMMENT#JSDOC#RETURNS#MAKERULECOMPRESS
|
|
11
11
|
*/
|
|
12
12
|
const makeRule = (reversedFlattenedConfigData) => {
|
|
13
|
-
|
|
13
|
+
/** 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. */
|
|
14
14
|
const sortedReversedFlattenedConfigData = Object.entries(
|
|
15
15
|
reversedFlattenedConfigData
|
|
16
16
|
).sort(([a], [b]) => b.length - a.length);
|
|
@@ -47,9 +47,8 @@ const makeRule = (flattenedConfigData, aliases_flattenedKeys) => {
|
|
|
47
47
|
const replacement =
|
|
48
48
|
flattenedConfigData[key] || // original
|
|
49
49
|
flattenedConfigData[aliases_flattenedKeys?.[key]]; // alias
|
|
50
|
-
|
|
51
50
|
if (replacement) {
|
|
52
|
-
fixedText = fixedText.replace(fullMatch, replacement);
|
|
51
|
+
fixedText = fixedText.replace(fullMatch, () => replacement);
|
|
53
52
|
hasValidFix = true;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -158,12 +158,12 @@ export const placeholdersCommentsFlow = async (
|
|
|
158
158
|
|
|
159
159
|
for (const [key, value] of Object.entries(originalFlattenedConfigData)) {
|
|
160
160
|
if (value.includes(`${$COMMENT}#`))
|
|
161
|
-
// composed
|
|
161
|
+
// composed variables
|
|
162
162
|
composedValues_originalKeys[value] = key;
|
|
163
163
|
else if (originalFlattenedConfigData[value])
|
|
164
|
-
// alias
|
|
164
|
+
// alias variables
|
|
165
165
|
aliasValues_originalKeys[value] = aliases_flattenedKeys[key];
|
|
166
|
-
//
|
|
166
|
+
// comment variables
|
|
167
167
|
else regularValuesOnly_originalKeys[value] = key;
|
|
168
168
|
} // no need for continues, potential collisions are caught in resolveConfig run prior
|
|
169
169
|
|
|
@@ -216,7 +216,3 @@ 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
|
@@ -136,13 +136,16 @@ if (!makeResolvedConfigDataResults.success) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
const resolvedConfigData = makeResolvedConfigDataResults.resolvedConfigData;
|
|
139
|
-
const jsonPath = resolveConfigResults.configPath.replace(
|
|
139
|
+
const jsonPath = resolveConfigResults.configPath.replace(
|
|
140
|
+
/\.js$/,
|
|
141
|
+
() => ".json"
|
|
142
|
+
);
|
|
140
143
|
const jsonData = JSON.stringify(resolvedConfigData, null, 2);
|
|
141
144
|
fs.writeFileSync(jsonPath, jsonData, "utf8");
|
|
142
145
|
|
|
143
146
|
console.log(`JSON resolved config data written to: \n${jsonPath}`);
|
|
144
147
|
|
|
145
|
-
// ADDRESSES THE CORE COMMANDS "resolve" AND "
|
|
148
|
+
// ADDRESSES THE CORE COMMANDS "resolve", "compress", AND "placeholders".
|
|
146
149
|
|
|
147
150
|
switch (coreCommand) {
|
|
148
151
|
case resolveRuleName:
|
|
@@ -168,11 +171,11 @@ switch (coreCommand) {
|
|
|
168
171
|
default:
|
|
169
172
|
if (coreCommand && !coreCommand.startsWith("--"))
|
|
170
173
|
console.error(
|
|
171
|
-
`ERROR. Core command not recognized. Choose between "
|
|
174
|
+
`ERROR. Core command not recognized. Choose between "${resolveRuleName}" and "${compressRuleName}" or "${placeholdersRuleName}".`
|
|
172
175
|
);
|
|
173
176
|
else
|
|
174
177
|
console.log(
|
|
175
|
-
`If these settings are correct with you, feel free to initiate the command "
|
|
178
|
+
`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}".${
|
|
176
179
|
passedConfigPath || lintConfigImports || myIgnoresOnly
|
|
177
180
|
? " (And DON'T FORGET YOUR FLAGS!)"
|
|
178
181
|
: ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comment-variables",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
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",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"main": "library/index.js",
|
|
10
10
|
"files": [
|
|
11
11
|
"library",
|
|
12
|
-
"comments.config.js"
|
|
12
|
+
"comments.config.js",
|
|
13
|
+
"comments.config.json"
|
|
13
14
|
],
|
|
14
15
|
"repository": {
|
|
15
16
|
"type": "git",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"type": "module",
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"@eslint/markdown": "^6.5.0",
|
|
29
|
-
"comment-variables-resolve-config": "^1.
|
|
30
|
+
"comment-variables-resolve-config": "^1.10.1",
|
|
30
31
|
"eslint": "^9.29.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|