Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: relax dependencies #108

Closed
wants to merge 1 commit into from
Closed

Conversation

nponeccop
Copy link

This helps with #68 as now the users are free to upgrade nx within 19.x without waiting for our update.

This follows two most popular third-party nx plugins: nx-stylelint and nx-remotecache-custom.

This helps with Bielik20#68 as now the users are free to upgrade nx within 19.x without waiting for our update.

This follows two most popular third-party nx plugins: `nx-stylelint` and `nx-remotecache-custom`.
Copy link

nx-cloud bot commented Sep 5, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 28491d6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 3 targets

Sent with 💌 from NxCloud.

@Bielik20
Copy link
Owner

Bielik20 commented Sep 5, 2024

Does it? The dependencies of packages are defined in their individual package.json. I think it needs to be changed there, and it is managed by Nx's eslint plugin.

@nponeccop
Copy link
Author

nponeccop commented Sep 5, 2024

It helps with my last comment, which is a part of the problem but not its entirety (since "helps with" and not "solves"). Now 19.6 is out but I can't migrate because your strict constraints cause massive package duplication.

If you fix the forced dependency update part it won't help before something like this PR is also made.

@Bielik20
Copy link
Owner

Bielik20 commented Sep 5, 2024

Yeah, but what I am saying it does nothing. Root package.json is only used in development.

I will change it in #109 but keep an eye if after Nx update if it still is "relaxed". If I forget about it nag me 😅

@Bielik20
Copy link
Owner

Bielik20 commented Sep 5, 2024

Released

@Bielik20 Bielik20 closed this Sep 5, 2024
@nponeccop nponeccop deleted the patch-1 branch September 5, 2024 13:10
@nponeccop
Copy link
Author

nponeccop commented Sep 5, 2024

It will nag you. The right solution is to use a lockfile for library development, and update it carefully, while letting the users to fix their dependency problems by themselves.

So your old constraints were good for you as your builds didn't suddenly break due to third-party updates. But showing that on the library users is incorrect and contradicts the practice of other third-party nx plugins.

The plugins developed by nrwl pin their versions down because they are released as a whole. You should only pin your versions whenever you are ready to release with every upstream release. AFAIK no third-party plugin does that.

Upd: you already do that pinning by npm ci in https://github.com/Bielik20/nx-plugins/blob/master/.github/actions/setup/action.yml#L20 so it won't affect you unless you are careless with committing new package-locks.

@Bielik20
Copy link
Owner

Bielik20 commented Sep 5, 2024

Exactly, the change wasn't needed. So it was already with ^, I knew I handled it long time ago, so I don't think the release I have just made changed anything. And everything was correct to begin with. What may be problematic is Nx sometimes break some of their deep exports which I sometimes use.

@Bielik20
Copy link
Owner

Bielik20 commented Sep 5, 2024

Everything is always with ^ without my previous change:

async function caretDepsVersion(normalizedOptions: PublishExecutorNormalizedSchema) {
const pkgJsonPath = joinPathFragments(normalizedOptions.pkgLocation, 'package.json');
const packageJson = await readJson(pkgJsonPath);
const projectsNames = await getAllProjectsNames();
projectsNames.forEach((name) => {
if (name in (packageJson.peerDependencies || {})) {
packageJson.peerDependencies[name] = addCaret(packageJson.peerDependencies[name]);
}
if (name in (packageJson.dependencies || {})) {
packageJson.dependencies[name] = addCaret(packageJson.dependencies[name]);
}
});
await writeJson(pkgJsonPath, packageJson, { spaces: 2 });
}

So the error must be somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants