Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codiume/astro-component-starter
A starter kit template for your next astro component
https://github.com/codiume/astro-component-starter
astro astro-component astro-starter-kit
Last synced: 6 days ago
JSON representation
A starter kit template for your next astro component
- Host: GitHub
- URL: https://github.com/codiume/astro-component-starter
- Owner: codiume
- License: mit
- Created: 2022-08-20T13:44:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-13T16:23:50.000Z (3 months ago)
- Last Synced: 2024-11-05T13:42:26.476Z (8 days ago)
- Topics: astro, astro-component, astro-starter-kit
- Language: JavaScript
- Homepage: https://astro.build
- Size: 291 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Astro Component Starter
A simple starter template to help you start coding your next amazing [astro](https://astro.build) component.
## Running locally
### Using Github interface
This repo can be used to scaffold an [astro](https://astro.build) package. Follow these steps to get started:
1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
2. Clone the project to your local environment.
3. Have fun creating your package.### Using Terminal
Clone the project
```bash
git clone [email protected]:codiume/astro-component-starter.git my-astro-component
```Go to the project directory
```bash
cd my-astro-component
```## Installation
Install dependencies
```bash
pnpm install
```Start development server
```bash
pnpm dev
```Format your code
```bash
pnpm format
```Build your component
```bash
pnpm build
```## Publishing to NPM
### Setup GitHub Actions
When you're ready to publish your package to npm, this template is pre-configured with Changesets—a tool that automates versioning and package publishing. By default, the release action is disabled to prevent unintentional publishing from this template.
To enable publishing for your project, you need to modify the GitHub Actions workflow. Specifically, you'll need to update the `.github/workflows/release.yml` file by removing the following line:
```diff
- if: ${{ false }} # This ensures the workflow is skipped without any notification
```### Creating an NPM access token
You’ll also need to set up an npm token in GitHub to authenticate with the npm registry and enable package publishing.
For guidance on creating an npm token, refer to the official documentation: [Creating and viewing access tokens](https://docs.npmjs.com/creating-and-viewing-access-tokens).
### Adding NPM Token to GitHub Secrets
Now that you have an NPM access token, you need to add it to your repository's secrets using the following key:
```ruby
NPM_TOKEN=your-npm-token
```For guidance on adding secrets to a GitHub repository, please refer to the official documentation:[Creating secrets for a repository](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository).