Skip to content

Commit 8e6e1db

Browse files
committed
Restructure monorepo, use vitest projects support
1 parent f5d35bc commit 8e6e1db

19 files changed

Lines changed: 48 additions & 68 deletions

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ jobs:
2626
id: test-cache
2727
uses: actions/cache@v4
2828
with:
29-
path: packages/tide-predictor/.test-cache
29+
path: .test-cache
3030
key: ${{ runner.os }}-test-cache
3131

3232
- name: Test build
3333
run: npm run build:all
3434

3535
- name: Test
36-
run: npm run coverage:all
36+
run: npm run coverage
3737

3838
- name: Report coverage
3939
uses: codecov/codecov-action@v5
4040
with:
4141
fail_ci_if_error: true
42-
files: ./coverage/coverage-final.json,./packages/*/coverage/coverage-final.json
42+
files: ./coverage/coverage-final.json
4343

4444
- name: Upload NOAA summary
4545
uses: actions/upload-artifact@v6

package.json

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11
{
2-
"name": "neaps",
3-
"version": "0.1.0",
4-
"description": "Tide predictions",
5-
"keywords": [
6-
"tides",
7-
"harmonics"
8-
],
9-
"homepage": "https://github.com/neaps/tide-predictor#readme",
10-
"bugs": {
11-
"url": "https://github.com/neaps/tide-predictor/issues"
12-
},
13-
"repository": {
14-
"type": "git",
15-
"url": "git+https://github.com/neaps/tide-predictor.git"
16-
},
17-
"license": "MIT",
18-
"author": "Brandon Keepers <brandon@openwaters.io>",
19-
"type": "module",
20-
"main": "src/index.ts",
2+
"private": true,
213
"scripts": {
22-
"build": "tsdown",
4+
"test": "vitest",
235
"coverage": "vitest run --coverage",
246
"build:all": "npm run build --workspaces --if-present",
25-
"coverage:all": "npm run coverage --workspaces --if-present",
26-
"test": "vitest",
277
"lint": "eslint && prettier --check .",
288
"format": "prettier --write ."
299
},
30-
"dependencies": {
31-
"@neaps/tide-predictor": "^0.1.1",
32-
"@neaps/tide-stations": "github:neaps/tide-database",
33-
"geolib": "^3.3.4"
34-
},
3510
"devDependencies": {
3611
"@eslint/js": "^9.39.2",
3712
"@types/node": "^25.0.2",
@@ -46,7 +21,6 @@
4621
"vitest": "^4.0.15"
4722
},
4823
"workspaces": [
49-
".",
5024
"packages/*"
5125
]
5226
}

packages/neaps/package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "neaps",
3+
"version": "0.1.0",
4+
"description": "Tide predictions",
5+
"keywords": [
6+
"tides",
7+
"harmonics"
8+
],
9+
"homepage": "https://github.com/neaps/tide-predictor#readme",
10+
"bugs": {
11+
"url": "https://github.com/neaps/tide-predictor/issues"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/neaps/tide-predictor.git"
16+
},
17+
"license": "MIT",
18+
"author": "Brandon Keepers <brandon@openwaters.io>",
19+
"type": "module",
20+
"main": "src/index.ts",
21+
"scripts": {
22+
"build": "tsdown"
23+
},
24+
"dependencies": {
25+
"@neaps/tide-predictor": "^0.1.1",
26+
"@neaps/tide-stations": "github:neaps/tide-database",
27+
"geolib": "^3.3.4"
28+
}
29+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('getExtremesPrediction', () => {
1010
const { predictions } = getExtremesPrediction({
1111
lat: 26.7,
1212
lon: -80.05,
13-
start: new Date('2025-12-17 00:00'),
14-
end: new Date('2025-12-18 00:00'),
13+
start: new Date('2025-12-17T05:00:00Z'),
14+
end: new Date('2025-12-18T05:00:00Z'),
1515
timeFidelity: 6,
1616
datum: 'MLLW'
1717
})
@@ -31,8 +31,8 @@ describe('getExtremesPrediction', () => {
3131
test(`accepts position with ${Object.keys(position).join('/')}`, () => {
3232
const { predictions } = getExtremesPrediction({
3333
...position,
34-
start: new Date('2025-12-17 00:00'),
35-
end: new Date('2025-12-18 00:00')
34+
start: new Date('2025-12-17T05:00:00Z'),
35+
end: new Date('2025-12-18T05:00:00Z')
3636
})
3737
expect(predictions.length).toBe(4)
3838
})
@@ -50,8 +50,8 @@ describe('nearestStation', () => {
5050
test('can return extremes from station', () => {
5151
const station = nearestStation({ lat: 26.7, lon: -80.05 })
5252

53-
const start = new Date('2025-12-17 00:00')
54-
const end = new Date('2025-12-18 00:00')
53+
const start = new Date('2025-12-17T05:00:00Z')
54+
const end = new Date('2025-12-18T05:00:00Z')
5555

5656
const { predictions } = station.getExtremesPrediction({
5757
start,

packages/tide-predictor/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
"devDependencies": {},
2121
"scripts": {
2222
"build": "tsdown",
23-
"test": "vitest",
24-
"coverage": "vitest run --coverage",
25-
"ci": "run-s lint build coverage",
2623
"prepare": "npm run build"
2724
}
2825
}

packages/tide-predictor/test/astronomy/coefficients.ts renamed to packages/tide-predictor/test/astronomy/coefficients.test.ts

File renamed without changes.
File renamed without changes.

packages/tide-predictor/test/constituents/compound-constituent.ts renamed to packages/tide-predictor/test/constituents/compound-constituent.test.ts

File renamed without changes.

packages/tide-predictor/test/constituents/constituent.ts renamed to packages/tide-predictor/test/constituents/constituent.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)