Skip to content

Commit

Permalink
moduleResolution = nodenext
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Jul 10, 2024
1 parent ba4327d commit 6a6d22c
Show file tree
Hide file tree
Showing 53 changed files with 1,858 additions and 1,705 deletions.
9 changes: 1 addition & 8 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,7 @@ const finalConfig = {
}
],
"import/no-internal-modules": [
"warn", {
"allow": [
"source-map-support/*",
"lodash/*",
"aws-sdk/**/*",
"types/*"
]
}
"off"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"cSpell.words": [
"bignumber",
"boundingbox",
"mapbox",
"quadkey",
"typechain",
Expand Down
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://mskelton.dev/yarn-outdated/v3"

yarnPath: .yarn/releases/yarn-4.1.1.cjs
yarnPath: .yarn/releases/yarn-4.3.1.cjs
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,29 @@
"module": "dist/node/index.js",
"types": "dist/node/index.d.ts",
"license": "LGPL-3.0-only",
"packageManager": "yarn@4.1.1",
"packageManager": "yarn@4.3.1",
"workspaces": [
"packages/*"
],
"dependencies": {
"@xyo-network/ethers-wrappers": "workspace:~",
"@xyo-network/sdk-geo": "workspace:~"
"@xyo-network/ethers-wrappers": "workspace:^",
"@xyo-network/sdk-geo": "workspace:^"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/mocha": "^10.0.6",
"@xylabs/eslint-config": "^3.5.2",
"@xylabs/ts-scripts-yarn3": "^3.5.2",
"@xylabs/tsconfig": "^3.5.2",
"@xylabs/tsconfig-jest": "^3.5.2",
"@types/mocha": "^10.0.7",
"@xylabs/eslint-config": "^3.11.12",
"@xylabs/ts-scripts-yarn3": "^3.11.12",
"@xylabs/tsconfig": "^3.11.12",
"@xylabs/tsconfig-jest": "^3.11.12",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-plugin-unicorn": "^51.0.1",
"eslint": "^9.6.0",
"eslint-plugin-unicorn": "^54.0.0",
"jest": "^29.7.0",
"typescript": "^5.4.2"
"typescript": "^5.5.3"
},
"resolutions": {
"mapbox-gl": "~3.2"
},
"scripts": {
"test": "yarn jest",
Expand Down
14 changes: 7 additions & 7 deletions packages/ethers-wrappers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
"types": "dist/node/index.d.ts",
"license": "LGPL-3.0-only",
"dependencies": {
"@xylabs/assert": "^3.0.11",
"@xylabs/eth-address": "^3.0.11",
"@xylabs/assert": "^3.5.5",
"@xylabs/eth-address": "^3.5.5",
"@xyo-network/typechain": "^3.0.5",
"ethers": "^6.11.1"
"ethers": "^6.13.1"
},
"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^3.5.2",
"@xylabs/tsconfig": "^3.5.2",
"ethers": "^6.11.1",
"typescript": "^5.4.2"
"@xylabs/ts-scripts-yarn3": "^3.11.12",
"@xylabs/tsconfig": "^3.11.12",
"ethers": "^6.13.1",
"typescript": "^5.5.3"
},
"sideEffects": false,
"packageManager": "yarn@3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ethers-wrappers/src/Erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EthAddress } from '@xylabs/eth-address'
import { BurnableErc20, BurnableErc20__factory as BurnableErc20Factory } from '@xyo-network/typechain'
import { Provider, Signer } from 'ethers'

import { XyoEthersWrapperBase } from './EthersBase'
import { XyoEthersWrapperBase } from './EthersBase.js'

/** @deprecated use @xyo-network/typechain instead*/
export class XyoErc20Wrapper extends XyoEthersWrapperBase {
Expand Down
4 changes: 2 additions & 2 deletions packages/ethers-wrappers/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './Erc20'
export * from './EthersBase'
export * from './Erc20.js'
export * from './EthersBase.js'
2 changes: 2 additions & 0 deletions packages/ethers-wrappers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext",
"typeRoots": []
},
"exclude": ["**/spec/**/*"],
Expand Down
8 changes: 4 additions & 4 deletions packages/geo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"license": "LGPL-3.0-only",
"dependencies": {
"geojson": "^0.5.0",
"mapbox-gl": "^3.2.0"
"mapbox-gl": "^3.5.1"
},
"devDependencies": {
"@types/mapbox-gl": "^3.1.0",
"@xylabs/ts-scripts-yarn3": "^3.5.2",
"@xylabs/tsconfig": "^3.5.2",
"typescript": "^5.4.2"
"@xylabs/ts-scripts-yarn3": "^3.11.12",
"@xylabs/tsconfig": "^3.11.12",
"typescript": "^5.5.3"
},
"sideEffects": false,
"packageManager": "yarn@3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/src/GeoJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Feature, FeatureCollection, Geometry, Point, Polygon } from 'geojson'
// eslint-disable-next-line no-restricted-imports
import { GeoJSONSourceRaw, LngLat } from 'mapbox-gl'

import { boundingBoxToCenter, boundingBoxToPolygon, tileFromQuadkey, tileToBoundingBox } from './mercator'
import { boundingBoxToCenter, boundingBoxToPolygon, tileFromQuadkey, tileToBoundingBox } from './mercator/index.js'

class GeoJson {
private _lngLat?: LngLat
Expand Down
6 changes: 3 additions & 3 deletions packages/geo/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './GeoJson'
export * from './LayerBase'
export * from './mercator'
export * from './GeoJson.js'
export * from './LayerBase.js'
export * from './mercator/index.js'
2 changes: 1 addition & 1 deletion packages/geo/src/mercator/boundingbox/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './to'
export * from './to/index.js'
5 changes: 5 additions & 0 deletions packages/geo/src/mercator/boundingbox/to/boundary.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { MercatorBoundary, MercatorBoundingBox } from '../../types.js'

export const boundingBoxToBoundary = (box: MercatorBoundingBox): MercatorBoundary => {
return [box.getNorthWest(), box.getNorthEast(), box.getSouthEast(), box.getSouthWest(), box.getNorthWest()]
}
5 changes: 0 additions & 5 deletions packages/geo/src/mercator/boundingbox/to/boundry.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/geo/src/mercator/boundingbox/to/center.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MercatorBoundingBox } from '../../types'
import { MercatorBoundingBox } from '../../types.js'

export const boundingBoxToCenter = (boundingBox: MercatorBoundingBox, decimal = 6) => {
const west = boundingBox.getWest()
Expand Down
6 changes: 3 additions & 3 deletions packages/geo/src/mercator/boundingbox/to/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { boundingBoxToBoundry } from './boundry'
export { boundingBoxToCenter } from './center'
export { boundingBoxToPolygon } from './polygon'
export { boundingBoxToBoundary } from './boundary.js'
export { boundingBoxToCenter } from './center.js'
export { boundingBoxToPolygon } from './polygon.js'
6 changes: 3 additions & 3 deletions packages/geo/src/mercator/boundingbox/to/polygon.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Polygon } from 'geojson'

import { MercatorBoundingBox, MercatorLngLat } from '../../types'
import { boundingBoxToBoundry } from './boundry'
import { MercatorBoundingBox, MercatorLngLat } from '../../types.js'
import { boundingBoxToBoundary } from './boundary.js'

export const boundingBoxToPolygon = (box: MercatorBoundingBox): Polygon => {
const boundry = boundingBoxToBoundry(box)
const boundry = boundingBoxToBoundary(box)
return {
coordinates: [boundry.map((lnglng: MercatorLngLat) => lnglng.toArray())],
type: 'Polygon',
Expand Down
10 changes: 5 additions & 5 deletions packages/geo/src/mercator/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './boundingbox'
export * from './constants'
export * from './tile'
export * from './tiles'
export * from './types'
export * from './boundingbox/index.js'
export * from './constants.js'
export * from './tile/index.js'
export * from './tiles/index.js'
export * from './types.js'
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tile/from/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { tileFromPoint } from './point'
export { tileFromQuadkey } from './quadkey'
export { tileFromPoint } from './point.js'
export { tileFromQuadkey } from './quadkey.js'
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tile/from/point.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { d2r } from '../../constants'
import { MercatorLngLat } from '../../types'
import { d2r } from '../../constants.js'
import { MercatorLngLat } from '../../types.js'

const pointToTileFraction = (point: MercatorLngLat, z: number) => {
const sin = Math.sin(point.lat * d2r)
Expand Down
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tile/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './from'
export * from './to'
export * from './from/index.js'
export * from './to/index.js'
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tile/to/boundingbox.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// eslint-disable-next-line no-restricted-imports
import { LngLat } from 'mapbox-gl'

import { r2d } from '../../constants'
import { MercatorBoundingBox, MercatorTile } from '../../types'
import { r2d } from '../../constants.js'
import { MercatorBoundingBox, MercatorTile } from '../../types.js'

const toLongitude = (x: number, z: number): number => {
return (x / Math.pow(2, z)) * 360 - 180
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/src/mercator/tile/to/children.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MercatorTile } from '../../types'
import { MercatorTile } from '../../types.js'

const tileToChildren = (tile: MercatorTile) => {
return [
Expand Down
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tile/to/geoJson.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Polygon, Position } from 'geojson'

import { MercatorTile } from '../../types'
import { tileToBoundingBox } from './boundingbox'
import { MercatorTile } from '../../types.js'
import { tileToBoundingBox } from './boundingbox.js'

const tileToGeoJson = (tile: MercatorTile): Polygon => {
const box = tileToBoundingBox(tile)
Expand Down
14 changes: 7 additions & 7 deletions packages/geo/src/mercator/tile/to/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { tileToBoundingBox } from './boundingbox'
export { tileToChildren } from './children'
export { tileToGeoJson } from './geoJson'
export { tileToParent } from './parent'
export { tileToPoint } from './point'
export { tileToQuadkey } from './quadkey'
export { tileToSiblings } from './siblings'
export { tileToBoundingBox } from './boundingbox.js'
export { tileToChildren } from './children.js'
export { tileToGeoJson } from './geoJson.js'
export { tileToParent } from './parent.js'
export { tileToPoint } from './point.js'
export { tileToQuadkey } from './quadkey.js'
export { tileToSiblings } from './siblings.js'
2 changes: 1 addition & 1 deletion packages/geo/src/mercator/tile/to/parent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MercatorTile } from '../../types'
import { MercatorTile } from '../../types.js'

const tileToParent = (tile: MercatorTile): MercatorTile => {
return [tile[0] >> 1, tile[1] >> 1, tile[2] - 1]
Expand Down
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tile/to/point.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MercatorLngLat, MercatorTile } from '../../types'
import { tileToBoundingBox } from './boundingbox'
import { MercatorLngLat, MercatorTile } from '../../types.js'
import { tileToBoundingBox } from './boundingbox.js'

const tileToPoint = (tile: MercatorTile): MercatorLngLat => {
const boundingBox = tileToBoundingBox(tile)
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/src/mercator/tile/to/quadkey.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MercatorTile } from '../../types'
import { MercatorTile } from '../../types.js'

const tileToQuadkey = (tile: MercatorTile): string => {
let index = ''
Expand Down
6 changes: 3 additions & 3 deletions packages/geo/src/mercator/tile/to/siblings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MercatorTile } from '../../types'
import { tileToChildren } from './children'
import { tileToParent } from './parent'
import { MercatorTile } from '../../types.js'
import { tileToChildren } from './children.js'
import { tileToParent } from './parent.js'

const tileToSiblings = (tile: MercatorTile): MercatorTile[] => {
return tileToChildren(tileToParent(tile))
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/src/mercator/tiles/equal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MercatorTile } from '../types'
import { MercatorTile } from '../types.js'

const tilesEqual = (tile1: MercatorTile, tile2: MercatorTile) => {
return tile1[0] === tile2[0] && tile1[1] === tile2[1] && tile1[2] === tile2[2]
Expand Down
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tiles/from/boundingbox.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { tileFromPoint } from '../../tile'
import { MercatorBoundingBox, MercatorTile } from '../../types'
import { tileFromPoint } from '../../tile/index.js'
import { MercatorBoundingBox, MercatorTile } from '../../types.js'

const tilesFromBoundingBox = (box: MercatorBoundingBox, zoom: number): MercatorTile[] => {
const nw = tileFromPoint(box.getNorthWest(), zoom)
Expand Down
2 changes: 1 addition & 1 deletion packages/geo/src/mercator/tiles/from/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { tilesFromBoundingBox } from './boundingbox'
export { tilesFromBoundingBox } from './boundingbox.js'
6 changes: 3 additions & 3 deletions packages/geo/src/mercator/tiles/hasSiblings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { tileToSiblings } from '../tile'
import { MercatorTile } from '../types'
import { tilesHasTile } from './hasTile'
import { tileToSiblings } from '../tile/index.js'
import { MercatorTile } from '../types.js'
import { tilesHasTile } from './hasTile.js'

const hasSiblings = (tiles: MercatorTile[], tile: MercatorTile) => {
const siblings = tileToSiblings(tile)
Expand Down
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/tiles/hasTile.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MercatorTile } from '../types'
import { tilesEqual } from './equal'
import { MercatorTile } from '../types.js'
import { tilesEqual } from './equal.js'

const tilesHasTile = (tiles: MercatorTile[], tile: MercatorTile) => {
for (const tileToCheck of tiles) {
Expand Down
6 changes: 3 additions & 3 deletions packages/geo/src/mercator/tiles/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { tilesEqual } from './equal'
export * from './from'
export { tilesHasTile } from './hasTile'
export { tilesEqual } from './equal.js'
export * from './from/index.js'
export { tilesHasTile } from './hasTile.js'
4 changes: 2 additions & 2 deletions packages/geo/src/mercator/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { LngLat, LngLatBounds } from 'mapbox-gl'

type MercatorTile = number[]
type MercatorBoundry = MercatorLngLat[]
type MercatorBoundary = MercatorLngLat[]
class MercatorBoundingBox extends LngLatBounds {}
class MercatorLngLat extends LngLat {}

export { MercatorBoundingBox, MercatorLngLat }
export type { MercatorBoundry, MercatorTile }
export type { MercatorBoundary, MercatorTile }
2 changes: 2 additions & 0 deletions packages/geo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext",
"typeRoots": []
},
"exclude": ["**/spec/**/*"],
Expand Down
6 changes: 3 additions & 3 deletions packages/meta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"cheerio": "^1.0.0-rc.12"
},
"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^3.5.2",
"@xylabs/tsconfig": "^3.5.2",
"@xylabs/ts-scripts-yarn3": "^3.11.12",
"@xylabs/tsconfig": "^3.11.12",
"jest-serializer-html": "^7.1.0",
"typescript": "^5.4.2"
"typescript": "^5.5.3"
},
"sideEffects": false,
"packageManager": "yarn@3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/meta/src/html/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './mergeDocumentHead'
export * from './mergeDocumentHead.js'
6 changes: 3 additions & 3 deletions packages/meta/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './html'
export * from './meta'
export * from './models'
export * from './html/index.js'
export * from './meta/index.js'
export * from './models/index.js'
2 changes: 1 addition & 1 deletion packages/meta/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './getMetaAsDict'
export * from './getMetaAsDict.js'
4 changes: 2 additions & 2 deletions packages/meta/src/meta/builder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CheerioAPI, load } from 'cheerio'

import { getMetaAsDict } from '../lib'
import { Meta } from '../models'
import { getMetaAsDict } from '../lib/index.js'
import { Meta } from '../models/index.js'

/* test change */

Expand Down
2 changes: 1 addition & 1 deletion packages/meta/src/meta/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './builder'
export * from './builder.js'
Loading

0 comments on commit 6a6d22c

Please sign in to comment.