I have a project which uses dependency having having version same as that of the project. So I would like to change the version only in one place and write something like below this in my package.json
{
"name": "my-child-app",
"version": "1.2.3",
"description": "My Application",
"dependencies": {
"my-parent-app": %npm_package_version%
}
}
Basically the child app is always supposed to have version in sync with the parent app. So any approach where I will have to change only one line (instead of two in usual scenario) when I have to upgrade to a newer parent-app would suffice.
Note: I am using frontend-maven-plugin to build the project as child-app is a module of Java Project. parent-app is also built in a same way but they are not in the same code repository so file referencing cannot be used.
Related
I'm checking the dependencies of this Strapi Project with Next and as I'm setting up the backend directory, I review the dependencies and see:
`
"strapi": {
"uuid": "c35cad70-92f3-4df5-9408-xxxxxxxxxxxx"
},
`
Just curious whether I should update this or not according to what my professor's backend directory.
I'm stuck in a dependency bug and just trying to edit each dependency that's deprecated in the package.json
I am working in a complex project structure of bundles and plugins for karaf.
When attaching to the process, I cannot use WATCH as the project cannot be found:
Cannot evaluate because of java.lang.IllegalStateException: Project XY cannot be found..
Is it possible to determine the correct project name from the file the breakpoint is in and the maven file its contained in?
For some reason the content inside XY does not work.
This is the launch config:
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug Karaf",
"projectName" : "XY",
"request": "attach",
"hostName" : "localhost",
"port": 5005
}
]
Edit: Breakpoints and step by step debugging do work. Its strange that these two things are different.
The project name XYZ that worked for me was in the pom building the jar file under artifactId: <artifactId>XYZ</artifactId>.
Right-click on a Java file (one without a main() function) and choose "Run Java" and you'll get a prompt with a few options. This prompt will show the project name.
As you can see in this screenshot of this Ant project, sometimes the project name is unpredictable.
I am using the package teamtnt/laravel-scout-tntsearch-driver and I wish to make a very small change to one of the files within teamtnt/tntsearch which is one of the packages dependencies.
Usually I would:
Create a fork of the package.
Add the repository into my composer.json as follows:
"repositories": [
{"type": "vcs", "url": "https://github.com/user/packagefork"}
],
Require/Upgrade the package to the correct version (usually dev-master) keeping the original name spacing and it all works fine.
However, with a dependency which is not directly included in my composer.json file, this does not seem to work. Do I need to fork both the base package, and the dependency package even though I do not need to change anything within the base?
I am hoping there is a simple way to do this, without having to fork each level.
This was actually quite simple. Not too sure why it did not work originally! Instructions below for anyone wondering:
Fork the package (i.e. GitHub)
Add the repo from your username, to your projects main composer.json as follows:
"repositories": [
{"type": "vcs", "url": "https://github.com/youruser/tntsearch"}
],
Edit the composer.json file within the new fork you created in step 1 (youruser/tntsearch) and create/add to the extras key:
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
}
This effectively allows you to install your dev-master version, but allow other packages where this is a dependency to request the 2.0 version (in this case). You do need to be careful in this case that you have forked the correct version and any upgrades are correctly managed later down the line, or things may break!
More info on composer alias here
Require/Upgrade the package using original package namespace, at the dev-master version.
composer require teamtnt/tntsearch:dev-master
The name spacing and package versions will remain the same as before your fork, but the edits from your fork will be pulled into your project instead.
I'm using a library that has supports another library with a wide range of versions as a peer dependency. Unfortunately, one of the child projects of the workspace pulls in a version different from the child project that uses the library. As a result, they end up requiring different versions.
I'm trying to use selective resolutions to handle this and force it to use the correct version (https://yarnpkg.com/lang/en/docs/selective-version-resolutions/) but I'm not having any luck.
It's possible I'm misunderstanding how to utilize these.
My current setup is I have a root workspace with these children inside:
Project A package.json (which is the source of the issue):
dependencies: {
backbone.marionette: '2.4.1'
}
Project B package.json (which is the application having issues):
dependencies: {
backbone.marionette: '1.8.8',
#organization/UILibrary: '0.0.22'
}
The #organization/UILibrary (which is outside the workspace) package.json looks like so:
peerDependencies: {
backbone.marionette: ">= 1 < 3"
}
Unfortunately, even though Project B has no dependency on Project A, when #organization/UILibrary is pulled into Project B it gets backbone.marionette version 2.4.1 for it's requires (whereas the requires local to Project B get 1.8.8).
My attempt to use resolutions is updating Project B package.json to this:
dependencies: {
backbone.marionette: '1.8.8',
#organization/UILibrary: '0.0.22'
},
{
"resolutions": {
"#organization/**/backbone.marionette": "1.8.8",
"#organization/backbone.marionette": "1.8.8",
"#organization/UILibrary/backbone.marionette: "1.8.8",
"#organization/UILibrary/**/backbone.marionette: '1.8.8"
}
Any ideas? Based on some digging in yarn's issues and some of their selective dependency PRs (see https://github.com/yarnpkg/yarn/issues/4874) I believe it may be due to the fact that the UILibrary is scoped (has a slash).
I ran into something similar recently; what I found is that resolutions only works in the root package.json. Try moving the resolutions there instead of in Package B's.
Using the latest version of Nativescript I've created a plugin as per the documentation and after running tns plugin add ../nativescript-keychain I get the message Successfully installed plugin nativescript-keychain.
I can also see that it's been added to the node_modules directory of my app but require("nativescript-keychain") doesn't work as I get the error Cannot find module 'nativescript-keychain'
My plugin package.json looks like
{
"name": "nativescript-keychain",
"version": "0.0.1",
"nativescript": {
"platforms": {
"ios": "2.2.1"
}
}
}
There are several reasons why this might occur; it would be helpful if you provided a repo to see all the code.
package.json doesn't have a link to the source, typically you have a main: "somefile" key.
Did you do tns run ios --emulator after you installed the plugin, you have to rebuild the app before it will take effect, plugins can't be synced via livesync...
Is the code TypeScript or JavaScript, if it is TypeScript it needs to be transpiled to JS before you can add it to your demo application. TNS will NOT compile any TS code in the plugins. Plugins have to ship with the final JS code.
You need typings for TS to use the auto-complete and not throw warnings about what methods are available.