Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
Expand All @@ -24,8 +22,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
node-version: "24"

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -61,7 +58,7 @@ jobs:

- name: Update package version to -<commit-hash>
env:
PACKAGE_VERSION: ${{ steps.package-version.outputs.current-version }}-experimental-${{ env.COMMIT_HASH }}
PACKAGE_VERSION: ${{ steps.package-version.outputs.current-version }}-alpha-${{ env.COMMIT_HASH }}
run: |
node <<'NODE'
const fs = require("node:fs");
Expand All @@ -77,18 +74,38 @@ jobs:
- name: Upload npm package artifact
uses: actions/upload-artifact@v7
with:
name: npm-packages
name: npm-package
path: "*.tgz"

release:
needs: build
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "24"
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Download npm package artifact
uses: actions/download-artifact@v8
with:
name: npm-package

- name: Publish npm package
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
run: npm publish --access public --tag experimental
run: npm publish ./rescript-webapi-*.tgz --access public --tag alpha

deploy-docs:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/experimental)](https://www.npmjs.com/package/@rescript/webapi)
[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/alpha)](https://www.npmjs.com/package/@rescript/webapi)

# experimental-rescript-webapi

Expand All @@ -9,7 +9,7 @@ Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescrip
Install the package using your favorite package manager:

```shell
npm i @rescript/webapi@experimental
npm i @rescript/webapi@alpha
```

and add `@rescript/webapi` to your `rescript.json`:
Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ tableOfContents: false

import { Tabs, TabItem, Code } from "@astrojs/starlight/components";

[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/experimental)](https://www.npmjs.com/package/@rescript/webapi)
[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/alpha)](https://www.npmjs.com/package/@rescript/webapi)

## Installation

Install the package using your favorite package manager:

<Tabs syncKey="package manager">
<TabItem label="npm">
<Code lang="shell" frame="none" code="npm i @rescript/webapi@experimental" />
<Code lang="shell" frame="none" code="npm i @rescript/webapi@alpha" />
</TabItem>
<TabItem label="bun">
<Code lang="shell" frame="none" code="bun i @rescript/webapi@experimental" />
<Code lang="shell" frame="none" code="bun i @rescript/webapi@alpha" />
</TabItem>
</Tabs>

Expand Down
4 changes: 2 additions & 2 deletions docs/llm.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ files.sort();

const pages = await Promise.all(files.map(processFile));
const packageJson = await fs.readFile(path.join(import.meta.dirname, "../package.json"), "utf-8");
let version = JSON.parse(packageJson).version;
const version = JSON.parse(packageJson).version;
const sha = await execAsync("git rev-parse --short HEAD").then(({ stdout }) => stdout.trim());
const fullVersion = `${version}-experimental-${sha}`;
const fullVersion = `${version}-alpha-${sha}`;
const header = `Experimental ReScript WebAPI Documentation ${fullVersion}

This is the API documentation for the experimental WebAPI module version ${fullVersion}.
Expand Down