Skip to content

Commit 8d58cbe

Browse files
authored
V2 (#16)
* Migrate to Bun, Biome, structure changes, CI/CD update - Migrate from PNPM to Bun (package manager) - Migrate from Node to Bun (runtime) for /scripts - Migrate from Prettier/ESLint to Biome - Migrate Tests from Jest to Bun Test Runner - Move tests closer to each tested file, also splitting them - Update GH Action to support NPM's Trusted publishing, Bun and update used actions' versions - Update README, CONTRIBUTING and LICENSE year * Change formatters param signature, add new FormatStyle type with union strings, make formatters throw only when it's unable to parse. * Add vscode workspace settings for biome and recommended extensions * Update READMEs * Change LICENSE to MIT * misc script changes * v2.0.0-beta.0 * Fix GH action permissions * v2.0.0-beta.1 * Re: Fix GH action permissions * v2.0.0-beta.2 * Use npm publish instead of bun * v2.0.0-beta.3 * Update NPM step to support Trusted Publishing OIDC * v2.0.0-beta.4 * Use bunx instead of udpating npm * v2.0.0-beta.5 * Explicitly set tag to version on npm publish * v2.0.0-beta.6 * Have two steps for publishing release and prerelease tags * v2.0.0-beta.7 * Add repository field in package.json * v2.0.0-beta.8 * Disable source maps generation * v2.0.0-beta.9 * Update package.json * v2.0.0-beta.10 * Update script to generate rnc/cedula with and without dashes for proper testing, also remove shuffling algo * Refactor some of the validators, fix js docs, update RNC validator test to also use cedulas, update generate script * Add script to generate provincias/municipios helpers, update tsconfig for import alias, update vscode settings * Add license badge, fix EOF new line on script, add tsdown for building lib and minifying * v2.0.0-beta.11 * Add script for calculating false negatives, update README, add exports field to package.json, update biome config * Update README.es.md * v2.0.0-beta.12 * Update package.json exports * v2.0.0-beta.13 * Use "default" instead of "import" in package.json exports * v2.0.0-beta.14 * Remove .DS_Store * Update READMEs * Update GH Action to mark release as prerelease if not stable version * v2.0.0-beta.15 * Enable generate release notes on GH Action
1 parent e5f0451 commit 8d58cbe

55 files changed

Lines changed: 1746 additions & 5352 deletions

Some content is hidden

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

.eslintrc.js

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

.github/workflows/release-and-publish.yaml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,38 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
id-token: write # Required for OIDC (NPM)
10+
contents: write
11+
812
jobs:
913
release:
1014
runs-on: ubuntu-latest
1115
steps:
1216
- name: Checkout
13-
uses: actions/checkout@v2
14-
17+
uses: actions/checkout@v6
1518
- name: Create Release
16-
uses: softprops/action-gh-release@v1
19+
uses: softprops/action-gh-release@v2
20+
with:
21+
prerelease: ${{ contains(github.ref_name, '-') }}
22+
generate_release_notes: true
1723

1824
publish:
1925
needs: release
2026
runs-on: ubuntu-latest
2127
steps:
22-
- uses: actions/checkout@v2
23-
24-
- uses: actions/setup-node@v2
25-
with:
26-
node-version: '16.x'
27-
registry-url: 'https://registry.npmjs.org'
28-
29-
- run: npm install
30-
31-
- run: npm publish
32-
env:
33-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28+
- name: Checkout
29+
uses: actions/checkout@v6
30+
- name: Install bun
31+
uses: oven-sh/setup-bun@v2
32+
- name: Install dependencies
33+
run: bun ci
34+
- name: Run tests
35+
run: bun test
36+
- name: Publish to NPM (Pre-release)
37+
run: bunx npm@latest publish --tag next
38+
if: contains(github.ref_name, '-')
39+
- name: Publish to NPM (Stable)
40+
run: bunx npm@latest publish
41+
if: "!contains(github.ref_name, '-')"
42+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules/
22
lib/
33
tmp/
44
coverage/
5+
.DS_Store

.prettierrc

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

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome", "oven.bun-vscode"]
3+
}

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.formatOnSave": true,
4+
"javascript.preferences.quoteStyle": "single",
5+
"typescript.preferences.quoteStyle": "single",
6+
"notebook.defaultFormatter": "biomejs.biome",
7+
"[typescript]": {
8+
"editor.defaultFormatter": "biomejs.biome"
9+
},
10+
"editor.codeActionsOnSave": {
11+
"source.organizeImports.biome": "explicit",
12+
"source.fixAll.biome": "explicit"
13+
}
14+
}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
125125
* All public API methods **must be documented**. (Details TBC). -->
126126

127127
- All features or bug fixes **must be tested** by one or more suites.
128-
- We follow [Airbnb's JavaScript Style Guide](https://airbnb.io/javascript), using ESLint.
128+
- We are using [Biome](https://biomejs.dev/) for lint/format, meaning we don't exactly follow a style guide (anymore). Make sure to exec `bun run biome` to confirm everything's as expected.

0 commit comments

Comments
 (0)