Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
chore(build): Add deno.json and mod.ts, update the build workflows an…
Browse files Browse the repository at this point in the history
…d config files

This commit includes the addition of deno.json and mod.ts files to better structure the project and also enhances the build processes by implementing an updated jsr-publish workflow in GitHub. This update ensures the version in deno.json is updated during the build. Additionally, changes have been made to tsconfig.json file to include 'mod.ts' and 'renovate.json' file to enhance versioning practices.
  • Loading branch information
hckhanh committed Feb 26, 2024
1 parent b1c04fa commit efb1831
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/jsr-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish JSR Package

on:
release:
types: [published]

jobs:
publish-jsr:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
registry-url: https://npm.pkg.github.com/
- name: Build commonjs, es6, esnext and amd
run: |
yarn build:cjs
yarn build:es
yarn build:types
- name: Install jq
uses: dcarbone/[email protected]
- name: Update version in deno.json
run: |
VERSION_NUMBER="$(node -p "require('./package.json').version")"
jq '.version = "'$VERSION_NUMBER'"' deno.json > temp.json
mv temp.json deno.json
- name: Install Deno
uses: denoland/[email protected]
- name: Publish to jsr
run: deno publish
5 changes: 5 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@hckhanh/read-vn-number",
"version": "0.0.0-development",
"exports": "./mod.ts"
}
14 changes: 14 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This is a helper that convert a number to a string like the way a real Vietnamese read it.
*
* @example
* ```ts
* import readNumber from 'read-vn-number'
*
* readNumber('19990000') // or readNumber(19990000)
* // output: mười chín triệu chín trăm chín mươi nghìn
* ```
*
* @module
*/
export * from './src'
2 changes: 2 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
":automergeTypes",
"npm:unpublishSafe",
"group:definitelyTyped",
":semanticCommitTypeAll(deps)",
":semanticCommitScopeDisabled",
":separateMultipleMajorReleases",
":automergeRequireAllStatusChecks"
],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@
/* Other Options */
// "resolveJsonModule": true /* allows for importing, extracting types from and generating .json files. */
},
"files": ["src/index.ts"]
"files": ["src/index.ts", "mod.ts"]
}

0 comments on commit efb1831

Please sign in to comment.