sonar-autofix 0.0.6 → 0.0.9
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/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +93 -89
- package/package.json +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/core/index.js +4 -2
- package/packages/core/package.json +2 -2
- package/packages/llm-client/index.js +1 -1
- package/packages/llm-client/package.json +1 -1
- package/packages/sonar-client/index.js +4 -2
- package/packages/sonar-client/package.json +1 -1
- package/PUBLISHING_INSTRUCTIONS.md +0 -136
package/.idea/vcs.xml
ADDED
package/.idea/workspace.xml
CHANGED
|
@@ -6,17 +6,10 @@
|
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
7
|
<list default="true" id="2b435513-27c8-4fc6-b596-5368f46599ce" name="Changes" comment="package publishing changes">
|
|
8
8
|
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/packages/cli/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/packages/cli/index.js" afterDir="false" />
|
|
10
9
|
<change beforePath="$PROJECT_DIR$/packages/cli/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/packages/cli/package.json" afterDir="false" />
|
|
11
10
|
<change beforePath="$PROJECT_DIR$/packages/core/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/packages/core/index.js" afterDir="false" />
|
|
12
|
-
<change beforePath="$PROJECT_DIR$/packages/
|
|
13
|
-
<change beforePath="$PROJECT_DIR$/packages/git-client/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/packages/git-client/package.json" afterDir="false" />
|
|
14
|
-
<change beforePath="$PROJECT_DIR$/packages/github-action/action.yml" beforeDir="false" afterPath="$PROJECT_DIR$/packages/github-action/action.yml" afterDir="false" />
|
|
15
|
-
<change beforePath="$PROJECT_DIR$/packages/github-action/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/packages/github-action/index.js" afterDir="false" />
|
|
16
|
-
<change beforePath="$PROJECT_DIR$/packages/github-action/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/packages/github-action/package.json" afterDir="false" />
|
|
17
|
-
<change beforePath="$PROJECT_DIR$/packages/llm-client/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/packages/llm-client/package.json" afterDir="false" />
|
|
11
|
+
<change beforePath="$PROJECT_DIR$/packages/sonar-client/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/packages/sonar-client/index.js" afterDir="false" />
|
|
18
12
|
<change beforePath="$PROJECT_DIR$/packages/sonar-client/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/packages/sonar-client/package.json" afterDir="false" />
|
|
19
|
-
<change beforePath="$PROJECT_DIR$/packages/validator/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/packages/validator/package.json" afterDir="false" />
|
|
20
13
|
</list>
|
|
21
14
|
<option name="SHOW_DIALOG" value="false" />
|
|
22
15
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -24,6 +17,7 @@
|
|
|
24
17
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
25
18
|
</component>
|
|
26
19
|
<component name="EmbeddingIndexingInfo">
|
|
20
|
+
<option name="cachedIndexableFilesCount" value="25" />
|
|
27
21
|
<option name="fileBasedEmbeddingIndicesEnabled" value="true" />
|
|
28
22
|
</component>
|
|
29
23
|
<component name="Git.Settings">
|
|
@@ -38,61 +32,61 @@
|
|
|
38
32
|
</component>
|
|
39
33
|
<component name="NextEditCompletionFeaturesState">
|
|
40
34
|
<decayedCancelled>
|
|
41
|
-
<entry key="MS100" value="1.
|
|
42
|
-
<entry key="MS500" value="
|
|
43
|
-
<entry key="S2" value="
|
|
44
|
-
<entry key="S5" value="
|
|
45
|
-
<entry key="S10" value="
|
|
46
|
-
<entry key="S30" value="
|
|
47
|
-
<entry key="S60" value="
|
|
48
|
-
<entry key="M2" value="
|
|
49
|
-
<entry key="M5" value="
|
|
50
|
-
<entry key="M10" value="
|
|
51
|
-
<entry key="M15" value="
|
|
52
|
-
<entry key="M30" value="
|
|
53
|
-
<entry key="H1" value="
|
|
54
|
-
<entry key="H2" value="
|
|
55
|
-
<entry key="H4" value="
|
|
56
|
-
<entry key="D1" value="
|
|
57
|
-
<entry key="W1" value="
|
|
35
|
+
<entry key="MS100" value="1.0" />
|
|
36
|
+
<entry key="MS500" value="1.0000000000000704" />
|
|
37
|
+
<entry key="S2" value="1.0005244925270327" />
|
|
38
|
+
<entry key="S5" value="1.0787338518441307" />
|
|
39
|
+
<entry key="S10" value="1.7028002829034747" />
|
|
40
|
+
<entry key="S30" value="5.799622050521681" />
|
|
41
|
+
<entry key="S60" value="11.388586342110854" />
|
|
42
|
+
<entry key="M2" value="18.237406931383767" />
|
|
43
|
+
<entry key="M5" value="28.97263054936812" />
|
|
44
|
+
<entry key="M10" value="43.88055896339482" />
|
|
45
|
+
<entry key="M15" value="58.89329986998447" />
|
|
46
|
+
<entry key="M30" value="103.3007215334597" />
|
|
47
|
+
<entry key="H1" value="187.41467366187922" />
|
|
48
|
+
<entry key="H2" value="312.9920326628546" />
|
|
49
|
+
<entry key="H4" value="457.48915429275854" />
|
|
50
|
+
<entry key="D1" value="860.7485692267073" />
|
|
51
|
+
<entry key="W1" value="1033.7507789484623" />
|
|
58
52
|
</decayedCancelled>
|
|
59
53
|
<decayedSelected>
|
|
60
|
-
<entry key="MS100" value="
|
|
61
|
-
<entry key="MS500" value="
|
|
62
|
-
<entry key="S2" value="
|
|
63
|
-
<entry key="S5" value="
|
|
64
|
-
<entry key="S10" value="
|
|
65
|
-
<entry key="S30" value="
|
|
66
|
-
<entry key="S60" value="
|
|
67
|
-
<entry key="M2" value="
|
|
68
|
-
<entry key="M5" value="
|
|
69
|
-
<entry key="M10" value="
|
|
70
|
-
<entry key="M15" value="3.
|
|
71
|
-
<entry key="M30" value="
|
|
72
|
-
<entry key="H1" value="
|
|
73
|
-
<entry key="H2" value="
|
|
74
|
-
<entry key="H4" value="
|
|
75
|
-
<entry key="D1" value="
|
|
76
|
-
<entry key="W1" value="
|
|
54
|
+
<entry key="MS100" value="0.0" />
|
|
55
|
+
<entry key="MS500" value="0.0" />
|
|
56
|
+
<entry key="S2" value="1.2459397001661356E-108" />
|
|
57
|
+
<entry key="S5" value="6.889676171789915E-44" />
|
|
58
|
+
<entry key="S10" value="2.6248192645951694E-22" />
|
|
59
|
+
<entry key="S30" value="6.402748889531117E-8" />
|
|
60
|
+
<entry key="S60" value="2.530670794866498E-4" />
|
|
61
|
+
<entry key="M2" value="0.01636112125793061" />
|
|
62
|
+
<entry key="M5" value="0.35482440424226747" />
|
|
63
|
+
<entry key="M10" value="1.6802099504326233" />
|
|
64
|
+
<entry key="M15" value="3.127710393890115" />
|
|
65
|
+
<entry key="M30" value="6.49184352263302" />
|
|
66
|
+
<entry key="H1" value="10.430602813426669" />
|
|
67
|
+
<entry key="H2" value="14.325500293134443" />
|
|
68
|
+
<entry key="H4" value="17.699557877938798" />
|
|
69
|
+
<entry key="D1" value="24.190097763384788" />
|
|
70
|
+
<entry key="W1" value="26.535211617161142" />
|
|
77
71
|
</decayedSelected>
|
|
78
72
|
<decayedShown>
|
|
79
|
-
<entry key="MS100" value="
|
|
80
|
-
<entry key="MS500" value="
|
|
81
|
-
<entry key="S2" value="
|
|
82
|
-
<entry key="S5" value="
|
|
83
|
-
<entry key="S10" value="
|
|
84
|
-
<entry key="S30" value="
|
|
85
|
-
<entry key="S60" value="
|
|
86
|
-
<entry key="M2" value="
|
|
87
|
-
<entry key="M5" value="
|
|
88
|
-
<entry key="M10" value="
|
|
89
|
-
<entry key="M15" value="
|
|
90
|
-
<entry key="M30" value="
|
|
91
|
-
<entry key="H1" value="
|
|
92
|
-
<entry key="H2" value="
|
|
93
|
-
<entry key="H4" value="
|
|
94
|
-
<entry key="D1" value="
|
|
95
|
-
<entry key="W1" value="
|
|
73
|
+
<entry key="MS100" value="0.9794202975869268" />
|
|
74
|
+
<entry key="MS500" value="0.995849753094528" />
|
|
75
|
+
<entry key="S2" value="0.9994845777449164" />
|
|
76
|
+
<entry key="S5" value="1.0782672283672625" />
|
|
77
|
+
<entry key="S10" value="1.7023182610861152" />
|
|
78
|
+
<entry key="S30" value="5.79122089059208" />
|
|
79
|
+
<entry key="S60" value="11.367524714130134" />
|
|
80
|
+
<entry key="M2" value="18.22884900047904" />
|
|
81
|
+
<entry key="M5" value="29.30798012562218" />
|
|
82
|
+
<entry key="M10" value="45.54486358086654" />
|
|
83
|
+
<entry key="M15" value="62.006949558676" />
|
|
84
|
+
<entry key="M30" value="109.78194716400667" />
|
|
85
|
+
<entry key="H1" value="197.837982392345" />
|
|
86
|
+
<entry key="H2" value="327.31289572842553" />
|
|
87
|
+
<entry key="H4" value="475.1859062916317" />
|
|
88
|
+
<entry key="D1" value="884.9379640629377" />
|
|
89
|
+
<entry key="W1" value="1060.2858752528125" />
|
|
96
90
|
</decayedShown>
|
|
97
91
|
</component>
|
|
98
92
|
<component name="ProjectColorInfo">{
|
|
@@ -104,35 +98,35 @@
|
|
|
104
98
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
105
99
|
<option name="showLibraryContents" value="true" />
|
|
106
100
|
</component>
|
|
107
|
-
<component name="PropertiesComponent"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
101
|
+
<component name="PropertiesComponent">{
|
|
102
|
+
"keyToString": {
|
|
103
|
+
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
|
104
|
+
"RunOnceActivity.MCP Project settings loaded": "true",
|
|
105
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
106
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
107
|
+
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
|
108
|
+
"SONARLINT_PRECOMMIT_ANALYSIS": "true",
|
|
109
|
+
"codeWithMe.voiceChat.enabledByDefault": "false",
|
|
110
|
+
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
|
|
111
|
+
"git-widget-placeholder": "master",
|
|
112
|
+
"javascript.nodejs.core.library.configured.version": "24.18.0",
|
|
113
|
+
"javascript.nodejs.core.library.typings.version": "24.13.3",
|
|
114
|
+
"javascript.preferred.runtime.type.id": "node",
|
|
115
|
+
"junie.onboarding.icon.badge.shown": "true",
|
|
116
|
+
"last_opened_file_path": "/Users/divyaaditya/projects/sonar-autofix",
|
|
117
|
+
"node.js.detected.package.eslint": "true",
|
|
118
|
+
"node.js.detected.package.jshint": "true",
|
|
119
|
+
"node.js.detected.package.tslint": "true",
|
|
120
|
+
"node.js.selected.package.eslint": "(autodetect)",
|
|
121
|
+
"node.js.selected.package.jshint": "",
|
|
122
|
+
"node.js.selected.package.tslint": "(autodetect)",
|
|
123
|
+
"nodejs_interpreter_path": "node",
|
|
124
|
+
"nodejs_package_manager_path": "npm",
|
|
125
|
+
"settings.editor.selected.configurable": "project.propVCSSupport.DirectoryMappings",
|
|
126
|
+
"to.speed.mode.migration.done": "true",
|
|
127
|
+
"ts.external.directory.path": "/Applications/WebStorm.app/Contents/plugins/javascript-plugin/jsLanguageServicesImpl/external"
|
|
134
128
|
}
|
|
135
|
-
}
|
|
129
|
+
}</component>
|
|
136
130
|
<component name="RecentsManager">
|
|
137
131
|
<key name="CopyFile.RECENT_KEYS">
|
|
138
132
|
<recent name="$PROJECT_DIR$" />
|
|
@@ -165,7 +159,9 @@
|
|
|
165
159
|
<workItem from="1788169983174" duration="1684000" />
|
|
166
160
|
<workItem from="1788171725187" duration="4774000" />
|
|
167
161
|
<workItem from="1788177896634" duration="4501000" />
|
|
168
|
-
<workItem from="1788182750659" duration="
|
|
162
|
+
<workItem from="1788182750659" duration="1495000" />
|
|
163
|
+
<workItem from="1788184609891" duration="38000" />
|
|
164
|
+
<workItem from="1788186007862" duration="4026000" />
|
|
169
165
|
</task>
|
|
170
166
|
<task id="LOCAL-00001" summary="package publishing changes">
|
|
171
167
|
<option name="closed" value="true" />
|
|
@@ -175,7 +171,15 @@
|
|
|
175
171
|
<option name="project" value="LOCAL" />
|
|
176
172
|
<updated>1788181949023</updated>
|
|
177
173
|
</task>
|
|
178
|
-
<
|
|
174
|
+
<task id="LOCAL-00002" summary="package publishing changes">
|
|
175
|
+
<option name="closed" value="true" />
|
|
176
|
+
<created>1788186558939</created>
|
|
177
|
+
<option name="number" value="00002" />
|
|
178
|
+
<option name="presentableId" value="LOCAL-00002" />
|
|
179
|
+
<option name="project" value="LOCAL" />
|
|
180
|
+
<updated>1788186558939</updated>
|
|
181
|
+
</task>
|
|
182
|
+
<option name="localTasksCounter" value="3" />
|
|
179
183
|
<servers />
|
|
180
184
|
</component>
|
|
181
185
|
<component name="TypeScriptGeneratedFilesManager">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonar-autofix/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "CLI tool for the Sonar Autofix tool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"author": "Sonar Autofix Team",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@sonar-autofix/core": "^0.0.
|
|
21
|
+
"@sonar-autofix/core": "^0.0.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/packages/core/index.js
CHANGED
|
@@ -23,6 +23,7 @@ class CoreOrchestrator {
|
|
|
23
23
|
constructor(config, deps = {}) {
|
|
24
24
|
this.config = config;
|
|
25
25
|
this.dryRun = config.dryRun || false;
|
|
26
|
+
this.restoreOnFail = config.restoreOnFail || false;
|
|
26
27
|
this.retryLimit = config.retry?.maxRetries || DEFAULT_RETRY_LIMIT;
|
|
27
28
|
this.maxIterations = config.retry?.maxIterations || DEFAULT_MAX_ITERATIONS;
|
|
28
29
|
this.cwd = config.cwd || process.cwd();
|
|
@@ -138,8 +139,9 @@ class CoreOrchestrator {
|
|
|
138
139
|
fixedInIteration++;
|
|
139
140
|
console.log(` ✓ ${filePath} fixed successfully`);
|
|
140
141
|
} else {
|
|
141
|
-
console.log(` ✗ ${filePath} could not be fixed
|
|
142
|
-
if (!this.dryRun) {
|
|
142
|
+
console.log(` ✗ ${filePath} could not be fixed`);
|
|
143
|
+
if (!this.dryRun && this.restoreOnFail) {
|
|
144
|
+
console.log(` ✗ ${filePath} could not be fixed — restoring original`);
|
|
143
145
|
await this.gitClient.restoreFile(filePath);
|
|
144
146
|
}
|
|
145
147
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonar-autofix/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Core orchestrator for the Sonar Autofix tool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@sonar-autofix/sonar-client": "^0.0.1",
|
|
19
|
-
"@sonar-autofix/llm-client": "^0.0.
|
|
19
|
+
"@sonar-autofix/llm-client": "^0.0.2",
|
|
20
20
|
"@sonar-autofix/git-client": "^0.0.1"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -35,7 +35,7 @@ class SonarClient {
|
|
|
35
35
|
try {
|
|
36
36
|
var params = {
|
|
37
37
|
componentKeys: projectKey,
|
|
38
|
-
statuses: 'OPEN,CONFIRMED
|
|
38
|
+
statuses: 'OPEN,CONFIRMED'
|
|
39
39
|
};
|
|
40
40
|
if (severity) {
|
|
41
41
|
params.severities = severity;
|
|
@@ -43,7 +43,9 @@ class SonarClient {
|
|
|
43
43
|
const response = await this.axiosInstance.get(`/api/issues/search`, {
|
|
44
44
|
params: params
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
const openIssues = response.data.issues.filter(data => data.statatus === 'OPEN');
|
|
48
|
+
return openIssues;
|
|
47
49
|
} catch (error) {
|
|
48
50
|
// Provide more detailed error information for debugging
|
|
49
51
|
if (error.response) {
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# Publishing Instructions for sonar-autofix Monorepo
|
|
2
|
-
|
|
3
|
-
This document outlines how to publish all packages in this monorepo to npm.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
The project is a monorepo containing 7 packages under the `@sonar-autofix` scope:
|
|
7
|
-
1. @sonar-autofix/cli
|
|
8
|
-
2. @sonar-autofix/core
|
|
9
|
-
3. @sonar-autofix/git-client
|
|
10
|
-
4. @sonar-autofix/github-action
|
|
11
|
-
5. @sonar-autofix/llm-client
|
|
12
|
-
6. @sonar-autofix/sonar-client
|
|
13
|
-
7. @sonar-autofix/validator
|
|
14
|
-
|
|
15
|
-
## Prerequisites
|
|
16
|
-
1. You must have npm account with publish permissions
|
|
17
|
-
2. You need to be logged into npm: `npm login`
|
|
18
|
-
3. All packages must have unique versions (they currently all have version 0.0.1)
|
|
19
|
-
|
|
20
|
-
## Publishing Steps
|
|
21
|
-
|
|
22
|
-
### Option 1: Manual Publishing (Simplest)
|
|
23
|
-
```bash
|
|
24
|
-
# Navigate to each package and publish individually
|
|
25
|
-
cd packages/cli && npm publish --access public
|
|
26
|
-
cd ../core && npm publish --access public
|
|
27
|
-
cd ../git-client && npm publish --access public
|
|
28
|
-
cd ../github-action && npm publish --access public
|
|
29
|
-
cd ../llm-client && npm publish --access public
|
|
30
|
-
cd ../sonar-client && npm publish --access public
|
|
31
|
-
cd ../validator && npm publish --access public
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Option 2: Using Changesets (Recommended for Version Management)
|
|
35
|
-
1. Install changesets:
|
|
36
|
-
```bash
|
|
37
|
-
npm install @changesets/cli --save-dev
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
2. Initialize changesets:
|
|
41
|
-
```bash
|
|
42
|
-
npx changeset init
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
3. Create a changeset for each package:
|
|
46
|
-
```bash
|
|
47
|
-
npx changeset add
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
4. Generate version updates and publish:
|
|
51
|
-
```bash
|
|
52
|
-
npx changeset version
|
|
53
|
-
npm publish
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Option 3: Using Lerna (Alternative)
|
|
57
|
-
1. Install lerna:
|
|
58
|
-
```bash
|
|
59
|
-
npm install lerna --save-dev
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
2. Configure lerna in root package.json:
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"name": "sonar-autofix",
|
|
66
|
-
"version": "0.0.1",
|
|
67
|
-
"lerna": {
|
|
68
|
-
"packages": [
|
|
69
|
-
"packages/*"
|
|
70
|
-
],
|
|
71
|
-
"version": "independent"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
3. Publish packages:
|
|
77
|
-
```bash
|
|
78
|
-
npx lerna publish --scope @sonar-autofix/*
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Package Structure
|
|
82
|
-
Each package contains:
|
|
83
|
-
- `index.js` - Main implementation file
|
|
84
|
-
- `package.json` - Package configuration (already properly set up)
|
|
85
|
-
- Some packages also contain additional files:
|
|
86
|
-
- `github-action` contains `action.yml`
|
|
87
|
-
- All packages have proper main entry points
|
|
88
|
-
|
|
89
|
-
## Configuration Notes
|
|
90
|
-
1. All package.json files already correctly specify:
|
|
91
|
-
- Scoped names: `@sonar-autofix/*`
|
|
92
|
-
- Proper main entry points
|
|
93
|
-
- Version numbers (currently 0.0.1 for all)
|
|
94
|
-
|
|
95
|
-
2. The root package.json includes:
|
|
96
|
-
- `workspaces` configuration
|
|
97
|
-
- Dependencies
|
|
98
|
-
|
|
99
|
-
3. Files to ensure are included in published packages:
|
|
100
|
-
- All JavaScript files (index.js)
|
|
101
|
-
- action.yml (for github-action package)
|
|
102
|
-
- All necessary source code files
|
|
103
|
-
|
|
104
|
-
## Publishing Considerations
|
|
105
|
-
1. **Version Management**: All packages currently have version 0.0.1 - you should update these to appropriate versions
|
|
106
|
-
2. **Scope**: All packages are correctly scoped under `@sonar-autofix`
|
|
107
|
-
3. **Dependencies**: Packages depend on each other (e.g., CLI depends on core, which depends on other packages)
|
|
108
|
-
4. **Publish Access**: Make sure you have permissions to publish to the `@sonar-autofix` scope
|
|
109
|
-
|
|
110
|
-
## Troubleshooting
|
|
111
|
-
1. If publishing fails due to version conflicts:
|
|
112
|
-
- Update version numbers in each package.json
|
|
113
|
-
- Ensure versions are unique and follow semantic versioning
|
|
114
|
-
|
|
115
|
-
2. If files appear to be missing:
|
|
116
|
-
- Check .npmignore files in each package directory
|
|
117
|
-
- Ensure no files are being excluded
|
|
118
|
-
|
|
119
|
-
3. If you get 404 errors:
|
|
120
|
-
- Make sure you're using the correct scope name
|
|
121
|
-
- Verify that your npm account has proper permissions
|
|
122
|
-
|
|
123
|
-
## Best Practices
|
|
124
|
-
1. Use semantic versioning (v0.1.0, v0.2.0, etc.)
|
|
125
|
-
2. Consider using changesets or lerna for consistent versioning across packages
|
|
126
|
-
3. Document breaking changes in changelogs
|
|
127
|
-
4. Test package installations in clean environments before publishing
|
|
128
|
-
|
|
129
|
-
## Testing After Publishing
|
|
130
|
-
After publishing, test installation:
|
|
131
|
-
```bash
|
|
132
|
-
# In a new project
|
|
133
|
-
npm install @sonar-autofix/cli
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
Check that all expected files and functionality are present.
|