diff --git a/.sfdevrc.json b/.sfdevrc.json index 26f3c0b0..e16812b9 100644 --- a/.sfdevrc.json +++ b/.sfdevrc.json @@ -1,5 +1,17 @@ { "test": { "testsPath": "test/**/*.test.ts" + }, + "wireit": { + "test": { + "dependencies": [ + "test:compile", + "test:only", + "test:command-reference", + "test:deprecation-policy", + "lint", + "link-check" + ] + } } } diff --git a/package.json b/package.json index 219a9597..99187064 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,6 @@ "test:command-reference", "test:deprecation-policy", "lint", - "test:json-schema", "link-check" ] }, diff --git a/schemas/schema-generate-field.json b/schemas/schema-generate-field.json deleted file mode 100644 index 5560e8bb..00000000 --- a/schemas/schema-generate-field.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/FieldGenerateResult", - "definitions": { - "FieldGenerateResult": { - "type": "object", - "properties": { - "field": { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "$ref": "#/definitions/FieldType" - }, - "label": { - "type": "string" - }, - "description": { - "type": "string" - }, - "trackHistory": { - "type": "boolean" - }, - "inlineHelpText": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "fullName": { - "type": "string" - }, - "scale": { - "type": "number" - }, - "precision": { - "type": "number" - }, - "visibleLines": { - "type": "number" - }, - "length": { - "type": "number" - }, - "unique": { - "type": "boolean" - }, - "externalId": { - "type": "boolean" - }, - "startingNumber": { - "type": "number" - }, - "defaultValue": { - "type": "string" - }, - "securityClassification": { - "type": "string" - }, - "displayLocationInDecimal": { - "type": "boolean" - } - }, - "required": ["type"] - }, - "path": { - "type": "string" - } - }, - "required": ["field", "path"], - "additionalProperties": false - }, - "FieldType": { - "type": "string", - "enum": [ - "AutoNumber", - "Lookup", - "MasterDetail", - "Checkbox", - "Currency", - "Date", - "DateTime", - "Email", - "Number", - "Percent", - "Phone", - "Picklist", - "MultiselectPicklist", - "Text", - "TextArea", - "LongTextArea", - "Html", - "Url", - "EncryptedText", - "Summary", - "Hierarchy", - "File", - "MetadataRelationship", - "Location", - "ExternalLookup", - "IndirectLookup", - "CustomDataType", - "Time", - "Address", - "Array" - ] - } - } -} diff --git a/schemas/schema-generate-platformevent.json b/schemas/schema-generate-platformevent.json deleted file mode 100644 index f65bdc3e..00000000 --- a/schemas/schema-generate-platformevent.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/PlatformEventGenerateResult", - "definitions": { - "PlatformEventGenerateResult": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/SaveablePlatformEvent" - }, - "path": { - "type": "string" - } - }, - "required": ["object", "path"], - "additionalProperties": false - }, - "SaveablePlatformEvent": { - "type": "object", - "properties": { - "fullName": { - "type": "string" - }, - "label": { - "type": "string" - }, - "deploymentStatus": { - "$ref": "#/definitions/DeploymentStatus" - }, - "description": { - "type": "string" - }, - "pluralLabel": { - "type": "string" - }, - "eventType": { - "$ref": "#/definitions/PlatformEventType" - }, - "publishBehavior": { - "$ref": "#/definitions/PlatformEventPublishBehavior" - } - }, - "additionalProperties": false, - "description": "This type represents a PlatformEvent that can deploy." - }, - "DeploymentStatus": { - "type": "string", - "enum": ["InDevelopment", "Deployed"] - }, - "PlatformEventType": { - "type": "string", - "enum": ["HighVolume", "StandardVolume", "ExternalEvent"] - }, - "PlatformEventPublishBehavior": { - "type": "string", - "enum": ["PublishAfterCommit", "PublishImmediately"] - } - } -} diff --git a/schemas/schema-generate-sobject.json b/schemas/schema-generate-sobject.json deleted file mode 100644 index 16c88358..00000000 --- a/schemas/schema-generate-sobject.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CustomObjectGenerateResult", - "definitions": { - "CustomObjectGenerateResult": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/SaveableCustomObject" - }, - "path": { - "type": "string" - } - }, - "required": ["object", "path"], - "additionalProperties": false - }, - "SaveableCustomObject": { - "type": "object", - "additionalProperties": false, - "properties": { - "nameField": { - "$ref": "#/definitions/NameField" - }, - "label": { - "type": "string" - }, - "deploymentStatus": { - "$ref": "#/definitions/DeploymentStatus" - }, - "description": { - "type": "string" - }, - "enableHistory": { - "type": "boolean" - }, - "enableActivities": { - "type": "boolean" - }, - "enableBulkApi": { - "type": "boolean" - }, - "enableFeeds": { - "type": "boolean" - }, - "enableReports": { - "type": "boolean" - }, - "enableSearch": { - "type": "boolean" - }, - "enableStreamingApi": { - "type": "boolean" - }, - "enableSharing": { - "type": "boolean" - }, - "pluralLabel": { - "type": "string" - }, - "sharingModel": { - "$ref": "#/definitions/SharingModel" - }, - "fullName": { - "type": "string" - } - }, - "required": ["nameField"], - "description": "This type represents a \"classical\" CustomObject subset that can deploy." - }, - "NameField": { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/FieldType" - }, - "displayFormat": { - "type": "string" - } - }, - "additionalProperties": false, - "description": "Used by classical CustomObject" - }, - "FieldType": { - "type": "string", - "enum": [ - "AutoNumber", - "Lookup", - "MasterDetail", - "Checkbox", - "Currency", - "Date", - "DateTime", - "Email", - "Number", - "Percent", - "Phone", - "Picklist", - "MultiselectPicklist", - "Text", - "TextArea", - "LongTextArea", - "Html", - "Url", - "EncryptedText", - "Summary", - "Hierarchy", - "File", - "MetadataRelationship", - "Location", - "ExternalLookup", - "IndirectLookup", - "CustomDataType", - "Time", - "Address", - "Array" - ] - }, - "DeploymentStatus": { - "type": "string", - "enum": ["InDevelopment", "Deployed"] - }, - "SharingModel": { - "type": "string", - "enum": [ - "Private", - "Read", - "ReadSelect", - "ReadWrite", - "ReadWriteTransfer", - "FullAccess", - "ControlledByParent", - "ControlledByLeadOrContact", - "ControlledByCampaign" - ] - } - } -} diff --git a/schemas/schema-generate-tab.json b/schemas/schema-generate-tab.json deleted file mode 100644 index 3b9404ff..00000000 --- a/schemas/schema-generate-tab.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GenerateTabResult", - "definitions": { - "GenerateTabResult": { - "type": "object", - "properties": { - "tab": { - "type": "object", - "properties": { - "customObject": { - "type": "boolean" - }, - "motif": { - "type": "string" - } - }, - "additionalProperties": false - }, - "path": { - "type": "string" - } - }, - "required": ["tab", "path"], - "additionalProperties": false - } - } -} diff --git a/src/commands/schema/generate/field.ts b/src/commands/schema/generate/field.ts index 338e4313..b1cbc9d0 100644 --- a/src/commands/schema/generate/field.ts +++ b/src/commands/schema/generate/field.ts @@ -14,7 +14,7 @@ import confirm from '@inquirer/confirm'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; import type { AnyJson } from '@salesforce/ts-types'; -import type { CustomField } from '../../../../node_modules/@salesforce/types/lib/metadata.js'; +import type { CustomField } from '@salesforce/types/metadata'; import { convertJsonToXml } from '../../../shared/convert.js'; import { picklistPrompts } from '../../../shared/prompts/picklist.js'; import { integerValidation } from '../../../shared/prompts/functions.js'; diff --git a/src/commands/schema/generate/tab.ts b/src/commands/schema/generate/tab.ts index 04fb29a4..e446b647 100644 --- a/src/commands/schema/generate/tab.ts +++ b/src/commands/schema/generate/tab.ts @@ -10,7 +10,7 @@ import path from 'node:path'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core/messages'; -import type { CustomTab } from '../../../../node_modules/@salesforce/types/lib/metadata.js'; +import type { CustomTab } from '@salesforce/types/metadata'; import { isTabsFolder } from '../../../shared/flags.js'; import { convertJsonToXml } from '../../../shared/convert.js'; diff --git a/src/shared/convert.ts b/src/shared/convert.ts index 2cbf85c2..7b10e8c4 100644 --- a/src/shared/convert.ts +++ b/src/shared/convert.ts @@ -8,7 +8,7 @@ import * as jsToXml from 'js2xmlparser'; import { XMLParser } from 'fast-xml-parser'; import type { IOptions } from 'js2xmlparser/lib/options.js'; import type { JsonMap } from '@salesforce/ts-types'; -import type { CustomObject, CustomField } from '../../node_modules/@salesforce/types/lib/metadata.js'; +import type { CustomObject, CustomField } from '@salesforce/types/metadata'; const standardOptions: IOptions = { declaration: { diff --git a/src/shared/fs.ts b/src/shared/fs.ts index 21f5f089..77aaaa80 100644 --- a/src/shared/fs.ts +++ b/src/shared/fs.ts @@ -7,7 +7,7 @@ import path from 'node:path'; import fs from 'node:fs'; import fg from 'fast-glob'; -import type { CustomObject } from '../../node_modules/@salesforce/types/lib/metadata.js'; +import type { CustomObject } from '@salesforce/types/metadata'; import { convertJsonToXml, parseXml } from './convert.js'; import { SaveableCustomObject, SaveablePlatformEvent } from './types.js'; diff --git a/src/shared/prompts/nameField.ts b/src/shared/prompts/nameField.ts index 27b00cf2..428b6d0f 100644 --- a/src/shared/prompts/nameField.ts +++ b/src/shared/prompts/nameField.ts @@ -9,7 +9,7 @@ import { Messages } from '@salesforce/core/messages'; import input from '@inquirer/input'; import select from '@inquirer/select'; -import { FieldType } from '../../../node_modules/@salesforce/types/lib/metadata.js'; +import { FieldType } from '@salesforce/types/metadata'; import { NameField } from '../types.js'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); diff --git a/src/shared/prompts/picklist.ts b/src/shared/prompts/picklist.ts index 7c2b2bf0..4709e4a6 100644 --- a/src/shared/prompts/picklist.ts +++ b/src/shared/prompts/picklist.ts @@ -6,7 +6,7 @@ */ import input from '@inquirer/input'; import { Messages } from '@salesforce/core/messages'; -import type { ValueSet, CustomValue } from '../../../node_modules/@salesforce/types/lib/metadata.js'; +import type { ValueSet, CustomValue } from '@salesforce/types/metadata'; /** * recursively keep adding picklist values until the user says to stop diff --git a/src/shared/prompts/relationshipField.ts b/src/shared/prompts/relationshipField.ts index 00a82f94..ee4facb4 100644 --- a/src/shared/prompts/relationshipField.ts +++ b/src/shared/prompts/relationshipField.ts @@ -9,7 +9,7 @@ import input from '@inquirer/input'; import confirm from '@inquirer/confirm'; import select from '@inquirer/select'; import { Messages, type NamedPackageDir } from '@salesforce/core'; -import type { CustomField, DeleteConstraint } from '../../../node_modules/@salesforce/types/lib/metadata.js'; +import type { CustomField, DeleteConstraint } from '@salesforce/types/metadata'; import { getObjectXmlByFolderAsJson } from '../fs.js'; import { objectPrompt } from './object.js'; import { makeNameApiCompatible } from './functions.js'; diff --git a/src/shared/types.ts b/src/shared/types.ts index 7966faf1..b7d0d4e5 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -5,7 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import type { CustomObject, CustomField } from '../../node_modules/@salesforce/types/lib/metadata.js'; +import type { CustomObject, CustomField } from '@salesforce/types/metadata'; /** Used by classical CustomObject */ export type NameField = Pick; diff --git a/test/shared/convert.test.ts b/test/shared/convert.test.ts index d4fdd279..72d71080 100644 --- a/test/shared/convert.test.ts +++ b/test/shared/convert.test.ts @@ -5,7 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { expect } from 'chai'; -import type { CustomObject } from '../../node_modules/@salesforce/types/lib/metadata.js'; +import type { CustomObject } from '@salesforce/types/metadata'; import { parseXml } from '../../src/shared/convert.js'; // tests configurations of the xml parser diff --git a/yarn.lock b/yarn.lock index 0d6d5480..2641082b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6892,7 +6892,16 @@ srcset@^5.0.0: resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.0.tgz#9df6c3961b5b44a02532ce6ae4544832609e2e3f" integrity sha512-SqEZaAEhe0A6ETEa9O1IhSPC7MdvehZtCnTR0AftXk3QhY2UNgb+NApFOUPZILXk/YTDfFxMTNJOBpzrJsEdIA== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -6951,7 +6960,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -7489,7 +7505,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -7507,6 +7523,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"