Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial structure #2

Merged
merged 2 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jest.config.ts
release.config.js
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed

$CHANGES
46 changes: 46 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: GitHub CI
on:
push:
branches: [ main ]
pull_request:

jobs:
Test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x, 20.x, 'lts/*' ]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install --ignore-scripts
# - name: Run Unit Tests
# run: npm run test:ci
- name: Release Drafter
uses: release-drafter/release-drafter@v5.9.0
env:
GITHUB_TOKEN: ${{ secrets.GH_SECRET }}
Release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm install
- name: Semantic Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_SECRET }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
138 changes: 138 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

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

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Typedoc
docs

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# NPM
package-lock.json

# Webstorm
.idea
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Folders
.github
.idea
src
__tests__
coverage

# Files
jest.config.ts
*.json
*.yml
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Node HL7 Client
Node.js client library for creating a HL7 Client which can publish a properlly formatted HL7 message to a source.

Benefits:

- No dependencies, making this ultra-fast.
- Automatically re-connect, re-subscribe, or retry sending
- Written in typescript and published with heavily commented type definitions
- Intuitive API with named parameters instead of positional

## Table of Contents

1. [Acknowledgements](#acknowledgements)
2. [License](#license)

## Acknowledgements

- My Wife and Baby Girl.

## License

Licensed under [MIT](LICENSE).
11 changes: 11 additions & 0 deletions bin/build-types.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cat >lib/cjs/package.json <<!EOF
{
"type": "commonjs"
}
!EOF

cat >lib/esm/package.json <<!EOF
{
"type": "module"
}
!EOF
10 changes: 10 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['/__fixtures__/', '/__utils__/'],
resolver: 'jest-ts-webcompat-resolver',
}

export default jestConfig
65 changes: 65 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "node-hl7-client",
"version": "0.0.0-development",
"description": "",
"module": "./lib/esm/index.js",
"main": "./lib/cjs/index.js",
"types": "./lib/types/index.d.ts",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js",
"default": "./lib/cjs/index.js"
}
},
"files": [
"lib/**/*"
],
"scripts": {
"clean": "rm -rf dist coverage",
"build": "tsc && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && ./bin/build-types.sh",
"build:watch": "tsc -w",
"lint": "ts-standard --parser @typescript-eslint/parser | snazzy",
"lint:fix": "ts-standard --fix --parser @typescript-eslint/parser | snazzy",
"pack": "npm run clean && npm run test:ci && npm run build && npm pack",
"prepublishOnly": "npm run clean && npm run build",
"test": "jest",
"test:ci": "jest --ci",
"test:coverage": "jest --coverage",
"typedoc": "typedoc",
"typedoc:watch": "typedoc -watch",
"semantic-release": "semantic-release",
"semantic-release:dryRun": "semantic-release --dry-run"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Bugs5382/node-hl7-client.git"
},
"author": "Shane Froebel",
"license": "MIT",
"bugs": {
"url": "https://github.com/Bugs5382/node-hl7-client/issues"
},
"homepage": "https://github.com/Bugs5382/node-hl7-client#readme",
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^12.1.0",
"@types/jest": "^29.5.8",
"@types/node": "^20.9.1",
"@typescript-eslint/parser": "^5.62.0",
"jest": "^29.7.0",
"jest-ts-webcompat-resolver": "^1.0.0",
"pre-commit": "^1.2.2",
"semantic-release": "^22.0.8",
"snazzy": "^9.0.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"ts-standard": "^12.0.2",
"tsd": "^0.29.0",
"typedoc": "^0.25.3",
"typescript": "^5.2.2"
}
}
27 changes: 27 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
"branches": ["main"],
"verifyConditions": [
'@semantic-release/changelog',
'@semantic-release/npm',
'@semantic-release/git'
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
9 changes: 9 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": false,
"sourceMap": false,
"module": "commonjs",
"outDir": "./lib/cjs"
}
}
Loading