paperlamp 0.1.0 → 0.1.1

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/dist/index.js +7 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import process from "node:process";
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "paperlamp",
11
- version: "0.1.0",
11
+ version: "0.1.1",
12
12
  description: "纸灯 / Paperlamp CLI — copy Paperlamp Vue components into your project",
13
13
  license: "MIT",
14
14
  type: "module",
@@ -181,13 +181,12 @@ var CONFIG_FILE = "paperlamp.json";
181
181
  var DEFAULT_REGISTRY = "https://peach0x33a.github.io/paperlamp/r";
182
182
  var CATEGORY_LABELS = {
183
183
  general: "通用",
184
- form: "表单",
185
184
  layout: "布局",
186
- overlay: "浮层",
187
- feedback: "反馈",
188
185
  navigation: "导航",
186
+ form: "数据录入",
189
187
  data: "数据展示",
190
- signature: "纸灯特色"
188
+ feedback: "反馈",
189
+ other: "其他"
191
190
  };
192
191
  var tty = process.stdout.isTTY && !process.env.NO_COLOR;
193
192
  var paint = (code) => (s) => tty ? `\x1B[${code}m${s}\x1B[0m` : s;
@@ -463,7 +462,9 @@ async function list(cwd, flags) {
463
462
  const k = i.category ?? "other";
464
463
  groups.set(k, [...groups.get(k) ?? [], i]);
465
464
  }
466
- for (const [cat, group] of groups) {
465
+ const order = Object.keys(CATEGORY_LABELS);
466
+ const rank = (k) => order.includes(k) ? order.indexOf(k) : order.length;
467
+ for (const [cat, group] of [...groups].sort(([a], [b]) => rank(a) - rank(b))) {
467
468
  console.log(bold(CATEGORY_LABELS[cat] ?? "其他"));
468
469
  for (const i of group)
469
470
  console.log(` ${i.name.padEnd(16)}${dim(i.title)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperlamp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "纸灯 / Paperlamp CLI — copy Paperlamp Vue components into your project",
5
5
  "license": "MIT",
6
6
  "type": "module",