Commit Graph

32 Commits

Author SHA1 Message Date
Vladimír Gorej
3c4d9c20b5 chore(deps): bump swagger-client from 3.19.6 to 3.19.7 (#8610) 2023-05-02 14:09:10 +02:00
Vladimír Gorej
c9156f0549 build(webpack): amend build configs to compensate for ApiDOM (#8460)
Refs #8403
2023-03-08 15:35:15 +01:00
Vladimir Gorej
187b0e743d Merge branch 'master' into next 2023-03-08 10:31:48 +01:00
Vladimír Gorej
11957fb868 chore: regenerate package-lock.json (#8411)
package-lock.json was regenerated using Node@16.13.2
and npm@8.1.2. Along with that, these Node.js and npm
versions were set to .nvmrc file.

Given that the dependency tree now changed,
webpack config resolve aliases needed to be
amended to reflect the current dependency tree.
2023-02-23 16:34:17 +01:00
Tim Lai
4557b2497b feat: OpenAPI 3.1 support (#8367)
- New top-level field - `webhooks`. This allows describing out-of-band webhooks that are available as part of the API.

- New top-level field - `jsonSchemaDialect`. This allows defining of a default `$schema` value for Schema Objects

- The Info Object has a new `summary` field.

- The License Object now has a new `identifier` field for SPDX licenses. This `identifier` field is mutually exclusive with the `url` field. Either can be used in OpenAPI 3.1 definitions.

- Components Object now has a new entry `pathItems`, to allow for reusable Path Item Objects to be defined within a valid OpenAPI document.

- `License` and `Contact` components are now exported and available via `getComponent`

- New version predicates and selectors for `isOpenAPI30` and `isOpenAPI31`. This avoids needing to change the usage of `isOAS3` selector.

- New OAS3 components: `Webhooks`

- New OAS3 wrapped components: `Info`, `License`
2023-02-03 14:06:56 -08:00
Tim Lai
0121b18ddf chore(deps-dev): bump sass-loader from 9.0.3 to 12.6.0 (#8191) 2022-09-21 15:38:33 -07:00
Vladimir Gorej
81ef19ca17 feat(build): add support for Create React App without eject (#7946)
Refs #7898
Refs #7944
Refs #7935
Refs #7910
Refs #7908
Refs #7902
2022-03-28 10:47:08 +02:00
Vladimir Gorej
7409f41b97 feat(build): expose true ESM bundle as primary artifact (#7937)
Refs #7907
Refs #7831
2022-03-24 12:24:01 +01:00
Tim Lai
07d346b516 feat(build): webpack@5 and webpack-dev-server@4 (#7826)
SwaggerUI is now built using `webpack@5`, with dev support for `webpack-dev-server@4`
- ES Module output bundle path now points to `swagger-ui-es-bundle-core`, which does not include dependencies
- No change to CommonJS output bundle or path
- Now uses Asset Modules, which replaces `file-loader`, `raw-loader`, and `url-loader`
- Removed unused rules/loaders for `.woff | .woff2 | .ttf | .eot` fonts and html
- Node polyfills are no longer bundled with `webpack@5`, and must be loaded separately and/or use `resolve.fallback`. 
As an example, SwaggerUI loads `process`, `buffer`, and `stream-browserify` as `devDependencies` in order to build development and production bundles.

SwaggerUI-React
- Now imports `swagger-ui-es-bundle-core`, and similarly outputs `swagger-ui-es-bundle-core` to its `dist` directory

Dev notes:
- Order of execution matters for the production npm build scripts. `build-stylesheets` needs to get built first, 
then cleanup of any empty artifacts, before building the various production bundles
- `Dev-helpers` now relies on `HTMLWebpackPlugin` to inject css and bundle files
2022-03-01 12:08:50 -08:00
Vladimir Gorej
efff3a6051 build(webpack): remove duplicates from the build
Refs #7341
2021-11-03 09:49:50 +01:00
Vladimir Gorej
4c369b0027 chore(package-lock): add integrity check info
Refs #7341
2021-11-03 09:49:50 +01:00
Vladimir Gorej
fdef4ead7a fix(build-security): do not expose hostname to build framents (#7491)
Refs #7446
2021-09-10 13:29:42 +03:00
Tim Lai
eb04d9ef66 chore(webpack): sass-loader with sassOptions (#7089) 2021-03-17 13:06:06 -07:00
Tim Lai
12eb6f34dc chore(webpack): use postcss-preset-env plugin (#7084) 2021-03-16 18:27:17 -07:00
Mahtis Michel
0f092e56af chore(build): increase bundle size limit to 1.1 MiB (#7018) 2021-03-03 14:08:47 -08:00
Mahtis Michel
cdfb64f711 fix(webpack): assets should not be treaded as esModule (#6861) 2021-01-22 10:20:25 -08:00
Tim Lai
a75f2c67fd chore(deps-dev): css-loader cumulative deps and config update (#6596)
* css-loader@5
* postcss@8 peer dependency
* postcss-loader@4
* update webpack config with postcssOptions
2020-11-09 11:23:31 -08:00
Tim Lai
3f4db5f474 refactor(build): increase maxEntrypointSize for core-js@3 (#6419) 2020-09-18 11:21:28 -07:00
Tim Lai
0d63e70c8e chore: remove unused deprecated polyfill.js file (#6345)
* config(dev): remove unused polyfills in webpack-dev
2020-08-27 12:19:57 -07:00
Tim Lai
20b32d8b90 fix(build): css stylesheets bundle config and deps (#6315) 2020-08-18 16:05:31 -07:00
Tim Lai
d521b8c5b1 build: change globalObject to "this" for es bundles (#6301) 2020-08-14 11:10:27 -07:00
Pontus Wallberg
d0ae61f8c9 change globalObject to "this" (#6287)
Co-authored-by: Pontus Wallberg <pontus.wallberg@configura.com>
2020-08-14 10:47:32 -07:00
Tim Lai
2eaa6c10e4 feat(build): es2015 bundle artifact (#6291)
* es2015 bundle with dependencies via npm script build:es:bundle
* es2015 bundle without dependencies via npm script build:es:bundle
* jest dependency for test:artifact
* migrate babel.config.json to babel.config.js and maintain env support for commonjs and es2015
* remove polyfill
* fix es syntax: replace module.exports with export
* fix es syntax: remove .jsx extension inside import
2020-08-13 17:21:55 -07:00
Timothy Lai
ea5b64bca3 build(webpack): remove LodashModuleReplacementPlugin 2020-07-22 12:40:30 -07:00
Tim Lai
60b411e8c0 build(webpack): enable lodash options (#6248) 2020-07-21 10:49:13 -07:00
Tim Lai
d12662e354 build(webpack): bundle size optimization for lodash (#6244)
* add duplicate code detection check for general purpose use
* webpack alias for lodash
* redux and react-redux dependency bump that removes lodash dependencies
* lodash version match with swagger-client and recent security update
* additional webpack config to help reduce build sizes
* restore max bundle size back to 1024000
2020-07-20 20:26:56 -07:00
Tim Lai
a73783b73d feat: syntax highlighting of code section (#6236)
Co-authored-by: AdrieanKhisbe <adriean.khisbe@live.fr>
2020-07-17 15:29:15 -07:00
Tim Lai
251ea10d94 config: increase max bundle size to 1024 KiB (#6231) 2020-07-16 19:19:21 -07:00
Vladimir Gorej
4f2e8ad7d1 build(webpack): move resolve alises to one common place
As resolving applies to everything and not just specific builds
the resolve.aliases have been moved to one common place.
2020-07-04 11:26:17 +02:00
Vladimir Gorej
c30760cfe5 build(webpack): make sure we're not bundling same deps twice
As versions of libraries that are both used by swagger-js and swagger-ui
may diverge in time, we must use webpack resolve aliases to make sure
that only one version of these libraries gets bundled.
2020-06-29 14:19:38 +02:00
kyle
2af696dcc1 housekeeping: @kyleshockey/js-yaml -> js-yaml (via #5511)
* `@kyleshockey/js-yaml` -> `js-yaml`

* externalize `esprima`
2019-07-31 14:45:18 -07:00
kyle
88204daad8 housekeeping: upgrade to webpack@4 (via #5454)
* build new core webpack config

* fix exports in Webpack; use ESM syntax throughout

* add bundle config

* add standalone config

* add style config

* prettier...

* add dev config

* delete legacy webpack scripts

* rewire npm scripts to use new webpack configs

* cache babel-loader results

* fix e2e dev servers

* update core Webpack modules

* update loaders to latest

* remove unused loaders

* update Webpack plugins

* add mode flags to Webpack configs

* remove plugin invocations that are now production-standard in v4

* update webpack-cli

* add webpack perf size limit flags

* replace ExtractText with MiniCssExtract + IgnoreAssets

* UglifyJsPlugin -> TerserPlugin

* fix PostCSS processing

* enable Terser sourcemaps

* webpack/style -> webpack/stylesheets
2019-07-11 18:57:44 -05:00