Open claudeduguay opened 6 years ago
I'm very sorry for late responding. Since I'm not currently using typescript, I did not know that the issues had aroused before checking this repository. Thus, I think it is better to gather more people to maintain it or to transfer this project to other people.
Before discussing such things, I made an upgrade. (v.0.3.2)
typescript
engine will compile inherited classes.Anyway, sorry for the inconvenience caused by the lazy update.
@nearbydelta import
statements do not seem to be working still. Not sure what the issue is.
To replicate. Create ./test.ts
in the same directory as your notebook.
export const test = 'test'
and in your notebook, if you try and import * as test from './test'; and then log out
test.test. You'll get an error saying
Can not find module './test'`.
fs
. Even though I've installed @types/node
locally. @zya Could you paste your tsconfig.json file? And it'll be helpful to know which version of typescript & iTypescript that you're using currently.
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"sourceMap": false,
"moduleResolution": "node",
"allowJs": false,
"lib": [
"es2017",
"dom",
"esnext.asynciterable"
],
"noUnusedLocals": false,
"esModuleInterop": true
}
}
itypescript
version 0.3.5
tsc
version 3.4.3
@zya I separated your issue since it posed another problem. And, the module fs
is correctly loaded under specifying types
option in the compilerOptions when I attempted to replicate the issue, as follow:
"compilerOptions":{
"types": ["node"],
...
Without specifying the types
option, its will throw errors since typescript compiler cannot check syntax/semantics of unknown fs
module.
@nearbydelta I'll give that a go, but I think this issue must be related to the working directory. In a normal TS project, if you have a local install of @types/node
, you do not need to specify the types in compilerOptions
. So this leads me to think that when compiling, its
does not respect the locally installed packages. In the case of fs
this is solvable by adding node
to types
in compilerOptions
but if you have a installed package with types, I think it will not be picked up.
A simple test installing on Anaconda causes virtually every example to fail. It's not sufficient to simply copy files and rename a few things:
1) $TS command don't work 2) imports/modules don't appear to work 3) Writing a class works but only so long as it doesn't inherit from another class 4) Syntax highlighting appears broken 5) TypeScript 2.8 (which is what the Kernel is targeting) has numerous features that are apparently ignored.
This project seems questionable to me and really just a clone with little effort invested in a properly working implementation.