@embeddable.com/init 0.1.3 → 0.1.4
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/index.js +24 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import terminalLink from "terminal-link";
|
|
|
11
11
|
import open from "open";
|
|
12
12
|
var REPO_URL = "embeddable-hq/remarkable-pro-boilerplate";
|
|
13
13
|
var DEFAULT_FOLDER = "embeddable-repo";
|
|
14
|
+
var TYPEWRITER_SPEED = 10;
|
|
14
15
|
var WORKSPACE_URLS = {
|
|
15
16
|
US: "https://app.us.embeddable.com",
|
|
16
17
|
EU: "https://app.eu.embeddable.com"
|
|
@@ -44,6 +45,12 @@ function isValidUuid(value) {
|
|
|
44
45
|
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
45
46
|
return uuidRegex.test(value.trim());
|
|
46
47
|
}
|
|
48
|
+
async function typewriter(text, style, speed = 10) {
|
|
49
|
+
for (const char of text) {
|
|
50
|
+
process.stdout.write(style ? style(char) : char);
|
|
51
|
+
await new Promise((resolve) => setTimeout(resolve, speed));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
47
54
|
var LOGO = `
|
|
48
55
|
\u2584\u2584\u2588\u2588\u2588\u2588\u2584\u2584
|
|
49
56
|
\u2584\u2588\u2588\u2580\u2580\u2580\u2580\u2580\u2580\u2588\u2588\u2584 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
@@ -56,10 +63,21 @@ var LOGO = `
|
|
|
56
63
|
async function main() {
|
|
57
64
|
const onCancel = () => exit("\nSetup cancelled.\n");
|
|
58
65
|
console.log(chalk.white(LOGO));
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
await typewriter("Welcome to Embeddable!\n\n", chalk.bold, TYPEWRITER_SPEED);
|
|
67
|
+
await typewriter("Embeddable stores your ", void 0, TYPEWRITER_SPEED);
|
|
68
|
+
await typewriter("charting components", chalk.bold, TYPEWRITER_SPEED);
|
|
69
|
+
await typewriter(", ", void 0, TYPEWRITER_SPEED);
|
|
70
|
+
await typewriter("data models", chalk.bold, TYPEWRITER_SPEED);
|
|
71
|
+
await typewriter(" and ", void 0, TYPEWRITER_SPEED);
|
|
72
|
+
await typewriter("themes", chalk.bold, TYPEWRITER_SPEED);
|
|
73
|
+
await typewriter(" in code, so you have ", void 0, TYPEWRITER_SPEED);
|
|
74
|
+
await typewriter("full control", chalk.bold, TYPEWRITER_SPEED);
|
|
75
|
+
await typewriter(" over the ", void 0, TYPEWRITER_SPEED);
|
|
76
|
+
await typewriter("look-and-feel", chalk.bold, TYPEWRITER_SPEED);
|
|
77
|
+
await typewriter(" and the ", void 0, TYPEWRITER_SPEED);
|
|
78
|
+
await typewriter("data", chalk.bold, TYPEWRITER_SPEED);
|
|
79
|
+
await typewriter(" powering your dashboards.\n\n", void 0, TYPEWRITER_SPEED);
|
|
80
|
+
await typewriter("This tool helps you get set up to create your first Embeddable dashboard.\n\n", void 0, TYPEWRITER_SPEED);
|
|
63
81
|
const cwd = process.cwd();
|
|
64
82
|
const { confirmDir } = await prompts(
|
|
65
83
|
{
|
|
@@ -185,7 +203,7 @@ Paste your API Key here:`,
|
|
|
185
203
|
);
|
|
186
204
|
}
|
|
187
205
|
}
|
|
188
|
-
console.log(chalk.dim("\nBuilding bundle
|
|
206
|
+
console.log(chalk.dim("\nBuilding bundle..."));
|
|
189
207
|
try {
|
|
190
208
|
execSync("npm run embeddable:build", { cwd: projectPath, stdio: "inherit" });
|
|
191
209
|
} catch {
|
|
@@ -193,7 +211,7 @@ Paste your API Key here:`,
|
|
|
193
211
|
printDocsHint();
|
|
194
212
|
process.exit(1);
|
|
195
213
|
}
|
|
196
|
-
console.log(chalk.dim("
|
|
214
|
+
console.log(chalk.dim("Pushing bundle to workspace..."));
|
|
197
215
|
try {
|
|
198
216
|
execSync(
|
|
199
217
|
`npm run embeddable:push -- --api-key ${apiKey.trim()} --email "no-reply@embeddable.com" --message "npx @embeddable.com/init"`,
|