File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 run : bun install
3131
3232 - name : Publish to npm
33- run : bun publish --access public
33+ run : bun run --filter './packages/*' release
3434 env :
3535 BUN_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
3636
Original file line number Diff line number Diff line change 11<script setup>
2- import { QRCode , QRCodeCorrectLevel } from ' @stacksjs/qrx'
2+ import { QRCode } from ' @stacksjs/qrx'
33import { onMounted , ref , watch } from ' vue'
44// import { QRCode, QRCodeCorrectLevel } from './qrcode'
55
6- const text = ref (' Hello VitePress !' )
6+ const text = ref (' Hello World !' )
77const errorLevel = ref (' 2' ) // H level by default
88const useSVG = ref (true )
99const qrContainer = ref (null )
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export default defineConfig({
5555 exclude : [
5656 // 'vue',
5757 'body-scroll-lock' ,
58+ 'bunfig' ,
5859 ] ,
5960 } ,
6061} )
Original file line number Diff line number Diff line change 3737 "fresh" : " bunx rimraf node_modules/ bun.lock && bun i" ,
3838 "changelog" : " bunx changelogen --output CHANGELOG.md" ,
3939 "prepublishOnly" : " bun --bun run build && bun run compile:all" ,
40- "release" : " bun run changelog && bunx bumpp package.json --all" ,
40+ "release" : " bun run changelog && bunx bumpp -r --all" ,
4141 "test" : " bun test" ,
4242 "dev:docs" : " bun --bun vitepress dev docs" ,
4343 "build:docs" : " bun --bun vitepress build docs" ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const resp = await Bun.build({
44 target : 'browser' ,
55 entrypoints : [ './src/index.ts' ] ,
66 outdir : './dist' ,
7+ external : [ 'bunfig' ] ,
78 plugins : [ dts ( ) ] ,
89} )
910
Original file line number Diff line number Diff line change 6060 "lint" : " bunx --bun eslint --flag unstable_ts_config ." ,
6161 "lint:fix" : " bunx --bun eslint --flag unstable_ts_config . --fix" ,
6262 "prepublishOnly" : " bun --bun run build && bun run compile:all" ,
63- "release" : " bun run changelog && bunx bumpp package.json --all " ,
63+ "release" : " bun publish --access public " ,
6464 "test" : " bun test" ,
6565 "typecheck" : " bun --bun tsc --noEmit"
6666 },
Original file line number Diff line number Diff line change @@ -27,21 +27,20 @@ class UPC extends Barcode {
2727 this . guardHeight = options . height + this . fontSize / 2 + options . textMargin
2828 }
2929
30- valid ( ) {
30+ valid ( ) : boolean {
3131 return this . data . search ( / ^ \d { 12 } $ / ) !== - 1
3232 && this . data [ 11 ] == checksum ( this . data )
3333 }
3434
35- encode ( ) {
35+ encode ( ) : any {
3636 if ( this . options . flat ) {
3737 return this . flatEncoding ( )
3838 }
39- else {
40- return this . guardedEncoding ( )
41- }
39+
40+ return this . guardedEncoding ( )
4241 }
4342
44- flatEncoding ( ) {
43+ flatEncoding ( ) : { data : string , text : string } {
4544 let result = ''
4645
4746 result += '101'
@@ -56,7 +55,7 @@ class UPC extends Barcode {
5655 }
5756 }
5857
59- guardedEncoding ( ) {
58+ guardedEncoding ( ) : any {
6059 const result = [ ]
6160
6261 // Add the first digit
@@ -115,7 +114,7 @@ class UPC extends Barcode {
115114
116115// Calulate the checksum digit
117116// https://en.wikipedia.org/wiki/International_Article_Number_(EAN)#Calculation_of_checksum_digit
118- export function checksum ( number ) {
117+ export function checksum ( number : string ) : number {
119118 let result = 0
120119
121120 let i
Original file line number Diff line number Diff line change 44import Barcode from '../barcode'
55
66class MSI extends Barcode {
7- constructor ( data , options ) {
7+ constructor ( data : string , options : any ) {
88 super ( data , options )
99 }
1010
11- encode ( ) {
11+ encode ( ) : { data : string , text : string } {
1212 // Start bits
1313 let ret = '110'
1414
@@ -20,7 +20,7 @@ class MSI extends Barcode {
2020
2121 // Add 100 for every zero and 110 for every 1
2222 for ( let b = 0 ; b < bin . length ; b ++ ) {
23- ret += bin [ b ] == '0' ? '100' : '110'
23+ ret += bin [ b ] === '0' ? '100' : '110'
2424 }
2525 }
2626
@@ -33,15 +33,16 @@ class MSI extends Barcode {
3333 }
3434 }
3535
36- valid ( ) {
36+ valid ( ) : boolean {
3737 return this . data . search ( / ^ \d + $ / ) !== - 1
3838 }
3939}
4040
41- function addZeroes ( number , n ) {
41+ function addZeroes ( number : string , n : number ) : string {
4242 for ( let i = 0 ; i < n ; i ++ ) {
4343 number = `0${ number } `
4444 }
45+
4546 return number
4647}
4748
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ API.prototype.options = function (options) {
116116
117117// Will create a blank space (usually in between barcodes)
118118API . prototype . blank = function ( size ) {
119+ // eslint-disable-next-line unicorn/no-new-array
119120 const zeroes = new Array ( size + 1 ) . join ( '0' )
120121 this . _encodings . push ( { data : zeroes } )
121122 return this
@@ -128,7 +129,7 @@ API.prototype.init = function () {
128129 return
129130 }
130131
131- // Make sure renderProperies is an array
132+ // Make sure renderProperties is an array
132133 if ( ! Array . isArray ( this . _renderProperties ) ) {
133134 this . _renderProperties = [ this . _renderProperties ]
134135 }
@@ -138,7 +139,7 @@ API.prototype.init = function () {
138139 renderProperty = this . _renderProperties [ i ]
139140 var options = merge ( this . _options , renderProperty . options )
140141
141- if ( options . format == 'auto' ) {
142+ if ( options . format === 'auto' ) {
142143 options . format = autoSelectBarcode ( )
143144 }
144145
Original file line number Diff line number Diff line change 5050 "build" : " bun --bun build.ts" ,
5151 "lint" : " bunx --bun eslint --flag unstable_ts_config ." ,
5252 "lint:fix" : " bunx --bun eslint --flag unstable_ts_config . --fix" ,
53+ "release" : " bun publish --access public" ,
5354 "prepublishOnly" : " bun --bun run build" ,
5455 "test" : " bun test" ,
5556 "typecheck" : " bun --bun tsc --noEmit"
You can’t perform that action at this time.
0 commit comments