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

Add source map of js files to swagger-ui-react #7717

Merged
merged 3 commits into from
Jan 12, 2022

Conversation

xfournet
Copy link
Contributor

@xfournet xfournet commented Dec 22, 2021

Description

The swagger-ui-react package includes the swagger-ui.js and swagger-ui.-es-bundle.js files, which references corresponding source map files that are already generated, but not included in the final npm package.

Motivation and Context

This is inconsistent and causes error message when building our application with CRA 5 (Webpack 5)

PR #7601 has fixed the problem for the css map source file. This is the same fix but for the js files.

How Has This Been Tested?

Tested manually by executing flavors/swagger-ui-react/release/run.sh

❯  ./run.sh
+ mkdir -p ../dist
+ cp ../../../dist/swagger-ui.js ../dist
+ cp ../../../dist/swagger-ui.js.map ../dist
+ cp ../../../dist/swagger-ui-es-bundle.js ../dist
+ cp ../../../dist/swagger-ui-es-bundle.js.map ../dist
+ cp ../../../dist/swagger-ui.css ../dist
+ cp ../../../dist/swagger-ui.css.map ../dist
+ node create-manifest.js
+ ../../../node_modules/.bin/cross-env BABEL_ENV=commonjs ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx
+ ../../../node_modules/.bin/cross-env BABEL_ENV=es ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx
+ cp ../README.md ../dist
+ cp ../../../LICENSE ../dist
+ cp ../../../NOTICE ../dist
+ cd ../dist
+ '[' '' = true ']'
+ npm pack .
npm notice
npm notice package: swagger-ui-react@4.1.3
npm notice === Tarball Contents ===
npm notice 11.6kB  LICENSE
npm notice 57B     NOTICE
npm notice 9.2kB   README.md
npm notice 6.7kB   commonjs.js
npm notice 6.6kB   index.js
npm notice 1.7kB   package.json
npm notice 1.1MB   swagger-ui-es-bundle.js
npm notice 4.3MB   swagger-ui-es-bundle.js.map
npm notice 143.9kB swagger-ui.css
npm notice 275.4kB swagger-ui.css.map
npm notice 513.6kB swagger-ui.js
npm notice 1.9MB   swagger-ui.js.map
npm notice === Tarball Details ===
npm notice name:          swagger-ui-react
npm notice version:       4.1.3
npm notice filename:      swagger-ui-react-4.1.3.tgz
npm notice package size:  2.3 MB
npm notice unpacked size: 8.3 MB
npm notice shasum:        21f9c43a2cd5dac371284993a3f92034f5a7267e
npm notice integrity:     sha512-EM+TqwxbgvDJN[...]UyNQPxGQr8XQg==
npm notice total files:   12
npm notice
swagger-ui-react-4.1.3.tgz

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

@char0n char0n self-requested a review January 10, 2022 09:50
@char0n char0n self-assigned this Jan 10, 2022
@char0n char0n added javascript Pull requests that update Javascript code type: enhancement version: 4.x labels Jan 10, 2022
@tim-lai tim-lai merged commit e6ea523 into swagger-api:master Jan 12, 2022
@tim-lai
Copy link
Contributor

tim-lai commented Jan 12, 2022

@xfournet PR merged! Thanks for the contribution, and coincidentally a timely one too! 😁

@xfournet xfournet deleted the add-js-source-maps branch January 12, 2022 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code type: enhancement version: 4.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants