Skip to content

Commit

Permalink
feat: Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Jun 18, 2024
1 parent a59afac commit af5cb77
Show file tree
Hide file tree
Showing 18 changed files with 4,297 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
// see https://docs.renovatebot.com/presets-config/
extends: [
'config:base',
// automatically rebase onto main branch
':rebaseStalePrs',
// groups all ESLint-related dependency upgrades into a single PR
'group:linters'
],
packageRules: [
// only send upgrade for deps (from the npm registry) after they've been
// published for 30 days
{
matchDatasources: ['npm'],
minimumReleaseAge: '30 days',
},
],
}
27 changes: 27 additions & 0 deletions .github/workflows/bun-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Bun CI

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
bun: [latest]

steps:
- uses: actions/checkout@v4
- name: Use Bun ${{ matrix.bun }}
uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun }}
- name: bun install, build, and test
run: |
bun install
bun run build
bun run --bun test:unit
env:
CI: true
29 changes: 29 additions & 0 deletions .github/workflows/nodejs-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Node CI

on: [push, pull_request]

jobs:
test:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
node: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
- name: JSR Publish Test
run: npm run test:jsr
62 changes: 62 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
push:
branches:
- main
name: release-please

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}

# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}

- run: npm ci
if: ${{ steps.release.outputs.release_created }}

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}

- name: Publish to JSR
run: |
npm run build
npx jsr publish
if: ${{ steps.release.outputs.release_created }}

# Tweets out release announcement
- run: 'npx @humanwhocodes/tweet "${{ github.event.repository.full_name }} v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs.tag_name }}"'
if: ${{ steps.release.outputs.release_created }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}

# Toots out release announcement
- run: 'npx @humanwhocodes/toot "${{ github.event.repository.full_name }} v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs.tag_name }}"'
if: ${{ steps.release.outputs.release_created }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
CHANGELOG.md
packages/*/tests/fixtures
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.0"
}
14 changes: 14 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import js from "@eslint/js";

export default [
js.configs.recommended,
{
languageOptions: {
globals: {
process: false,
URL: false,
console: false
},
}
}
];
14 changes: 14 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@humanwhocodes/object-store",
"version": "0.0.0",
"exports": "./dist/object-store.js",
"publish": {
"include": [
"jsr.json",
"LICENSE",
"README.md",
"dist/object-store.js",
"dist/object-store.d.ts"
]
}
}
Loading

0 comments on commit af5cb77

Please sign in to comment.