Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy #436

Merged
merged 25 commits into from
Sep 13, 2022
Merged

Remove legacy #436

merged 25 commits into from
Sep 13, 2022

Conversation

javierbrea
Copy link
Member

core

Removed

  • feat: Remove legacy routesHandlers option
  • feat: Remove legacy core.addRoutesHandler method
  • feat: Remove legacy core.loadMocks method
  • feat: Remove legacy core.loadRoutes method
  • feat: Remove legacy core.onChangeMocks method
  • feat: Remove legacy core.onChangeAlerts method
  • feat: Remove legacy core.onChangeLogs method
  • feat: Remove legacy core.restartServer method
  • feat: Remove legacy core.addRouter method
  • feat: Remove legacy core.removeRouter method
  • feat: Remove context property from alerts.flat collection items
  • feat: Remove legacy core.alertsApi getter. Now core.alerts can be used instead
  • feat: Remove legacy core.mocks getter
  • feat: Remove legacy core.tracer getter
  • feat: Remove legacy core.logs getter
  • feat: Remove legacy mocks.selected option
  • feat: Remove legacy mocks.delay option
  • feat: Remove legacy core.mock.current setter
  • feat: Remove legacy core.mock.restoreRoutesVariants method
  • feat: Remove legacy core.mock.customRoutesVariants getter
  • feat: Remove legacy core.mock.current getter
  • feat: Remove legacy core.mock.ids getter
  • feat: Remove legacy core.mock.plainMocks getter
  • feat: Remove legacy core.mock.plainRoutes
  • feat: Remove legacy core.mock.plainRoutesVariants
  • feat: Remove legacy core.mock.error getter
  • feat: Remove support for defining plugins as objects, functions, etc. Now, only classes are supported. If the class has not a static id, the alerts, config and logger properties won’t be available in the core passed to the constructor. If the class has an id getter, those properties will be received in start, stop, init and register methods, but not in the constructor.
  • feat: Remove default route handler. Now the type property is mandatory in variants
  • feat: Do not support handler property in variants, which was an alias for type. From now, only type is supported (and required, unless disabled property is true)
  • feat: Ignore version property in variant handlers. From now, all handlers are considered to be defined in “v4” format
  • feat: Do not support plainResponsePreview getter in variant handlers. Now only preview getter is supported
  • feat: Do not support routeVariants or routesVariants properties in collections. Now, only routes is supported
  • feat: Remove legacy methods passed to the plugins as parameters: loadMocks, loadRoutes, addAlert, removeAlert, core. Now, only the core is passed as argument (with namespaced alerts, logger and config)

Changed

  • feat: core.alerts getter now returns the root Alerts API, not a flat collection of alerts.
  • test: Migrate functional tests to core package from core-e2e (those that can be used to get coverage)
  • feat: Use namespaces logger when tracing variant requests

Added

  • feat: Add support for .cjs files
  • feat: Add core.mock.routes.delay getter
  • feat: Add route method and url to route not found logs.

plugin-admin-api

Removed

  • feat: Remove custom router "/admin" from mock server. Admin API is only available at its own server from now.

Added

  • feat: Add url and method to route not found log

plugin-proxy

Changed

  • feat: Rename "proxy-v4" handler into "proxy". Remove legacy proxy handler.

admin-api-client

Removed

  • feat: Remove default client methods. Class AdminApiClient has to be used instead. BREAKING CHANGE

admin-api-paths

Removed

  • feat: Remove legacy paths

main

Changed

  • fix: Update @mocks-server/core
  • fix: Update @mocks-server/plugin-admin-api
  • fix: Update @mocks-server/plugin-proxy

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (9ba18b3) compared to base (ab1fdb6).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           release      #436    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           89        84     -5     
  Lines         3316      2959   -357     
  Branches        87        87            
==========================================
- Hits          3316      2959   -357     
Flag Coverage Δ
admin-api-client 100.00% <ø> (ø)
admin-api-client-data-provider 100.00% <ø> (ø)
admin-api-paths 100.00% <ø> (ø)
config 100.00% <ø> (ø)
core 100.00% <100.00%> (ø)
cypress-commands 100.00% <ø> (ø)
logger 100.00% <ø> (ø)
main 100.00% <ø> (ø)
nested-collections 100.00% <ø> (ø)
plugin-admin-api 100.00% <100.00%> (ø)
plugin-inquirer-cli 100.00% <100.00%> (ø)
plugin-openapi 100.00% <ø> (ø)
plugin-proxy 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/admin-api-client/src/methods.ts 100.00% <ø> (ø)
packages/admin-api-paths/src/index.ts 100.00% <ø> (ø)
packages/core/src/common/events.js 100.00% <ø> (ø)
packages/core/src/server/Server.js 100.00% <ø> (ø)
...ackages/core/src/variant-handlers/handlers/File.js 100.00% <ø> (ø)
...ackages/core/src/variant-handlers/handlers/Json.js 100.00% <ø> (ø)
...kages/core/src/variant-handlers/handlers/Static.js 100.00% <ø> (ø)
...kages/core/src/variant-handlers/handlers/Status.js 100.00% <ø> (ø)
packages/plugin-admin-api/src/swagger/openapi.js 100.00% <ø> (ø)
packages/core/src/Core.js 100.00% <100.00%> (ø)
... and 23 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

Affected projects

🔎 Comparing current branch with origin/release

  • 8 applications: admin-api-client-e2e-vanilla-app, admin-api-client-data-provider-e2e-react-app, admin-api-client-data-provider-e2e-vanilla-app, main, admin-api-client-data-provider-e2e-mocks, admin-api-client-unit-mocks, admin-api-client-data-provider-e2e-specs, cypress-commands-e2e-vanilla-app
  • 14 libraries: admin-api-client, cypress-commands, admin-api-paths, admin-api-client-data-provider, plugin-admin-api, core, plugin-inquirer-cli, plugin-openapi, plugin-proxy, cli-runner, inquirer-cli-runner, config, logger, nested-collections
  • 12 test: admin-api-client-vanilla-app-e2e, admin-api-client-nodejs-e2e, cypress-commands-typescript-e2e, cypress-commands-e2e, admin-api-client-data-provider-react-app-e2e, admin-api-client-data-provider-vanilla-app-e2e, admin-api-client-data-provider-nodejs-e2e, plugin-admin-api-swagger-e2e, main-e2e, plugin-inquirer-cli-e2e, core-e2e, config-e2e
Total: 34 projects are affected by changes

@sonarqubecloud
Copy link

[admin-api-client] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

[cypress-commands] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

[cypress-commands-e2e] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[admin-api-paths] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

[plugin-admin-api] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[admin-api-client-data-provider] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

[main] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

[main-e2e] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[core] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[plugin-inquirer-cli] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[plugin-inquirer-cli-e2e] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[plugin-openapi] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[plugin-proxy] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[core-e2e] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

[config] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

[logger] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

[nested-collections] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@javierbrea javierbrea merged commit a748e3d into release Sep 13, 2022
@javierbrea javierbrea deleted the feat-remove-legacy-2 branch September 13, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants