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

feat(cli): add lint and fix commands #3

Open
JamieMason opened this issue Feb 5, 2018 · 4 comments
Open

feat(cli): add lint and fix commands #3

JamieMason opened this issue Feb 5, 2018 · 4 comments

Comments

@JamieMason
Copy link
Owner

JamieMason commented Feb 5, 2018

Based on some configuration and a glob for package.json files, exits with 0 or 1 based on whether the files match the configuration. Could be used in CI and/or hooks.

EDIT: create a lint command and a fix command which each combine the existing commands which either list issues or fix them.

@JamieMason JamieMason changed the title Add "validate" command feat(cli): add validate command Nov 2, 2018
@JamieMason JamieMason changed the title feat(cli): add validate command feat: add validate command Aug 6, 2021
@LudovicSterlin
Copy link
Contributor

As a workaround, waiting for this feature, I use the command below in my CI:

npx syncpack@$(node -pe "require('./package').devDependencies.syncpack") list-mismatches

Which exit with a 0 code when there are no mismatches and 1when there

Posting it here in case anyone is searching to use syncpack in his CI pipelines.

@JamieMason JamieMason changed the title feat: add validate command feat: add lint and fix commands Feb 18, 2023
@JamieMason JamieMason changed the title feat: add lint and fix commands feat(cli): add lint and fix commands May 28, 2023
JamieMason added a commit that referenced this issue May 28, 2023
Closes #124

When using the `workspace` dependency type, packages installing that dependency
no longer have to exactly match the `version` property of the package.json of
origin.

If the version or version range used by every dependent package matches, it is
considered valid.

Closes #130

JavaScript config files now have support for TypeScript IntelliSense.

https://jamiemason.github.io/syncpack/config-file#typescript-intellisense

Closes #114
Refs #109
Refs #125

Unsupported versions can now at least be managed via `pinVersion`, where
previously anything which was not valid semver would be ignored.

Refs #111
Refs #132

TypeScript IntelliSense support helps catch invalid config, but more work is
needed to display useful error messages at runtime.

Refs #48
Refs #3

Syncpack's internals are now better organised, so providing a Node.js API and
general lint and fix CLI commands are now closer to being released.

BREAKING CHANGES:

Although they are still not auto-fixable, unsupported versions which were
previously ignored are now acknowledged, which may introduce mismatches which
previously would have been considered valid.

This release was also a huge rewrite of Syncpack's internals and, while there
is a large amount of tests, some scenarios may have been missed.

If you run into any problems, please create an issue.
JamieMason added a commit that referenced this issue May 28, 2023
Closes #124

When using the `workspace` dependency type, packages installing that dependency no longer have to exactly match the `version` property of the package.json of origin.

If the version or version range used by every dependent package matches, it is considered valid.

Closes #130
Closes #131

JavaScript config files now have support for TypeScript IntelliSense.

https://jamiemason.github.io/syncpack/config-file#typescript-intellisense

Closes #114
Refs #109
Refs #125

Unsupported versions can now at least be managed via `pinVersion`, where previously anything which was not valid semver would be ignored.

Refs #111
Refs #132

TypeScript IntelliSense support helps catch invalid config, but more work is needed to display useful error messages at runtime.

Refs #48
Refs #3

Syncpack's internals are now better organised, so providing a Node.js API and general lint and fix CLI commands are now closer to being released.

BREAKING CHANGES:

- `fix-mismatches` will now exit with a status code of 1 if there are mismatches among unsupported versions which syncpack cannot auto-fix.
- Although they are still not auto-fixable, unsupported versions which were previously ignored are now acknowledged, which may introduce mismatches which previously would have been considered valid.
- This release was also a huge rewrite of Syncpack's internals and, while there is a large amount of tests, some scenarios may have been missed.
- If you run into any problems, please create an issue.
JamieMason added a commit that referenced this issue May 28, 2023
### #124

When using the `workspace` dependency type, packages installing that dependency no longer have to exactly match the `version` property of the package.json of origin.

Closes #124

If the version or version range used by every dependent package matches, it is considered valid.

### #130, #131

JavaScript config files now have support for TypeScript IntelliSense.

Closes #130
Closes #131

https://jamiemason.github.io/syncpack/config-file#typescript-intellisense

### #109, #114, #125

Unsupported versions can now at least be managed via `pinVersion`, where previously anything which was not valid semver would be ignored.

Closes #114

### #111, #132

TypeScript IntelliSense support helps catch invalid config, but more work is needed to display useful error messages at runtime.

### #48, #3

Syncpack's internals are now better organised, so providing a Node.js API and general lint and fix CLI commands are now closer to being released.

BREAKING CHANGE:

- `fix-mismatches` will now exit with a status code of 1 if there are mismatches among unsupported versions which syncpack cannot auto-fix.
- Although they are still not auto-fixable, unsupported versions which were previously ignored are now acknowledged, which may introduce mismatches which previously would have been considered valid.
- This release was also a huge rewrite of Syncpack's internals and, while there is a large amount of tests, some scenarios may have been missed.
- If you run into any problems, please create an issue.
JamieMason added a commit that referenced this issue May 29, 2023
JamieMason added a commit that referenced this issue May 29, 2023
@JamieMason
Copy link
Owner Author

syncpack lint added in 10.1.0. A fix command will follow at a later date.

/cc @abelmokadem, @LcTwisk, @amitdahan, @joaopedrodcf, @rpeach, @LudovicSterlin, @gogoout (👍🏻'd this issue)

@joaopedrodcf
Copy link

Awesome feature 🥇

JamieMason added a commit that referenced this issue Dec 30, 2023
@JamieMason
Copy link
Owner Author

  • syncpack lint is finished in 12.3.0 as it lints versions, ranges, and now formatting.
  • syncpack fix shouldn't be too big a job now.

/cc @amitdahan, @joaopedrodcf, @LudovicSterlin, @abelmokadem, @danielpza, @LcTwisk, @rpeach, @gogoout, and @dbjorge (+1'd or referenced this issue).

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

No branches or pull requests

3 participants