Skip to content

Simplify build with TypeScript#7

Merged
kylebarron merged 4 commits intogeoarrow:mainfrom
manzt:typescript
Sep 26, 2023
Merged

Simplify build with TypeScript#7
kylebarron merged 4 commits intogeoarrow:mainfrom
manzt:typescript

Conversation

@manzt
Copy link
Contributor

@manzt manzt commented Sep 26, 2023

Changes:

  • Adds tsconfig.json to modules/deck.gl-geoarrow
  • Replaces Rollup with TypeScript
  • Just builds ESM export (with types) in dist

If you don't need commonjs or UMD builds, then I'd recommend this setup for simplicity. Otherwise, you can probably use Rollup to support preparing those formats as well.

@manzt
Copy link
Contributor Author

manzt commented Sep 26, 2023

BTW, publint is a nice tool to make sure your package is correct for NPM (i.e., exports & main fields are correctly specified):

npx publint

@@ -1 +1 @@
export { GeoArrowPointLayer } from "./point.ts.bak";
export { GeoArrowPointLayer } from "./point.js";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .js extensions are essential for relative imports so that TypeScript compiler will output true ESM. TypeScript won't touch imports, so you need to provide the extension in the output.

assert,
} from "@deck.gl/core/typed";
import * as arrow from "apache-arrow";
import { ScatterplotLayer } from "@deck.gl/layers/typed";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some tool in JS land to auto-sort your imports? would be nice

@kylebarron kylebarron merged commit 748e2b4 into geoarrow:main Sep 26, 2023
@kylebarron
Copy link
Member

Amazing, thanks! Excited to try this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants