I’ve written an open source library for connecting to a third-party API and providing convenience wrappers around it’s functions:
https://www.npmjs.com/package/@opoint/opoint
https://github.com/queenvictoria/opoint
I am having difficulting figuring out how to correctly set up the workspace, namespace, and build pipeline so that one can easily import it into a typescript project:
import { StoredSearch } from '@opoint/storedsearch'
import {
DocumentProps as OpointDocumentProps,
StoredSearchFeedProps,
StoredSearchFeedResponse
} from '@opoint/types'
The way it is written now I get errors in my implementation that imports the libraries such as:
FAIL tests/opoint-storedsearch.test.ts
● Test suite failed to run
Cannot find module '@opoint/storedsearch' from 'src/opoint-storedsearch.ts'
Require stack:
src/opoint-storedsearch.ts
tests/opoint-storedsearch.test.ts
1 | import { BaseReceiver } from './base'
> 2 | import { StoredSearch } from '@opoint/storedsearch'
| ^
3 | import {
4 | DocumentProps as OpointDocumentProps,
5 | StoredSearchFeedProps,
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.<anonymous> (src/opoint-storedsearch.ts:2:1)
at Object.<anonymous> (tests/opoint-storedsearch.test.ts:5:1)
Can anyone see what I’ve done incorrectly or point me in the right direction?