Skip to content

Commit 22e4bb2

Browse files
Add npm publish action and move to @fujocoded
1 parent 0abb396 commit 22e4bb2

5 files changed

Lines changed: 42 additions & 10 deletions

File tree

.github/workflows/npm-publish.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write # Allows GitHub to generate OIDC tokens required for provenance
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version-file: ".nvmrc"
20+
registry-url: "https://registry.npmjs.org"
21+
22+
- run: npm ci
23+
- run: npm test
24+
25+
- name: Update version
26+
run: |
27+
VERSION=${GITHUB_REF#refs/tags/v}
28+
npm version $VERSION --no-git-tag-version
29+
30+
- run: npm publish --provenance
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v24
1+
v22.20.0

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ Using `setFetcher`, you can override the default `fetch` method used by the libr
5858
With yarn
5959

6060
```sh
61-
yarn install @bobaboard/ao3.js
61+
yarn install @fujocoded/ao3.js
6262
```
6363

6464
or npm
6565

6666
```sh
67-
npm install @bobaboard/ao3.js
67+
npm install @fujocoded/ao3.js
6868
```
6969

7070
Then go to town in your JavaScript (or TypeScript) files:
7171

7272
```ts
73-
import { getTag, getWork } from "@bobaboard/ao3.js";
73+
import { getTag, getWork } from "@fujocoded/ao3.js";
7474

7575
const tag = await getTag({
7676
tagName: "Ever Given Container Ship (Anthropomorphic)",
@@ -166,7 +166,7 @@ If you wish to override `fetch` with your own implementation, you can use the
166166
next section for more details.
167167

168168
```ts
169-
import { setFetcher } from "@bobaboard/ao3.js";
169+
import { setFetcher } from "@fujocoded/ao3.js";
170170
import fetch from "node-fetch";
171171

172172
// You MUST call this before calling other ao3.js methods
@@ -182,7 +182,7 @@ by using the exported `setFetch` function.
182182
For example, to override `fetch` with the `node-fetch` implementation:
183183

184184
```ts
185-
import { setFetcher } from "@bobaboard/ao3.js";
185+
import { setFetcher } from "@fujocoded/ao3.js";
186186
import fetch from "node-fetch";
187187

188188
// You MUST call this before calling other ao3.js methods
@@ -203,7 +203,7 @@ If you want to avoid these issues, you can use the following code to add caching
203203
automatic retrying to the library:
204204

205205
```ts
206-
import { setFetcher } from "@bobaboard/ao3.js";
206+
import { setFetcher } from "@fujocoded/ao3.js";
207207

208208
const CACHE = new Map();
209209
setFetcher(async (...params: Parameters<typeof fetch>) => {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@bobaboard/ao3.js",
2+
"name": "@fujocoded/ao3.js",
33
"version": "0.21.0",
44
"description": "A NodeJS API for scraping AO3 data",
55
"type": "module",

0 commit comments

Comments
 (0)