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.

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

This file was deleted.

14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import tsconfigs from 'eslint-config-salesforce-typescript';
import plugin from 'eslint-plugin-sf-plugin';

const configs = [
...tsconfigs,
...plugin.configs.recommended,
{
rules: {
'sf-plugin/dash-o': 'off',
},
},
];

export default configs;
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"enableO11y": true,
"o11yUploadEndpoint": "https://794testsite.my.site.com/byolwr/webruntime/log/metrics",
"dependencies": {
"@inquirer/confirm": "^3.2.0",
"@inquirer/input": "^2.3.0",
"@inquirer/select": "^2.5.0",
"@inquirer/prompts": "^7.10.1",
"@oclif/core": "^4.13.3",
"@salesforce/core": "^9.1.0",
"@salesforce/kit": "^4.0.0",
Expand All @@ -21,10 +19,16 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.3.35",
"@salesforce/cli-plugins-testkit": "^5.3.66",
"@salesforce/dev-scripts": "^11.0.4",
"@salesforce/dev-scripts": "^13.0.2",
"@salesforce/plugin-command-reference": "^3.1.132",
"@salesforce/types": "^1.7.1",
"eslint-plugin-sf-plugin": "^1.20.33",
"@types/chai": "^4.3.17",
"@types/mocha": "^10.0.10",
"@types/node": "^18",
"@types/sinon": "^10.0.20",
"eslint": "^10.4.0",
"eslint-config-salesforce-typescript": "^6.0.0",
"eslint-plugin-sf-plugin": "^3.0.0",
"oclif": "^4.23.29",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
Expand Down Expand Up @@ -131,6 +135,7 @@
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
"**/eslint.config.*",
"**/.eslint*",
"**/tsconfig.json"
],
Expand Down
9 changes: 3 additions & 6 deletions src/commands/schema/generate/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@

import fs from 'node:fs';
import path from 'node:path';
import input from '@inquirer/input';
import select from '@inquirer/select';
import confirm from '@inquirer/confirm';
import { input, select, confirm } from '@inquirer/prompts';

import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import type { AnyJson } from '@salesforce/ts-types';
import type { CustomField } from '@salesforce/types/metadata';
import { convertJsonToXml } from '../../../shared/convert.js';
import { picklistPrompts } from '../../../shared/prompts/picklist.js';
Expand Down Expand Up @@ -82,9 +79,9 @@ type SaveableCustomField = Pick<
| 'startingNumber'
| 'defaultValue'
| 'securityClassification'
| 'displayLocationInDecimal'
> & {
type: (typeof supportedFieldTypesCustomObject)[number];
displayLocationInDecimal?: boolean;
};

export type FieldGenerateResult = {
Expand Down Expand Up @@ -176,7 +173,7 @@ export default class FieldGenerate extends SfCommand<FieldGenerateResult> {
},
path: path.join(object, 'fields', `${fullName}.field-meta.xml`),
};
this.styledJSON(result as AnyJson);
this.styledJSON(result);
await fs.promises.mkdir(path.join(object, 'fields'), { recursive: true });
await fs.promises.writeFile(result.path, convertJsonToXml({ json: result.field, type: 'CustomField' }));

Expand Down
5 changes: 2 additions & 3 deletions src/commands/schema/generate/platformevent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import { dirname } from 'node:path';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core/messages';
import select from '@inquirer/select';
import type { AnyJson } from '@salesforce/ts-types';
import { select } from '@inquirer/prompts';
import { apiNamePrompt } from '../../../shared/prompts/apiName.js';
import { pluralPrompt } from '../../../shared/prompts/plural.js';
import { directoryPrompt } from '../../../shared/prompts/directory.js';
Expand Down Expand Up @@ -70,7 +69,7 @@ export default class PlatformEventGenerate extends SfCommand<PlatformEventGenera
label: flags.label,
};

this.styledJSON(objectToWrite as AnyJson);
this.styledJSON(objectToWrite);
const writePath = await writeObjectFile(directory, objectToWrite);
this.info(messages.getMessage('success.field', [dirname(writePath)]));

Expand Down
3 changes: 1 addition & 2 deletions src/commands/schema/generate/sobject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* limitations under the License.
*/
import { dirname } from 'node:path';
import select from '@inquirer/select';
import confirm from '@inquirer/confirm';
import { select, confirm } from '@inquirer/prompts';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core/messages';
import { nameFieldPrompts } from '../../../shared/prompts/nameField.js';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/apiName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import input from '@inquirer/input';
import { input } from '@inquirer/prompts';
import { Messages } from '@salesforce/core/messages';
import { makeNameApiCompatible } from './functions.js';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { Messages } from '@salesforce/core/messages';
import input from '@inquirer/input';
import { input } from '@inquirer/prompts';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
export const messages = Messages.loadMessages('@salesforce/plugin-sobject', 'prompts.shared');
Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { type NamedPackageDir, Messages } from '@salesforce/core';
import select from '@inquirer/select';
import { select } from '@inquirer/prompts';
import { getDirectoriesThatContainObjects } from '../fs.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/fields/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import input from '@inquirer/input';
import { input } from '@inquirer/prompts';
import { Messages } from '@salesforce/core/messages';
import { integerValidation } from '../functions.js';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/fields/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import input from '@inquirer/input';
import { input } from '@inquirer/prompts';
import { integerValidation } from '../functions.js';

const MAX_LONG_TEXT_LENGTH = 131_072;
Expand Down
3 changes: 1 addition & 2 deletions src/shared/prompts/nameField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/

import { Messages } from '@salesforce/core/messages';
import input from '@inquirer/input';
import select from '@inquirer/select';
import { input, select } from '@inquirer/prompts';

import { FieldType } from '@salesforce/types/metadata';
import { NameField } from '../types.js';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import select from '@inquirer/select';
import { select } from '@inquirer/prompts';
import { Messages, type NamedPackageDir } from '@salesforce/core';
import { getObjectDirectories } from '../fs.js';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/picklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import input from '@inquirer/input';
import { input } from '@inquirer/prompts';
import { Messages } from '@salesforce/core/messages';
import type { ValueSet, CustomValue } from '@salesforce/types/metadata';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/prompts/plural.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import input from '@inquirer/input';
import { input } from '@inquirer/prompts';
import { Messages } from '@salesforce/core/messages';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
Expand Down
4 changes: 1 addition & 3 deletions src/shared/prompts/relationshipField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
*/
import path from 'node:path';
import input from '@inquirer/input';
import confirm from '@inquirer/confirm';
import select from '@inquirer/select';
import { input, confirm, select } from '@inquirer/prompts';
import { Messages, type NamedPackageDir } from '@salesforce/core';
import type { CustomField, DeleteConstraint } from '@salesforce/types/metadata';
import { getObjectXmlByFolderAsJson } from '../fs.js';
Expand Down
25 changes: 0 additions & 25 deletions test/.eslintrc.cjs

This file was deleted.

Loading
Loading