Skip to content

Commit 521bb18

Browse files
authored
refactor: remove deps, add missing (#894)
* refactor: remove deps, add missing * docs: link fixes * chore: schemas
1 parent 04c2a6e commit 521bb18

File tree

15 files changed

+33
-45
lines changed

15 files changed

+33
-45
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ open source, it may not represent all of the `org` commands.
77

88
## About Salesforce CLI plugins
99

10-
Salesforce CLI plugins are based on the [oclif plugin framework](<(https://oclif.io/docs/introduction.html)>). Read
10+
Salesforce CLI plugins are based on the [oclif plugin framework](https://oclif.io/docs/introduction). Read
1111
the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm)
1212
to learn about Salesforce CLI plugin development.
1313

@@ -934,7 +934,7 @@ GLOBAL FLAGS
934934
DESCRIPTION
935935
Open your default scratch org, or another specified org, in a browser.
936936
937-
To open a specific page, specify the portion of the URL after "https://MyDomainName.my.salesforce.com/" as the value
937+
To open a specific page, specify the portion of the URL after "https://MyDomainName.my.salesforce.com" as the value
938938
for the --path flag. For example, specify "--path lightning" to open Lightning Experience, or specify "--path
939939
/apex/YourPage" to open a Visualforce page.
940940

messages/open.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Open your default scratch org, or another specified org, in a browser.
44

55
# description
66

7-
To open a specific page, specify the portion of the URL after "https://MyDomainName.my.salesforce.com/" as the value for the --path flag. For example, specify "--path lightning" to open Lightning Experience, or specify "--path /apex/YourPage" to open a Visualforce page.
7+
To open a specific page, specify the portion of the URL after "https://mydomain.my.salesforce.com" as the value for the --path flag. For example, specify "--path lightning" to open Lightning Experience, or specify "--path /apex/YourPage" to open a Visualforce page.
88

99
Use the --source-file to open a Lightning Page from your local project in Lightning App Builder. Lightning page files have the suffix .flexipage-meta.xml, and are stored in the "flexipages" directory.
1010

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"@salesforce/kit": "^3.0.15",
1111
"@salesforce/sf-plugins-core": "^5.0.3",
1212
"@salesforce/source-deploy-retrieve": "^10.0.3",
13+
"chalk": "^4",
14+
"change-case": "^5.3.0",
1315
"open": "^9.1.0"
1416
},
1517
"devDependencies": {

schemas/org-list.json

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"enum": ["(D)", "(U)"]
5959
},
6060
"attributes": {
61-
"$ref": "#/definitions/Dictionary%3Cunknown%3E"
61+
"type": "object",
62+
"additionalProperties": {}
6263
},
6364
"lastUsed": {
6465
"type": "string",
@@ -163,22 +164,6 @@
163164
},
164165
"required": ["accessToken", "clientId", "instanceUrl", "orgId", "string", "username"]
165166
},
166-
"Dictionary<unknown>": {
167-
"type": "object",
168-
"additionalProperties": {
169-
"$ref": "#/definitions/Optional%3Cunknown%3E"
170-
},
171-
"description": "An object with arbitrary string-indexed values of an optional generic type `Optional<T>`. `T` defaults to `unknown` when not explicitly supplied. For convenient iteration of definitely assigned (i.e. non-nullable) entries, keys, and values, see the following functions: {@link definiteEntriesOf } , {@link definiteKeysOf } , and {@link definiteValuesOf } ."
172-
},
173-
"Optional<unknown>": {
174-
"anyOf": [
175-
{},
176-
{
177-
"not": {}
178-
}
179-
],
180-
"description": "A union type for either the parameterized type `T` or `undefined` -- the opposite of {@link NonOptional } ."
181-
},
182167
"FullyPopulatedScratchOrgFields": {
183168
"type": "object",
184169
"additionalProperties": false,
@@ -209,7 +194,8 @@
209194
"enum": ["(D)", "(U)"]
210195
},
211196
"attributes": {
212-
"$ref": "#/definitions/Dictionary%3Cunknown%3E"
197+
"type": "object",
198+
"additionalProperties": {}
213199
},
214200
"lastUsed": {
215201
"type": "string",

src/commands/org/list/metadata-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import fs from 'node:fs';
88
import { dirname } from 'node:path';
99
import { fileURLToPath } from 'node:url';
1010
import { Messages } from '@salesforce/core';
11-
import { DescribeMetadataResult } from 'jsforce/api/metadata';
11+
import type { DescribeMetadataResult } from 'jsforce/api/metadata';
1212
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
1313
import { Flags, loglevel, requiredOrgFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
1414

src/commands/org/list/metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import fs from 'node:fs';
99
import { dirname } from 'node:path';
1010
import { fileURLToPath } from 'node:url';
1111
import { Messages } from '@salesforce/core';
12-
import { FileProperties, ListMetadataQuery } from 'jsforce/api/metadata';
12+
import type { FileProperties, ListMetadataQuery } from 'jsforce/api/metadata';
1313
import { Flags, loglevel, requiredOrgFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
1414

1515
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));

src/shared/orgHooks.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { Optional } from '@salesforce/ts-types';
9-
import { AuthFields } from '@salesforce/core';
8+
import type { AuthFields } from '@salesforce/core';
109
import { Command, Interfaces, Hook } from '@oclif/core';
1110

1211
type HookOpts<T> = {
1312
options: { Command: Command.Class; argv: string[]; commandId: string };
14-
return: Optional<T>;
13+
return: T | undefined;
1514
};
1615

1716
export type OrgCreateResult = Pick<

src/shared/orgListUtil.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ import {
1818
ConfigAggregator,
1919
OrgConfigProperties,
2020
} from '@salesforce/core';
21-
import { isObject } from '@salesforce/ts-types';
22-
import { Record } from 'jsforce';
21+
import type { Record } from 'jsforce';
2322
import { omit } from '@salesforce/kit';
24-
import utils from './utils.js';
25-
import {
23+
import utils, { isDefined } from './utils.js';
24+
import type {
2625
ScratchOrgInfoSObject,
2726
ExtendedAuthFields,
2827
ExtendedAuthFieldsScratch,
@@ -180,7 +179,7 @@ export class OrgListUtil {
180179
}
181180
})
182181
);
183-
return allAuths.filter(isObject<AuthInfo>);
182+
return allAuths.filter(isDefined);
184183
}
185184

186185
/**
@@ -285,13 +284,13 @@ export class OrgListUtil {
285284
: `Can't find ${scratchOrgInfo.username} in the updated contents`;
286285
});
287286

288-
const warnings = results.filter((result) => typeof result === 'string') as string[];
287+
const warnings = results.filter((result): result is string => typeof result === 'string');
289288
if (warnings.length) {
290289
const logger = await OrgListUtil.retrieveLogger();
291290
warnings.forEach((warning) => logger.warn(warning));
292291
}
293292

294-
return results.filter((result) => typeof result !== 'string') as FullyPopulatedScratchOrgFields[];
293+
return results.filter((result): result is FullyPopulatedScratchOrgFields => typeof result !== 'string');
295294
}
296295

297296
/**

src/shared/orgTypes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
import { AuthFields, ScratchOrgInfo } from '@salesforce/core';
9-
import { Dictionary } from '@salesforce/ts-types';
109

1110
export type OrgDisplayReturn = Partial<ScratchOrgFields> & {
1211
username: string;
@@ -86,7 +85,7 @@ export interface OrgListFields {
8685
isDefaultUsername?: boolean;
8786
isDefaultDevHubUsername?: boolean;
8887
defaultMarker?: '(D)' | '(U)';
89-
attributes?: Dictionary<unknown>;
88+
attributes?: Record<string, unknown>;
9089
lastUsed?: Date;
9190
}
9291

src/shared/sandboxProgress.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Ux } from '@salesforce/sf-plugins-core/lib/ux';
1010
import { ux } from '@oclif/core';
1111
import { getClockForSeconds } from '../shared/timeUtils.js';
1212
import { StagedProgress } from './stagedProgress.js';
13+
import { isDefined } from './utils.js';
1314

1415
const columns: Ux.Table.Columns<{ key: string; value: string }> = {
1516
key: { header: 'Field' },
@@ -74,7 +75,7 @@ export class SandboxProgress extends StagedProgress<SandboxStatusData> {
7475
'Sandbox Create Stages',
7576
this.formatStages(),
7677
]
77-
.filter((line) => line)
78+
.filter(isDefined)
7879
.join(os.EOL);
7980
}
8081
// eslint-disable-next-line class-methods-use-this

0 commit comments

Comments
 (0)