Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ jobs:
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
id: distTag
npm:
permissions:
id-token: write
contents: read
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
needs: [getDistTag]
with:
trustedPublishing: true
ctc: true
sign: true
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
Expand Down
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import tsconfigs from 'eslint-config-salesforce-typescript';
import plugin from 'eslint-plugin-sf-plugin';

const configs = [...tsconfigs, ...plugin.configs.recommended];

export default configs;
27 changes: 17 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@inquirer/select": "^5.0.2",
"@oclif/core": "^4",
"@salesforce/core": "^8.25.1",
"@salesforce/kit": "^3.2.4",
"@salesforce/sf-plugins-core": "^12.2.6",
"@oclif/core": "^5.1.7",
"@salesforce/core": "^9.3.6",
"@salesforce/kit": "^4.0.1",
"@salesforce/sf-plugins-core": "^13.0.7",
"@salesforce/ui-bundle": "^1.118.4",
"chokidar": "^3.6.0",
"form-data": "^4.0.5",
Expand All @@ -22,15 +22,21 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.3.8",
"@salesforce/cli-plugins-testkit": "^5.3.41",
"@salesforce/dev-scripts": "^11.0.4",
"@salesforce/plugin-command-reference": "^3.1.77",
"@salesforce/dev-scripts": "^15.0.0",
"@salesforce/plugin-command-reference": "^3.1.141",
"@types/chai": "^4.3.17",
"@types/http-proxy": "^1.17.14",
"@types/micromatch": "^4.0.10",
"@types/mocha": "^10.0.10",
"@types/node": "^18",
"@types/sinon": "^10.0.20",
"dotenv": "^17.3.1",
"eslint-plugin-sf-plugin": "^1.20.33",
"oclif": "^4.22.68",
"eslint": "^10.4.0",
"eslint-config-salesforce-typescript": "^6.0.0",
"eslint-plugin-sf-plugin": "^3.0.1",
"oclif": "^6.0.8",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
"typescript": "^6.0.0"
},
"engines": {
"node": ">=18.0.0"
Expand Down Expand Up @@ -85,9 +91,9 @@
"prepack": "sf-prepack",
"prepare": "sf-install",
"test": "wireit",
"test:nut:local": "node -r dotenv/config ./node_modules/.bin/nyc mocha --slow 4500 --timeout 300000",
"test:nuts": "mocha \"**/*.nut.ts\" --slow 4500 --timeout 300000 --parallel=false",
"test:nuts:local": "node -r dotenv/config ./node_modules/.bin/nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 300000 --parallel=false",
"test:nut:local": "node -r dotenv/config ./node_modules/.bin/nyc mocha --slow 4500 --timeout 300000",
"test:only": "wireit",
"version": "oclif readme"
},
Expand Down Expand Up @@ -131,6 +137,7 @@
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
"**/eslint.config.*",
"**/.eslint*",
"**/tsconfig.json"
],
Expand Down
10 changes: 3 additions & 7 deletions src/commands/ui-bundle/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,11 @@ export default class UiBundleDev extends SfCommand<UiBundleDevResult> {
this.logger = await Logger.child('UiBundleDev');

// Ensure a live preview token exists — self-generate if the extension didn't provide one
if (!process.env.SF_LIVE_PREVIEW_TOKEN) {
process.env.SF_LIVE_PREVIEW_TOKEN = randomUUID();
}
process.env.SF_LIVE_PREVIEW_TOKEN ??= randomUUID();

// Declare variables outside try block for catch block access
let manifest: UiBundleManifest | null = null;
let devServerUrl: string | null = null;
let devServerUrl: string | null;
let orgUsername = '';

try {
Expand Down Expand Up @@ -696,9 +694,7 @@ export default class UiBundleDev extends SfCommand<UiBundleDevResult> {
private emitLegacyWebappWarning(url: string, bundleName: string): void {
if (this.legacyWarningEmitted) return;
this.legacyWarningEmitted = true;
process.stderr.write(
JSON.stringify({ warn: 'LEGACY_WEBAPP_DETECTED', port: url, bundle: bundleName }) + '\n'
);
process.stderr.write(JSON.stringify({ warn: 'LEGACY_WEBAPP_DETECTED', port: url, bundle: bundleName }) + '\n');
this.warn(
`Unable to verify the authenticity of the dev server for "${bundleName}". ` +
'Update @salesforce/ui-bundle to the latest version.'
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/ProxyServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class ProxyServer extends EventEmitter {
private healthCheckInterval: NodeJS.Timeout | null = null;
private devServerStatus: 'unknown' | 'up' | 'down' | 'error' = 'unknown';
private activeDevServerError: DevServerError | null = null;
private readonly activeConnections: Set<import('net').Socket> = new Set();
private readonly activeConnections: Set<import('node:net').Socket> = new Set();
private proxyHandler: ProxyHandler | null = null;
private orgInfo: OrgInfo | undefined;

Expand Down
25 changes: 0 additions & 25 deletions test/.eslintrc.cjs

This file was deleted.

12 changes: 6 additions & 6 deletions test/commands/ui-bundle/dev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('ui-bundle:dev command integration', () => {
fetchStub.resolves({
ok: true,
headers: mockHeaders,
} as Response);
});

const result = await checkViteProxyActive('http://localhost:5173');

Expand All @@ -81,7 +81,7 @@ describe('ui-bundle:dev command integration', () => {
fetchStub.resolves({
ok: true,
headers: mockHeaders,
} as Response);
});

const result = await checkViteProxyActive('http://localhost:5173');

Expand All @@ -95,7 +95,7 @@ describe('ui-bundle:dev command integration', () => {
fetchStub.resolves({
ok: true,
headers: mockHeaders,
} as Response);
});

const result = await checkViteProxyActive('http://localhost:5173');

Expand Down Expand Up @@ -133,7 +133,7 @@ describe('ui-bundle:dev command integration', () => {
fetchStub.resolves({
ok: true,
headers: mockHeaders,
} as Response);
});

await checkViteProxyActive('http://localhost:5173');

Expand All @@ -148,7 +148,7 @@ describe('ui-bundle:dev command integration', () => {
fetchStub.resolves({
ok: true,
headers: mockHeaders,
} as Response);
});

await checkViteProxyActive('http://localhost:5173/?existing=param');

Expand All @@ -162,7 +162,7 @@ describe('ui-bundle:dev command integration', () => {
fetchStub.resolves({
ok: true,
headers: mockHeaders,
} as Response);
});

await checkViteProxyActive('http://localhost:5173');

Expand Down
Loading
Loading