Skip to content

Commit

Permalink
fix: compiler issue with typescript v5.5.x (#3310)
Browse files Browse the repository at this point in the history
### Motivation

<!-- TODO: Say why you made your changes. -->

Typescript v5.5.x was failing to build `@basemaps/tiler` causing the
entire build to fail

### Modifications

remove a unused package.json import which was causing it to fail

<!-- TODO: Say what changes you made. -->

<!-- TODO: Attach screenshots if you changed the UI. -->

### Verification

<!-- TODO: Say how you tested your changes. -->
  • Loading branch information
blacha committed Jul 8, 2024
1 parent 6610322 commit 2734115
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 83 deletions.
137 changes: 61 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"esbuild": "^0.19.8",
"lerna": "^8.0.0",
"rimraf": "^5.0.5",
"sinon": "^17.0.1",
"typescript": "5.4.x"
"sinon": "^17.0.1"
},
"workspaces": {
"packages": [
Expand Down
6 changes: 3 additions & 3 deletions packages/lambda-tiler/src/routes/preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConfigTileSetRaster, ConfigTileSetRasterOutput, TileSetType } from '@basemaps/config';
import { Bounds, LatLon, Projection, TileMatrixSet } from '@basemaps/geo';
import { CompositionTiff, TileMakerContext, Tiler } from '@basemaps/tiler';
import { SharpOverlay, TileMakerSharp } from '@basemaps/tiler-sharp';
import { TileMakerSharp } from '@basemaps/tiler-sharp';
import { HttpHeader, LambdaHttpRequest, LambdaHttpResponse } from '@linzjs/lambda';
import sharp from 'sharp';

Expand Down Expand Up @@ -163,12 +163,12 @@ export async function renderPreview(req: LambdaHttpRequest, ctx: PreviewRenderCo
req.timer.start('compose:overlay');
// Remove with typescript >=5.5.0

const overlays = (await Promise.all(
const overlays = await Promise.all(
compositions.map((comp) => {
if (tileContext.pipeline) return TilerSharp.composeTilePipeline(comp, tileContext);
return TilerSharp.composeTileTiff(comp, tileContext.resizeKernel);
}),
).then((items) => items.filter((f) => f != null))) as SharpOverlay[];
).then((items) => items.filter((f) => f != null));
req.timer.end('compose:overlay');

// Create the output image and render all the individual pieces into them
Expand Down
2 changes: 1 addition & 1 deletion packages/lambda-tiler/src/routes/tile.xyz.raster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const TileXyzRaster = {

// Remove with typescript >=5.5.0

return (await Promise.all(toLoad)).filter((f) => f != null) as CloudArchive[];
return (await Promise.all(toLoad)).filter((f) => f != null);
},

async getAssetsForTile(req: LambdaHttpRequest, tileSet: ConfigTileSetRaster, xyz: TileXyz): Promise<URL[]> {
Expand Down
1 change: 0 additions & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@aws-sdk/util-dynamodb": "^3.470.0",
"@basemaps/config": "^7.5.0",
"@basemaps/geo": "^7.5.0",
"@basemaps/tiler": "^7.5.0",
"@chunkd/fs": "^11.2.0",
"@chunkd/fs-aws": "^11.2.2",
"@chunkd/middleware": "^11.1.0",
Expand Down

0 comments on commit 2734115

Please sign in to comment.