Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

webpack-hot-dev-server.config.js 1.4 KiB

7 år sedan
7 år sedan
feat: Multiple Examples for OpenAPI 3 Parameters, Request Bodies, and Responses (via #5427) * add opt-in Prettier config * remove legacy `examples` implementation * create ExamplesSelect * support `Response.examples` in OpenAPI 3 * create response controls group * prettier reformat * prepare to break up Parameters * reunify Parameters and OAS3 Parameters * Parameter Examples * Example component * handle parameter value stringification correctly * FOR REVIEW: add prop for controlling Select * use regular header for param examples in Try-It-Out * manage active examples member via Redux * Request Body Try-It-Out examples * remove special Response description styling * omit Example value display in Try-It-Out * support disabled text inputs in JsonSchemaForm * Example.omitValue => Example.showValue * ExamplesSelectValueRetainer * styling for disabled inputs * remove console.log * support "Modified Values" in ExamplesSelect * remove Examples component (wasn't used anywhere) * use ParameterRow.getParamKey for active examples member keying * split-rendering of examples in ParameterRow * send disabled prop to JsonSchemaForm * use content type to key request body active examples members * remove debugger * rewire RequestBodyEditor to be a controlled component REVIEW: does this have perf implications? * trigger synthetic onSelect events in ExamplesSelect * prettier updates * remove outdated Examples usage in RequestBody * don't handle examples changes in ESVR * make RequestBodyEditor semi-controlled * don't default to an empty Map for request bodies * add namespaceKey to ESVR for state mgmt * don't key RequestBody activeExampleKeys on media type * tweak ESVR isModifiedValueSelected calculation * add trace class to ExamplesSelect * remove usage of ESVR.currentNamespace * reset to first example if currentExampleKey is invalid * add default values to RequestBody rendering * stringify things in ESVR * avoid null select value (silences React warning) * detect user inputs that match any examples member's value * add trace class for json-schema-array * shallowly convert namespace state, to preserve Immutable stucts in state * stringify RBE values; don't trim JSON in editor * match user input to an example when non-primitives are expressed in state as strings * update Cypress * don't apply sample values in JsonSchema_Object * support disabling all JsonSchemaForm subcomponents * Core tests * style changes to accomodate Examples * fix version-checking error in Response * disable SCU for Responses * don't stringify Select values * ModelExample: default to Model tab if no example is available; provide a default no example message * don't trim JSON ParamBody inputs * read directly from 2.0 Response.schema instead of inferring a value * show current Example information in RequestBody * show label for Examples dropdown by default * rework Response content ordering * style disabled textareas like other read-only blocks * meta: fix sourcemaps * refactor ESVR setNameForNamespace * protect second half of ternary expession * cypress: `select.examples-select` => `.examples-select > select` * clarify ModelExample.componentWillReceiveProps * add gates/defaults to prevent issues in very bare-boned documents * fix test block organization problem * simplify RequestBodyEditor interface * linter fixes * prettier updates * use plugin system for new components * move ME Cypress helpers to other file
5 år sedan
7 år sedan
7 år sedan
7 år sedan
7 år sedan
7 år sedan
7 år sedan
7 år sedan
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. const path = require("path")
  2. const rules = [
  3. { test: /\.(worker\.js)(\?.*)?$/,
  4. use: [
  5. {
  6. loader: "worker-loader",
  7. options: {
  8. inline: true
  9. }
  10. },
  11. { loader: "babel-loader?retainLines=true" }
  12. ]
  13. },
  14. { test: /\.(css)(\?.*)?$/,
  15. use: [
  16. "style-loader",
  17. "css-loader",
  18. "postcss-loader"
  19. ]
  20. },
  21. { test: /\.(scss)(\?.*)?$/,
  22. use: [
  23. "style-loader",
  24. "css-loader",
  25. {
  26. loader: "postcss-loader",
  27. options: { sourceMap: true }
  28. },
  29. { loader: "sass-loader",
  30. options: {
  31. outputStyle: "expanded",
  32. sourceMap: true,
  33. sourceMapContents: "true"
  34. }
  35. }
  36. ]
  37. }
  38. ]
  39. module.exports = require("./make-webpack-config")(rules, {
  40. _special: {
  41. separateStylesheets: false,
  42. sourcemaps: true,
  43. },
  44. entry: {
  45. "swagger-ui-bundle": [
  46. "./src/polyfills",
  47. "./src/core/index.js"
  48. ],
  49. "swagger-ui-standalone-preset": [
  50. "./src/style/main.scss",
  51. "./src/polyfills",
  52. "./src/standalone/index.js",
  53. ]
  54. },
  55. output: {
  56. pathinfo: true,
  57. filename: "[name].js",
  58. library: "[name]",
  59. libraryTarget: "umd",
  60. chunkFilename: "[id].js"
  61. },
  62. devServer: {
  63. port: 3200,
  64. publicPath: "/",
  65. noInfo: true,
  66. hot: true,
  67. disableHostCheck: true, // for development within VMs
  68. stats: {
  69. colors: true
  70. },
  71. },
  72. })