@salesforce/core 6.1.0 → 6.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,12 @@ export type PackageDir = {
23
23
  versionDescription?: string;
24
24
  versionName?: string;
25
25
  versionNumber?: string;
26
+ unpackagedMetadata?: {
27
+ path: string;
28
+ };
29
+ seedMetadata?: {
30
+ path: string;
31
+ };
26
32
  };
27
33
  export type NamedPackageDir = PackageDir & {
28
34
  /**
@@ -65,15 +71,14 @@ export type ProjectJson = ConfigContents & {
65
71
  *
66
72
  * **See** [force:project:create](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_create_new.htm)
67
73
  */
68
- export declare class SfProjectJson extends ConfigFile {
74
+ export declare class SfProjectJson extends ConfigFile<ConfigFile.Options, ProjectJson> {
69
75
  static BLOCKLIST: string[];
70
76
  static getFileName(): string;
71
77
  static getDefaultOptions(isGlobal?: boolean): ConfigFile.Options;
72
- read(): Promise<ConfigContents>;
73
- readSync(): ConfigContents;
74
- write(): Promise<ConfigContents>;
75
- writeSync(): ConfigContents;
76
- getContents(): ProjectJson;
78
+ read(): Promise<ProjectJson>;
79
+ readSync(): ProjectJson;
80
+ write(): Promise<ProjectJson>;
81
+ writeSync(): ProjectJson;
77
82
  getDefaultOptions(options?: ConfigFile.Options): ConfigFile.Options;
78
83
  /**
79
84
  * Validates sfdx-project.json against the schema.
package/lib/sfProject.js CHANGED
@@ -66,9 +66,6 @@ class SfProjectJson extends configFile_1.ConfigFile {
66
66
  this.validateKeys();
67
67
  return super.writeSync();
68
68
  }
69
- getContents() {
70
- return super.getContents();
71
- }
72
69
  // eslint-disable-next-line class-methods-use-this
73
70
  getDefaultOptions(options) {
74
71
  return { ...{ isState: false }, ...(options ?? {}) };
@@ -273,13 +270,12 @@ class SfProjectJson extends configFile_1.ConfigFile {
273
270
  });
274
271
  // merge new package dir with existing entry, if present
275
272
  const packageDirEntry = Object.assign({}, dirIndex > -1 ? this.getContents().packageDirectories[dirIndex] : packageDir, packageDir);
276
- // update package dir entries
277
- if (dirIndex > -1) {
278
- this.getContents().packageDirectories[dirIndex] = packageDirEntry;
279
- }
280
- else {
281
- this.getContents().packageDirectories.push(packageDirEntry);
282
- }
273
+ const modifiedPackagesDirs = dirIndex > -1
274
+ ? // replace the matching entry with the new entry
275
+ this.getContents().packageDirectories.map((pd, i) => (i === dirIndex ? packageDir : pd))
276
+ : // add the new entry to the end of the list
277
+ [...(this.getContents()?.packageDirectories ?? []), packageDirEntry];
278
+ this.set('packageDirectories', modifiedPackagesDirs);
283
279
  }
284
280
  // eslint-disable-next-line class-methods-use-this
285
281
  doesPackageExist(packagePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "6.1.0",
3
+ "version": "6.1.2",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -59,7 +59,7 @@
59
59
  "ts-retry-promise": "^0.7.1"
60
60
  },
61
61
  "devDependencies": {
62
- "@salesforce/dev-scripts": "^6.0.3",
62
+ "@salesforce/dev-scripts": "^6.0.4",
63
63
  "@salesforce/ts-sinon": "^1.4.19",
64
64
  "@types/benchmark": "^2.1.3",
65
65
  "@types/chai-string": "^1.4.5",