-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement basic nvector/latlon conversions
- Loading branch information
Showing
25 changed files
with
602 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/artifacts/ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
module.exports = { | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:n/recommended", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
"plugin:promise/recommended", | ||
"prettier", | ||
], | ||
parserOptions: { | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
env: { | ||
es2022: true, | ||
node: true, | ||
}, | ||
rules: { | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
// allow unused args if they start with _ | ||
argsIgnorePattern: "^_", | ||
}, | ||
], | ||
// handled by import/no-unresolved | ||
"n/no-missing-import": "off", | ||
// don't check for unsupported features - too much config to make this work | ||
"n/no-unsupported-features/es-builtins": "off", | ||
"n/no-unsupported-features/es-syntax": "off", | ||
"n/no-unsupported-features/node-builtins": "off", | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.ts", "*.tsx"], | ||
extends: [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
], | ||
parserOptions: { | ||
project: "./tsconfig.json", | ||
}, | ||
settings: { | ||
"import/resolver": "typescript", | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
// allow unused args if they start with _ | ||
argsIgnorePattern: "^_", | ||
}, | ||
], | ||
// this rule gets in the way of designing APIs | ||
"@typescript-eslint/require-await": "off", | ||
}, | ||
}, | ||
{ | ||
files: [ | ||
"*.spec.js", | ||
"*.spec.jsx", | ||
"*.spec.ts", | ||
"*.spec.tsx", | ||
"*.test.js", | ||
"*.test.jsx", | ||
"*.test.ts", | ||
"*.test.tsx", | ||
], | ||
extends: ["plugin:jest/recommended"], | ||
plugins: ["jest"], | ||
env: { | ||
jest: true, | ||
}, | ||
rules: { | ||
// focused tests that make it to CI will cause a build failure | ||
"jest/no-focused-tests": "warn", | ||
|
||
// allow expect inside fast-check tests | ||
"jest/no-standalone-expect": [ | ||
"error", | ||
{ additionalTestBlockFunctions: ["it.prop", "test.prop"] }, | ||
], | ||
|
||
// allow custom expect functions | ||
"jest/expect-expect": [ | ||
"warn", | ||
{ | ||
assertFunctionNames: ["expect*"], | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
# TODO | ||
# reviewers: | ||
# - org/team | ||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
# TODO | ||
# reviewers: | ||
# - org/team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI (scheduled) | ||
|
||
on: | ||
schedule: | ||
- cron: 0 14 * * 0 # Sunday 2PM UTC = Monday 12AM AEST | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
nvector-test-api: | ||
image: ghcr.io/ezzatron/nvector-test-api | ||
ports: | ||
- 17357:8000 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install dependencies | ||
run: make link-dependencies | ||
|
||
- name: Make | ||
run: make ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
nvector-test-api: | ||
image: ghcr.io/ezzatron/nvector-test-api | ||
ports: | ||
- 17357:8000 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install dependencies | ||
run: make link-dependencies | ||
|
||
- name: Make | ||
run: make ci | ||
|
||
- name: Publish coverage | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish package | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
name: Publish package | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install dependencies | ||
run: make link-dependencies | ||
|
||
- name: Make | ||
run: make ci | ||
|
||
- name: Set package version | ||
run: make set-package-version | ||
|
||
- name: Publish package | ||
if: success() | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Publish release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
name: Publish release | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Publish release | ||
uses: ghalactic/github-release-from-tag@v5 | ||
with: | ||
reactions: hooray,heart,rocket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/.makefiles/ | ||
/artifacts/ | ||
/node_modules/ | ||
/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/.github/ | ||
/.makefiles/ | ||
/artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["prettier-plugin-organize-imports"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright © 2023 Erin Millard | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export NODE_OPTIONS := --experimental-vm-modules --redirect-warnings=artifacts/node-warnings | ||
|
||
CHANGELOG_TAG_URL_PREFIX := https://github.com/ezzatron/nvector-js/releases/tag/ | ||
|
||
################################################################################ | ||
|
||
-include .makefiles/Makefile | ||
-include .makefiles/pkg/js/v1/Makefile | ||
-include .makefiles/pkg/js/v1/with-npm.mk | ||
-include .makefiles/pkg/js/v1/with-tsc.mk | ||
-include .makefiles/pkg/changelog/v1/Makefile | ||
|
||
.makefiles/%: | ||
@curl -sfL https://makefiles.dev/v1 | bash /dev/stdin "$@" | ||
|
||
################################################################################ | ||
|
||
artifacts/dist: tsconfig.build.json artifacts/link-dependencies.touch $(JS_SOURCE_FILES) | ||
@rm -rf "$@" | ||
$(JS_EXEC) tsc -p "$<" | ||
@touch "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# _n_-vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** @type {import('jest').Config} */ | ||
const config = { | ||
extensionsToTreatAsEsm: [".ts"], | ||
moduleNameMapper: { | ||
"^(\\.{1,2}/.*)\\.js$": "$1", | ||
}, | ||
transform: { | ||
"^.+\\.(t|j)sx?$": "@swc/jest", | ||
}, | ||
transformIgnorePatterns: [], | ||
coverageDirectory: "artifacts/coverage/jest", | ||
collectCoverageFrom: ["<rootDir>/src/**/*"], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "nvector", | ||
"version": "0.0.0", | ||
"description": "TODO", | ||
"keywords": [ | ||
"TODO" | ||
], | ||
"repository": "ezzatron/nvector", | ||
"bugs": "https://github.com/ezzatron/nvector/issues", | ||
"homepage": "https://github.com/ezzatron/nvector", | ||
"author": "Erin Millard <[email protected]>", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"type": "module", | ||
"main": "artifacts/dist/index.js", | ||
"types": "artifacts/dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./artifacts/dist/index.d.ts", | ||
"import": "./artifacts/dist/index.js", | ||
"default": "./artifacts/dist/index.js" | ||
} | ||
}, | ||
"sideEffects": false, | ||
"files": [ | ||
"/artifacts/dist/" | ||
], | ||
"scripts": { | ||
"prepublishOnly": "tsc -p tsconfig.build.json" | ||
}, | ||
"devDependencies": { | ||
"@fast-check/jest": "^1.7.3", | ||
"@jest/globals": "^29.7.0", | ||
"@swc/jest": "^0.2.29", | ||
"@types/jest": "^29.5.5", | ||
"@types/ws": "^8.5.5", | ||
"@typescript-eslint/eslint-plugin": "^6.7.2", | ||
"@typescript-eslint/parser": "^6.7.2", | ||
"eslint": "^8.50.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-jest": "^27.4.0", | ||
"eslint-plugin-n": "^16.1.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.0.3", | ||
"prettier-plugin-organize-imports": "^3.2.3", | ||
"typescript": "^5.2.2", | ||
"ws": "^8.14.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
asyncio==3.4.3 | ||
numpy==1.26.0 | ||
nvector==0.7.7 | ||
websockets==11.0.3 |
Oops, something went wrong.