configure cordova-plugin into capacitor environment - configuration

I have a react-app webapp wrapped by an ionic-capacitor framework.
I already used a lot of cordova-plugins inside my code, like the phonegap-plugin-barcodescanner or the cordova-plugin-inappbrowser.
I understood that i can use them if I make:
npm install --save cordova-plugin-pluginName #ionic-native/plugin-name
then i could import them into my React environment with:
import {PluginName} from #ionic-native/plugin-name
and it's works like a magic!
The problem is:
when i need to use a cordova-plugin which requires configuration, it used to be cordova add plugin plugin-name --variable var=""
but in the react-capacitor environment i can't install the plugin with it's configuration! i should add it later somehow, via the androidManifest.xml or via the cordova:config.xml.
can someone help me please?
thanks a lot...

Ionic provides a tool for changing the ios/android configs using a separate file. It's called Trapeze. It does require a bit of extra configuration and an aditional build step but it will allow for the adding of these variables to the ios/android config.

Related

How to send emails with smtpjs in reacts without typescript

I tried creating a contact form with SMTP js in react but it did not work tried checking stack over flow but no good answer for using only react not typescript
I was expecting the stmp is to be installed like normal swiper
Because I'm still a junior frontend dev 🤧
You can also find more information and documentation on using smtp.js in React app on the following resources:
Official smtp.js documentation: https://github.com/kimmobrunfeldt/smtp.js
SMTP in Node.js: https://nodemailer.com/smtp/
this also explains better:
https://victorbruce82.medium.com/how-to-send-emails-using-react-through-emailjs-no-server-code-needed-8e1453ef8796
Yes, you can install smtp.js in a similar way to installing other packages in your React app. You can use npm or yarn to install it:
CODE :
npm install smtpjs
or
yarn add smtpjs
After installation, you can import and use smtp.js in your React component.

Trying to use multi-rake with Google Cloud Functions

I am trying to use this library here: multi-rake
However, as stated in the docs, we have to run this before installing multi-rake:
CFLAGS="-Wno-narrowing" pip install cld2-cffi
So I cannot simply put cld2-cffi and multi-rake in requirements.txt because cld2-cffi needs to be installed like this beforehand. How could I overcome this problem?
According to the official documentation you have to package as local dependencies.
You can also package and deploy dependencies alongside your function.
This approach is useful if your dependency is not available via the
pip package manager or if your Cloud Functions environment's internet
access is restricted. For example, you might use a directory structure
such as the following:
You can then use code as usual from the included local dependency,
localpackage. You can use this approach to bundle any Python packages
with your deployment.
Note: You can still use a requirements.txt file to specify additional
dependencies you haven't packaged alongside your function.
Specifying dependencies in Python

How do I use electron-compile?

I'm having trouble with electron-compile.
The docs state
How does it work? (Easiest Way)
Change your reference to electron-prebuilt to electron-prebuilt-compile. Tada! You did it.
What reference, where? You can't be talking about package.json?
I've always run electron using supervisor -x "electron" -i "./" .
What am I completely missing / what should be the contents of my pull request to make this clearer?
I've installed electron-compile with npm i electron-compile --save-dev
I'd like to have es2015/jsx precompiled to es5, so that I can run a react application in electron. electron-compile appears to solve this problem.
You should install Electron as a dev reference in package.json, yes:
npm install --save-dev electron-prebuilt-compile
Don't install Electron as a global because then other people have to set stuff up to run your app (i.e. they now have to micromanage which version of Electron they have installed globally)
With the recent versions (electron 1.3.5), I was unable to get electron-prebuilt-compile working, well it works for development but packaging for production has no real working examples.
It seems the compiling and packaging needs to be done manually, so in case anyone needs a working example, it's here. Hope to save someone some time and pain.

Readthedocs mock not working with Matplolitb

Read the Docs will not build docs for my package because it includes matplotlib.
I used the code on their website to mock out matplotlib, but still the build fails because freetype and png are required to build matplotlib, and apparently this is not installed on their machine.
I tried with and without building in the virtualenv.
Here is my config.py.
Why is my mock not working?
If you have matplotlib in your requirements.txt, Read the Docs will still try to install it in the virtualenv. You have to take matplotlib (and anything else you want to mock) out of the requirements.
If you still want it in requirements.txt for setup but not for building the docs, I think you can specify a different requirements file (like docs/requirements.txt or something) in the ReadTheDocs Admin (under advanced settings).
I hope this solves your problem.

Local portable grunt distribution?

I am currently creating a portable consolidation of my workflow using Node-Webkit which has node.js embedded. Now my problem is getting grunt/gulp inside the project itself as it depends on the cli somewhat(avoidable, granted), and also is confusing to me on the architecture. Is it possible to find just a .js with grunt in it to include much like Jquery/Handlebars?
Is this all I need to just include and run?
No before that make sure you environment is up, get the package.json, GruntFile.js file. In GruntFile.js you can specify what you want to pre-process. For example jade,Less,coffee. It looks very much like a node function, for sample you can refer to link
Now to make this work you also need to install various contrib plugins as per your requirement. Then register every single task in GruntFile.js. It really speeds up the development.
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.registerTask('test', ['jade', 'less','coffee']);
So to process less,jade,coffee, we need to run the module installations such as
npm install grunt --save-dev
npm install grunt <module name> --save-dev
There are many more interesting configurations to learn and documentation is really nice, please refer to getting started guide
This adds the required Grunt and grunt plugins to package.json