Skip to content

Commit 6558cbc

Browse files
authored
fix: migrate npm publishing to OIDC (#109)
1 parent 37032aa commit 6558cbc

11 files changed

Lines changed: 1126 additions & 1696 deletions

File tree

‎.eslintignore‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎.eslintrc.cjs‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎.github/workflows/onRelease.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ jobs:
2222
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
2323
id: distTag
2424
npm:
25+
permissions:
26+
id-token: write
27+
contents: read
2528
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
2629
needs: [getDistTag]
2730
with:
31+
trustedPublishing: true
2832
ctc: true
2933
sign: true
3034
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}

‎eslint.config.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import salesforce from 'eslint-config-salesforce-typescript';
2+
import sfPlugin from 'eslint-plugin-sf-plugin';
3+
4+
export default [...salesforce, ...sfPlugin.configs.recommended];

‎package.json‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
"devDependencies": {
1414
"@oclif/plugin-command-snapshot": "^6.0.0",
1515
"@salesforce/cli-plugins-testkit": "^5.3.39",
16-
"@salesforce/dev-scripts": "^11.0.4",
16+
"@salesforce/dev-scripts": "^15.0.0",
1717
"@salesforce/plugin-command-reference": "^3.1.49",
1818
"@salesforce/ts-types": "^3.0.0",
19-
"eslint-plugin-sf-plugin": "^1.20.15",
19+
"@types/chai": "^4.3.17",
20+
"@types/mocha": "^10.0.10",
21+
"@types/node": "^18",
22+
"@types/sinon": "^10.0.20",
23+
"eslint": "^10.4.0",
24+
"eslint-config-salesforce-typescript": "^6.0.0",
25+
"eslint-plugin-sf-plugin": "^3.0.1",
2026
"oclif": "^5.0.0",
2127
"ts-node": "^10.9.2",
22-
"typescript": "^5.8.2"
28+
"typescript": "^6.0.0"
2329
},
2430
"engines": {
2531
"node": ">=22.0.0"
@@ -126,6 +132,7 @@
126132
"src/**/*.ts",
127133
"test/**/*.ts",
128134
"messages/**",
135+
"**/eslint.config.*",
129136
"**/.eslint*",
130137
"**/tsconfig.json"
131138
],

‎src/reporters/testReporter.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class TestReporter {
7474
}
7575

7676
try {
77-
if (result.summary && result.summary.outcome === 'Failed') {
77+
if (result.summary?.outcome === 'Failed') {
7878
process.exitCode = FAILURE_EXIT_CODE;
7979
}
8080
switch (options['result-format']) {
@@ -96,8 +96,9 @@ export class TestReporter {
9696
});
9797
}
9898
break;
99-
default:
99+
case undefined:
100100
this.logHuman(result, options['detailed-coverage'] as boolean, options['concise'], options['output-dir']);
101+
break;
101102
}
102103
} catch (e) {
103104
this.ux.styledJSON(result);
@@ -156,6 +157,8 @@ export class TestReporter {
156157
resultFormatValue = ResultFormat.human;
157158
}
158159

160+
// ResultFormat values not handled here do not require an additional output file.
161+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
159162
switch (resultFormatValue) {
160163
case ResultFormat.tap:
161164
outputDirConfig.fileInfos?.push({

‎test/.eslintrc.cjs‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎test/commands/flow/run/test.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('flow:test:run', () => {
6060
try {
6161
// the library writes to a directory, so we need to clean it up :(
6262
fs.rmSync('myDirectory', { recursive: true });
63-
} catch (e) {
63+
} catch {
6464
// do nothing
6565
}
6666
});

‎test/tsconfig.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "@salesforce/dev-config/tsconfig-test-strict-esm",
33
"include": ["./**/*.ts"],
44
"compilerOptions": {
5-
"skipLibCheck": true
5+
"skipLibCheck": true,
6+
"types": ["mocha", "node"]
67
}
78
}

‎tsconfig.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"outDir": "lib",
55
"rootDir": "src",
66
"skipLibCheck": true,
7-
"strictNullChecks": true
7+
"strictNullChecks": true,
8+
"types": ["mocha", "node"]
89
},
910
"include": ["./src/**/*.ts"]
1011
}

0 commit comments

Comments
 (0)