Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dropin-starter-template.md #212

Merged
merged 10 commits into from
Mar 16, 2025
Prev Previous commit
Next Next commit
Update dropin-starter-template.md
Updates instructions to include generating a component, a container, and adding the container to the sandbox env.
supernova-at authored Mar 13, 2025
commit bcdfeb2b709c71485604adde5a3b1350c2e70b27
25 changes: 18 additions & 7 deletions _drafts/dropin-starter-template.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ For more information on GitHub Templates, you can refer to the following resourc
1. **Navigate to the Template Repository**: Go to https://github.com/adobe-commerce/dropin-template.
2. **Create a New Repository**: Click on the "Use this template" button to create a new repository based on the template. This will generate a new repository with the same directory structure and files as the template.
3. **Clone Your New Repository**: You can now clone the newly created repository to your local machine using `git clone`.
4. **Install, Configure, and Launch**: Follow the instructions in your new repo's `README` file to install, configure, and launch your development environment.
4. **Install, Configure, and Launch**: Follow the instructions in your new repo's `README` file to install the dependencies, generate a configuration file, update your Mesh endpoint, and launch your development environment.

That's it! You now have a drop-in application with the same consistency and best practices that Adobe's drop-ins have, built in.

@@ -28,17 +28,24 @@ To add a shared component from the Adobe Commerce Storefront SDK to your new pro

1. **Install the `@adobe-commerce/elsie ` Package**: Run the following command to install the Storefront SDK package:
```bash
npm install @dropins/tools
npm install @adobe-commerce/elsie
```

2. **Import the Component**: In your project, import the desired component from the `@dropins/tools` package. For example, to import the `Button` component, add the following line to your code:
```javascript
import { Button } from '@dropins/tools';
2. **Generate a Container**: Run the following command to generate a Container component:
```bash
npx elsie generate container --pathname <MyContainer>
```

3. **Use the Component**: Now you can use the imported component in your project. For example:
3. **Generate a UI Component**: Run the following command to generate a UI component:
```bash
npx elsie generate component --pathname <myUIComponent>
```

4. **Use a Component from the SDK**: In your generated UI component, import a shared component from the Storefront SDK package and render it. For example, the `Button` component:
```javascript
function App() {
import { Button } from '@adobe-commerce/elsie';

function MyUiComponent() {
return (
<div>
<Button label="Click Me" />
@@ -47,6 +54,10 @@ To add a shared component from the Adobe Commerce Storefront SDK to your new pro
}
```

5. **Add your Component to your Container**: Add your component to the container created in step 2.

6. **Render the Container**: Update your sandbox environment to render your container in `examples/html-host/index.html`.

## Conclusion

By following this guide, you should be able to quickly set up a new project using the Adobe Commerce Drop-in Template and add shared components from the Storefront SDK package. If you have any questions or need further assistance, please feel free to reach out.