Skip to content

Commit

Permalink
chore: make codebase bundle-able
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxuanzhangsfdx committed Feb 13, 2024
1 parent 5bd3456 commit e01b3cb
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 27 deletions.
3 changes: 2 additions & 1 deletion examples/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"esModuleInterop": true
}
}
2 changes: 1 addition & 1 deletion src/deviceOauthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Transport from 'jsforce/lib/transport';
import { AsyncCreatable, Duration, parseJsonMap, sleep } from '@salesforce/kit';
import { HttpRequest, OAuth2Config } from 'jsforce';
import { ensureString, isString, JsonMap, Nullable } from '@salesforce/ts-types';
import * as FormData from 'form-data';
import FormData from 'form-data';
import { Logger } from './logger/logger';
import { AuthInfo, DEFAULT_CONNECTED_APP_INFO } from './org/authInfo';
import { SFDX_HTTP_HEADERS } from './org/connection';
Expand Down
2 changes: 1 addition & 1 deletion src/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class Logger {
transport: {
pipeline: [
{
target: path.join('..', '..', 'lib', 'logger', 'transformStream'),
target: './transformStream',
},
getWriteStream(level),
],
Expand Down
2 changes: 1 addition & 1 deletion src/status/streamingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { resolve as resolveUrl } from 'node:url';
import { AsyncOptionalCreatable, Duration, Env, env, set } from '@salesforce/kit/lib';
import { AnyFunction, AnyJson, ensure, ensureString, JsonMap } from '@salesforce/ts-types/lib';
import * as Faye from 'faye';
import Faye from 'faye';
import { Logger } from '../logger/logger';
import { Org } from '../org/org';
import { SfError } from '../sfError';
Expand Down
2 changes: 1 addition & 1 deletion src/util/zipWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Readable, Writable } from 'node:stream';
import * as JSZip from 'jszip';
import JSZip from 'jszip';
import { Logger } from '../logger/logger';
import { SfError } from '../sfError';
import { StructuredWriter } from './structuredWriter';
Expand Down
3 changes: 2 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"esModuleInterop": true
}
}
2 changes: 1 addition & 1 deletion test/unit/config/configAggregatorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import * as fs from 'node:fs';
import fs from 'node:fs';
import { assert, expect, config as chaiConfig } from 'chai';
import { Config, ConfigProperties, SFDX_ALLOWED_PROPERTIES, SfdxPropertyKeys } from '../../../src/config/config';
import { ConfigAggregator, ConfigInfo } from '../../../src/config/configAggregator';
Expand Down
6 changes: 3 additions & 3 deletions test/unit/config/configFileTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */

import * as Path from 'node:path';
import * as fs from 'node:fs';
import Path from 'node:path';
import fs from 'node:fs';
import { expect } from 'chai';

import { assert } from '@salesforce/ts-types';
import * as lockfileLib from 'proper-lockfile';
import lockfileLib from 'proper-lockfile';
import { ConfigFile } from '../../../src/config/configFile';
import { SfError } from '../../../src/exported';
import { shouldThrow, TestContext } from '../../../src/testSetup';
Expand Down
6 changes: 3 additions & 3 deletions test/unit/crypto/cryptoKeyFailuresTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

import * as childProcess from 'node:child_process';
import * as _crypto from 'node:crypto';
import * as os from 'node:os';
import childProcess from 'node:child_process';
import _crypto from 'node:crypto';
import os from 'node:os';
import { AnyJson } from '@salesforce/ts-types';
import { assert, expect } from 'chai';
import { Crypto } from '../../../src/crypto/crypto';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/crypto/cryptoTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
/* eslint-disable @typescript-eslint/ban-types */

import * as os from 'node:os';
import os from 'node:os';
import { stubMethod } from '@salesforce/ts-sinon';
import { expect } from 'chai';
import { Crypto } from '../../../src/crypto/crypto';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/crypto/keyChainImplTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* eslint-disable no-underscore-dangle */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import * as fs from 'node:fs';
import fs from 'node:fs';
import { assert, expect } from 'chai';
import { KeychainAccess, keyChainImpl } from '../../../src/crypto/keyChainImpl';
import { shouldThrow, TestContext } from '../../../src/testSetup';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/crypto/secureStringTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import * as crypto from 'node:crypto';
import crypto from 'node:crypto';
import { expect } from 'chai';
import { stub } from 'sinon';
import { SecureBuffer } from '../../../src/crypto/secureBuffer';
Expand Down
4 changes: 2 additions & 2 deletions test/unit/messagesTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

import * as fs from 'node:fs';
import * as path from 'node:path';
import fs from 'node:fs';
import path from 'node:path';
import { EOL } from 'node:os';
import { assert, expect } from 'chai';
import { SinonStub } from 'sinon';
Expand Down
6 changes: 3 additions & 3 deletions test/unit/org/authInfoTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

import * as pathImport from 'node:path';
import * as dns from 'node:dns';
import * as jwt from 'jsonwebtoken';
import pathImport from 'node:path';
import dns from 'node:dns';
import jwt from 'jsonwebtoken';
import { env, includes } from '@salesforce/kit';
import { spyMethod, stubMethod } from '@salesforce/ts-sinon';
import { AnyJson, getJsonMap, JsonMap, toJsonMap } from '@salesforce/ts-types';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/org/orgTest.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 { deepStrictEqual, fail } from 'node:assert';
import * as fs from 'node:fs';
import fs from 'node:fs';
import { constants as fsConstants } from 'node:fs';
import { join as pathJoin } from 'node:path';
import { format } from 'node:util';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/status/myDomainResolverTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import * as dns from 'node:dns';
import dns from 'node:dns';
import { URL } from 'node:url';
import { Duration, Env } from '@salesforce/kit';
import { AnyFunction } from '@salesforce/ts-types';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/directoryWriterTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as fs from 'node:fs';
import * as path from 'node:path';
import { Readable } from 'node:stream';
import * as chai from 'chai';
import * as chaiString from 'chai-string';
import chaiString from 'chai-string';
import { DirectoryWriter } from '../../../src/util/directoryWriter';

// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/zipWriterTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as fs from 'node:fs';
import * as path from 'node:path';
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as JSZip from 'jszip';
import JSZip from 'jszip';
import { ZipWriter } from '../../../src/util/zipWriter';

describe('ZipWriter', () => {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"outDir": "./lib",
"resolveJsonModule": true,
"rootDir": "./src",
"plugins": [{ "transform": "./src/messageTransformer.ts" }]
"plugins": [{ "transform": "./src/messageTransformer.ts" }],
"esModuleInterop": true
},
"include": ["./src/**/*.ts"]
}
3 changes: 2 additions & 1 deletion typedocExamples/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"esModuleInterop": true
}
}

0 comments on commit e01b3cb

Please sign in to comment.