Skip to content

Commit 077a788

Browse files
committed
rewritten in TS
1 parent d662d08 commit 077a788

37 files changed

+2573
-3264
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ root = true
44
indent_style = space
55
indent_size = 4
66
charset = utf-8
7+
quote_type = single
78
trim_trailing_whitespace = true
89
insert_final_newline = true
910
end_of_line = lf

.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/base-format.ts":"1","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-format.ts":"2","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-hemi-format.ts":"3","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-sexa-format.ts":"4","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-sexa-hemi-format.ts":"5","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/dms-decimal-min-format.ts":"6","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/index.ts":"7","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/is-numeric.ts":"8","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/parser.ts":"9","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/validate-schema.ts":"10","/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/types.ts":"11"},{"size":3464,"mtime":1733253259861,"results":"12","hashOfConfig":"13"},{"size":1695,"mtime":1733252412107,"results":"14","hashOfConfig":"13"},{"size":1785,"mtime":1733253986658,"results":"15","hashOfConfig":"13"},{"size":1747,"mtime":1733252537041,"results":"16","hashOfConfig":"13"},{"size":1815,"mtime":1733252581847,"results":"17","hashOfConfig":"13"},{"size":2630,"mtime":1733252648307,"results":"18","hashOfConfig":"13"},{"size":38,"mtime":1733251402305,"results":"19","hashOfConfig":"13"},{"size":301,"mtime":1733253724106,"results":"20","hashOfConfig":"13"},{"size":2668,"mtime":1733253291038,"results":"21","hashOfConfig":"13"},{"size":3785,"mtime":1733253470485,"results":"22","hashOfConfig":"13"},{"size":542,"mtime":1733252133764,"results":"23","hashOfConfig":"13"},{"filePath":"24","messages":"25","suppressedMessages":"26","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"cb57k8",{"filePath":"27","messages":"28","suppressedMessages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","suppressedMessages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","suppressedMessages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","suppressedMessages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","suppressedMessages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","suppressedMessages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","suppressedMessages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","suppressedMessages":"56","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/base-format.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-format.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-hemi-format.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-sexa-format.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/decimal-sexa-hemi-format.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/formats/dms-decimal-min-format.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/index.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/is-numeric.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/parser.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/validate-schema.ts",[],[],"/Volumes/Workspace/projects/@air-avionics/openaip/openaip-coordinate-parser/src/types.ts",[],[]]
Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,71 @@
1+
name: Create NPM package
12
on:
23
push:
3-
# Sequence of patterns matched against refs/tags
4-
tags:
5-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6-
7-
name: Create Release
84

95
jobs:
106
run-tests:
11-
name: Run tests
12-
runs-on: ubuntu-latest
7+
# only run if specific '#build' tag is found in commit message
8+
if: contains(github.event.head_commit.message, '#build')
9+
name: "Run tests"
10+
runs-on: ubuntu-22.04
1311
steps:
14-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1513
- uses: actions/setup-node@v3
1614
with:
1715
node-version: 22
1816
registry-url: https://npm.pkg.github.com/
19-
scope: '@openaip'
17+
scope: "@openaip"
18+
# IMPORTANT use "npm install" to also include dev-dependencies which are required for running tests
2019
- run: npm install
20+
name: Install packages
2121
env:
22-
#NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
23-
NODE_AUTH_TOKEN: ${{secrets.AUTOMATOR_PAT_PACKAGE_TOKEN}}
22+
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}}
2423
- run: npm run test
25-
env:
26-
#NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
27-
NODE_AUTH_TOKEN: ${{secrets.AUTOMATOR_PAT_PACKAGE_TOKEN}}
28-
- run: npm run lint
29-
30-
create-release:
31-
name: Create Release
32-
needs: run-tests
33-
runs-on: ubuntu-latest
34-
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@v3
37-
- name: Create Release
38-
id: create_release
39-
uses: actions/create-release@v1
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
42-
with:
43-
tag_name: ${{ github.ref }}
44-
release_name: Release ${{ github.ref }}
45-
body: |
46-
Changes in this Release
47-
48-
Various fixes and improvements.
49-
${{ github.event.head_commit.message }}
50-
draft: false
51-
prerelease: false
52-
53-
publish-package-github:
24+
publish:
25+
name: "Build and publish package"
5426
needs: run-tests
55-
runs-on: ubuntu-latest
27+
runs-on: ubuntu-22.04
5628
steps:
57-
- uses: actions/checkout@v3
29+
# IMPORTANT initiates another checkout which essentially resets the working directory
30+
- uses: actions/checkout@v4
5831
- uses: actions/setup-node@v3
5932
with:
6033
node-version: 22
6134
registry-url: https://npm.pkg.github.com/
62-
scope: '@openaip'
63-
- run: npm ci --only=prod
35+
scope: "@openaip"
36+
# IMPORTANT building requires dev-dependencies to be installed
37+
- run: npm install
6438
env:
65-
#NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
66-
NODE_AUTH_TOKEN: ${{secrets.AUTOMATOR_PAT_PACKAGE_TOKEN}}
67-
- run: npm publish
39+
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}}
40+
- run: npm run build
6841
env:
69-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
70-
71-
publish-package-npm:
72-
needs: run-tests
73-
runs-on: ubuntu-latest
74-
steps:
75-
- uses: actions/checkout@v3
76-
- uses: actions/setup-node@v3
42+
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}}
43+
- id: bump-version
44+
uses: phips28/gh-action-bump-version@master
45+
name: Bump package version
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7748
with:
78-
node-version: 2
79-
registry-url: https://registry.npmjs.org
80-
scope: '@openaip'
81-
- run: npm ci --only=prod
82-
- run: npm publish --access public
49+
major-wording: "#build-major"
50+
minor-wording: "#build-minor"
51+
patch-wording: "#build-patch"
52+
# use "patch" as default bump strategy
53+
default: patch
54+
tag-prefix: "v"
55+
- uses: actions/create-release@v1
56+
name: Create release
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
59+
with:
60+
tag_name: ${{steps.bump-version.outputs.newTag}}
61+
release_name: Release ${{steps.bump-version.outputs.newTag}}
62+
body: |
63+
Various fixes and performance improvements.
64+
draft: false
65+
prerelease: false
66+
- run: npm publish
67+
name: Publish to GitHub Package Registry
8368
env:
84-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
69+
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}}
70+
permissions:
71+
contents: write

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.idea/*
2-
coverage/*
3-
node_modules/*
1+
.idea/
2+
.vscode/
3+
coverage/
4+
node_modules/
45
.env*
56
.npmrc
67
nohup.out
8+
dist/

.npmignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.vscode/
2+
coverage/
3+
tests/
4+
.github/
5+
node_modules/
6+
.tools-versions
7+
.redeploy_commit.sh
8+
vite.config.js
9+
tsconfig.json
10+
.npmrc
11+
.npmignore
12+
.gitignore
13+
.gitattributes
14+
buildcache
15+
tsconfig.tsbuildinfo

.prettierrc

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

.prettierrc.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
printWidth: 120,
3+
useTabs: false,
4+
semi: true,
5+
arrowParens: 'always',
6+
tabWidth: 4,
7+
singleQuote: true,
8+
trailingComma: 'es5',
9+
plugins: ['@ianvs/prettier-plugin-sort-imports'],
10+
importOrder: ['<BUILTIN_MODULES>', '<THIRD_PARTY_MODULES>', '^@/.*$', '^[.]'],
11+
};

eslint.config.js

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

eslint.config.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import eslint from '@eslint/js';
2+
import pluginSecurity from 'eslint-plugin-security';
3+
import tseslint from 'typescript-eslint';
4+
5+
export default tseslint.config(
6+
eslint.configs.recommended,
7+
pluginSecurity.configs.recommended,
8+
...tseslint.configs.recommended,
9+
{
10+
ignores: ['**/*.js', '**/*.cjs', '**/*.mjs'],
11+
rules: {
12+
'@typescript-eslint/consistent-type-assertions': 'off',
13+
'@typescript-eslint/no-floating-promises': 'off',
14+
'@typescript-eslint/strict-boolean-expressions': 'off',
15+
'@typescript-eslint/explicit-function-return-type': 'off',
16+
'@typescript-eslint/naming-convention': 'off',
17+
'@typescript-eslint/no-unused-vars': 'off',
18+
'security/detect-object-injection': 'off',
19+
'security/detect-unsafe-regex': 'off',
20+
'security/detect-possible-timing-attacks': 'off',
21+
'security/detect-non-literal-regexp': 'off',
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'@typescript-eslint/ban-ts-comment': 'off',
24+
'@typescript-eslint/no-empty-object-type': 'off',
25+
'no-useless-escape': 'off',
26+
},
27+
}
28+
);

jsconfig.json

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

license.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2022 OpenAIP
1+
Copyright 2024 OpenAIP
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

0 commit comments

Comments
 (0)