@aptos-scp/scp-component-rn-device-services
v4.31.0
Published
A react-native component for integrating with devices.
Maintainers
Keywords
Readme
** POD Owner **
- ** Store Selling 1 **
scp-component-rn-device-services
The device services library handles integration with various devices (payment, scanner, etc).
Installation
First, make sure you are logged-in to the private NPM registry:
npm adduser --registry=https://registry.npmjs.org/ --scope=@aptos-scpThen install the dependency packages:
npm installBuilding the component library
First, make sure you are logged-in to the private NPM registry (mentioned earlier) Then, install the dependencies:
$ npm installFinally, build the component library:
$ npm run buildYou can then also run tests and coverage:
$ npm run test
$ npm run coverageDebugging
To setup a mocha test configuration in WebStorm, do the following:
- Open the project in WebStorm.
- At the top right of the project window, choose Edit Configurations....
- Click the "+" symbol to add a new configuration, and choose Mocha.
- Select the appropriate node interpreter. If using NVM, this should be something like, ~/.nvm/versions/node/v8.11.3/bin/node.
- Make sure the project root is set as the working directory.
- Set Extra M¡ocha Options to
--opts mochaUnitTest.opts. - Set Test file patterns to
test-js/**/*.spec.js. - Save the configuration, then run or debug.
To setup interactive debugging in VSCode, do the following:
- Open launch.json from debugging side bar.
- Paste the following section into file: { "name": "Run mocha", "type": "node", "request": "launch", "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", "stopOnEntry": false, "args": ["${workspaceRoot}/test-js/**/*.js", "--no-timeouts", "--opts", "${workspaceRoot}/mochaUnitTest.opts"], "cwd": "${workspaceRoot}", "runtimeExecutable": null, "env": { "NODE_ENV": "testing"} }
- Run "Run mocha" from debugger dropdown. Breakpoints added to mocha tests should be hit.
Publishing changes
To publish a new version to the NPM registry:
Commit and push the changes .
Update the version of the package using one of the following:
npm version patchor
npm version minoror one of the other variations (see npm-version)
Push the version commit
git push origin masterPush the version tag
git push origin <name-of-tag>where is something like vX.Y.Z (e.g. v1.0.58)
or
From WebStorm or IntelliJ make sure that the Push Tags check-box is checked, when you push changes.
When the build in Circle CI sees the version tag, it will publish the changes to the NPM repository.
API
tbd
Adding Dependency Injection (DI) Types (Inversify)
Please see src/config/inversify/README.md.
Import as dependency
To use package before android build you need in your parent project publish local maven repository (eg. ./gradlew publishToMavenLocal).
Troubleshooting / Tips
- I just installed a package and now I'm getting an
Unexpected token importerror when I run tests: The unit tests are run with mocha under node.js. Unfortunately node's CommonJS module system is incompatible with ES6 modules. Some React Native modules are compiled as ES6 modules, and will have to be either mocked or transpiled to run under node. There is a file in the root of this procect,custom-babel-register.js, which contains a regular expression intended to match any modules that require transpilation to run under the node testing framework. If necessary, modify this expression to include your package and see if the problem is resolved.
version update commit
License
Copyright (c) 2017 Aptos, Inc. All rights reserved.
Integrated Frameworks
Aurus SDK
- iOS -- v22.018
- Android -- v21.0083
Adyen SDK
- iOS - N/A
- Android - N/A
Epson SDK
- iOS - v2.13.0
- Android - v2.13.0
