Add build setup for swagger-ui-dist

This commit is contained in:
Kyle Shockey
2017-04-21 18:25:59 -07:00
parent 06c82bb325
commit e871871724
6 changed files with 63 additions and 12 deletions

View File

@@ -0,0 +1,2 @@
README.md
deploy.sh

View File

@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

View File

@@ -0,0 +1,3 @@
This directory is used to build the `swagger-ui-dist` npm package.
For anything else, check the [Swagger-UI](https://github.com/swagger-api/swagger-ui) repository.

View File

@@ -0,0 +1,21 @@
# Deploy `swagger-ui-dist` to npm.
# Parameter Expansion: http://stackoverflow.com/questions/6393551/what-is-the-meaning-of-0-in-a-bash-script
cd "${0%/*}"
# Get UI version
UI_VERSION=$(node -p "require('../package.json').version")
# Replace our version placeholder with UI's version
sed -i '' "s|\$\$VERSION|$UI_VERSION|g" package.json
# Copy UI's dist files to our directory
cp ../dist/* .
if [[ $PUBLISH_DIST = "true" || $TRAVIS = "true" ]]; then
npm publish .
else
npm pack .
fi
rm !(README.md|package.json|deploy.sh)

View File

@@ -0,0 +1,18 @@
{
"name": "swagger-ui-dist",
"version": "$$VERSION",
"main": "dist/swagger-ui.js",
"repository": "git@github.com:swagger-api/swagger-ui.git",
"contributors": [
"(in alphabetical order)",
"Anna Bodnia <anna.bodnia@gmail.com>",
"Buu Nguyen <buunguyen@gmail.com>",
"Josh Ponelat <jponelat@gmail.com>",
"Kyle Shockey <kyleshockey1@gmail.com>",
"Robert Barnwell <robert@robertismy.name>",
"Sahar Jafari <shr.jafari@gmail.com>"
],
"license": "Apache-2.0",
"dependencies": {},
"devDependencies": {}
}