Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up TypeScript #5

Closed
davidstraka2 opened this issue Nov 29, 2020 · 0 comments
Closed

Set up TypeScript #5

davidstraka2 opened this issue Nov 29, 2020 · 0 comments
Assignees
Labels
env Development environment changes not covered by other tags

Comments

@davidstraka2
Copy link
Owner

Set up TypeScript for package development.

@davidstraka2 davidstraka2 added the env Development environment changes not covered by other tags label Nov 29, 2020
@davidstraka2 davidstraka2 added this to the [v0.1.0] Project Setup milestone Dec 4, 2020
@davidstraka2 davidstraka2 self-assigned this Feb 23, 2021
davidstraka2 added a commit that referenced this issue Feb 23, 2021
Basic setup utilizing TypeScript project references (see
https://stackoverflow.com/a/55000497 for more information).

The compiler rules are very lax for now.

Atom and Jasmine typings have been installed.

CI workflow has been updated.

As Atom's included test runner expects tests in the /spec directory (see
https://flight-manual.atom.io/hacking-atom/sections/writing-specs/#create-a-new-spec),
and the TypeScript compiler cannot modify import paths (see
https://stackoverflow.com/a/52731590), the TypeScript source files must
follow the directory structure (possibly inside some directories) of the
output with the /spec directory. Hence /src/spec/ and /src/lib/ instead
of e.g. /src/ and /test/.

As Atom's included test runner uses Jasmine 1.3 (very old version, which
lacks async/await support; see
https://flight-manual.atom.io/hacking-atom/sections/writing-specs/#customizing-your-test-runner),
using Atom's global waitsForPromise seems to be the best way (recommended by
the official guide). However, even with the Atom typings installed,
there is a compiler error "Cannot find name 'waitsForPromise'.ts(2304)".
For now, a temporary hotfix in form of "any" declaration has been used.
davidstraka2 added a commit that referenced this issue Feb 23, 2021
Basic setup utilizing TypeScript project references (see
https://stackoverflow.com/a/55000497 for more information).

The compiler rules are very lax for now.

Atom and Jasmine typings have been installed.

CI workflow has been updated.

As Atom's included test runner expects tests in the /spec directory (see
https://flight-manual.atom.io/hacking-atom/sections/writing-specs/#create-a-new-spec),
and the TypeScript compiler cannot modify import paths (see
https://stackoverflow.com/a/52731590), the TypeScript source files must
follow the directory structure (possibly inside some directories) of the
output with the /spec directory. Hence /src/spec/ and /src/lib/ instead
of e.g. /src/ and /test/.

As Atom's included test runner uses Jasmine 1.3 (very old version, which
lacks async/await support; see
https://flight-manual.atom.io/hacking-atom/sections/writing-specs/#customizing-your-test-runner),
using Atom's global waitsForPromise seems to be the best way (recommended by
the official guide). However, even with the Atom typings installed,
there is a compiler error "Cannot find name 'waitsForPromise'.ts(2304)".
For now, a temporary hotfix in form of "any" declaration has been used.
Repository owner locked as resolved and limited conversation to collaborators Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
env Development environment changes not covered by other tags
Projects
None yet
Development

No branches or pull requests

1 participant