Skip to content

Commit 4b3b3ed

Browse files
Merge pull request #15 from HubSpot/UIE-public-beta-update
React getting started project
2 parents e0555ec + 35f2081 commit 4b3b3ed

File tree

16 files changed

+199
-137
lines changed

16 files changed

+199
-137
lines changed

config.json

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
{
2-
"components": [
3-
{ "path": "components/app-crm-card-middle", "label": "App (CRM card - middle panel)", "insertPath": "./"},
4-
{ "path": "components/app-crm-card-side", "label": "App (CRM card - side panel)", "insertPath": "./"}
5-
],
6-
"projects": [
7-
{
8-
"name": "no-template",
9-
"label": "No template",
10-
"path": "projects/no-template",
11-
"insertPath": "./"
12-
},
13-
{
14-
"name": "getting-started",
15-
"label": "Getting started",
16-
"path": "projects/getting-started-template",
17-
"insertPath": "./"
18-
}
19-
]
2+
"components": [
3+
{
4+
"path": "components/app-crm-card-middle",
5+
"label": "App (CRM card - middle panel)",
6+
"insertPath": "./"
7+
},
8+
{
9+
"path": "components/app-crm-card-side",
10+
"label": "App (CRM card - side panel)",
11+
"insertPath": "./"
12+
}
13+
],
14+
"projects": [
15+
{
16+
"name": "getting-started",
17+
"label": "Use CRM getting started project",
18+
"path": "projects/getting-started-template",
19+
"insertPath": "./"
20+
},
21+
{
22+
"name": "no-template",
23+
"label": "No, start from scratch",
24+
"path": "projects/no-template",
25+
"insertPath": "./"
26+
}
27+
]
2028
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 HubSpot
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# getting-started-project-template
1+
# HubSpot Getting Started Project Template
22

3-
This is the Getting Started project for HubSpot developer projects. This repo contains code that is intended to help developers to get up and running with developer projects quickly and easily.
3+
This is the Getting Started project for HubSpot developer projects. It contains a private app, a CRM card written in React, and a serverless function that the CRM card is able to interact with. This code is intended to help developers get up and running with developer projects quickly and easily.
44

55
## Requirements
6+
67
There are a few things that must be set up before you can make use of this getting started project.
8+
79
- You must have an active HubSpot account.
810
- You must have the [HubSpot CLI](https://www.npmjs.com/package/@hubspot/cli) installed and set up.
911
- You must have access to developer projects (developer projects are currently [in public beta under "CRM Development Tools"](https://app.hubspot.com/l/whats-new/betas)).
1012

1113
## Usage
12-
The HubSpot CLI is configured to pull from the latest release of this project. To get started, run the following CLI command in your terminal:
1314

14-
`hs project create`
15+
The HubSpot CLI enables you to run this project locally so that you may test and iterate quickly. Getting started is simple, just run this HubSpot CLI command in your project directory and follow the prompts:
1516

16-
The CLI should walk you throug the rest of the setup flow.
17+
`hs project dev`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "getting-started-template",
2+
"name": "Get Started Project",
33
"srcDir": "src",
44
"platformVersion": "2023.1"
55
}

projects/getting-started-template/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "hubspot-get-started-project",
3+
"version": "0.1.0",
4+
"description": "Basic example of a UI Extension built with HubSpot's React developer tools",
5+
"scripts": {
6+
"postinstall": "cd ./src/app/extensions/ && npm install; cd ../app.functions && npm install",
7+
"build": "npm run build --prefix ./src/app/extensions/"
8+
},
9+
"author": "HubSpot",
10+
"license": "MIT"
11+
}

projects/getting-started-template/src/app/app.functions/example-card.js

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
exports.main = (context = {}, sendResponse) => {
2+
const { text } = context.parameters;
3+
4+
const response = `This is coming from a serverless function! You entered: ${text}`;
5+
6+
try {
7+
sendResponse(response);
8+
} catch (error) {
9+
sendResponse(error);
10+
}
11+
};

projects/getting-started-template/src/app/app.functions/package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
"name": "demo.functions",
3-
"version": "1.0.0",
4-
"description": "",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
9-
"author": "",
10-
"license": "ISC",
2+
"name": "hubspot-example-function",
3+
"version": "0.1.0",
4+
"author": "HubSpot",
5+
"license": "MIT",
116
"dependencies": {
127
"@hubspot/api-client": "^7.0.1",
138
"axios": "^0.27.2"

projects/getting-started-template/src/app/app.functions/serverless.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"runtime": "nodejs16.x",
33
"version": "1.0",
44
"appFunctions": {
5-
"crm-card": {
6-
"file": "example-card.js",
5+
"myFunc": {
6+
"file": "example-function.js",
77
"secrets": []
88
}
99
}

0 commit comments

Comments
 (0)