comment-variables 1.5.1 → 1.5.3
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 +1 -1
- package/library/_commons/constants/bases.js +1 -1
- package/library/index.js +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
package/library/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
hasPackageJson,
|
|
29
29
|
hasGitFolder,
|
|
30
30
|
classic,
|
|
31
|
-
|
|
31
|
+
advanced,
|
|
32
32
|
} from "./_commons/constants/bases.js";
|
|
33
33
|
|
|
34
34
|
import { exitDueToFailure, logError } from "./_commons/utilities/helpers.js";
|
|
@@ -96,11 +96,11 @@ if (!fs.existsSync(rawConfigPath)) {
|
|
|
96
96
|
generateExampleFilePath: "../generate.example.js",
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
const
|
|
99
|
+
const classicOrAdvanced = await prompts({
|
|
100
100
|
type: "select",
|
|
101
101
|
name: "value",
|
|
102
102
|
message:
|
|
103
|
-
"Would you like to generate a
|
|
103
|
+
"Would you like to generate a simple template (classic) or a template with variations (advanced) instead?",
|
|
104
104
|
choices: [
|
|
105
105
|
{
|
|
106
106
|
title: classic,
|
|
@@ -109,39 +109,39 @@ if (!fs.existsSync(rawConfigPath)) {
|
|
|
109
109
|
value: classic,
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
title:
|
|
112
|
+
title: advanced,
|
|
113
113
|
description:
|
|
114
|
-
"
|
|
115
|
-
value:
|
|
114
|
+
"With variations. For those who know their way around Comment Variables and may want to use its native internationalization features or any configuration of their own that relies on variants.",
|
|
115
|
+
value: advanced,
|
|
116
116
|
},
|
|
117
117
|
],
|
|
118
118
|
initial: 0,
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
* @type {typeof classic | typeof
|
|
122
|
+
* @type {typeof classic | typeof advanced}
|
|
123
123
|
* `control+C` returns `undefined`.
|
|
124
124
|
*/
|
|
125
|
-
const
|
|
125
|
+
const classicOrAdvancedValue = classicOrAdvanced.value;
|
|
126
126
|
|
|
127
|
-
if (!
|
|
127
|
+
if (!classicOrAdvancedValue) {
|
|
128
128
|
console.error(
|
|
129
129
|
"ERROR. No template selected. Please select a template to begin using comment-variables via this CLI."
|
|
130
130
|
);
|
|
131
131
|
exitDueToFailure();
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
switch (
|
|
134
|
+
switch (classicOrAdvancedValue) {
|
|
135
135
|
case classic:
|
|
136
136
|
tutorialConfig.generateTemplateFilePath = "../generate.template.js";
|
|
137
137
|
break;
|
|
138
|
-
case
|
|
138
|
+
case advanced:
|
|
139
139
|
tutorialConfig.generateTemplateFilePath = "../generate.variations.js";
|
|
140
140
|
break;
|
|
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
|
|
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
|
}
|
package/package.json
CHANGED