Skip to content

Commit b808816

Browse files
authored
Merge pull request #2 from louisescher/feat/npm-package
2 parents 4e00413 + 9a8a2f5 commit b808816

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1257
-137
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../node_modules/@changesets/config/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "louisescher/astro-webrings" }],
4+
"ignore": ["web"],
5+
"commit": false,
6+
"fixed": [],
7+
"linked": [],
8+
"access": "public",
9+
"baseBranch": "master",
10+
"updateInternalDependencies": "patch"
11+
}

.changeset/full-clouds-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"astro-webrings": minor
3+
---
4+
5+
Initial release

.github/actions/install/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Install Tools & Dependencies
2+
description: Installs pnpm, Node.js & package dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup pnpm
8+
uses: pnpm/action-setup@v3
9+
10+
- name: Setup Node.js based on .node-version
11+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
12+
with:
13+
node-version-file: '.node-version'
14+
cache: 'pnpm'
15+
16+
- name: Install Dependencies
17+
run: pnpm install --frozen-lockfile
18+
shell: bash
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI - Push to Master
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
permissions:
11+
issues: write
12+
repository-projects: read
13+
contents: write
14+
pull-requests: write
15+
pages: write
16+
id-token: write
17+
18+
jobs:
19+
changeset-release:
20+
name: Changeset Release
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout Repo
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
25+
26+
- name: Install Tools & Dependencies
27+
uses: louisescher/astro-webrings/.github/actions/install@master
28+
29+
- name: Run Prepublish
30+
run: pnpm ci:prepublish
31+
32+
- name: Create Release Pull Request or Publish to npm
33+
id: changesets
34+
uses: changesets/action@v1
35+
with:
36+
setupGitUser: true
37+
commit: "👷 [ci]: Version Packages"
38+
title: "👷 [ci]: Ready for Release"
39+
version: pnpm ci:version
40+
publish: pnpm ci:publish
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.20.0

README.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./packages/web/README.md

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"indentStyle": "space"
2626
}
2727
},
28-
"assist": { "actions": { "source": { "organizeImports": "on" } } },
28+
"assist": { "actions": { "source": { "organizeImports": "off" } } },
2929
"linter": {
3030
"enabled": true,
3131
"rules": {

package.json

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
{
2-
"name": "astro-webring",
3-
"type": "module",
4-
"version": "0.0.1",
5-
"packageManager": "pnpm@10.17.1",
6-
"scripts": {
7-
"dev": "astro dev",
8-
"build": "astro build",
9-
"preview": "astro preview",
10-
"astro": "astro",
11-
"start": "node ./dist/server/entry.mjs"
12-
},
13-
"dependencies": {
14-
"@astrojs/node": "^9.4.4",
15-
"astro": "^5.14.1",
16-
"@biomejs/biome": "^2.2.4"
17-
}
18-
}
1+
{
2+
"name": "root",
3+
"private": true,
4+
"packageManager": "pnpm@10.17.1",
5+
"license": "MIT",
6+
"author": {
7+
"name": "Louis Escher",
8+
"url": "https://lou.gg"
9+
},
10+
"type": "module",
11+
"scripts": {
12+
"build": "pnpm --filter astro-webrings build && pnpm --filter web build",
13+
"dev": "pnpm --stream -r -parallel dev",
14+
"start": "pnpm --filter web start",
15+
"changeset": "changeset",
16+
"ci:prepublish": "pnpm build",
17+
"ci:install": "pnpm install --frozen-lockfile",
18+
"ci:version": "pnpm changeset version",
19+
"ci:publish": "pnpm changeset publish"
20+
},
21+
"devDependencies": {
22+
"@changesets/changelog-github": "0.5.1",
23+
"@changesets/cli": "2.29.7",
24+
"@changesets/config": "3.1.1",
25+
"@changesets/write": "0.4.0",
26+
"@biomejs/biome": "^2.2.4"
27+
}
28+
}

packages/astro-webrings/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# astro-webrings
2+
3+
Add webring badges for astro-webrings.lou.gg to your Astro site with ease!
4+
5+
## Installation
6+
7+
You can install the package from the NPM:
8+
9+
```bash
10+
# npm
11+
npm install astro-webrings
12+
13+
# pnpm
14+
pnpm add astro-webrings
15+
16+
# yarn
17+
yarn add astro-webrings
18+
```
19+
20+
Once installed, you can import the component to add a badge to your site:
21+
22+
```jsx
23+
---
24+
import WebringBadge from "astro-webrings/badge";
25+
---
26+
27+
<WebringBadge site="example.com" ring="friends-of-houston" />
28+
```
29+
30+
Make sure that the `site` prop matches the slug you chose in your PR to the [`astro-webrings`](https://github.com/louisescher/astro-webrings) repository and the `ring` prop matches the ring you added your site to. Otherwise, people will see errors when clicking on the badge!
31+
32+
### Animated Badges
33+
If you can see an animated version of the badge you want to use in the [webrings list](https://astro-webrings.lou.gg/#available-webrings), you can set the `animated` prop to use that version instead.

0 commit comments

Comments
 (0)