Browse Source

Add script documentation to development docs

bubble
Kyle Shockey 6 years ago
parent
commit
c23b884d9a
4 changed files with 34 additions and 27 deletions
  1. +2
    -15
      README.md
  2. +1
    -12
      dev-helpers/index.html
  3. +1
    -0
      docs/SUMMARY.md
  4. +30
    -0
      docs/development/scripts.md

+ 2
- 15
README.md View File

@@ -48,19 +48,7 @@ Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes

#### Development
- [Setting up](docs/development/setting-up.md)

### How to run

##### Prerequisites
- Node 6.x
- NPM 3.x

If you just want to see your specs, open `dist/index.html` in your browser directly from your filesystem.

If you'd like to make modifications to the codebase, run the dev server with: `npm run dev`. A development server will open on `3200`.

If you'd like to rebuild the `/dist` folder with your codebase changes, run `npm run build`.

- [Scripts](docs/development/scripts.md)

##### Integration Tests

@@ -69,7 +57,6 @@ http://nightwatchjs.org/gettingstarted#selenium-server-setup

Integration tests can be run locally with `npm run e2e` - be sure you aren't running a dev server when testing!


### Browser support
Swagger UI works in the latest versions of Chrome, Safari, Firefox, Edge and IE11.

@@ -77,7 +64,7 @@ Swagger UI works in the latest versions of Chrome, Safari, Firefox, Edge and IE1

To help with the migration, here are the currently known issues with 3.X. This list will update regularly, and will not include features that were not implemented in previous versions.

- Only part of the [parameters](#parameters) previously supported are available.
- Only part of the parameters previously supported are available.
- The JSON Form Editor is not implemented.
- Support for `collectionFormat` is partial.
- l10n (translations) is not implemented.


+ 1
- 12
dev-helpers/index.html View File

@@ -70,16 +70,6 @@
<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script>

const MyComponentPlugin = function(system) {
return {
components: {
// components can just be functions
// HelloWorld: () => "Hello World"
}
}
}

window.onload = function() {
window["SwaggerUIBundle"] = window["swagger-ui-bundle"]
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
@@ -92,8 +82,7 @@
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl,
MyComponentPlugin
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})


+ 1
- 0
docs/SUMMARY.md View File

@@ -14,3 +14,4 @@

#### Development
- [Setting up](docs/development/setting-up.md)
- [Scripts](docs/development/scripts.md)

+ 30
- 0
docs/development/scripts.md View File

@@ -0,0 +1,30 @@
# Helpful scripts

Any of the scripts below can be run by typing `npm run <script name>` in the project's root directory.

### Developing
Script name | Description
--- | ---
`dev` | Spawn a hot-reloading dev server on port 3200.
`deps-check` | Generate a size and licensing report on Swagger-UI's dependencies.
`lint` | Report ESLint style errors and warnings.
`lint-errors` | Report ESLint style errors, without warnings.
`lint-fix` | Attempt to fix style errors automatically.
`watch` | Rebuild the core files in `/dist` when the source code changes. Useful for `npm link` with Swagger-Editor.

### Building
Script name | Description
--- | ---
`build` | Build a new set of JS and CSS assets, and output them to `/dist`.
`build-bundle` | Build `swagger-ui-bundle.js` only.
`build-core` | Build `swagger-ui.(js|css)` only.
`build-standalone` | Build `swagger-ui-standalone-preset.js` only.

### Testing
Script name | Description
--- | ---
`test` | Run unit tests in Node and run ESLint in errors-only mode.
`just-test` | Run unit tests in the browser with Karma.
`just-test-in-node` | Run unit tests in Node.
`just-check-coverage` | Generate a code coverage report with NYC.
`e2e` | Run end-to-end tests (requires JDK and Selenium).

Loading…
Cancel
Save