sprint-es 0.0.51 → 0.0.52
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/dist/cjs/cli.cjs +19 -0
- package/dist/esm/cli.js +19 -0
- package/package.json +1 -1
package/dist/cjs/cli.cjs
CHANGED
|
@@ -67,6 +67,25 @@ function runCommand(cmd, envVars) {
|
|
|
67
67
|
process.exit(code || 0);
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
+
function generateJWTSecret() {
|
|
71
|
+
const chars = crypto__namespace.randomBytes(24).toString("hex").split("");
|
|
72
|
+
const positions = /* @__PURE__ */ new Set();
|
|
73
|
+
while (positions.size < 5) {
|
|
74
|
+
const pos = crypto__namespace.randomInt(0, 48);
|
|
75
|
+
let valid = true;
|
|
76
|
+
for (const p of positions) {
|
|
77
|
+
if (Math.abs(p - pos) <= 1) {
|
|
78
|
+
valid = false;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (valid) positions.add(pos);
|
|
83
|
+
}
|
|
84
|
+
for (const pos of positions) {
|
|
85
|
+
chars[pos] = ".";
|
|
86
|
+
}
|
|
87
|
+
return chars.join("");
|
|
88
|
+
}
|
|
70
89
|
switch (command) {
|
|
71
90
|
case "dev":
|
|
72
91
|
console.log("🚀 Starting development server with hot reload...");
|
package/dist/esm/cli.js
CHANGED
|
@@ -49,6 +49,25 @@ function runCommand(cmd, envVars) {
|
|
|
49
49
|
process.exit(code || 0);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
+
function generateJWTSecret() {
|
|
53
|
+
const chars = crypto.randomBytes(24).toString("hex").split("");
|
|
54
|
+
const positions = /* @__PURE__ */ new Set();
|
|
55
|
+
while (positions.size < 5) {
|
|
56
|
+
const pos = crypto.randomInt(0, 48);
|
|
57
|
+
let valid = true;
|
|
58
|
+
for (const p of positions) {
|
|
59
|
+
if (Math.abs(p - pos) <= 1) {
|
|
60
|
+
valid = false;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (valid) positions.add(pos);
|
|
65
|
+
}
|
|
66
|
+
for (const pos of positions) {
|
|
67
|
+
chars[pos] = ".";
|
|
68
|
+
}
|
|
69
|
+
return chars.join("");
|
|
70
|
+
}
|
|
52
71
|
switch (command) {
|
|
53
72
|
case "dev":
|
|
54
73
|
console.log("🚀 Starting development server with hot reload...");
|