new-s-block 1.0.6 → 1.0.8

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.
Files changed (2) hide show
  1. package/bin/cli.js +15 -3
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -84,6 +84,14 @@ function checkForUpdate() {
84
84
  req.on('timeout', function () { req.destroy(); resolve(); });
85
85
  });
86
86
  }
87
+ // ── Version flag ─────────────────────────────────────────────────────────
88
+
89
+ if (process.argv.includes('--version') || process.argv.includes('-v')) {
90
+ var pkg = require('../package.json');
91
+ console.log(pkg.version);
92
+ process.exit(0);
93
+ }
94
+
87
95
  // ── Main ───────────────────────────────────────────────────────────────────
88
96
 
89
97
  async function main() {
@@ -115,14 +123,18 @@ async function main() {
115
123
  // 3. Description
116
124
  const blockDescription = await prompt(rl, 'Block description (optional): ');
117
125
 
118
- // 4. Extra keywords
126
+ // 4. Block category
127
+ const categoryRaw = await prompt(rl, 'Block category [s-tier]: ');
128
+ const blockCategory = categoryRaw.trim() || 's-tier';
129
+
130
+ // 5. Extra keywords
119
131
  const extraKeywordsRaw = await prompt(rl, 'Additional keywords (comma-separated, optional): ');
120
132
  const extraKeywords = extraKeywordsRaw
121
133
  .split(',')
122
134
  .map(function (k) { return k.trim().toLowerCase(); })
123
135
  .filter(Boolean);
124
136
 
125
- // 5. Blocks folder
137
+ // 6. Blocks folder
126
138
  const folderRaw = await prompt(rl, 'Blocks folder [blocks]: ');
127
139
 
128
140
  rl.close();
@@ -167,7 +179,7 @@ async function main() {
167
179
  ' "name": "acf/' + blockName + '",\n' +
168
180
  ' "title": "' + blockLabel + '",\n' +
169
181
  ' "description": "' + (blockDescription.trim() || blockLabel) + ' Block",\n' +
170
- ' "category": "s-tier",\n' +
182
+ ' "category": "' + blockCategory + '",\n' +
171
183
  ' "viewScript": "file:./' + blockName + '.js",\n' +
172
184
  ' "icon": ' + JSON.stringify(svgIcon) + ',\n' +
173
185
  ' "keywords": ' + keywordsJson + ',\n' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "new-s-block",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "CLI tool to scaffold ACF Gutenberg blocks",
5
5
  "bin": {
6
6
  "new-s-block": "./bin/cli.js"