Giter Site home page Giter Site logo

Comments (11)

jtpio avatar jtpio commented on July 22, 2024

Not that I know of.

But it should be possible to create a similar extension to this one to create Julia files. Or a more generic one to create any type of files.

from jupyterlab-python-file.

ArcticSnow avatar ArcticSnow commented on July 22, 2024

Hi @jtpio !
So I forked your project and made an attempt to adapt the code to create .jl files instead of .py. I get an error message during the npm run build. Would you have a look at my modification and edits if needed? This is my first time messing with code for a Jupyterlab extension.
https://github.com/ArcticSnow/jupyterlab-julia-file

Thanks

from jupyterlab-python-file.

jtpio avatar jtpio commented on July 22, 2024

That's awesome @ArcticSnow !

The code looks good. Would you mind posting the error you get from npm run build?

Usually it's good practice to create a new conda environment locally for development:

conda create -n jupyterlab-python-file -c conda-forge jupyterlab nodejs
conda activate jupyterlab-python-file
npm install
npm run build
jupyter labextension install .

from jupyterlab-python-file.

ArcticSnow avatar ArcticSnow commented on July 22, 2024

Ok, I tried as you indicated creating a conda VE and run npm, though npm still returns the following error.

~/github/jupyterlab-julia-file$ npm install

> [email protected] prepare /home/arcticsnow/github/jupyterlab-julia-file
> npm run clean && npm run build


> [email protected] clean /home/arcticsnow/github/jupyterlab-julia-file
> rimraf lib


> [email protected] build /home/arcticsnow/github/jupyterlab-julia-file
> tsc

node_modules/@jupyterlab/ui-components/lib/icon/iconregistry.d.ts:1:8 - error TS1259: Module '"/home/arcticsnow/github/jupyterlab-julia-file/node_modules/@types/react/index"' can only be default-imported using the 'esModuleInterop' flag

1 import React from 'react';
         ~~~~~

  node_modules/@types/react/index.d.ts:55:1
    55 export = React;
       ~~~~~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

node_modules/@jupyterlab/ui-components/lib/icon/interfaces.d.ts:3:8 - error TS1259: Module '"/home/arcticsnow/github/jupyterlab-julia-file/node_modules/@types/react/index"' can only be default-imported using the 'esModuleInterop' flag

3 import React from 'react';
         ~~~~~

from jupyterlab-python-file.

jtpio avatar jtpio commented on July 22, 2024

Wow, good catch.

There must have been a new version of the ui-components package that breaks compatibility with the previous tsconfig.

What if you apply the following change to tsconfig.json? (I'll push the same to this repo)

diff --git a/tsconfig.json b/tsconfig.json
index 4946663..3227f68 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,6 +1,7 @@
 {
   "compilerOptions": {
     "declaration": true,
+    "esModuleInterop": true,
     "lib": ["es2015", "dom"],
     "module": "commonjs",
     "moduleResolution": "node",

from jupyterlab-python-file.

jtpio avatar jtpio commented on July 22, 2024

Should be fixed in: #9

from jupyterlab-python-file.

ArcticSnow avatar ArcticSnow commented on July 22, 2024

Wow thanks for the guidance, everything works now!!!
I'll update the readme and media (logos) and then I'll have to figure out how to make the extension available to others :)

from jupyterlab-python-file.

jtpio avatar jtpio commented on July 22, 2024

Nice!

To make it available to others, the easiest would be to publish it to npm.

There is a section about this in the JupyterLab documentation: https://jupyterlab.readthedocs.io/en/latest/developer/extension_tutorial.html#publish-your-extension-to-npmjs-org

from jupyterlab-python-file.

ArcticSnow avatar ArcticSnow commented on July 22, 2024

Well it is now published on npm following their tutorial.
To install it:

jupyter labextension install @arcticsnow/jupyterlab-julia-file

I simply miss the Julia icon. But most importantly it works as wanted. :)
many thanks!

from jupyterlab-python-file.

jtpio avatar jtpio commented on July 22, 2024

Well done!

You might want to have a look at this example to add an icon to the launcher: https://github.com/jtpio/jupyterlab-extension-examples/tree/master/launcher

The same repo contains more examples on various other topics related to JupyterLab extension development, in case you are interested.

from jupyterlab-python-file.

jtpio avatar jtpio commented on July 22, 2024

Closing as answered.

Would you like to open a PR to add a link to your extension in a new "Related Projects" section in the README file?

from jupyterlab-python-file.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.