Skip to content

Commit

Permalink
NORSUB-eMRU: Update nmea-parser dep and philosophy (load internal pro…
Browse files Browse the repository at this point in the history
…tocols from TS instead of yaml file)
  • Loading branch information
crisconru committed May 16, 2024
1 parent 7e64fd3 commit 4b99c7e
Show file tree
Hide file tree
Showing 7 changed files with 893 additions and 23 deletions.
11 changes: 7 additions & 4 deletions packages/norsub-emru/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@
"node": ">= 18"
},
"scripts": {
"protocols": "node yaml-to-json.js ./protocols/norsub.yaml ./src/norsub.ts",
"build": "npm run protocols && npm run format && tsc",
"lint": "ts-standard",
"format": "ts-standard --fix",
"build": "tsc && cp -r ./src/norsub.yaml ./dist",
"test": "vitest",
"test": "npm run protocols && vitest",
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@coremarine/nmea-parser": ">=1.6.13",
"@coremarine/nmea-parser": ">=1.6.14",
"@schemasjs/valibot-numbers": "^1.0.8"
},
"peerDependencies": {
Expand All @@ -60,7 +61,9 @@
"ts-standard": {
"ignore": [
"tests",
"vitest.config.ts"
"vitest.config.ts",
"tsup.config.ts",
"yaml-to-json.js"
]
},
"eslintConfig": {
Expand Down
File renamed without changes.
13 changes: 0 additions & 13 deletions packages/norsub-emru/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'
// DIR
export const DIRNAME = ((): string => {
try {
// CJS
return __dirname
} catch (error) {
// ESM
const filename = fileURLToPath(import.meta.url)
return path.dirname(filename)
}
})()
// GENERATE NUMBERS
export const UINT8_MAX = Uint8Array.from([0b1111_1111])[0]
export const UINT16_MAX = Uint16Array.from([0b1111_1111_1111_1111])[0]
Expand Down
Loading

0 comments on commit 4b99c7e

Please sign in to comment.