Skip to content

Commit

Permalink
As of hs cli v7, hs project upload no longer takes an argument (will …
Browse files Browse the repository at this point in the history
…fail with "Unknown argument: .")
  • Loading branch information
Aaron Mead committed Feb 6, 2025
1 parent 4fca49a commit c7f7821
Show file tree
Hide file tree
Showing 21 changed files with 4,135 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
HUBSPOT_PORTAL_ID: ${{ secrets.hubspot_portal_id }}
HUBSPOT_PERSONAL_ACCESS_KEY: ${{ secrets.hubspot_personal_access_key }}
run: |
npx --yes --package=@hubspot/cli@latest --call='hs project upload . --use-env'
npx --yes --package=@hubspot/cli@latest --call='hs project upload --use-env'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you'd like to get started with your own React module or one of our defaults,

- Become familiar with working with our CLI, if you are not already, with our [Hubspot CLI documentation](https://developers.hubspot.com/docs/cms/guides/getting-started)
- Run `hs init` and select your portal.
- Within the react-module-boilerplate/src run `yarn deploy` or `npm deploy`, which is a helper script we offer which runs the `hs project upload react-module-boilerplate` CLI command.
- Within the react-module-boilerplate/src run `yarn deploy` or `npm deploy`, which is a helper script we offer which runs the `hs project upload` CLI command.
- You will be prompted to create this project in your portal. Confirm and the project will be created.
- Wait a few moments for the deploy to finish. You can view the projects within your portal at `https://app.hubspot.com/developer-projects/{YOUR_PORTAL_ID}`

Expand Down
2 changes: 1 addition & 1 deletion default-react-modules/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"start": "hs-cms-dev-server ../src",
"start-storybook": "hs-cms-dev-server ../src --storybook",
"deploy": "hs project upload public-default-react-modules",
"deploy": "hs project upload",
"test": "vitest"
},
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CMS React components introduce the “CMS assets” project component alongside
The linked documentation notes that "Create a project (BETA)" is available for "Sales Hub" and "Service Hub" enterprise. CMS React components are available for all tiers and therefore so is use of the Projects system to support them.
:::

Building and deploying is straightforward. A project can be uploaded for build and deploy with the `hs project upload` command. The command can be run in the root of a project with no argument or a directory path can be passed i.e. `hs project upload path/to/project`.
Building and deploying is straightforward. A project can be uploaded for build and deploy with the `hs project upload` command. The command can be run in the root of a project with no argument or a directory path can be passed i.e. `hs project upload`.

The command will kick off a build for your project. If you have "auto deploy" configured for the project it will deploy the build if successful. Projects that are not configured for "auto deploy" can be deployed via the command line with `hs project deploy`. More info is available with `hs project --help`.

Expand Down
2 changes: 1 addition & 1 deletion examples/contact-profile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prettier": "prettier . --check",
"watch:hubl": "hs watch contact-profile-theme contact-profile-theme",
"upload:hubl": "hs upload contact-profile-theme contact-profile-theme",
"deploy": "hs project upload contact-profile-project"
"deploy": "hs project upload"
},
"dependencies": {},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/data-fetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prettier": "prettier . --write",
"watch:hubl": "hs watch data-fetching-theme data-fetching-theme",
"upload:hubl": "hs upload data-fetching-theme",
"deploy": "hs project upload data-fetching-project"
"deploy": "hs project upload"
},
"engines": {
"node": ">=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/getting-started-project-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"postinstall": "cd src/getting-started-theme && yarpm install",
"lint:js": "eslint . --ext .js,.jsx",
"prettier": "prettier . --check",
"deploy": "hs project upload ."
"deploy": "hs project upload"
},
"engines": {
"node": ">=16.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
interface Teammate {
firstname: string;
lastname: string;
}

interface MyTeamProps {
total: number;
teammates: Teammate[];
}

export default function MyTeam({ total, teammates }: MyTeamProps) {
const hasTeammateData: boolean = !!teammates;

function Teammates({ teammateData }) {
return (
<>
<div>
<h2>My Team</h2>
<ul>
{teammateData.map((teammate, idx) => (
<li key={idx}>
{teammate.firstname} {teammate.lastname}
</li>
))}
</ul>
</div>
</>
);
}

return (
<div>
<div>
{hasTeammateData && <Teammates teammateData={teammates} />}
{!hasTeammateData && <h2>No teammates found</h2>}
</div>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { VideoPlayer } from '@hubspot/cms-components';
type PlayerType = 'hsvideo2' | 'simple-html5';
type ConversionAsset = {
type: 'CTA' | 'FORM';
id: string;
position: 'PRE' | 'POST' | 'CUSTOM';
};
type HubSpotVideoParams = {
player_id: number;
width: number;
height: number;
max_width?: number;
max_height?: number;
autoplay: boolean;
hide_controls: boolean;
loop_video: boolean;
mute_by_default: boolean;
player_type: PlayerType;
};

type VideoPlayerProps = {
hubspotVideo: HubSpotVideoParams;
};

export default function VideoIsland(props: VideoPlayerProps) {
const { hubspotVideo } = props;
return (
<>
<VideoPlayer hubspotVideo={hubspotVideo} />
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import weatherStyles from '../../../styles/weather.module.css';

import {
BooleanField,
ModuleFields,
RepeatedFieldGroup,
TextField,
VideoField,
RichTextField,
ImageField,
} from '@hubspot/cms-components/fields';
import VideoIsland from '../../islands/VideoIsland.tsx?island';
import MyTeam from '../../islands/MyTeam.tsx?island';

import {
RichText,
getHubID,
// VideoPlayer,
// Image,
Island,
} from '@hubspot/cms-components';
// import { RichText } from '@hubspot/cms-components';

export function Component(props: any) {
console.log('props', arguments);
const { fieldValues } = props;
// const { hubspotVideo, default_todos } = fieldValues;

return (
<div>
{/* <Image imageField={imageField} /> */}
Video in Island
{/* <Island module={VideoIsland} hubspotVideo={hubspotVideo} /> */}
<hr />
Video Not in Island
{/* <VideoPlayer
tag={'div'}
style={{ border: '1px solid red' }}
hubspotVideo={hubspotVideo}
/> */}
Richtext2
<div className={weatherStyles.testClass} />
<RichText fieldPath="richTextField" data-attr="test" />
{/* player_id="52655782663" /> */}
{/* <RichText fieldPath="@hubspot/richtest" /> */}
<hr></hr>
Todos :
<br />
{/* {default_todos.map((todo, idx) => (
<p key={'todo' + idx}>
Todo: {todo.text} - {todo.completed ? 'Complete' : 'Incomplete'}
</p>
))} */}
</div>
);
}

export const meta = {
label: 'Test Module',
};
2 changes: 1 addition & 1 deletion examples/getting-started/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prettier": "prettier . --check",
"watch:hubl": "hs watch getting-started-theme getting-started-theme",
"upload:hubl": "hs upload getting-started-theme getting-started-theme",
"deploy": "hs project upload getting-started-project"
"deploy": "hs project upload"
},
"engines": {
"node": ">=16.0.0"
Expand Down
Loading

0 comments on commit c7f7821

Please sign in to comment.