@droneey/devkit-ts-syncpack 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-PRESENT Dmytro Kurovskyi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @droneey/devkit-ts-syncpack
2
+
3
+ Shared [Syncpack](https://syncpack.dev) configuration: the order of the fields in every `package.json`, the alphabetical fields, and caret ranges for the dependencies of the project. Scripts keep the order their author chose.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add -d @droneey/devkit-ts-syncpack syncpack
9
+ ```
10
+
11
+ Create `.syncpackrc.mjs` in your project root:
12
+
13
+ ```js
14
+ export { config as default } from '@droneey/devkit-ts-syncpack';
15
+ ```
16
+
17
+ A monorepo adds its own version groups on top:
18
+
19
+ ```js
20
+ import { config } from '@droneey/devkit-ts-syncpack';
21
+
22
+ export default {
23
+ ...config,
24
+ versionGroups: [
25
+ {
26
+ label: 'Workspace packages use the workspace protocol',
27
+ dependencies: ['@acme/**'],
28
+ dependencyTypes: ['dev'],
29
+ pinVersion: 'workspace:*',
30
+ },
31
+ ],
32
+ };
33
+ ```
34
+
35
+ ## Scripts
36
+
37
+ ```json
38
+ {
39
+ "scripts": {
40
+ "packages:check": "syncpack lint && syncpack format --check",
41
+ "packages:fix": "syncpack fix && syncpack format"
42
+ }
43
+ }
44
+ ```
45
+
46
+ `syncpack lint` checks versions and ranges; `syncpack format --check` checks the field order. Both run in `check`.
package/index.mjs ADDED
@@ -0,0 +1,53 @@
1
+ /** @type {import('syncpack').RcFile} */
2
+ const config = {
3
+ formatBugs: false,
4
+ formatRepository: false,
5
+ sortAz: [
6
+ 'bin',
7
+ 'contributors',
8
+ 'dependencies',
9
+ 'devDependencies',
10
+ 'keywords',
11
+ 'peerDependencies',
12
+ 'resolutions',
13
+ ],
14
+ sortFirst: [
15
+ 'name',
16
+ 'version',
17
+ 'private',
18
+ 'description',
19
+ 'keywords',
20
+ 'homepage',
21
+ 'bugs',
22
+ 'license',
23
+ 'author',
24
+ 'repository',
25
+ 'type',
26
+ 'packageManager',
27
+ 'bin',
28
+ 'main',
29
+ 'module',
30
+ 'types',
31
+ 'exports',
32
+ 'imports',
33
+ 'files',
34
+ 'scripts',
35
+ 'workspaces',
36
+ 'dependencies',
37
+ 'devDependencies',
38
+ 'peerDependencies',
39
+ 'peerDependenciesMeta',
40
+ ],
41
+ semverGroups: [
42
+ {
43
+ label: 'Use caret ranges for the dependencies of the project',
44
+ range: '^',
45
+ dependencyTypes: [
46
+ 'dev',
47
+ 'prod',
48
+ ],
49
+ },
50
+ ],
51
+ };
52
+
53
+ export { config };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@droneey/devkit-ts-syncpack",
3
+ "version": "1.10.0",
4
+ "description": "Shared Syncpack configuration: the order of the fields in package.json and the version ranges of the dependencies.",
5
+ "keywords": [
6
+ "config",
7
+ "package-json",
8
+ "shared",
9
+ "syncpack"
10
+ ],
11
+ "homepage": "https://github.com/droneey/devkit/blob/main/packages/typescript/libs/syncpack#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/droneey/devkit/issues"
14
+ },
15
+ "license": "MIT",
16
+ "author": {
17
+ "name": "Dmytro Kurovskyi",
18
+ "url": "https://kurovskyi.dev"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/droneey/devkit.git",
23
+ "directory": "packages/typescript/libs/syncpack"
24
+ },
25
+ "type": "module",
26
+ "exports": {
27
+ ".": "./index.mjs"
28
+ },
29
+ "files": [
30
+ "index.mjs"
31
+ ],
32
+ "peerDependencies": {
33
+ "syncpack": ">=15.0.0"
34
+ }
35
+ }