@embeddable.com/init 0.1.4 → 0.1.6
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/README.md +105 -0
- package/dist/index.js +6 -5
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# @embeddable.com/init
|
|
2
|
+
|
|
3
|
+
A CLI tool that helps you quickly set up your first [Embeddable](https://embeddable.com) project. It guides you through the entire onboarding process—from project creation to pushing your first components to your workspace.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Run the following command to get started:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @embeddable.com/init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The CLI will walk you through:
|
|
14
|
+
|
|
15
|
+
1. Creating a new project folder
|
|
16
|
+
2. Downloading the boilerplate project template
|
|
17
|
+
3. Installing dependencies
|
|
18
|
+
4. Configuring your API credentials and region (US/EU)
|
|
19
|
+
5. Building and deploying your initial bundle to your Embeddable workspace
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
- Node.js 20 or higher
|
|
24
|
+
- An Embeddable account with an API key
|
|
25
|
+
|
|
26
|
+
## Development
|
|
27
|
+
|
|
28
|
+
### Setup
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Build
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Watch mode
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm run dev
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Test locally
|
|
47
|
+
|
|
48
|
+
After building, you can test the CLI locally:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
node dist/index.js
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
or run from a separate directory:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx <path-to-this-repo>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Publishing to npm
|
|
61
|
+
|
|
62
|
+
### Prerequisites
|
|
63
|
+
|
|
64
|
+
1. Ensure you have an npm account with access to the `@embeddable.com` scope
|
|
65
|
+
2. Log in to npm:
|
|
66
|
+
```bash
|
|
67
|
+
npm login
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Publishing
|
|
71
|
+
|
|
72
|
+
1. Update the version in `package.json`:
|
|
73
|
+
```bash
|
|
74
|
+
npm version patch # or minor/major
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
2. Publish to npm:
|
|
78
|
+
```bash
|
|
79
|
+
npm publish --access public
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The `prepublishOnly` script will automatically run the build before publishing.
|
|
83
|
+
|
|
84
|
+
### Verifying the release
|
|
85
|
+
|
|
86
|
+
After publishing, verify the package is available:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm view @embeddable.com/init
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Project Structure
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
├── src/
|
|
96
|
+
│ └── index.ts # Main CLI application
|
|
97
|
+
├── dist/ # Compiled output (generated)
|
|
98
|
+
├── package.json # Package configuration
|
|
99
|
+
├── tsconfig.json # TypeScript configuration
|
|
100
|
+
└── tsup.config.ts # Build configuration
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var WORKSPACE_URLS = {
|
|
|
19
19
|
var INVALID_FOLDER_CHARS = /[<>:"/\\|?*\x00-\x1f]/;
|
|
20
20
|
function exit(message) {
|
|
21
21
|
if (message) console.log(message);
|
|
22
|
+
printDocsHint();
|
|
22
23
|
process.exit(0);
|
|
23
24
|
}
|
|
24
25
|
function printDocsHint() {
|
|
@@ -141,7 +142,7 @@ Failed to download boilerplate: ${message}
|
|
|
141
142
|
{
|
|
142
143
|
type: "password",
|
|
143
144
|
name: "apiKey",
|
|
144
|
-
message: `You'll need an API Key to push this code bundle to your workspace
|
|
145
|
+
message: `You'll need an API Key to push this code bundle to your account's workspace
|
|
145
146
|
(to create an account, head to ${chalk.cyan("https://embeddable.com/start")}).
|
|
146
147
|
|
|
147
148
|
Paste your API Key here:`,
|
|
@@ -165,7 +166,7 @@ Paste your API Key here:`,
|
|
|
165
166
|
{
|
|
166
167
|
type: "select",
|
|
167
168
|
name: "region",
|
|
168
|
-
message: "Confirm your workspace region:",
|
|
169
|
+
message: "Confirm your workspace region (you can find this in your workspace):",
|
|
169
170
|
choices: [
|
|
170
171
|
{ title: "US", value: "US" },
|
|
171
172
|
{ title: "EU", value: "EU" }
|
|
@@ -226,19 +227,19 @@ Paste your API Key here:`,
|
|
|
226
227
|
const workspaceLink = terminalLink(workspaceUrl, workspaceUrl, {
|
|
227
228
|
fallback: (text) => text
|
|
228
229
|
});
|
|
229
|
-
const docsUrl = "https://docs.embeddable.com/getting-started/
|
|
230
|
+
const docsUrl = "https://docs.embeddable.com/getting-started/your-workspace";
|
|
230
231
|
const docsLink = terminalLink(docsUrl, docsUrl, {
|
|
231
232
|
fallback: (text) => text
|
|
232
233
|
});
|
|
233
234
|
console.log(chalk.green(`
|
|
234
235
|
Success!
|
|
235
236
|
`));
|
|
236
|
-
console.log(`You have pushed
|
|
237
|
+
console.log(`You have pushed Embeddable's ${chalk.bold("default chart library")} and sample ${chalk.bold("data models")} to your workspace.`);
|
|
237
238
|
console.log(`Refresh your workspace page to see the "Create new Embeddable" button and the sample dashboards: ${chalk.cyan(workspaceLink)}
|
|
238
239
|
`);
|
|
239
240
|
console.log(`Follow the guide here to create your first Embeddable dashboard: ${chalk.cyan(docsLink)}
|
|
240
241
|
`);
|
|
241
|
-
await open(
|
|
242
|
+
await open(docsUrl);
|
|
242
243
|
}
|
|
243
244
|
main().catch((error) => {
|
|
244
245
|
console.error(chalk.red("An unexpected error occurred:"), error);
|