A simple starter template to help you start coding your next amazing astro component.
This repo can be used to scaffold an astro package. Follow these steps to get started:
- Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
- Clone the project to your local environment.
- Have fun creating your package.
Clone the project
git clone [email protected]:codiume/astro-component-starter.git my-astro-component
Go to the project directory
cd my-astro-component
Install dependencies
pnpm install
Start development server
pnpm dev
Format your code
pnpm format
Build your component
pnpm build
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:
- if: ${{ false }} # This ensures the workflow is skipped without any notification
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.
Now that you have an NPM access token, you need to add it to your repository's secrets using the following key:
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.