Files
swagger-ui/flavors/swagger-ui-react/release/run.sh
Florian Dreier 83021df9b0 fix: add source map of css file to swagger-ui-react (#7601)
Fixes source map of css file missing in swagger-ui-react.
The source map is referenced in ./dist/swagger-ui.css,
but as it does not exist in the final package creates errors in our tooling.
2021-11-05 16:11:56 +01:00

39 lines
1.2 KiB
Bash
Executable File

# Deploy `swagger-ui-react` to npm.
# https://www.peterbe.com/plog/set-ex
set -ex
# Parameter Expansion: http://stackoverflow.com/questions/6393551/what-is-the-meaning-of-0-in-a-bash-script
cd "${0%/*}"
mkdir -p ../dist
# Copy UI's dist files to our directory
cp ../../../dist/swagger-ui.js ../dist
cp ../../../dist/swagger-ui-es-bundle.js ../dist
cp ../../../dist/swagger-ui.css ../dist
cp ../../../dist/swagger-ui.css.map ../dist
# Create a releasable package manifest
node create-manifest.js > ../dist/package.json
# Transpile our top-level component
../../../node_modules/.bin/cross-env BABEL_ENV=commonjs ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx > ../dist/commonjs.js
../../../node_modules/.bin/cross-env BABEL_ENV=es ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx > ../dist/index.js
# Copy our README into the dist folder for npm
cp ../README.md ../dist
# Copy LICENSE & NOTICE into the dist folder for npm
cp ../../../LICENSE ../dist
cp ../../../NOTICE ../dist
# Run the release from the dist folder
cd ../dist
if [ "$PUBLISH_FLAVOR_REACT" = "true" ] ; then
npm publish .
else
npm pack .
fi