Ivy: How to set cache policy for SNAPSHOT dependencies? - ivy

I'm using Ivy Ant and would like to create a policy such that the build checks for the most recent update to a dependency on every build. This is because we're developing in partnership and want to immediately see changes pushed up to the Nexus server.
In Ant I'm doing...
<ivy:cachefileset organisation="com.FOO.storage" conf="default" module="yoda-ui"
revision="0.1.8-SNAPSHOT" setid="ac" inline="true"/>
In ivy-settings.xml I'm trying...
<ivysettings>
<settings defaultResolver="XXX"/>
....
<caches>
<cache name="mycache" basedir="c:/tmp">
<ttl organisation="com.FOO.storage" module="yoda-ui" duration="0ms"/>
</cache>
</caches>
</ivysettings>
However, it still appears to not be checking each time
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 2 | 0 | 0 | 0 || 2 | 0 |
---------------------------------------------------------------------
I believe this is telling me that its not checking the server each time.
So how do I force Ivy to check the server for updates on every build for this particular module?

You haven't listed your complete ivy settings file. I suspect you're not using the ibilio resolver:
<ibiblio name="mavenrepo" m2compatible="true" root="https://hostname/path/to/repo"/>
No need for special cache configuration,
when you enable the m2compatible flag which understands how to download snapshots properly.
See the following answer for more details:
What's wrong with this Ivy changingPattern / SNAPSHOT configuration?

Related

How to use react-native-qrcode-svg for react-native-web?

i want to use the package react-native-qrcode-svg for my react native web project, but hit this error:
Compiled with problems:X
ERROR in ./node_modules/react-native-qrcode-svg/src/index.js 29:4
Module parse failed: Unexpected token (29:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| return (
<G x={logoPosition} y={logoPosition}>
|
|
I tried installing the react-native-svg-web and managed to used .svg file only, it didn't work for this package.

Docusaurus error during building the project

First of all let me say that I'm new of Docusaurus and I'm using version 2.
I was building my documentation project and I have got the following error:
Docusaurus Node/SSR could not render static page with path=/docs/My_MDX_Page because of error: useBaseUrl is not defined
I'm using a MDX page to get the baseURL to retrieve static contents.
The MDX page:
---
title: title
hide_title: true
sidebar_label: item
---
import useBaseUrl from '#docusaurus/useBaseUrl';
## Section
| Name | image |
| :--- | :--- |
| YL_GN3 | <img src={useBaseUrl('img/YL_GN3.png')} /> |
I think I'm doing something wrong even if executing without building it works (by npm start).
npm install was executed.
Here is the directory structure of project:
+ .docusaurus
+ build
+ docs
+ node_modules
+ src
+ static
+ versioned_docs
+ versioned_sidebars
babel.config.js
docusaurus.config.js
package-lock.json
package.json
README.md
sidebars.js
versions.json
UPDATE
For reasons that I don't know, it has started working. I have changed docusaurs config, adding the baseUrl different from '/' and 'index.js' in order to have the docs as landing page

Using Vue CLI 3 on XAMPP

A little background..
As mentioned before in https://forum.vuejs.org/t/how-to-make-webpack-vue-work-on-xampp/33808. And it works when I put my Vue project directly in htdocs like this.
htdocs/
| - css/
| - js/
| etc..
However I'm using it differently, here's my current file structure in the htdocs.
htdocs/
| - project1/
| | - css/
| | - some other stuff for project1
| - project2/
| | - css/
| | - some other stuff for project2
| - vue-project/ (Where I wanted my Vue went to)
| | - css/
| | - stuff..
The error I get when I put dist/ of my vue project directly to htdocs/vue-project is 404, because they directly went back to the root file (root is htdocs/), in which it doesn't find the required file to launch Vue Project!
What I wanted
Anything that can launch the project in htdocs/vue-project/. Would accept any answer configuring either settings in the Vue/Webpack OR from XAMPP itself. If you need additional information please do ask in the comment section.
And if it turns out there are no other way, then I would accept answers involving XAMPP configuration on how to start a server in a different directories. Like start a server in htdocs, and other-file would be great as well.
For Vue CLI before 3.x
Try changing assetsPublicPath under build object in config/index.js. Then append your folder name there. Similiar issue that might help https://forum.vuejs.org/t/vue-js-webpack-deployment-for-xaamp-testing/28970
And if vue-router used then add ROUTER_BASE.
https://router.vuejs.org/en/api/options.html#base
For Vue CLI 3
Create vue.config.js inside your vue-projects
Inside it simply add the following
module.exports = {
publicPath: "/{path-to-your-vue-project}"
}
For more information please refer to this docs https://cli.vuejs.org/config/#publicpath

How to use pdfjs with aurelia-cli

Has anyone got pdfjs (https://github.com/mozilla/pdf.js) working with the Aurelia cli?
I'm getting nowhere fast with getting it up and running.
I followed the docs here (http://aurelia.io/docs/build-systems/aurelia-cli#adding-client-libraries-to-your-project) and guessed that main needed to be set to webpack, but the paths in that file seem to be interpreted incorrectly.
------- File not found or not accessible ------
| Location: /home/ubuntu/workspace/public/pdfjs-dist/build/pdf.js
| Requested by: /home/ubuntu/workspace/public/src/modules/admin/admin.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
------- File not found or not accessible ------
| Location: /home/ubuntu/workspace/public/src/worker-loader.js
| Requested by: /home/ubuntu/workspace/public/src/modules/admin/admin.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package

Why npm installs my github repo multiple times and does not do it only once at the top of the tree?

I have a couple of private github repos, and a simplified dependency tree looks something like this.
A
+-B
| +-D
| +-lodash
|
+-C
| +-D
| +-lodash
|
+-D
+-lodash
My private github repo D is installed by npm as many times as it is used and lodash is installed only once in the top of the tree.
It is the same version of D and same version of lodash in every package.
So why D is treated differently?
Is there a way to make npm treat D the same way it treats lodash?
As Vasil Dininski mentioned, this is a npm bug.
For now a possible workaround is to use force-dedupe-git-modules