@common-stack/common-tools 8.2.4-alpha.7
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 +34 -0
- package/README.md +186 -0
- package/bin/common-tools.js +26 -0
- package/bin/generate-resolutions.js +22 -0
- package/bin/sort-package-json.js +23 -0
- package/bin/update-dependencies.js +23 -0
- package/bin/update-dependency-version.js +22 -0
- package/lib/cli/generateResolutions.d.ts +25 -0
- package/lib/cli/generateResolutions.d.ts.map +1 -0
- package/lib/cli/generateResolutions.js +75 -0
- package/lib/cli/generateResolutions.js.map +1 -0
- package/lib/cli/sortPackageJson.d.ts +42 -0
- package/lib/cli/sortPackageJson.d.ts.map +1 -0
- package/lib/cli/sortPackageJson.js +163 -0
- package/lib/cli/sortPackageJson.js.map +1 -0
- package/lib/cli/updateDependencies.d.ts +27 -0
- package/lib/cli/updateDependencies.d.ts.map +1 -0
- package/lib/cli/updateDependencies.js +85 -0
- package/lib/cli/updateDependencies.js.map +1 -0
- package/lib/cli/updateDependencyVersion.d.ts +39 -0
- package/lib/cli/updateDependencyVersion.d.ts.map +1 -0
- package/lib/cli/updateDependencyVersion.js +170 -0
- package/lib/cli/updateDependencyVersion.js.map +1 -0
- package/lib/config/index.d.ts +6 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/loader.d.ts +30 -0
- package/lib/config/loader.d.ts.map +1 -0
- package/lib/config/loader.js +109 -0
- package/lib/config/loader.js.map +1 -0
- package/lib/config/types.d.ts +82 -0
- package/lib/config/types.d.ts.map +1 -0
- package/lib/config/types.js +43 -0
- package/lib/config/types.js.map +1 -0
- package/lib/index.d.ts +376 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/dependencies.d.ts +47 -0
- package/lib/utils/dependencies.d.ts.map +1 -0
- package/lib/utils/dependencies.js +96 -0
- package/lib/utils/dependencies.js.map +1 -0
- package/lib/utils/monorepo.d.ts +29 -0
- package/lib/utils/monorepo.d.ts.map +1 -0
- package/lib/utils/monorepo.js +104 -0
- package/lib/utils/monorepo.js.map +1 -0
- package/lib/utils/packageJson.d.ts +53 -0
- package/lib/utils/packageJson.d.ts.map +1 -0
- package/lib/utils/packageJson.js +76 -0
- package/lib/utils/packageJson.js.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
PROPRIETARY LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-2025 CDMBase LLC. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are the
|
|
6
|
+
proprietary and confidential information of CDMBase LLC ("Confidential Information").
|
|
7
|
+
|
|
8
|
+
NOTICE: All information contained herein is, and remains the property of
|
|
9
|
+
CDMBase LLC. The intellectual and technical concepts contained herein are
|
|
10
|
+
proprietary to CDMBase LLC and may be covered by U.S. and Foreign Patents,
|
|
11
|
+
patents in process, and are protected by trade secret or copyright law.
|
|
12
|
+
|
|
13
|
+
Dissemination of this information or reproduction of this material is strictly
|
|
14
|
+
forbidden unless prior written permission is obtained from CDMBase LLC.
|
|
15
|
+
|
|
16
|
+
NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL
|
|
17
|
+
PROPERTY RIGHTS ARE GRANTED BY THIS DOCUMENT.
|
|
18
|
+
|
|
19
|
+
RESTRICTIONS:
|
|
20
|
+
1. You may NOT use, copy, modify, merge, publish, distribute, sublicense,
|
|
21
|
+
and/or sell copies of the Software without explicit written permission
|
|
22
|
+
from CDMBase LLC.
|
|
23
|
+
2. You may NOT reverse engineer, decompile, or disassemble the Software.
|
|
24
|
+
3. You may NOT remove or alter any proprietary notices or labels on the Software.
|
|
25
|
+
4. The Software is licensed, not sold.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
30
|
+
CDMBASE LLC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
31
|
+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
32
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
33
|
+
|
|
34
|
+
For licensing inquiries, please contact: legal@cdmbase.com
|
package/README.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# @common-stack/common-tools
|
|
2
|
+
|
|
3
|
+
Common CLI tools for monorepo management. All tools read their configuration from `cdecode-config.json` in your repository root.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add -D @common-stack/common-tools
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Available Commands
|
|
12
|
+
|
|
13
|
+
### generate-resolutions
|
|
14
|
+
|
|
15
|
+
Generate yarn resolutions for servers to prevent version conflicts in monorepo setups.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Process backend servers (default)
|
|
19
|
+
npx generate-resolutions
|
|
20
|
+
|
|
21
|
+
# Process all server categories
|
|
22
|
+
npx generate-resolutions --category all
|
|
23
|
+
|
|
24
|
+
# Preview without writing
|
|
25
|
+
npx generate-resolutions --dry-run
|
|
26
|
+
|
|
27
|
+
# Add additional packages to track
|
|
28
|
+
npx generate-resolutions --packages "@aws-sdk/client-dynamodb,lodash"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Configuration in `cdecode-config.json`:**
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"updateDependencies": {
|
|
36
|
+
"packagePaths": {
|
|
37
|
+
"backend": ["servers/backend-server/package.json"],
|
|
38
|
+
"frontend": ["servers/frontend-server/package.json"],
|
|
39
|
+
"mobile": ["portable-devices/mobile/package.json"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### update-dependencies
|
|
46
|
+
|
|
47
|
+
Update dependencies from @common-stack packages across your servers.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Run full update workflow
|
|
51
|
+
npx update-dependencies
|
|
52
|
+
|
|
53
|
+
# Skip ncu step
|
|
54
|
+
npx update-dependencies --skip-ncu
|
|
55
|
+
|
|
56
|
+
# Custom packages to check
|
|
57
|
+
npx update-dependencies --packages "@common-stack/server-stack"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Configuration in `cdecode-config.json`:**
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"updateDependencies": {
|
|
65
|
+
"packagesToCheck": ["@common-stack/server-stack", "@common-stack/frontend-stack-react"],
|
|
66
|
+
"packagePaths": {
|
|
67
|
+
"backend": ["servers/backend-server/package.json"],
|
|
68
|
+
"frontend": ["servers/frontend-server/package.json"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### sort-package-json
|
|
75
|
+
|
|
76
|
+
Sort all package.json files in the monorepo for consistent formatting.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Sort all package.json files
|
|
80
|
+
npx sort-package-json
|
|
81
|
+
|
|
82
|
+
# Preview changes
|
|
83
|
+
npx sort-package-json --dry-run
|
|
84
|
+
|
|
85
|
+
# Custom directories
|
|
86
|
+
npx sort-package-json --directories "packages,servers"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Configuration in `cdecode-config.json`:**
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"sortPackageJson": {
|
|
94
|
+
"directories": [".", "packages", "packages-modules", "servers"],
|
|
95
|
+
"skipNodeModules": true
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### update-dependency-version
|
|
101
|
+
|
|
102
|
+
Update internal monorepo package versions and resolve `link:` references.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Update all versions
|
|
106
|
+
npx update-dependency-version
|
|
107
|
+
|
|
108
|
+
# Preview changes
|
|
109
|
+
npx update-dependency-version --dry-run
|
|
110
|
+
|
|
111
|
+
# Show commit command after update
|
|
112
|
+
npx update-dependency-version --commit
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Configuration in `cdecode-config.json`:**
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"updateDependencyVersion": {
|
|
120
|
+
"roots": ["servers", "portable-devices", "packages", "packages-modules"],
|
|
121
|
+
"ignorePattern": "**/node_modules/**",
|
|
122
|
+
"jsonSpacing": 4,
|
|
123
|
+
"addEndNewLine": true,
|
|
124
|
+
"commitMessage": "Updated packages to use correct versions"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Using the Main CLI
|
|
130
|
+
|
|
131
|
+
You can also use all commands through the main `common-tools` CLI:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npx common-tools generate-resolutions --help
|
|
135
|
+
npx common-tools update-dependencies --help
|
|
136
|
+
npx common-tools sort-package-json --help
|
|
137
|
+
npx common-tools update-dependency-version --help
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Adding to package.json Scripts
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"scripts": {
|
|
145
|
+
"generate-resolutions": "generate-resolutions",
|
|
146
|
+
"generate-resolutions:all": "generate-resolutions --category all",
|
|
147
|
+
"generate-resolutions:dry": "generate-resolutions --dry-run",
|
|
148
|
+
"update-deps": "update-dependencies",
|
|
149
|
+
"sort-packages": "sort-package-json",
|
|
150
|
+
"update-versions": "update-dependency-version"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Programmatic Usage
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
import {
|
|
159
|
+
generateResolutionsFromCDecodeConfig,
|
|
160
|
+
loadConfigWithDefaults,
|
|
161
|
+
updateDependencyVersions,
|
|
162
|
+
sortPackageJsonFile,
|
|
163
|
+
} from '@common-stack/common-tools';
|
|
164
|
+
|
|
165
|
+
// Load config from cdecode-config.json
|
|
166
|
+
const { config, repoRoot } = loadConfigWithDefaults();
|
|
167
|
+
|
|
168
|
+
// Generate resolutions
|
|
169
|
+
const results = generateResolutionsFromCDecodeConfig(repoRoot, {
|
|
170
|
+
category: 'backend',
|
|
171
|
+
dryRun: false,
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Update versions
|
|
175
|
+
const modifiedFiles = await updateDependencyVersions(repoRoot, {
|
|
176
|
+
dryRun: false,
|
|
177
|
+
config: config.updateDependencyVersion,
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// Sort a single package.json
|
|
181
|
+
await sortPackageJsonFile('/path/to/package.json');
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
UNLICENSED - CDMBase LLC
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Main CLI entry point for common-tools
|
|
4
|
+
*
|
|
5
|
+
* Provides access to all tools in a single command:
|
|
6
|
+
* common-tools <command> [options]
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import { createGenerateResolutionsCommand } from '../lib/cli/generateResolutions.js';
|
|
11
|
+
import { createUpdateDependenciesCommand } from '../lib/cli/updateDependencies.js';
|
|
12
|
+
import { createSortPackageJsonCommand } from '../lib/cli/sortPackageJson.js';
|
|
13
|
+
import { createUpdateDependencyVersionCommand } from '../lib/cli/updateDependencyVersion.js';
|
|
14
|
+
|
|
15
|
+
const program = new Command();
|
|
16
|
+
|
|
17
|
+
program.name('common-tools').description('Common CLI tools for monorepo management').version('8.2.4-alpha.5');
|
|
18
|
+
|
|
19
|
+
// Add all subcommands
|
|
20
|
+
program.addCommand(createGenerateResolutionsCommand());
|
|
21
|
+
program.addCommand(createUpdateDependenciesCommand());
|
|
22
|
+
program.addCommand(createSortPackageJsonCommand());
|
|
23
|
+
program.addCommand(createUpdateDependencyVersionCommand());
|
|
24
|
+
|
|
25
|
+
// Parse and execute
|
|
26
|
+
program.parse();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Standalone CLI for generate-resolutions
|
|
4
|
+
*
|
|
5
|
+
* Generate yarn resolutions for servers based on cdecode-config.json
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* generate-resolutions [options]
|
|
9
|
+
*
|
|
10
|
+
* Options:
|
|
11
|
+
* -c, --category <type> Category: backend, frontend, mobile, all (default: backend)
|
|
12
|
+
* --dry-run Preview changes without writing
|
|
13
|
+
* -p, --packages <list> Additional packages to track (comma-separated)
|
|
14
|
+
* -r, --root <path> Repository root path (auto-detected)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { runGenerateResolutionsCLI } from '../lib/cli/generateResolutions.js';
|
|
18
|
+
|
|
19
|
+
runGenerateResolutionsCLI().catch((error) => {
|
|
20
|
+
console.error('Error:', error.message);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Standalone CLI for sort-package-json
|
|
4
|
+
*
|
|
5
|
+
* Sort package.json files in the monorepo
|
|
6
|
+
* Reads configuration from cdecode-config.json
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* sort-package-json [options]
|
|
10
|
+
*
|
|
11
|
+
* Options:
|
|
12
|
+
* -r, --root <path> Repository root path (auto-detected)
|
|
13
|
+
* -d, --directories <list> Directories to process (comma-separated)
|
|
14
|
+
* --no-recursive Do not process subdirectories
|
|
15
|
+
* --dry-run Preview changes without writing
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { runSortPackageJsonCLI } from '../lib/cli/sortPackageJson.js';
|
|
19
|
+
|
|
20
|
+
runSortPackageJsonCLI().catch((error) => {
|
|
21
|
+
console.error('Error:', error.message);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Standalone CLI for update-dependencies
|
|
4
|
+
*
|
|
5
|
+
* Update dependencies from @common-stack packages
|
|
6
|
+
* Reads configuration from cdecode-config.json
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* update-dependencies [options]
|
|
10
|
+
*
|
|
11
|
+
* Options:
|
|
12
|
+
* -r, --root <path> Repository root path (auto-detected)
|
|
13
|
+
* -p, --packages <list> Packages to check (comma-separated)
|
|
14
|
+
* --skip-ncu Skip npm-check-updates step
|
|
15
|
+
* --skip-yarn Skip yarn install step
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { runUpdateDependenciesCLI } from '../lib/cli/updateDependencies.js';
|
|
19
|
+
|
|
20
|
+
runUpdateDependenciesCLI().catch((error) => {
|
|
21
|
+
console.error('Error:', error.message);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Standalone CLI for update-dependency-version
|
|
4
|
+
*
|
|
5
|
+
* Update dependency versions across monorepo packages
|
|
6
|
+
* Reads configuration from cdecode-config.json
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* update-dependency-version [options]
|
|
10
|
+
*
|
|
11
|
+
* Options:
|
|
12
|
+
* -r, --root <path> Repository root path (auto-detected)
|
|
13
|
+
* --commit Commit changes after updating
|
|
14
|
+
* --dry-run Preview changes without writing
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { runUpdateDependencyVersionCLI } from '../lib/cli/updateDependencyVersion.js';
|
|
18
|
+
|
|
19
|
+
runUpdateDependencyVersionCLI().catch((error) => {
|
|
20
|
+
console.error('Error:', error.message);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI for generating package resolutions
|
|
3
|
+
*
|
|
4
|
+
* Reads configuration from cdecode-config.json:
|
|
5
|
+
* - updateDependencies.packagePaths: Server package.json paths by category
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
export interface GenerateResolutionsOptions {
|
|
9
|
+
category: 'backend' | 'frontend' | 'mobile' | 'all';
|
|
10
|
+
dryRun: boolean;
|
|
11
|
+
packages: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates the generate-resolutions command
|
|
15
|
+
*/
|
|
16
|
+
export declare function createGenerateResolutionsCommand(): Command;
|
|
17
|
+
/**
|
|
18
|
+
* Runs the resolution generation process
|
|
19
|
+
*/
|
|
20
|
+
export declare function runGenerateResolutions(repoRoot: string, options: GenerateResolutionsOptions): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Standalone CLI entry point
|
|
23
|
+
*/
|
|
24
|
+
export declare function runGenerateResolutionsCLI(args?: string[]): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=generateResolutions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateResolutions.d.ts","sourceRoot":"","sources":["../../src/cli/generateResolutions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,MAAM,WAAW,0BAA0B;IACvC,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpD,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAoC1D;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,0BAA0B,GACpC,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG5F"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { generateResolutionsFromCDecodeConfig } from '@common-stack/rollup-vite-utils';
|
|
3
|
+
import { loadConfigWithDefaults } from '../config/loader.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CLI for generating package resolutions
|
|
7
|
+
*
|
|
8
|
+
* Reads configuration from cdecode-config.json:
|
|
9
|
+
* - updateDependencies.packagePaths: Server package.json paths by category
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Creates the generate-resolutions command
|
|
13
|
+
*/
|
|
14
|
+
function createGenerateResolutionsCommand() {
|
|
15
|
+
const command = new Command('generate-resolutions')
|
|
16
|
+
.description('Generate yarn resolutions for servers based on cdecode-config.json')
|
|
17
|
+
.option('-c, --category <type>', 'Category to process: backend, frontend, mobile, all', 'backend')
|
|
18
|
+
.option('--dry-run', 'Preview changes without writing', false)
|
|
19
|
+
.option('-p, --packages <list>', 'Additional packages to track (comma-separated)', (val) => val.split(',').map((p) => p.trim()), [])
|
|
20
|
+
.option('-r, --root <path>', 'Repository root path (auto-detected from cdecode-config.json)')
|
|
21
|
+
.action(async (options) => {
|
|
22
|
+
// Auto-detect repo root from cdecode-config.json if not specified
|
|
23
|
+
let repoRoot = options.root;
|
|
24
|
+
if (!repoRoot) {
|
|
25
|
+
try {
|
|
26
|
+
const { repoRoot: detectedRoot } = loadConfigWithDefaults();
|
|
27
|
+
repoRoot = detectedRoot;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
repoRoot = process.cwd();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
await runGenerateResolutions(repoRoot, {
|
|
34
|
+
category: options.category,
|
|
35
|
+
dryRun: options.dryRun,
|
|
36
|
+
packages: options.packages,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return command;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Runs the resolution generation process
|
|
43
|
+
*/
|
|
44
|
+
async function runGenerateResolutions(repoRoot, options) {
|
|
45
|
+
const { category, dryRun, packages: additionalPackages } = options;
|
|
46
|
+
console.log(`\nš Repo root: ${repoRoot}`);
|
|
47
|
+
console.log(`š Processing ${category} servers from cdecode-config.json`);
|
|
48
|
+
if (dryRun) {
|
|
49
|
+
console.log('š Dry run mode - no files will be modified\n');
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const results = generateResolutionsFromCDecodeConfig(repoRoot, {
|
|
53
|
+
category,
|
|
54
|
+
dryRun,
|
|
55
|
+
additionalConflictPackages: additionalPackages,
|
|
56
|
+
});
|
|
57
|
+
if (results.size === 0) {
|
|
58
|
+
console.log('\nā ļø No servers were processed. Check your cdecode-config.json');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error('ā Error:', error.message);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Standalone CLI entry point
|
|
68
|
+
*/
|
|
69
|
+
async function runGenerateResolutionsCLI(args = process.argv) {
|
|
70
|
+
const program = createGenerateResolutionsCommand();
|
|
71
|
+
await program.parseAsync(args);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { createGenerateResolutionsCommand, runGenerateResolutions, runGenerateResolutionsCLI };
|
|
75
|
+
//# sourceMappingURL=generateResolutions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateResolutions.js","sources":["../../src/cli/generateResolutions.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAaH;;AAEG;SACa,gCAAgC,GAAA;AAC5C,IAAA,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB;SAC7C,WAAW,CAAC,oEAAoE;AAChF,SAAA,MAAM,CACH,uBAAuB,EACvB,qDAAqD,EACrD,SAAS;AAEZ,SAAA,MAAM,CAAC,WAAW,EAAE,iCAAiC,EAAE,KAAK;AAC5D,SAAA,MAAM,CACH,uBAAuB,EACvB,gDAAgD,EAChD,CAAC,GAAW,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,EACpD,EAAE;AAEL,SAAA,MAAM,CAAC,mBAAmB,EAAE,+DAA+D;AAC3F,SAAA,MAAM,CAAC,OAAO,OAAO,KAAI;;AAEtB,QAAA,IAAI,QAAQ,GAAG,OAAO,CAAC,IAAI;QAC3B,IAAI,CAAC,QAAQ,EAAE;AACX,YAAA,IAAI;gBACA,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,sBAAsB,EAAE;gBAC3D,QAAQ,GAAG,YAAY;YAC3B;AAAE,YAAA,MAAM;AACJ,gBAAA,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;YAC5B;QACJ;QAEA,MAAM,sBAAsB,CAAC,QAAQ,EAAE;YACnC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAC7B,SAAA,CAAC;AACN,IAAA,CAAC,CAAC;AAEN,IAAA,OAAO,OAAO;AAClB;AAEA;;AAEG;AACI,eAAe,sBAAsB,CACxC,QAAgB,EAChB,OAAmC,EAAA;IAEnC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,OAAO;AAElE,IAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,QAAQ,CAAA,CAAE,CAAC;AAC1C,IAAA,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,CAAA,iCAAA,CAAmC,CAAC;IAEzE,IAAI,MAAM,EAAE;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC;IAChE;AAEA,IAAA,IAAI;AACA,QAAA,MAAM,OAAO,GAAG,oCAAoC,CAAC,QAAQ,EAAE;YAC3D,QAAQ;YACR,MAAM;AACN,YAAA,0BAA0B,EAAE,kBAAkB;AACjD,SAAA,CAAC;AAEF,QAAA,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC,EAAE;AACpB,YAAA,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC;QAClF;IACJ;IAAE,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,UAAU,EAAG,KAAe,CAAC,OAAO,CAAC;AACnD,QAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACnB;AACJ;AAEA;;AAEG;AACI,eAAe,yBAAyB,CAAC,IAAA,GAAiB,OAAO,CAAC,IAAI,EAAA;AACzE,IAAA,MAAM,OAAO,GAAG,gCAAgC,EAAE;AAClD,IAAA,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;AAClC;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI for sorting package.json files
|
|
3
|
+
*
|
|
4
|
+
* Reads configuration from cdecode-config.json:
|
|
5
|
+
* - sortPackageJson.directories: Directories to process
|
|
6
|
+
* - sortPackageJson.skipNodeModules: Skip node_modules directories
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
export interface SortPackageJsonOptions {
|
|
10
|
+
directories?: string[];
|
|
11
|
+
recursive?: boolean;
|
|
12
|
+
dryRun?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates the sort-package-json command
|
|
16
|
+
*/
|
|
17
|
+
export declare function createSortPackageJsonCommand(): Command;
|
|
18
|
+
/**
|
|
19
|
+
* Sorts a single package.json file
|
|
20
|
+
*/
|
|
21
|
+
export declare function sortPackageJsonFile(filePath: string, options?: {
|
|
22
|
+
dryRun?: boolean;
|
|
23
|
+
}): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Recursively sorts all package.json files in a directory
|
|
26
|
+
*/
|
|
27
|
+
export declare function sortAllPackageJsonFiles(dir: string, options?: {
|
|
28
|
+
dryRun?: boolean;
|
|
29
|
+
}): Promise<{
|
|
30
|
+
sorted: string[];
|
|
31
|
+
unchanged: string[];
|
|
32
|
+
errors: string[];
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Runs the sort package.json process
|
|
36
|
+
*/
|
|
37
|
+
export declare function runSortPackageJson(rootDir: string, options: SortPackageJsonOptions): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Standalone CLI entry point
|
|
40
|
+
*/
|
|
41
|
+
export declare function runSortPackageJsonCLI(args?: string[]): Promise<void>;
|
|
42
|
+
//# sourceMappingURL=sortPackageJson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortPackageJson.d.ts","sourceRoot":"","sources":["../../src/cli/sortPackageJson.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,MAAM,WAAW,sBAAsB;IACnC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAqCtD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACnC,OAAO,CAAC,OAAO,CAAC,CAkBlB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CACzC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACnC,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiCtE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,sBAAsB,GAChC,OAAO,CAAC,IAAI,CAAC,CAiDf;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxF"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { promises } from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import sortPackageJsonLib from 'sort-package-json';
|
|
5
|
+
import { loadConfigWithDefaults, resolveConfigPaths } from '../config/loader.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* CLI for sorting package.json files
|
|
9
|
+
*
|
|
10
|
+
* Reads configuration from cdecode-config.json:
|
|
11
|
+
* - sortPackageJson.directories: Directories to process
|
|
12
|
+
* - sortPackageJson.skipNodeModules: Skip node_modules directories
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Creates the sort-package-json command
|
|
16
|
+
*/
|
|
17
|
+
function createSortPackageJsonCommand() {
|
|
18
|
+
const command = new Command('sort-package-json')
|
|
19
|
+
.description('Sort package.json files in the monorepo (reads from cdecode-config.json)')
|
|
20
|
+
.option('-r, --root <path>', 'Repository root path (auto-detected from cdecode-config.json)')
|
|
21
|
+
.option('-d, --directories <list>', 'Directories to process (comma-separated, overrides cdecode-config.json)', (val) => val.split(',').map((p) => p.trim()))
|
|
22
|
+
.option('--no-recursive', 'Do not process subdirectories', true)
|
|
23
|
+
.option('--dry-run', 'Preview changes without writing', false)
|
|
24
|
+
.action(async (options) => {
|
|
25
|
+
// Load config from cdecode-config.json
|
|
26
|
+
let repoRoot = options.root;
|
|
27
|
+
let configDirectories;
|
|
28
|
+
try {
|
|
29
|
+
const { config, repoRoot: detectedRoot } = loadConfigWithDefaults(options.root);
|
|
30
|
+
const resolvedConfig = resolveConfigPaths(config, detectedRoot);
|
|
31
|
+
repoRoot = detectedRoot;
|
|
32
|
+
configDirectories = resolvedConfig.sortPackageJson?.directories;
|
|
33
|
+
console.log(`š Loaded configuration from cdecode-config.json`);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (!options.root) {
|
|
37
|
+
console.warn('ā ļø Could not find cdecode-config.json, using defaults');
|
|
38
|
+
repoRoot = process.cwd();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
await runSortPackageJson(repoRoot, {
|
|
42
|
+
directories: options.directories || configDirectories,
|
|
43
|
+
recursive: options.recursive !== false,
|
|
44
|
+
dryRun: options.dryRun,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
return command;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sorts a single package.json file
|
|
51
|
+
*/
|
|
52
|
+
async function sortPackageJsonFile(filePath, options = {}) {
|
|
53
|
+
try {
|
|
54
|
+
const content = await promises.readFile(filePath, 'utf8');
|
|
55
|
+
const packageJson = JSON.parse(content);
|
|
56
|
+
const sortedPackageJson = sortPackageJsonLib(packageJson);
|
|
57
|
+
const sortedContent = JSON.stringify(sortedPackageJson, null, 2) + '\n';
|
|
58
|
+
if (content !== sortedContent) {
|
|
59
|
+
if (!options.dryRun) {
|
|
60
|
+
await promises.writeFile(filePath, sortedContent);
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.error(`Error sorting ${filePath}:`, error);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Recursively sorts all package.json files in a directory
|
|
73
|
+
*/
|
|
74
|
+
async function sortAllPackageJsonFiles(dir, options = {}) {
|
|
75
|
+
const result = { sorted: [], unchanged: [], errors: [] };
|
|
76
|
+
async function walk(currentDir) {
|
|
77
|
+
try {
|
|
78
|
+
const files = await promises.readdir(currentDir);
|
|
79
|
+
for (const file of files) {
|
|
80
|
+
const fullPath = path.join(currentDir, file);
|
|
81
|
+
const stat = await promises.lstat(fullPath);
|
|
82
|
+
if (stat.isDirectory() && file !== 'node_modules') {
|
|
83
|
+
await walk(fullPath);
|
|
84
|
+
}
|
|
85
|
+
else if (file === 'package.json') {
|
|
86
|
+
try {
|
|
87
|
+
const changed = await sortPackageJsonFile(fullPath, options);
|
|
88
|
+
if (changed) {
|
|
89
|
+
result.sorted.push(fullPath);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
result.unchanged.push(fullPath);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
result.errors.push(fullPath);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.warn(`Error walking directory ${currentDir}:`, error);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
await walk(dir);
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Runs the sort package.json process
|
|
110
|
+
*/
|
|
111
|
+
async function runSortPackageJson(rootDir, options) {
|
|
112
|
+
const { dryRun = false } = options;
|
|
113
|
+
console.log(`\nš Repo root: ${rootDir}`);
|
|
114
|
+
if (dryRun) {
|
|
115
|
+
console.log('š Dry run mode - no files will be modified\n');
|
|
116
|
+
}
|
|
117
|
+
// Default directories if not specified
|
|
118
|
+
const directories = options.directories || [
|
|
119
|
+
rootDir,
|
|
120
|
+
path.join(rootDir, 'packages'),
|
|
121
|
+
path.join(rootDir, 'packages-modules'),
|
|
122
|
+
path.join(rootDir, 'servers'),
|
|
123
|
+
path.join(rootDir, 'portable-devices'),
|
|
124
|
+
];
|
|
125
|
+
const totalResult = { sorted: [], unchanged: [], errors: [] };
|
|
126
|
+
for (const dir of directories) {
|
|
127
|
+
try {
|
|
128
|
+
await promises.access(dir);
|
|
129
|
+
console.log(`š Processing ${dir}...`);
|
|
130
|
+
const result = await sortAllPackageJsonFiles(dir, { dryRun });
|
|
131
|
+
totalResult.sorted.push(...result.sorted);
|
|
132
|
+
totalResult.unchanged.push(...result.unchanged);
|
|
133
|
+
totalResult.errors.push(...result.errors);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
console.log(`ā ļø Directory not found: ${dir}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Report results
|
|
140
|
+
console.log('\nš Results:');
|
|
141
|
+
if (totalResult.sorted.length > 0) {
|
|
142
|
+
console.log(`\nā
${dryRun ? 'Would sort' : 'Sorted'} ${totalResult.sorted.length} file(s):`);
|
|
143
|
+
totalResult.sorted.forEach((f) => console.log(` - ${path.relative(rootDir, f)}`));
|
|
144
|
+
}
|
|
145
|
+
if (totalResult.unchanged.length > 0) {
|
|
146
|
+
console.log(`\nš ${totalResult.unchanged.length} file(s) already sorted`);
|
|
147
|
+
}
|
|
148
|
+
if (totalResult.errors.length > 0) {
|
|
149
|
+
console.log(`\nā ${totalResult.errors.length} error(s):`);
|
|
150
|
+
totalResult.errors.forEach((f) => console.log(` - ${path.relative(rootDir, f)}`));
|
|
151
|
+
}
|
|
152
|
+
console.log('');
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Standalone CLI entry point
|
|
156
|
+
*/
|
|
157
|
+
async function runSortPackageJsonCLI(args = process.argv) {
|
|
158
|
+
const program = createSortPackageJsonCommand();
|
|
159
|
+
await program.parseAsync(args);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export { createSortPackageJsonCommand, runSortPackageJson, runSortPackageJsonCLI, sortAllPackageJsonFiles, sortPackageJsonFile };
|
|
163
|
+
//# sourceMappingURL=sortPackageJson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortPackageJson.js","sources":["../../src/cli/sortPackageJson.ts"],"sourcesContent":[null],"names":["fsPromises"],"mappings":";;;;;;AAAA;;;;;;AAMG;AAcH;;AAEG;SACa,4BAA4B,GAAA;AACxC,IAAA,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;SAC1C,WAAW,CAAC,0EAA0E;AACtF,SAAA,MAAM,CAAC,mBAAmB,EAAE,+DAA+D;AAC3F,SAAA,MAAM,CACH,0BAA0B,EAC1B,yEAAyE,EACzE,CAAC,GAAW,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAEvD,SAAA,MAAM,CAAC,gBAAgB,EAAE,+BAA+B,EAAE,IAAI;AAC9D,SAAA,MAAM,CAAC,WAAW,EAAE,iCAAiC,EAAE,KAAK;AAC5D,SAAA,MAAM,CAAC,OAAO,OAAO,KAAI;;AAEtB,QAAA,IAAI,QAAQ,GAAG,OAAO,CAAC,IAAI;AAC3B,QAAA,IAAI,iBAAuC;AAE3C,QAAA,IAAI;AACA,YAAA,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC;YAC/E,MAAM,cAAc,GAAG,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC;Y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