-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): rewrite core architecture
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.
- Loading branch information
1 parent
2c5cd7f
commit 6ca61cc
Showing
194 changed files
with
6,498 additions
and
4,936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
branches: | ||
- master | ||
- dev | ||
- refactor | ||
|
||
jobs: | ||
all: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// @ts-check | ||
|
||
/** @type {import("./src").RcFile} */ | ||
const config = { | ||
versionGroups: [ | ||
{ | ||
dependencies: ['@types/node'], | ||
packages: ['**'], | ||
pinVersion: '14.18.36', | ||
}, | ||
{ | ||
dependencies: ['chalk'], | ||
packages: ['**'], | ||
pinVersion: '4.1.2', | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"args": [ | ||
"${workspaceFolder}/${relativeFileDirname}/${fileBasenameNoExtension}.spec.ts" | ||
], | ||
"command": "scripts/upsert-test.sh", | ||
"group": "test", | ||
"label": "Upsert test for current file", | ||
"presentation": { | ||
"panel": "dedicated", | ||
"reveal": "silent" | ||
}, | ||
"problemMatcher": [], | ||
"type": "shell" | ||
}, | ||
{ | ||
"args": ["src", "test"], | ||
"command": "${workspaceFolder}/node_modules/.bin/jest", | ||
"group": "test", | ||
"label": "Run tests", | ||
"presentation": { | ||
"panel": "dedicated", | ||
"reveal": "always" | ||
}, | ||
"problemMatcher": [], | ||
"type": "shell" | ||
}, | ||
{ | ||
"args": ["--watch", "--no-coverage", "src", "test"], | ||
"command": "${workspaceFolder}/node_modules/.bin/jest", | ||
"group": "test", | ||
"label": "Watch tests", | ||
"presentation": { | ||
"panel": "dedicated", | ||
"reveal": "always" | ||
}, | ||
"problemMatcher": [], | ||
"type": "shell" | ||
}, | ||
{ | ||
"args": ["--watch", "--no-coverage", "${relativeFile}"], | ||
"command": "${workspaceFolder}/node_modules/.bin/jest", | ||
"group": "test", | ||
"label": "Watch tests for current .spec.ts file", | ||
"presentation": { | ||
"panel": "dedicated", | ||
"reveal": "always" | ||
}, | ||
"problemMatcher": [], | ||
"type": "shell" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,49 +10,47 @@ npm install --save-dev syncpack | |
|
||
## Documentation | ||
|
||
Full information can be found in the documentation at | ||
https://jamiemason.github.io/syncpack/. | ||
Full information can be found in the documentation at https://jamiemason.github.io/syncpack/. | ||
|
||
## Commands | ||
|
||
### [fix-mismatches](https://jamiemason.github.io/syncpack/fix-mismatches) | ||
|
||
Ensure that multiple packages requiring the same dependency define the same | ||
version, so that every package requires eg. `[email protected]`, instead of a | ||
combination of `[email protected]`, `[email protected]`, and `[email protected]`. | ||
Ensure that multiple packages requiring the same dependency define the same version, so that every | ||
package requires eg. `[email protected]`, instead of a combination of `[email protected]`, `[email protected]`, and | ||
`[email protected]`. | ||
|
||
### [format](https://jamiemason.github.io/syncpack/format) | ||
|
||
Organise package.json files according to a conventional format, where fields | ||
appear in a predictable order and nested fields are ordered alphabetically. | ||
Shorthand properties are used where available, such as the `"repository"` and | ||
`"bugs"` fields. | ||
Organise package.json files according to a conventional format, where fields appear in a predictable | ||
order and nested fields are ordered alphabetically. Shorthand properties are used where available, | ||
such as the `"repository"` and `"bugs"` fields. | ||
|
||
### [lint-semver-ranges](https://jamiemason.github.io/syncpack/lint-semver-ranges) | ||
|
||
Check whether dependency versions used within "dependencies", "devDependencies", | ||
etc follow a consistent format. | ||
Check whether dependency versions used within "dependencies", "devDependencies", etc follow a | ||
consistent format. | ||
|
||
### [list](https://jamiemason.github.io/syncpack/list) | ||
|
||
List all dependencies required by your packages. | ||
|
||
### [list-mismatches](https://jamiemason.github.io/syncpack/list-mismatches) | ||
|
||
List dependencies which are required by multiple packages, where the version is | ||
not the same across every package. | ||
List dependencies which are required by multiple packages, where the version is not the same across | ||
every package. | ||
|
||
### [set-semver-ranges](https://jamiemason.github.io/syncpack/set-semver-ranges) | ||
|
||
Ensure dependency versions used within `"dependencies"`, `"devDependencies"` etc | ||
follow a consistent format. | ||
Ensure dependency versions used within `"dependencies"`, `"devDependencies"` etc follow a consistent | ||
format. | ||
|
||
## Breaking Changes | ||
|
||
Version [9.0.0](https://github.com/JamieMason/syncpack/releases/tag/9.0.0) | ||
required some breaking API changes to add support for a new | ||
[`customTypes`](https://jamiemason.github.io/syncpack/config/custom-types) | ||
feature, but they are very simple to make. | ||
Version [9.0.0](https://github.com/JamieMason/syncpack/releases/tag/9.0.0) required some breaking | ||
API changes to add support for a new | ||
[`customTypes`](https://jamiemason.github.io/syncpack/config/custom-types) feature, but they are | ||
very simple to make. | ||
|
||
## Badges | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
filepath="$1" | ||
touch "$filepath" | ||
code "$filepath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.