Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
0701e9e
chore!: update to new ESLint config
weiland Sep 5, 2025
9eccbbd
refact(tests): move to plain `assert`
weiland Sep 5, 2025
2c3755a
chore: format files and fix linting errors
weiland Sep 5, 2025
60b57a5
chore: improve dev linting
weiland Sep 5, 2025
1af2814
refact: start moving to Typescript
weiland Sep 5, 2025
eb64f49
refact(dates): adjust tests
weiland Sep 5, 2025
d819256
refact(dates): migrate getRelativeTime and getFullRelativeTime
weiland Sep 5, 2025
28a536c
refact(dates): migrate getYearMonthDay
weiland Sep 5, 2025
e7e9655
refact(dates): migrate getHourMinutes and getIsoRelativeTime
weiland Sep 5, 2025
5249830
refact(dates): migrate revYearMonthDay and finish dates
weiland Sep 5, 2025
13b6cf3
refact: migrate helpers
weiland Sep 5, 2025
c5d3860
refact(numbers): migrate all number utils
weiland Sep 6, 2025
87e688a
refact(strings): migrate all string utils
weiland Sep 6, 2025
be2df3c
chore: clean up directory structure
weiland Sep 6, 2025
7328bd9
chore: upgrade dependencies
weiland Sep 6, 2025
e16752d
refact(storage): migrate all storage utils
weiland Sep 6, 2025
8fafba5
refact(helpers): add request helper
weiland Sep 6, 2025
ee1126b
fix(linting): ignore redirected for now
weiland Sep 6, 2025
e2379fa
fix(request): address type issues
weiland Sep 6, 2025
c670bfa
chore(ci): add more node versions
weiland Sep 6, 2025
0661a5d
chore: clean up tests
weiland Sep 9, 2025
9633e6b
chore: clean up legacy functions
weiland Sep 11, 2025
7e23e12
feat(helper): create minimal fetch wrapper
weiland Sep 11, 2025
7e40623
chore: clean up unused files and adjust READMEs
weiland Sep 17, 2025
43a8eb2
ci: remove pr test label
weiland Sep 17, 2025
c1710c7
fix(ci): remove dependency
weiland Sep 17, 2025
aa7b54c
ci: separate node 20 test from other node tests
weiland Sep 17, 2025
fc800ac
fix(test): adjust regex to work in bun and node
weiland Sep 17, 2025
473896c
ci: use npm to run tests on older node
weiland Sep 17, 2025
361f997
ci: adjust test files
weiland Sep 17, 2025
9cc4f1c
fix(ci): remove glob star
weiland Sep 17, 2025
4850ea0
fix(ci): remove glob star
weiland Sep 17, 2025
1ae37d5
chore(test): rename tests to test
weiland Sep 17, 2025
1b8e4b3
fix(ci): add mjs-suffix
weiland Sep 17, 2025
6ff983f
fix(ci): fix tests path
weiland Sep 17, 2025
8f1f94d
chore(ci): clean up test job
weiland Sep 17, 2025
0f69948
chore: release v3.0.0-beta.1
weiland Sep 17, 2025
488a6cb
fix: use correct extension for bin
weiland Sep 17, 2025
88afa84
chore: release v3.0.0-beta.2
weiland Sep 17, 2025
f50be34
fix(npm): use bin path suggested from npm
weiland Sep 17, 2025
5a1d9ae
chore: release v3.0.0-beta.3
weiland Sep 17, 2025
fc071e1
refact: migrate to workspaces
weiland Sep 19, 2025
f4885ea
chore: upgrade dependencies
weiland Feb 24, 2026
5469184
chore: update dependencies
weiland Feb 28, 2026
cef4dcd
chore: update dependencies
weiland Feb 28, 2026
e12801d
fix(ci): clean up linting
weiland Feb 28, 2026
3165171
fix(ci): run dist tests only for legacy
weiland Feb 28, 2026
0439c64
fix(ci): use bun for installation
weiland Feb 28, 2026
88bd853
fix(ci): fix storage tests for node v20
weiland Feb 28, 2026
4bfbf4b
fix(ci): fix legacy tests
weiland Feb 28, 2026
2c065a6
fix: ts error
weiland Feb 28, 2026
15ff5c1
chore: mix biome to dev dependencies
weiland Feb 28, 2026
ea953bd
chore: bump versions
weiland Feb 28, 2026
a016f85
chore: release v3.0.0-beta.5
weiland Feb 28, 2026
8811522
fix(test): add version from `package.json`
weiland Feb 28, 2026
caaa0cc
feat(ci): add npm publishing
weiland Feb 28, 2026
486cb97
fix(ci): run dist tests in bun
weiland Feb 28, 2026
3b74361
ci: install more dependencies
weiland Feb 28, 2026
f87da05
chore: fix linting
weiland Feb 28, 2026
f74d711
fix: link mjs build output files
weiland Mar 1, 2026
7cb42b0
fix: lockfile
weiland Mar 1, 2026
f97fc20
chore(ci): run more tests
weiland Mar 1, 2026
f5336d1
chore: prefer `*` for workspaces
weiland Mar 1, 2026
9f92ab3
chore: add zed settings
weiland Mar 1, 2026
f7fa627
chore(ci): publish via tarball
weiland Mar 1, 2026
af341fc
chore: release v3.0.0-beta.6
weiland Mar 1, 2026
aa75c99
chore: update dependencies and clean up
weiland Mar 18, 2026
de9fa97
chore(utils-legacy): add bumpp
weiland Mar 18, 2026
08c5251
chore: release v3.0.0-beta.5
weiland Mar 18, 2026
d00a795
chore: release v3.0.0-beta.6
weiland Mar 18, 2026
d33341e
chore: release v3.0.0-beta.7
weiland Mar 18, 2026
805e34c
chore(ci): use node24
weiland Mar 18, 2026
c5dfe6c
chore: release v3.0.0-beta.8
weiland Mar 18, 2026
760497e
fix(ci): fix env var
weiland Mar 18, 2026
c6140d0
fix(ci): use node v24 in linting
weiland Mar 18, 2026
f601a27
chore(utils-legacy): add `release` npm script
weiland Mar 18, 2026
423e4f6
chore: release v3.0.0-beta.9
weiland Mar 18, 2026
86d6f94
fix(ci): registry-url -> registries
weiland Mar 18, 2026
2cddc57
chore: release v3.0.0-beta.10
weiland Mar 18, 2026
00ff348
ci: use correct package name before packaging
weiland Mar 18, 2026
11cdbcd
chore: release v3.0.0-beta.11
weiland Mar 18, 2026
1246445
fix: don't re-use the same name twice
weiland Mar 18, 2026
09f0e63
chore: release v3.0.0-beta.12
weiland Mar 18, 2026
2d82355
fix(ci): add new suffix to new package before publishing
weiland Mar 18, 2026
dae614c
chore: release v3.0.0-beta.13
weiland Mar 18, 2026
0c3722c
fix(ci): use `*` as filename
weiland Mar 18, 2026
6ce102e
chore: release v3.0.0-beta.14
weiland Mar 18, 2026
565c4ae
chore(ci): publish v4 as well
weiland Mar 18, 2026
f2097ef
chore(utils): clean up
weiland Mar 18, 2026
f125722
chore(utils): add bumpp
weiland Mar 18, 2026
4eb3236
chore: release v4.0.0-beta.1
weiland Mar 18, 2026
538fbc5
chore(ci): clean up release workflows
weiland Mar 18, 2026
f3d4426
chore(utils-legacy): fix workspace dependencies
weiland Mar 18, 2026
7137099
chore: release v3.0.0-beta.15
weiland Mar 18, 2026
df817c3
fix(utils-legacy): add separate cjs and mjs exports
weiland Mar 18, 2026
6d8ce24
chore: release v3.0.0-beta.16
weiland Mar 18, 2026
db0d88a
chore: fix linting
weiland Mar 18, 2026
125b008
fix(storage): fix exported modules
weiland Mar 18, 2026
e2d7f64
chore: release v3.0.0-beta.17
weiland Mar 18, 2026
46b14e5
chore(utils-legacy): always bundle the storage wrapper
weiland Mar 18, 2026
afed8f9
chore: release v3.0.0-beta.18
weiland Mar 18, 2026
5eca8f3
chore(utils): add README
weiland Mar 18, 2026
f5ec86f
chore(utils-legacy): use only ESM export
weiland Mar 18, 2026
83fa1a6
chore: release v4.0.0-beta.2
weiland Mar 18, 2026
a834a91
chore(utils-legacy): only output esm
weiland Mar 18, 2026
e9068ba
chore: release v3.0.0-beta.19
weiland Mar 18, 2026
356e278
chore(utils-legacy): re-add cjs export
weiland Mar 18, 2026
e4748d4
chore(utils-legacy): support node v20
weiland Mar 18, 2026
42b3eaa
chore: release v3.0.0-beta.17
weiland Mar 18, 2026
31e816e
chore: release v3.0.0-beta.18
weiland Mar 18, 2026
38208e4
chore: release v3.0.1-beta.1
weiland Mar 18, 2026
457cfa2
chore(ci): make sure everything is built for legacy
weiland Mar 18, 2026
decad54
chore: release v3.0.1-beta.2
weiland Mar 18, 2026
7ef1636
fix(utils-legacy): add default export to StorageWrapper
weiland Mar 18, 2026
59ab7f4
chore: release v3.0.1-beta.3
weiland Mar 18, 2026
10b5bc9
fix(utils-legacy): don't export Storage
weiland Mar 18, 2026
2ee9f5f
chore: release v3.0.1-beta.4
weiland Mar 18, 2026
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ root = true
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 8
indent_size = 4
max_line_length = 120
trim_trailing_whitespace = true
insert_final_newline = true
Expand Down
3 changes: 0 additions & 3 deletions .env.example

This file was deleted.

16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
- package-ecosystem: npm
directory: /
open-pull-requests-limit: 10
schedule:
interval: 'weekly'
day: 'sunday'
- package-ecosystem: 'github-actions'
directory: '/'
interval: weekly
day: sunday
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 10
schedule:
interval: 'weekly'
day: 'sunday'
interval: weekly
day: sunday
19 changes: 12 additions & 7 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,28 @@ on:

jobs:
lint:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
runs-on: ubuntu-latest
steps:
- name: 👀 Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: 🛠 Setup Bun
uses: oven-sh/setup-bun@v2
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
bun-version: 1.3.9

- name: 📦 Install Dependencies
run: bun install --frozen-lockfile

- name: 📚 Lint Code Base
run: bun run lint
- name: 📚 Code format check
run: bun run format:check

- name: 📚 Lint types
run: bun run typecheck

- name: 📚 Run Tests
run: bun run test
- name: 📚 Lint code
run: bun run lint
80 changes: 63 additions & 17 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
name: Test on Pull
name: Run tests for pull requests

on:
pull_request_target:
types: [labeled]

env:
NODE_VERSION: 20
workflow_dispatch:
pull_request:

jobs:
security:
name: Check permissions for pull request runs
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
steps:
- run: |
echo "Security checks passed!"

test:
needs: security
name: Run Tests
name: Run Node.js Tests
runs-on: ubuntu-latest
strategy:
matrix:
version: [22, 24]
steps:
- name: 👀 Checkout Code
uses: actions/checkout@v4

- name: 🏗 Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version: ${{ matrix.version }}

- name: 🛠 Setup Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -40,8 +31,63 @@ jobs:
- name: 🧪 Run Lint
run: bun run lint

- name: 🔨 Run build
run: bun run build

- name: 🧪 Run Tests (in Bun)
run: bun run test

- name: 🧪 Run Tests (in Node)
run: node --run test:node

- name: 🧪 Run Tests (in via npm in Bun)
run: npm run test

- name: 🧪 Run Tests (in via npm in Node)
run: npm run test:node

- name: 🧪 Run MJS Tests (in via npm in Node)
run: npm run test:mjs --workspace=packages/utils-legacy

- name: 🧪 Run Dist Tests (in via npm in bun)
run: npm run test:dist --workspace=packages/utils-legacy

- name: 🧪 Run Dist Tests (in via npm in Node)
run: npm run test:dist:node --workspace=packages/utils-legacy

test-node-20:
name: Run Tests in Node.js v20
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
runs-on: ubuntu-latest
steps:
- name: 👀 Checkout Code
uses: actions/checkout@v4

- name: 🏗 Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: 🛠 Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: 📦 Install Dependencies (via bun)
run: bun install

- name: 📦 Run build
run: npm run build

- name: 🧪 Run Tests
run: npm run --workspace=packages/{utils-legacy,utils} test

- name: 🧪 Run Storage Tests
run: npm run --workspace=packages/storage test:bun && npm run --workspace=packages/storage typecheck

- name: 🧪 Run Dist Tests (in Node via bun)
run: npm run --workspace=packages/utils-legacy test:dist

- name: 🧪 Run Tests (in Node via bun)
run: npm run --workspace=packages/utils-legacy test
116 changes: 116 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Release v3 or v4 NPM package

on:
push:
tags:
- 'v3*'
- 'v4*'

jobs:
publish-v3:
if: startsWith(github.ref_name, 'v3')
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.9
registries: |
https://registry.npmjs.org/

- name: Setup node for npm OIDC
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24.x

- name: bun install
run: bun install --frozen-lockfile

- name: global bun build
run: bun run build

- name: bun build
run: bun run build
working-directory: packages/utils-legacy

- name: bun test
run: bun run test
working-directory: packages/utils-legacy

- name: ensure correct package name
run: bun pm pkg set name="@swrlab/utils"
working-directory: packages/utils-legacy

- name: ensure correct package name for new package (to prevent errors)
run: bun pm pkg set name="@swrlab/utils-new"
working-directory: packages/utils

- name: create tarball
run: bun pm pack
working-directory: packages/utils-legacy

- name: npm publish legacy
run: npm publish --access public --provenance --tag legacy *.tgz
working-directory: packages/utils-legacy

publish-v4:
if: startsWith(github.ref_name, 'v4')
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.9
registries: |
https://registry.npmjs.org/

- name: Setup node for npm OIDC
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24.x

- name: bun install
run: bun install --frozen-lockfile

- name: bun build
run: bun run build
working-directory: packages/utils

- name: bun test
run: bun run test
working-directory: packages/utils

- name: create tarball
run: bun pm pack
working-directory: packages/utils

- name: npm publish latest
run: npm publish --access public --provenance --tag latest *.tgz
working-directory: packages/utils

- name: create github release
run: gh release create ${{ github.ref_name }} --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73 changes: 6 additions & 67 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,72 +1,11 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.DS_Store
.env

# config
config.js

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components
node_modules
dist
*.tsbuildinfo

# node-waf configuration
.lock-wscript
coverage/

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.yarn/
!**/.yarn/cache
!**/.yarn/patches
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
!**/.yarn/versions

# next.js build output
.next
.env

tmp/*
!tmp/.gitkeep
.DS_Store
Loading
Loading