question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add index.html and missing 'dist' files to npm package

See original GitHub issue
Q A
Bug or feature request? Bug?
Which Swagger/OpenAPI version? n/a
Which Swagger-Editor version? 3.1.7
How did you install Swagger-Editor? yarn add swagger-editor
Which broswer & version? n/a
Which operating system? Windows 10

Demonstration API definition

n/a

Configuration (browser query string, constructor, config.yaml)

n/a

Expected Behavior

The npm package should contain the necessary files to load the Swagger Editor in a browser. In other words, if I add swagger-editor as a node.js dependency in my project, I should be able to load the swagger-editor index.html file and have the editor render correctly.

Current Behavior

Currently the npm package contains:

  • dist/swagger-editor.css
  • dist/swagger-editor.css.map
  • dist/swagger-editor.js
  • dist/swagger-editor.js.map
  • dist/validation.worker.js
  • dist/validation.worker.js.map

However, cloning the repo and running npm run build yields several more files in dist:

  • dist/swagger-editor-bundle.js
  • dist/swagger-editor-bundle.js.map
  • dist/swagger-editor-standalone-preset.js
  • dist/swagger-editor-standalone-preset.js.map
  • dist/favicon-16x16.png
  • dist/favicon-32x32.png

Possible Solution

Adding the missing dist files above, along with index.html from the root of the project, should enable someone to add this project as a dependency and correctly render the swagger editor.

Context

I’d like to provide an easy way for my developers to add the swagger editor as a “dependency” of their Swagger JSON project and fire up a local editor to manipulate their API definition.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shockeycommented, Sep 12, 2017

@pofallon, I just merged #1492 which will include index.html in future releases of swagger-editor-dist. Thanks for bringing this to our attention!

I’m going to close this since it seems like this is solved. If you have any lingering concerns, feel free to reply and I’ll reopen this ticket.

1reaction
pofalloncommented, Sep 12, 2017

Awesome, thanks very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I publish an npm package with distribution files?
To solve your problem, create a .npmignore file based on your .gitignore file, without ignoring the dist folder. Source: Keeping files out of ......
Read more >
html-includes - npm
Install. npm i --save-dev html-includes. Add the script into your package.json along ... In /dist you'd have simply index.html , containing:.
Read more >
Output Management - webpack
Let's also update our dist/index.html file, in preparation for webpack to split out entries: dist/index.html ... npm install --save-dev html-webpack-plugin.
Read more >
How to make your own npm package with typescript
There is a lot of mystery around making your own npm package. ... Then, you can create a file named index.js (in your...
Read more >
How to publish a npm package (properly)
Main preparation steps (for JavaScript and TypeScript) · Create a readme.md file with documentation for your package. · It is also recommended to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found