partweave 0.3.2 → 0.3.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.
@@ -9,8 +9,6 @@ import pc3 from "picocolors";
9
9
 
10
10
  // src/banner.ts
11
11
  import pc from "picocolors";
12
- var WEAVE = ["\u2588", "\u2593"];
13
- var weaveCell = (row, col) => WEAVE[(row + col) % 2];
14
12
  var GLYPHS = {
15
13
  p: ["\u2588\u2588\u2588 ", "\u2588 \u2588", "\u2588\u2588\u2588 ", "\u2588 ", "\u2588 "],
16
14
  a: [" \u2588\u2588 ", "\u2588 \u2588", "\u2588\u2588\u2588\u2588", "\u2588 \u2588", "\u2588 \u2588"],
@@ -20,6 +18,8 @@ var GLYPHS = {
20
18
  e: ["\u2588\u2588\u2588\u2588", "\u2588 ", "\u2588\u2588\u2588 ", "\u2588 ", "\u2588\u2588\u2588\u2588"],
21
19
  v: ["\u2588 \u2588", "\u2588 \u2588", "\u2588 \u2588", " \u2588 \u2588 ", " \u2588 "]
22
20
  };
21
+ var weaveCell = (row, col) => (row + col) % 2 ? "\u2593" : "\u2588";
22
+ var LOOM = ["\u2503\u2501\u2503\u2501", "\u2501\u2503\u2501\u2503", "\u2503\u2501\u2503\u2501", "\u2501\u2503\u2501\u2503", "\u2503\u2501\u2503\u2501"];
23
23
  var WORD = "partweave";
24
24
  var HEIGHT = 5;
25
25
  function colorMode() {
@@ -47,36 +47,56 @@ function gradient(t) {
47
47
  const [a, b] = [STOPS[i], STOPS[i + 1]];
48
48
  return [0, 1, 2].map((k) => Math.round(a[k] + (b[k] - a[k]) * local));
49
49
  }
50
- function paint(ch, t, mode) {
50
+ function paintFace(ch, t, mode) {
51
51
  if (ch === " ") return " ";
52
52
  if (mode === "none") return ch;
53
53
  if (mode === "basic") return t < 0.5 ? pc.magentaBright(ch) : pc.redBright(ch);
54
54
  const [r, g, b] = gradient(t);
55
55
  return `\x1B[38;2;${r};${g};${b}m${ch}\x1B[39m`;
56
56
  }
57
- function compact(mode) {
58
- return " " + (mode === "none" ? "partweave" : word2tone("partweave", mode));
57
+ function paintShadow(ch, mode) {
58
+ if (ch === " ") return " ";
59
+ if (mode === "none") return ch;
60
+ if (mode === "basic") return pc.gray(ch);
61
+ return `\x1B[38;2;110;110;110m${ch}\x1B[39m`;
62
+ }
63
+ function paintThread(ch, mode) {
64
+ if (ch === " ") return " ";
65
+ if (mode === "none") return ch;
66
+ if (mode === "basic") return pc.dim(ch);
67
+ return `\x1B[38;2;120;110;140m${ch}\x1B[39m`;
59
68
  }
60
69
  function word2tone(word, mode) {
61
70
  if (mode === "none") return word;
62
- return [...word].map((ch, i) => paint(ch, word.length > 1 ? i / (word.length - 1) : 0, mode)).join("");
71
+ return [...word].map((ch, i) => paintFace(ch, word.length > 1 ? i / (word.length - 1) : 0, mode)).join("");
72
+ }
73
+ function compact(mode) {
74
+ return " " + (mode === "none" ? "partweave" : word2tone("partweave", mode));
63
75
  }
64
76
  function renderBanner() {
65
77
  const mode = colorMode();
66
78
  if (!process.stdout.isTTY) return compact(mode);
67
- const cols = process.stdout.columns ?? 80;
68
79
  const rows = [];
69
80
  for (let r = 0; r < HEIGHT; r++) {
70
81
  rows.push([...WORD].map((ch) => GLYPHS[ch]?.[r] ?? "").join(" "));
71
82
  }
72
- const width = rows[0].length;
73
- if (width + 2 > cols) return compact(mode);
74
- const painted = rows.map(
75
- (row, r) => " " + [...row].map(
76
- (ch, c) => ch === " " ? " " : paint(weaveCell(r, c), width > 1 ? c / (width - 1) : 0, mode)
77
- ).join("")
78
- );
79
- return painted.join("\n");
83
+ const glyphW = rows[0].length;
84
+ const total = 2 + LOOM[0].length + 1 + (glyphW + 1);
85
+ if (total > (process.stdout.columns ?? 80)) return compact(mode);
86
+ const front = (r, c) => r >= 0 && r < HEIGHT && c >= 0 && c < glyphW && rows[r][c] === "\u2588";
87
+ const out = [];
88
+ for (let R = 0; R < HEIGHT; R++) {
89
+ const loom = [...LOOM[R]].map((ch) => paintThread(ch, mode)).join("");
90
+ let mark = "";
91
+ for (let C = 0; C <= glyphW; C++) {
92
+ const t = glyphW > 1 ? Math.min(C, glyphW - 1) / (glyphW - 1) : 0;
93
+ if (front(R, C)) mark += paintFace(weaveCell(R, C), t, mode);
94
+ else if (front(R, C - 1)) mark += paintShadow("\u2591", mode);
95
+ else mark += " ";
96
+ }
97
+ out.push(" " + loom + " " + mark);
98
+ }
99
+ return out.join("\n");
80
100
  }
81
101
 
82
102
  // src/compose.ts
@@ -1709,4 +1729,4 @@ export {
1709
1729
  validateApps,
1710
1730
  runCreate
1711
1731
  };
1712
- //# sourceMappingURL=chunk-Y5FZVVV6.js.map
1732
+ //# sourceMappingURL=chunk-I2IJROBO.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCreate
4
- } from "./chunk-Y5FZVVV6.js";
4
+ } from "./chunk-I2IJROBO.js";
5
5
 
6
6
  // src/create-bin.ts
7
7
  import { Command } from "commander";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  selectedTargets,
16
16
  validateApps,
17
17
  writeProjectManifest
18
- } from "./chunk-Y5FZVVV6.js";
18
+ } from "./chunk-I2IJROBO.js";
19
19
 
20
20
  // src/index.ts
21
21
  import { Command } from "commander";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "partweave",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "A modular full-stack scaffolder — pick the parts you need (Django server, Next.js web, Expo mobile) and generate only that code, wired together.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",