Multiple less files with variable interpolation is not compiling using parceljs - less

I have tried to compile 2 less files with Variable declaration using Parcel. Below trying to compile two Less file with variable interpolation approach like "#component-name: banner1;"
and "#component-name: "banner2"; and then trying to compile the less and its compiling only the last imported less file.
Find the below git repo and test to replicate the issue.
Clone the below repo
https://github.com/ArunaArivazhagan/parecelless
from the root directory run "npm install "
then run "npm run build" from the root directory.
Once the build success go to theme/dist/theme.css
Actually parcel is compiling only the last https://github.com/import css in theme.less. it is not supporting two less import.
Screenshot 2022-06-01 at 11 48 02 AM
Screenshot 2022-06-01 at 11 48 19 AM
Screenshot 2022-06-01 at 11 48 30 AM

Related

React Native - How to create a correct Dependency Check / Vulnerability Report and handle it?

How to correctly create a dependency check (vulnerability report) for a react native app?
If I run "npm install" then automatically an information for "npm audit" is shown. For the following examples I've used a new created project with React Native CLI using RN 0.63.2
"npm audit" shows only 3 low vulnerabilities (node-fetch):
npm audit excerpt of output
Retire.js don't give any vulnerability (may be misconfigured, still trying to figure it out).
However, using DependencyCheck by jeremylong (https://github.com/jeremylong/DependencyCheck) it gives 132 vulnerabilities from 72 vulnerable dependencies. Excerpt:
Scan Information (show all):
dependency-check version: 6.0.1
Report Generated On: Sun, 20 Sep 2020 22:25:28 +0200
Dependencies Scanned: 15319 (11276 unique)
Vulnerable Dependencies: 72
Vulnerabilities Found: 132
Vulnerabilities Suppressed: 0
...
It looks like DependencyCheck sums up multiple analyzer reports and because of that probably finds more then the previous tools but I'm still wondering about the amount (132 vulnerabilities vs. only 3). Does "npm audit" may better be able to check if those vulnerabilities are even valid for RN? Or would I have to check all those 132 vulnerabilities manually if they apply to my React Native application and fix them (if possible)?
And with that there I've already have another question: some vulnerable dependencies come from react-native-cli. I can't find it anywhere but this should not be included in a production app since it is the commandline interpreter tools used during development, isn't it? Is there any documentation (I couldn't find any) that gives hints about which dependencies are only for dev and would not be in production?
Any help would be appreciated.
So anwering my own question here:
The tool DependencyCheck by jeremylong collected all vulnerabilities where the library names matched a string contained in the vulnerability. E.g. "#hapi/address:2.1.4" were listed by the tool but it was not in the dependency graph printed by NPM. But there was "hapijs". This occured many time and the only relevant findings were those already identified by npm with "npm audit".
So all others were simple "false-positives" but they had to be checked unfortunately one after another.
The following steps can be followed to generate a report describing all the vulnerabilities found in the project:
Download the OWASP Dependency-Check CLI tool from their official website (https://owasp.org/www-project-dependency-check/)
Extract the downloaded zip file.
Open the command prompt/terminal and navigate to the directory where the .bat and .sh files are located.
For windows, run the following command after replacing the correct directories of your project:
dependency-check.bat --project "<project_name>" --scan <folder containing 3rd party libraries> --out <folder to generate reports> --suppression <xml file containing suppressions>
For linux, run the following command after replacing the correct directories of your project:
dependency-check.sh --project "<project_name>" --scan <folder containing 3rd party libraries> --out <folder to generate reports> --suppression <xml file containing suppressions>
Sample command:
dependency-check.bat --project demo-project --scan E:/GitlabRepo/react/test-project --out E:/GitlabRepo/react/test-project/vulnerability-report
A report will be generated indicating all the relevant details of each vulnerability found in the project.

The apk rebuild by apktool can not be installed even after zipalign and sign

I need to make hundreds flavors of my app. They have different logos and names. When I use android studio's productFlavor, it always OOM, and cost very long time to build hundreds app.
So I want to make these apps by apktool. decompile, rebuild, zipalign, apksign. But I find that, the finally generated apk can not be installed.
The error is:
Failure [INSTALL_FAILED_INVALID_APK: ed to extract native libraries, res=-2]
apktool d my_app.apk decompile
change the logo and name.
apktool b decompile my_app-rebuild.apk
zipalign -v 4 my_app-rebuild.apk my_app-align.apk
apksigner sign --ks my_key.jks --ks-pass pass:my_ks_pass --key-pass pass:my_key_pass --v1-signing-enabled true --v2-signing-enabled true --out my_app_out.apk my_app-align.apk
After these works, the my_app_out.apk can not installed.
From the error you got:
Failure [INSTALL_FAILED_INVALID_APK: ed to extract native libraries, res=-2]
If set to false, then your native libraries must be page aligned and stored uncompressed in the APK.
It's either you need to set extractNativeLibs flag to true or you need to page align the apk when doing zipaligning by adding -p parameter:
-p : outfile.zip should use the same page alignment for all shared object files within infile.zip
The zipalign command should be:
zipalign -p -v 4 my_app-rebuild.apk my_app-align.apk

Wildfly leave Two Orphaned File Descriptors after uploading a file

I'm running Wildfly version 14 and version 18 (on different machines) and Primefaces. Whenever I upload a file, I get 2 orphaned fds. I've doubled checked my code and all resources are closed. I didn't have any problem running Wildfly 11, btw. I also use lsof to make sure that the opened files belong to Wildfly, and they are. Eventually, I get the Too Many Open Files error.
ls -alFtr /proc/30724/fd|grep elete
lr-x------ 1 ora ora 64 Apr 3 09:36 594 -> /PATH_TO/undertow1607766259253292434upload (deleted)
lr-x------ 1 ora ora 64 Apr 3 09:40 591 -> /PATH_TO/undertow1607766259253292434upload (deleted)
Googling the problem gave me several RedHat links, but I can't find any solution to my problem. Any ideas?
Yes if you are using PF 7.X this was a bug and fixed in PF8.0.
See: https://github.com/primefaces/primefaces/issues/5408

Problem: building my vue project takes forever

I've built a small vue project with 4 components and I want to build it to upload but it takes forever and building never completes.
I waited for 40 mins and building is not complete.
Here is a screenshot:
As was mentioned in comments building of application should finish in few seconds.
One of possible solution is to delete node_modules folder and install all deps again. It can help you.
Another possible solution it is to allocate more memory for task:
node --max_old_space_size=4096 node_modules/.bin/vue-cli-service build
This line will call node with increased size of memory (4GB) and will execute building task.
More about of how to serve and build application you can read here -
https://cli.vuejs.org/guide/cli-service.html#using-the-binary

gradle Test tasks colliding with each other

I have a gradle project with 2 Test tasks, test and test2.
When running gradle test test2 2 times both test and test2 ran again even though they should be UP-TO-DATE(when running gradle test It stays UP-TO-DATE no matter how many times I ran it).
Why is this happening?
After trying to recreate this error on another computer I found out that.
This error occurred on gradle 2, on gradle 3 It was OK.
This must have something to do with this link
What I think is happening
It seems that on gralde 2 the test results where exported to $buildDir/test-results and then the UP-TO-DATE function wouldn't work because the second Test tasks changed the output directory, which gives this directory structure:
build
test-results
binary
test/...
test2/...
TEST-MyTest1.xml
TEST-MyTest2.xml
And on gradle 3 the results are exported to $buildDir/test-results/$taskName, which gives this directory structure:
build
test-results
test
binary/...
TEST-MyTest1.xml
test2
binary/...
TEST-MyTest2.xml
P.S. If I am wrong please let me know