perun-network / erdstall-ts-sdk

TypeScript client SDK to interact with Erdstall.
Apache License 2.0
5 stars 2 forks source link

Change all (complex) relative imports to use package anchor #19

Closed sebastianst closed 3 years ago

sebastianst commented 3 years ago

In #18, a package anchor #erdstall in the form of an internal imports specification in package.json was created. The corresponding paths translation was also added to tsconfig.json and all files in src/test were updated to already use this new form of import.

I propose that we change all (complex) imports, that is, not short ones like import * from './ledger' in immediately surrounding files/dirs to use the package anchor.

We could also add a second #test import spec to package.json:imports that points to src/test and also then finally remove the test->src/test symlink. Of course, we could also just use #erdstall/test but since it's just an internal reference, we can spare a second one :)

To complete this issue, also remove the dev dependency tsconfig-paths and its mocha registration in the test script and from the tsconfig.*.json files.

sebastianst commented 3 years ago

In particular, we continue using the index.ts files to collect exports like

// file: src/api/index.ts

export * from "./call";
export * from "./object";
export * from "./result";
export * from "./signature";

because the index should only be concerned with files in the same directory anyways.

sebastianst commented 3 years ago

We've done this in #18 (3d083357afb5afdc3acf01045983afd7a21c070f)