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

new release #66

Closed
wants to merge 86 commits into from
Closed

new release #66

wants to merge 86 commits into from

Conversation

EmmaHegarty
Copy link
Contributor

decreases duplicate code

  • moves commonly used functions to OrsBase class
  • refactors service classes to child classes of OrsBase

adds developement Vue app
introduces cypress for code testing
adds code coverage

removes dependencies on bluebird and superagent (see #61 and #64)

  • "new Promise" syntax removed, functions refactored to async/await
  • error handling uses direct values instead of [resolve, reject] constructs

removes unused clear() functions

EmmaHegarty and others added 30 commits August 26, 2022 14:48
- remove redundant information
- add development setup instructions
extends Ors child classes
replace var declaration with const and let
previously the API key needed to be placed in multiple places for
examples to work.

It now only needs to be provided once during the environment setup by
running the setup.sh script.

- add setup.sh which generates a js api key module and an env file
  in preparation for further Dev APP
- use API key in example html files
- add generated files to .gitignore
using browserify and babel directly to bundle is complex and
not a modern way to build and bundle libraries.

Moving to vite as bundler instead, which has integrated support for
building libraries and is future-proof.
vue-cli was used to build the base structure for the project.

- use module repository type
- expose as cjs umd and es module
- main ors-js-client.js now needs to be included with type module
- remove babel & browserify dependencies and npm scripts
- update eslint & move to eslintrc.cjs
- add lint npm script
- adjust README.md examples
- other small README.md fixes
as prettier does not keep indentations properly and does not
work well with eslint combined, it was removed.

removes:
- dependencies
- prettierrc
- prettier disables in src files
during development currently the package has to be rebuild before changes
are reflected in the examples.
To have a faster development feedback a minimal app template was added,
which can be served by running 'vite' or 'npm run dev' from the command line.

This enables consistent use of breakpoints from both within the browser or
your IDE and serves as Test for the es module format.
to syncronize testing frameworks with the ors-map-client repo,
we use the modern cypress framework for both unit- and component tests.

- move from spec/ to src/__tests__ folder
- add tests for dev_app component & simple e2e test in cypress/e2e
- temporarily disables coverage functionality
- restructure .gitignore
- change test section in README.md

squash terser
some common structural declarations were missing in html files

fixed:
- missing lang attribute for html tag
- missing '<!DOCTYPE html>'
Sonarcloud treats html tags without lang as a bug
a dedicated block for checking errors is not needed, as the
test framework reports thrown errors that are not caught already.
- only run on pull requests
- adjust to cypress tests by using fitting container and action
- disable cypress video output generation
added checkHeaders() and createRequest() which are called in all child classes to remove duplicate code
adjust tests to reflect changes
refactor this.meta to this.argsCache and
prepareMeta() to saveArgsToCache() for more intuitive reading
refactor copyProperties() to fillArgs(),
amend the function to return requestArgs after gaps are filled by defaultArgs

remove clear() from Geocode tests
move method to remove double slashes before host part is added to url variable
- function initiates with creation of class
- adjust default services in child classes to also initiate with creation of class
calculate is now called from the OrsBase class
url variable is now defined within createRequest instead of
OrsElevation.js and OrsPois.js
tests request arguments are correctly adjusted for multiple requests
.js ending for import statements of Ors classes and constants is required for tests to work
with the new vite build process, derequire isn't used anymore
@EmmaHegarty EmmaHegarty added enhancement New feature or request dependencies Pull requests that update a dependency file labels Mar 20, 2023
@sonarcloud
Copy link

sonarcloud bot commented Mar 20, 2023

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 2 Code Smells

No Coverage information No Coverage information
0.4% 0.4% Duplication

@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use fetch API instead of superagent use native promises instead of bluebird
3 participants