Skip to content

Commit

Permalink
feat!: remove exports, major version migration doc
Browse files Browse the repository at this point in the history
BREAKING CHANGES: remove re-export of PackageDir/PackageDirDependency
  • Loading branch information
mshanemc committed Jun 18, 2024
1 parent a77e002 commit 66083f7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
15 changes: 15 additions & 0 deletions MIGRATING_V7-V8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Migrating `@salesforce/core` from v7 to v8

v8 uses the types from `@salesforce/schemas`, for SfProject/SfProjectJson.

The schemas types are more accurate about the PackageDir type (what `sfdx-project.json` packageDirectories is an array of). It is a union type of

1. simply `path`, with an optional default property
1. 1, along with the `package` property and lots of optional properties used for packaging.

To support differentiating between the two structures, 2 type guards are now importable:

1. isPackagingDirectory
1. isNamedPackagingDirectory

`PackageDir` and `PackageDirDependency` are no longer re-exported. If you need them, import them from `@salesforce/schemas`
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export {

export { OrgConfigProperties, ORG_CONFIG_ALLOWED_PROPERTIES } from './org/orgConfigProperties';

export { PackageDir, NamedPackageDir, PackageDirDependency, SfProject, SfProjectJson } from './sfProject';
export { NamedPackageDir, SfProject, SfProjectJson } from './sfProject';

export { SchemaValidator } from './schema/validator';

Expand Down
12 changes: 1 addition & 11 deletions src/sfProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import { basename, dirname, isAbsolute, normalize, resolve, sep } from 'node:pat
import * as fs from 'node:fs';
import { defaults, env } from '@salesforce/kit';
import { Dictionary, ensure, JsonMap, Nullable, Optional } from '@salesforce/ts-types';
import {
PackageDir as PackageDirSchema,
PackageDirDependency as PackageDirDependencySchema,
ProjectJson as ProjectJsonSchema,
PackagePackageDir,
} from '@salesforce/schemas';
import { PackageDir, ProjectJson as ProjectJsonSchema, PackagePackageDir } from '@salesforce/schemas';
import { SfdcUrl } from './util/sfdcUrl';
import { ConfigAggregator } from './config/configAggregator';
import { ConfigFile } from './config/configFile';
Expand All @@ -29,9 +24,6 @@ import { ensureNoUppercaseKeys } from './util/findUppercaseKeys';
Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/core', 'config');

/** @deprecated. Use PackageDirDependency from @salesforce/schemas */
export type PackageDirDependency = PackageDirDependencySchema;

type NamedDirAdditions = {
/**
* The [normalized](https://nodejs.org/api/path.html#path_path_normalize_path) path used as the package name.
Expand All @@ -43,8 +35,6 @@ type NamedDirAdditions = {
fullPath: string;
};

/** @deprecated. Use PackageDir from @salesforce/schemas */
export type PackageDir = PackageDirSchema;
export type NamedPackagingDir = PackagePackageDir & NamedDirAdditions;
export type NamedPackageDir = PackageDir & NamedDirAdditions;

Expand Down

2 comments on commit 66083f7

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: 66083f7 Previous: a77e002 Ratio
Child logger creation 471390 ops/sec (±0.98%) 456182 ops/sec (±0.73%) 0.97
Logging a string on root logger 781655 ops/sec (±8.78%) 794224 ops/sec (±8.80%) 1.02
Logging an object on root logger 627032 ops/sec (±6.39%) 633881 ops/sec (±6.20%) 1.01
Logging an object with a message on root logger 4270 ops/sec (±215.19%) 5259 ops/sec (±217.31%) 1.23
Logging an object with a redacted prop on root logger 435094 ops/sec (±15.65%) 427280 ops/sec (±14.01%) 0.98
Logging a nested 3-level object on root logger 364619 ops/sec (±6.00%) 355863 ops/sec (±9.64%) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: 66083f7 Previous: a77e002 Ratio
Child logger creation 315300 ops/sec (±1.71%) 324587 ops/sec (±1.17%) 1.03
Logging a string on root logger 792703 ops/sec (±6.55%) 800769 ops/sec (±5.07%) 1.01
Logging an object on root logger 592407 ops/sec (±7.06%) 557054 ops/sec (±8.24%) 0.94
Logging an object with a message on root logger 4423 ops/sec (±223.43%) 4116 ops/sec (±211.77%) 0.93
Logging an object with a redacted prop on root logger 505320 ops/sec (±6.70%) 422691 ops/sec (±13.34%) 0.84
Logging a nested 3-level object on root logger 352776 ops/sec (±5.72%) 335559 ops/sec (±4.82%) 0.95

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.