Skip to content

Commit

Permalink
refactor: remove barrel files
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Oct 24, 2023
1 parent 938e5da commit 02bc9d6
Show file tree
Hide file tree
Showing 28 changed files with 54 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/config/authInfoConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 { AuthFields } from '../org';
import { AuthFields } from '../org/authInfo';
import { ConfigFile } from './configFile';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/config/sandboxProcessCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 { Duration } from '@salesforce/kit';
import { SandboxProcessObject, SandboxRequest } from '../org';
import { SandboxProcessObject, SandboxRequest } from '../org/org';
import { Global } from '../global';
import { TTLConfig } from './ttlConfig';

Expand Down
3 changes: 2 additions & 1 deletion src/deviceOauthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { HttpRequest, OAuth2Config } from 'jsforce';
import { ensureString, JsonMap, Nullable } from '@salesforce/ts-types';
import * as FormData from 'form-data';
import { Logger } from './logger/logger';
import { AuthInfo, DEFAULT_CONNECTED_APP_INFO, SFDX_HTTP_HEADERS } from './org';
import { AuthInfo, DEFAULT_CONNECTED_APP_INFO } from './org/authInfo';
import { SFDX_HTTP_HEADERS } from './org/connection';
import { SfError } from './sfError';
import { Messages } from './messages';

Expand Down
4 changes: 2 additions & 2 deletions src/exported.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export { envVars, EnvironmentVariable, SUPPORTED_ENV_VARS, EnvVars } from './con

export { ConfigStore } from './config/configStore';
export { ConfigEntry, ConfigContents, ConfigValue } from './config/configStackTypes';
export { StateAggregator } from './stateAggregator';
export { StateAggregator } from './stateAggregator/stateAggregator';

export { DeviceOauthService, DeviceCodeResponse, DeviceCodePollingResponse } from './deviceOauthService';

Expand Down Expand Up @@ -70,7 +70,7 @@ export {
OrgTypes,
ResultEvent,
ScratchOrgRequest,
} from './org';
} from './org/org';

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

Expand Down
2 changes: 1 addition & 1 deletion src/org/authInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { ConfigAggregator } from '../config/configAggregator';
import { Logger } from '../logger/logger';
import { SfError } from '../sfError';
import { matchesAccessToken, trimTo15 } from '../util/sfdc';
import { StateAggregator } from '../stateAggregator';
import { StateAggregator } from '../stateAggregator/stateAggregator';
import { Messages } from '../messages';
import { getLoginAudienceCombos, SfdcUrl } from '../util/sfdcUrl';
import { Connection, SFDX_HTTP_HEADERS } from './connection';
Expand Down
4 changes: 2 additions & 2 deletions src/org/authRemover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { JsonMap } from '@salesforce/ts-types';
import { ConfigAggregator } from '../config/configAggregator';
import { Logger } from '../logger/logger';
import { Messages } from '../messages';
import { StateAggregator } from '../stateAggregator';
import { StateAggregator } from '../stateAggregator/stateAggregator';
import { OrgConfigProperties } from './orgConfigProperties';
import { AuthFields } from '.';
import { AuthFields } from './authInfo';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/core', 'auth');
Expand Down
13 changes: 0 additions & 13 deletions src/org/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/org/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { SfError } from '../sfError';
import { trimTo15 } from '../util/sfdc';
import { WebOAuthServer } from '../webOAuthServer';
import { Messages } from '../messages';
import { StateAggregator } from '../stateAggregator';
import { StateAggregator } from '../stateAggregator/stateAggregator';
import { PollingClient } from '../status/pollingClient';
import { StatusResult } from '../status/types';
import { Connection, SingleRecordQueryErrors } from './connection';
Expand Down
2 changes: 1 addition & 1 deletion src/org/scratchOrgCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Logger } from '../logger/logger';
import { ConfigAggregator } from '../config/configAggregator';
import { OrgConfigProperties } from '../org/orgConfigProperties';
import { SfProject } from '../sfProject';
import { StateAggregator } from '../stateAggregator';
import { StateAggregator } from '../stateAggregator/stateAggregator';
import { Org } from './org';
import {
authorizeScratchOrg,
Expand Down
2 changes: 1 addition & 1 deletion src/stateAggregator/accessors/orgAccessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Nullable, entriesOf } from '@salesforce/ts-types';
import { AsyncOptionalCreatable, isEmpty } from '@salesforce/kit';
import { AuthInfoConfig } from '../../config/authInfoConfig';
import { Global } from '../../global';
import { AuthFields } from '../../org';
import { AuthFields } from '../../org/authInfo';
import { ConfigFile } from '../../config/configFile';
import { ConfigContents } from '../../config/configStackTypes';
import { Logger } from '../../logger/logger';
Expand Down
2 changes: 1 addition & 1 deletion src/stateAggregator/accessors/sandboxAccessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* eslint-disable class-methods-use-this */

import { SandboxOrgConfig } from '../../config/sandboxOrgConfig';
import { SandboxFields } from '../../org';
import { SandboxFields } from '../../org/org';
import { BaseOrgAccessor } from './orgAccessor';

export class SandboxAccessor extends BaseOrgAccessor<SandboxOrgConfig, SandboxFields> {
Expand Down
10 changes: 0 additions & 10 deletions src/stateAggregator/index.ts

This file was deleted.

7 changes: 5 additions & 2 deletions src/testSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ import { SfError } from './sfError';
import { SfProject, SfProjectJson } from './sfProject';
import * as aliasAccessorEntireFile from './stateAggregator/accessors/aliasAccessor';
import { CometClient, CometSubscription, Message, StreamingExtension } from './status/streamingClient';
import { OrgAccessor, StateAggregator } from './stateAggregator';
import { AuthFields, Org, SandboxFields, User, UserFields } from './org';
import { StateAggregator } from './stateAggregator/stateAggregator';
import { OrgAccessor } from './stateAggregator/accessors/orgAccessor';
import { Org, SandboxFields } from './org/org';
import { AuthFields } from './org/authInfo';
import { User, UserFields } from './org/user';
import { SandboxAccessor } from './stateAggregator/accessors/sandboxAccessor';
import { Global } from './global';
import { uniqid } from './util/uniqid';
Expand Down
2 changes: 1 addition & 1 deletion src/webOAuthServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { OAuth2 } from 'jsforce';
import { AsyncCreatable, Env, set, toNumber } from '@salesforce/kit';
import { asString, get, Nullable } from '@salesforce/ts-types';
import { Logger } from './logger/logger';
import { AuthInfo, DEFAULT_CONNECTED_APP_INFO } from './org';
import { AuthInfo, DEFAULT_CONNECTED_APP_INFO } from './org/authInfo';
import { SfError } from './sfError';
import { Messages } from './messages';
import { SfProjectJson } from './sfProject';
Expand Down
3 changes: 2 additions & 1 deletion test/unit/deviceOauthServiceTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { StubbedType, stubInterface, stubMethod } from '@salesforce/ts-sinon';
import { expect } from 'chai';
import { MockTestOrgData, TestContext } from '../../src/testSetup';
import { DeviceOauthService } from '../../src/deviceOauthService';
import { AuthFields, AuthInfo, DEFAULT_CONNECTED_APP_INFO, SFDX_HTTP_HEADERS } from '../../src/org';
import { AuthFields, AuthInfo, DEFAULT_CONNECTED_APP_INFO } from '../../src/org/authInfo';
import { SFDX_HTTP_HEADERS } from '../../src/org/connection';

const deviceCodeResponse = {
device_code: '1234',
Expand Down
7 changes: 5 additions & 2 deletions test/unit/org/authInfoTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ import { Transport } from 'jsforce/lib/transport';

import { OAuth2 } from 'jsforce';
import { SinonSpy, SinonStub, match } from 'sinon';
import { AuthFields, AuthInfo, Org } from '../../../src/org';
import { Org } from '../../../src/org/org';
import { AuthFields, AuthInfo } from '../../../src/org/authInfo';
import { JwtOAuth2Config } from '../../../src/org/authInfo';
import { MockTestOrgData, shouldThrow, shouldThrowSync, TestContext } from '../../../src/testSetup';
import { OrgConfigProperties } from '../../../src/org/orgConfigProperties';
import { AliasAccessor, OrgAccessor, StateAggregator } from '../../../src/stateAggregator';
import { StateAggregator } from '../../../src/stateAggregator/stateAggregator';
import { AliasAccessor } from '../../../src/stateAggregator/accessors/aliasAccessor';
import { OrgAccessor } from '../../../src/stateAggregator/accessors/orgAccessor';
import { Crypto } from '../../../src/crypto/crypto';
import { Config } from '../../../src/config/config';
import { SfdcUrl } from '../../../src/util/sfdcUrl';
Expand Down
4 changes: 2 additions & 2 deletions test/unit/org/authRemoverTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { spyMethod } from '@salesforce/ts-sinon';
import { expect } from 'chai';
import { AuthRemover } from '../../../src/org/authRemover';
import { Config } from '../../../src/config/config';
import { AliasAccessor } from '../../../src/stateAggregator';
import { AliasAccessor } from '../../../src/stateAggregator/accessors/aliasAccessor';
import { MockTestOrgData, shouldThrow, TestContext } from '../../../src/testSetup';
import { OrgConfigProperties } from '../../../src/org/orgConfigProperties';
import { AuthFields } from '../../../src/org';
import { AuthFields } from '../../../src/org/authInfo';
import { SfError } from '../../../src/sfError';

describe('AuthRemover', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/org/connectionTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { expect } from 'chai';
import { fromStub, StubbedType, stubInterface, stubMethod } from '@salesforce/ts-sinon';
import { Duration } from '@salesforce/kit';
import { Connection as JSForceConnection, HttpRequest } from 'jsforce';
import { AuthInfo } from '../../../src/org';
import { AuthInfo } from '../../../src/org/authInfo';
import { MyDomainResolver } from '../../../src/status/myDomainResolver';
import { Connection, DNS_ERROR_NAME, SFDX_HTTP_HEADERS, SingleRecordQueryErrors } from '../../../src/org/connection';
import { shouldThrow, shouldThrowSync, TestContext } from '../../../src/testSetup';
Expand Down
15 changes: 5 additions & 10 deletions test/unit/org/orgTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,18 @@ import { assert, expect, config as chaiConfig } from 'chai';
import { OAuth2 } from 'jsforce';
import { Transport } from 'jsforce/lib/transport';
import { SinonSpy, SinonStub } from 'sinon';
import {
AuthInfo,
Connection,
Org,
SandboxEvents,
SandboxProcessObject,
SandboxUserAuthResponse,
SingleRecordQueryErrors,
} from '../../../src/org';
import { Org, SandboxEvents, SandboxProcessObject, SandboxUserAuthResponse } from '../../../src/org/org';
import { AuthInfo } from '../../../src/org/authInfo';
import {} from '../../../src/org/connection';
import { Connection, SingleRecordQueryErrors } from '../../../src/org/connection';
import { Config } from '../../../src/config/config';
import { ConfigAggregator } from '../../../src/config/configAggregator';
import { ConfigFile } from '../../../src/config/configFile';
import { OrgUsersConfig } from '../../../src/config/orgUsersConfig';
import { Global } from '../../../src/global';
import { MockTestOrgData, shouldThrow, shouldThrowSync, TestContext } from '../../../src/testSetup';
import { MyDomainResolver } from '../../../src/status/myDomainResolver';
import { StateAggregator } from '../../../src/stateAggregator';
import { StateAggregator } from '../../../src/stateAggregator/stateAggregator';
import { OrgConfigProperties } from '../../../src/org/orgConfigProperties';
import { Messages } from '../../../src/messages';
import { SfError } from '../../../src/sfError';
Expand Down
3 changes: 2 additions & 1 deletion test/unit/org/scratchOrgCreateTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { expect } from 'chai';
import * as sinon from 'sinon';
import { Duration } from '@salesforce/kit';
import { Connection } from 'jsforce';
import { AuthInfo, Org } from '../../../src/org';
import { Org } from '../../../src/org/org';
import { AuthInfo } from '../../../src/org/authInfo';
import { SfProject, SfProjectJson } from '../../../src/sfProject';
import { scratchOrgCreate, ScratchOrgCreateOptions, scratchOrgResume } from '../../../src/org/scratchOrgCreate';
import { ScratchOrgCache } from '../../../src/org/scratchOrgCache';
Expand Down
4 changes: 3 additions & 1 deletion test/unit/org/scratchOrgInfoApiTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import * as sinon from 'sinon';
import { assert, expect } from 'chai';
import { Duration, env } from '@salesforce/kit';
import { stubMethod } from '@salesforce/ts-sinon';
import { AuthInfo, Connection, Org } from '../../../src/org';
import { Org } from '../../../src/org/org';
import { Connection } from '../../../src/org/connection';
import { AuthInfo } from '../../../src/org/authInfo';
import { shouldThrow } from '../../../src/testSetup';
import { MyDomainResolver } from '../../../src/status/myDomainResolver';
import SettingsGenerator from '../../../src/org/scratchOrgSettingsGenerator';
Expand Down
3 changes: 2 additions & 1 deletion test/unit/org/scratchOrgInfoGeneratorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import * as sinon from 'sinon';
import { expect } from 'chai';
import { stubMethod, stubInterface } from '@salesforce/ts-sinon';
import { MockTestOrgData, shouldThrow, TestContext } from '../../../src/testSetup';
import { Org, Connection } from '../../../src/org';
import { Org } from '../../../src/org/org';
import { Connection } from '../../../src/org/connection';
import {
ScratchOrgInfoPayload,
getAncestorIds,
Expand Down
3 changes: 2 additions & 1 deletion test/unit/org/scratchOrgSettingsGeneratorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import * as path from 'path';
import * as sinon from 'sinon';
import { expect } from 'chai';
import { Org, Connection } from '../../../src/org';
import { Org } from '../../../src/org/org';
import { Connection } from '../../../src/org/connection';
import { validateApiVersion } from '../../../src/util/sfdc';
import { ZipWriter } from '../../../src/util/zipWriter';
import { ScratchOrgInfo } from '../../../src/org/scratchOrgTypes';
Expand Down
6 changes: 5 additions & 1 deletion test/unit/org/userTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { AnyJson, isString } from '@salesforce/ts-types';
import { expect } from 'chai';
import { SecureBuffer } from '../../../src/crypto/secureBuffer';
import { MockTestOrgData, shouldThrow, shouldThrowSync, TestContext } from '../../../src/testSetup';
import { DefaultUserFields, User, PermissionSetAssignment, Org, Connection, AuthInfo } from '../../../src/org';
import { Org } from '../../../src/org/org';
import { DefaultUserFields, User } from '../../../src/org/user';
import { AuthInfo } from '../../../src/org/authInfo';
import { Connection } from '../../../src/org/connection';
import { PermissionSetAssignment } from '../../../src/org/permissionSetAssignment';

describe('User Tests', () => {
const $$ = new TestContext();
Expand Down
3 changes: 2 additions & 1 deletion test/unit/stateAggregator/accessors/aliasAccessorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { existsSync } from 'node:fs';
import { rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { expect } from 'chai';
import { FILENAME, StateAggregator } from '../../../../src/stateAggregator';
import { StateAggregator } from '../../../../src/stateAggregator/stateAggregator';
import { FILENAME } from '../../../../src/stateAggregator/accessors/aliasAccessor';
import { MockTestOrgData, TestContext } from '../../../../src/testSetup';
import { Global } from '../../../../src/global';
import { uniqid } from '../../../../src/util/uniqid';
Expand Down
4 changes: 2 additions & 2 deletions test/unit/stateAggregator/accessors/orgAccessorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 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 { StateAggregator } from '../../../../src/stateAggregator';
import { AuthFields } from '../../../../src/org';
import { StateAggregator } from '../../../../src/stateAggregator/stateAggregator';
import { AuthFields } from '../../../../src/org/authInfo';
import { MockTestOrgData, shouldThrowSync, TestContext } from '../../../../src/testSetup';
import { uniqid } from '../../../../src/util/uniqid';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/stateAggregator/accessors/sandboxAccessorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 { StateAggregator } from '../../../../src/stateAggregator';
import { StateAggregator } from '../../../../src/stateAggregator/stateAggregator';
import { MockTestOrgData, MockTestSandboxData, TestContext } from '../../../../src/testSetup';
import { uniqid } from '../../../../src/util/uniqid';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/status/streamingClientTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SinonSpyCall } from 'sinon';
import { Duration } from '@salesforce/kit';
import { get, JsonMap } from '@salesforce/ts-types';
import { CometClient, StatusResult, StreamingClient } from '../../../src/status/streamingClient';
import { Connection } from '../../../src/org';
import { Connection } from '../../../src/org/connection';
// import { Crypto } from '../../../src/crypto/crypto';
import { Org } from '../../../src/org/org';
import { SfError } from '../../../src/sfError';
Expand Down

3 comments on commit 02bc9d6

@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: 02bc9d6 Previous: 938e5da Ratio
Child logger creation 473126 ops/sec (±8.65%) 546590 ops/sec (±0.86%) 1.16
Logging a string on root logger 637687 ops/sec (±11.36%) 602054 ops/sec (±10.86%) 0.94
Logging an object on root logger 378667 ops/sec (±16.24%) 316695 ops/sec (±16.27%) 0.84
Logging an object with a message on root logger 214855 ops/sec (±18.32%) 187608 ops/sec (±21.44%) 0.87
Logging an object with a redacted prop on root logger 258952 ops/sec (±17.47%) 195946 ops/sec (±19.67%) 0.76
Logging a nested 3-level object on root logger 11460 ops/sec (±187.02%) 150931 ops/sec (±20.88%) 13.17

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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Logger Benchmarks - ubuntu-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 02bc9d6 Previous: 938e5da Ratio
Logging a nested 3-level object on root logger 11460 ops/sec (±187.02%) 150931 ops/sec (±20.88%) 13.17

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: 02bc9d6 Previous: 938e5da Ratio
Child logger creation 391874 ops/sec (±1.33%) 402438 ops/sec (±8.15%) 1.03
Logging a string on root logger 461299 ops/sec (±10.27%) 449593 ops/sec (±13.80%) 0.97
Logging an object on root logger 285973 ops/sec (±20.41%) 295353 ops/sec (±21.21%) 1.03
Logging an object with a message on root logger 167689 ops/sec (±17.87%) 167230 ops/sec (±23.69%) 1.00
Logging an object with a redacted prop on root logger 165913 ops/sec (±21.87%) 170526 ops/sec (±19.53%) 1.03
Logging a nested 3-level object on root logger 117310 ops/sec (±24.53%) 114797 ops/sec (±22.46%) 0.98

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

Please sign in to comment.