Currently, if a user tries to create a simple new typescript project by doing the following
npx tsc --init
npm install lucid-cardano
npm install
echo import {Lucid} from "lucid-cardano" > index.ts
tsc index.ts
They are faced with a myriad of type errors.
`node_modules/lucid-cardano/dist/lucid/lucid.d.ts:1:18 - error TS2307: Cannot find module 'core/types' or its corresponding type declarations.
1 import Core from 'core/types';
~~~~~~~~~~~~
node_modules/lucid-cardano/dist/lucid/lucid.d.ts:24:23 - error TS2304: Cannot find name 'WalletApi'.
24 selectWallet(api: WalletApi): this;
~~~~~~~~~
node_modules/lucid-cardano/dist/lucid/tx.d.ts:1:18 - error TS2307: Cannot find module 'core/types' or its corresponding type declarations.
1 import Core from 'core/types';
~~~~~~~~~~~~
node_modules/lucid-cardano/dist/lucid/txComplete.d.ts:1:18 - error TS2307: Cannot find module 'core/types' or its corresponding type declarations.
1 import Core from 'core/types';
~~~~~~~~~~~~
node_modules/lucid-cardano/dist/lucid/txSigned.d.ts:1:18 - error TS2307: Cannot find module 'core/types' or its corresponding type declarations.
1 import Core from 'core/types';
~~~~~~~~~~~~
node_modules/lucid-cardano/dist/provider/blockfrost.d.ts:1:18 - error TS2307: Cannot find module 'core/types' or its corresponding type declarations.
1 import Core from 'core/types';
~~~~~~~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:1:18 - error TS2307: Cannot find module 'core/types' or its corresponding type declarations.
1 import Core from 'core/types';
~~~~~~~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:2:27 - error TS2307: Cannot find module 'utils' or its corresponding type declarations.
2 import { Construct } from 'utils';
~~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:10:17 - error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
10 keyDeposit: BigInt;
~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:11:18 - error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
11 poolDeposit: BigInt;
~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:14:23 - error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
14 coinsPerUtxoWord: BigInt;
~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:33:21 - error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
33 [unit: string]: BigInt;
~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:89:32 - error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.
89 export declare type Lovelace = BigInt;
~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:160:21 - error TS2456: Type alias 'PlutusData' circularly references itself.
160 export declare type PlutusData = string | bigint | PlutusData[] | Map<PlutusData, PlutusData> | Construct;
~~~~~~~~~~
node_modules/lucid-cardano/dist/types/types.d.ts:160:67 - error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
160 export declare type PlutusData = string | bigint | PlutusData[] | Map<PlutusData, PlutusData> | Construct;
~~~
node_modules/lucid-cardano/dist/utils/utils.d.ts:1:23 - error TS2688: Cannot find type definition file for 'node'.
1 ///
~~~~
node_modules/lucid-cardano/dist/utils/utils.d.ts:2:18 - error TS2307: Cannot find module 'core/types' or its corresponding type declarations.
2 import Core from 'core/types';
~~~~~~~~~~~~
node_modules/lucid-cardano/dist/utils/utils.d.ts:22:48 - error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try npm i --save-dev @types/node
.
22 export declare const fromHex: (hex: string) => Buffer;
~~~~~~
node_modules/lucid-cardano/dist/utils/utils.d.ts:23:37 - error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try npm i --save-dev @types/node
.
23 export declare const toHex: (bytes: Buffer | Uint8Array) => string;
~~~~~~
Found 19 errors in 7 files.
Errors Files
2 node_modules/lucid-cardano/dist/lucid/lucid.d.ts:1
1 node_modules/lucid-cardano/dist/lucid/tx.d.ts:1
1 node_modules/lucid-cardano/dist/lucid/txComplete.d.ts:1
1 node_modules/lucid-cardano/dist/lucid/txSigned.d.ts:1
1 node_modules/lucid-cardano/dist/provider/blockfrost.d.ts:1
9 node_modules/lucid-cardano/dist/types/types.d.ts:1
4 node_modules/lucid-cardano/dist/utils/utils.d.ts:1`
Can documentation be added to clarify what is needed to start doing something simple from Lucid? As newcomers come to develop for Cardano, being able to see simple projects start would really help.
Forgive me if this is a noob question or request, but I'm new to both typescript and javascript, but see Lucid as being the best way to submit transactions in the future, both for simple transactions, and contract interactions.