Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@developmentseed/stac-react",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"description": "React components and hooks for building STAC-API front-ends",
"repository": "[email protected]:developmentseed/stac-react.git",
"authors": [
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import useItem from './hooks/useItem';
import useStacApi from './hooks/useStacApi';
import { StacApiProvider } from './context';

export * from './types/stac.d';
export { useCollections, useCollection, useItem, useStacSearch, useStacApi, StacApiProvider };
4 changes: 2 additions & 2 deletions src/types/stac.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export type Item = {
type: 'Feature';
properties: GenericObject;
links: Link[];
assets: ItemAsset[];
assets: Record<string, ItemAsset>;
};

type Role = 'licensor' | 'producer' | 'processor' | 'host';
Expand Down Expand Up @@ -126,7 +126,7 @@ export type Collection = {
providers: Provider[];
extent: Extent;
links: Link[];
assets: GenericObject;
assets: Record<string, ItemAsset>;
};

export type CollectionsResponse = {
Expand Down
4 changes: 4 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default defineConfig({
exclude: ['**/*.test.ts'],
outDir: 'dist',
insertTypesEntry: true,
copyDtsFiles: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the essential fix. The .d.ts files are not copied by default, that's why the types are missing.

beforeWriteFile(filePath, content) {
return filePath.match(/\/(vite|jest)\./) ? false : { filePath, content };
},
Comment on lines +24 to +26
Copy link
Member Author

Choose a reason for hiding this comment

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

This parts just removes the types created for the config files to keep things clean. They're not needed for anything

}),
],
});