@embeddable.com/init 0.1.2 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +18 -3
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import chalk from "chalk";
8
8
  import degit from "degit";
9
9
  import prompts from "prompts";
10
10
  import terminalLink from "terminal-link";
11
+ import open from "open";
11
12
  var REPO_URL = "embeddable-hq/remarkable-pro-boilerplate";
12
13
  var DEFAULT_FOLDER = "embeddable-repo";
13
14
  var WORKSPACE_URLS = {
@@ -43,9 +44,19 @@ function isValidUuid(value) {
43
44
  const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
44
45
  return uuidRegex.test(value.trim());
45
46
  }
47
+ var LOGO = `
48
+ \u2584\u2584\u2588\u2588\u2588\u2588\u2584\u2584
49
+ \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
50
+ \u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
51
+ \u2588\u2588 \u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557
52
+ \u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D
53
+ \u2580\u2588\u2588\u2584\u2584\u2584\u2584\u2584\u2584\u2588\u2588\u2580 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
54
+ \u2580\u2580\u2588\u2588\u2588\u2588\u2580\u2580 \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D
55
+ `;
46
56
  async function main() {
47
57
  const onCancel = () => exit("\nSetup cancelled.\n");
48
- console.log(chalk.bold("\nWelcome to Embeddable!\n"));
58
+ console.log(chalk.white(LOGO));
59
+ console.log(chalk.bold("Welcome to Embeddable!\n"));
49
60
  console.log(`Embeddable stores your ${chalk.bold("charting components")}, ${chalk.bold("data models")} and ${chalk.bold("themes")} in code, so you have ${chalk.bold("full control")} over the ${chalk.bold("look-and-feel")} and the ${chalk.bold("data")} powering your dashboards.
50
61
  `);
51
62
  console.log("This tool helps you get set up to create your first Embeddable dashboard.\n");
@@ -112,7 +123,9 @@ Failed to download boilerplate: ${message}
112
123
  {
113
124
  type: "password",
114
125
  name: "apiKey",
115
- message: `You'll need an API Key to push this code bundle to your workspace (to create an account, head to ${chalk.cyan("https://embeddable.com/start")}).
126
+ message: `You'll need an API Key to push this code bundle to your workspace
127
+ (to create an account, head to ${chalk.cyan("https://embeddable.com/start")}).
128
+
116
129
  Paste your API Key here:`,
117
130
  validate: (value) => {
118
131
  const trimmed = value.trim();
@@ -129,6 +142,7 @@ Paste your API Key here:`,
129
142
  const embeddableDir = path.join(projectPath, ".embeddable");
130
143
  fs.mkdirSync(embeddableDir, { recursive: true });
131
144
  fs.writeFileSync(path.join(embeddableDir, ".api-key"), apiKey.trim());
145
+ console.log("");
132
146
  const regionResponse = await prompts(
133
147
  {
134
148
  type: "select",
@@ -202,10 +216,11 @@ Paste your API Key here:`,
202
216
  Success!
203
217
  `));
204
218
  console.log(`You have pushed your ${chalk.bold("components")} and ${chalk.bold("data models")} to workspace.`);
205
- console.log(`Head there now to build your first Embeddable: ${chalk.cyan(workspaceLink)}
219
+ console.log(`Refresh your workspace page to see the "Create new Embeddable" button and the sample dashboards: ${chalk.cyan(workspaceLink)}
206
220
  `);
207
221
  console.log(`Follow the guide here to create your first Embeddable dashboard: ${chalk.cyan(docsLink)}
208
222
  `);
223
+ await open(workspaceUrl);
209
224
  }
210
225
  main().catch((error) => {
211
226
  console.error(chalk.red("An unexpected error occurred:"), error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddable.com/init",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "CLI tool for Embeddable",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,6 +25,7 @@
25
25
  "dependencies": {
26
26
  "chalk": "^5.3.0",
27
27
  "degit": "^2.8.4",
28
+ "open": "^11.0.0",
28
29
  "prompts": "^2.4.2",
29
30
  "terminal-link": "^5.0.0"
30
31
  },