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

Publish npm packages to @jupyterlab org/scope #4

Closed
gnestor opened this issue Jul 7, 2017 · 16 comments
Closed

Publish npm packages to @jupyterlab org/scope #4

gnestor opened this issue Jul 7, 2017 · 16 comments

Comments

@gnestor
Copy link
Collaborator

gnestor commented Jul 7, 2017

@blink1073 I assume that I need permission to publish to the @jupyterlab scope on npm?

@blink1073
Copy link
Member

ping @ellisonbg. Also, our subscription appears to have expired for publishing private packages, which tanked the release this morning. I had to manually publish all of the packages. Ideally lerna would let us publish them publicly the first time, cf lerna/lerna#590.

@ellisonbg
Copy link

ellisonbg commented Jul 7, 2017 via email

@ellisonbg
Copy link

ellisonbg commented Jul 7, 2017 via email

@blink1073
Copy link
Member

In progress (plotly left to do).

@blink1073
Copy link
Member

Couldn't publish plotly due to this error:

src/index.tsx(12,25): error TS7016: Could not find a declaration file for module 'plotly.js/lib/core'. '/Users/ssilvester/workspace/jupyter/jupyter-renderers/node_modules/plotly.js/lib/core.js' implicitly has an 'any' type.

@gnestor
Copy link
Collaborator Author

gnestor commented Jul 7, 2017

Oh ok, I created a package for the plotly.js type declarations in this repo as a temporary patch until my PR on DefinitelyTyped (DefinitelyTyped/DefinitelyTyped#17783) is merged. Maybe you can help me figure this out:

  • The default export plotly.js doesn't play nice with webpack: Webpack support plotly/plotly.js#259
  • A workaround is to import one of its submodules (which do not depend on browserify specifically): import * as Plotly from 'plotly.js/lib/core'
  • @types/plotly.js doesn't provide types for 'plotly.js/lib/core' module
  • I submitted a PR to DefinitelyTyped to provide types for 'plotly.js/lib/core' (simply imported the types from default 'plotly.js'
  • This resolved the issue but now this extension depends on an unmerged PR

Given your experience with Typescript, is there a better way to do this? Maybe one that doesn't require a change to DefinitelyTyped? A way to say: "The types for 'plotly.js/lib/core' can be found in @types/plotly.js?"

@blink1073
Copy link
Member

I think that PR to DT is reasonable. You could shim the plotly type defs for now by declaring a module like the one below:

declare module "plotly.js/lib/core" {
  export = Plotly;
}

@gnestor
Copy link
Collaborator Author

gnestor commented Jul 10, 2017

@blink1073 Where should I put this module declaration? In a typings.d.ts file in the same directory? I tried that and I'm seeing this error: Invalid module name in augmentation. Module 'plotly.js/lib/core' resolves to an untyped module at '/Users/grant/Sites/jupyter/jupyter-renderers/node_modules/plotly.js/lib/core.js', which cannot be augmented.

@blink1073
Copy link
Member

Hmm, sounds like it won't work without the restructure then.

@gnestor
Copy link
Collaborator Author

gnestor commented Jul 19, 2017

Ok, the @jupyterlab/plotly-extension is ready to publish. @blink1073 should I publish or would you like to? If I can do it, what's your workflow? Just npm publish from the plotly-extension dir? Or can I do it using lerna?

@blink1073
Copy link
Member

blink1073 commented Jul 19, 2017

@gnestor, you should be able to run lerna publish from the repo root. I'd recommend adding a npm run publish command like the one in JLab to make sure everything is current and built. Since @jupyterlab/plotly-extension is a new package, it will be published privately, so you'll have to run npm access public @jupyterlab/plotly-extension after this first publish (cf jupyterlab/jupyterlab#2463).

@gnestor
Copy link
Collaborator Author

gnestor commented Jul 19, 2017

Ok, sounds good. I just tried to publish plotly-extension and I got the following error: " You need a paid account to perform this action. For more info, visit: https://www.npmjs.com/private-modules : @jupyterlab/plotly-extension"

@ellisonbg
Copy link

ellisonbg commented Jul 19, 2017 via email

@ellisonbg
Copy link

ellisonbg commented Jul 19, 2017 via email

@gnestor
Copy link
Collaborator Author

gnestor commented Jul 19, 2017

@gnestor gnestor closed this as completed Jul 19, 2017
@blink1073
Copy link
Member

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants