Add script documentation to development docs
This commit is contained in:
17
README.md
17
README.md
@@ -48,19 +48,7 @@ Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
|
|||||||
|
|
||||||
#### Development
|
#### Development
|
||||||
- [Setting up](docs/development/setting-up.md)
|
- [Setting up](docs/development/setting-up.md)
|
||||||
|
- [Scripts](docs/development/scripts.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`.
|
|
||||||
|
|
||||||
|
|
||||||
##### Integration Tests
|
##### 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!
|
Integration tests can be run locally with `npm run e2e` - be sure you aren't running a dev server when testing!
|
||||||
|
|
||||||
|
|
||||||
### Browser support
|
### Browser support
|
||||||
Swagger UI works in the latest versions of Chrome, Safari, Firefox, Edge and IE11.
|
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.
|
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.
|
- The JSON Form Editor is not implemented.
|
||||||
- Support for `collectionFormat` is partial.
|
- Support for `collectionFormat` is partial.
|
||||||
- l10n (translations) is not implemented.
|
- l10n (translations) is not implemented.
|
||||||
|
|||||||
@@ -70,16 +70,6 @@
|
|||||||
<script src="./swagger-ui-bundle.js"> </script>
|
<script src="./swagger-ui-bundle.js"> </script>
|
||||||
<script src="./swagger-ui-standalone-preset.js"> </script>
|
<script src="./swagger-ui-standalone-preset.js"> </script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
const MyComponentPlugin = function(system) {
|
|
||||||
return {
|
|
||||||
components: {
|
|
||||||
// components can just be functions
|
|
||||||
// HelloWorld: () => "Hello World"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
window["SwaggerUIBundle"] = window["swagger-ui-bundle"]
|
window["SwaggerUIBundle"] = window["swagger-ui-bundle"]
|
||||||
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
|
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
|
||||||
@@ -92,8 +82,7 @@
|
|||||||
SwaggerUIStandalonePreset
|
SwaggerUIStandalonePreset
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
SwaggerUIBundle.plugins.DownloadUrl,
|
SwaggerUIBundle.plugins.DownloadUrl
|
||||||
MyComponentPlugin
|
|
||||||
],
|
],
|
||||||
layout: "StandaloneLayout"
|
layout: "StandaloneLayout"
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,3 +14,4 @@
|
|||||||
|
|
||||||
#### Development
|
#### Development
|
||||||
- [Setting up](docs/development/setting-up.md)
|
- [Setting up](docs/development/setting-up.md)
|
||||||
|
- [Scripts](docs/development/scripts.md)
|
||||||
|
|||||||
30
docs/development/scripts.md
Normal file
30
docs/development/scripts.md
Normal 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).
|
||||||
Reference in New Issue
Block a user