Skip to content

Commit b01c15b

Browse files
authored
revert commit that added deasync dependancy (#591)
* Revert "Implement readFileSync for ZipTreeContainer (#583)" This reverts commit da9c7ef. * chore: adding types for SDR
1 parent b7f9fd6 commit b01c15b

File tree

5 files changed

+12
-64
lines changed

5 files changed

+12
-64
lines changed

METADATA_SUPPORT.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,18 +484,24 @@ v55 introduces the following new types. Here's their current level of support
484484
|Metadata Type|Support|Notes|
485485
|:---|:---|:---|
486486
|AssessmentQuestion||Not supported, but support could be added|
487+
|AssessmentQuestionSet||Not supported, but support could be added|
487488
|BotTemplate||Not supported, but support could be added|
488-
|ConvReasonReportSegment||Not supported, but support could be added|
489+
|ConvReasonReportDefinition||Not supported, but support could be added|
490+
|ConvReasonReportSegmentDef||Not supported, but support could be added|
491+
|CustomAddressFieldSettings|||
492+
|DecisionMatrixDefinition||Not supported, but support could be added|
493+
|DecisionMatrixDefinitionVersion||Not supported, but support could be added|
489494
|Experience|undefined|undefined|
490495
|ExperienceMetadataResource|undefined|undefined|
491496
|ExperienceSpace|undefined|undefined|
497+
|ExpressionSetDefinition||Not supported, but support could be added|
498+
|ExpressionSetDefinitionVersion||Not supported, but support could be added|
492499
|ExternalDataSrcDescriptor||Not supported, but support could be added|
493500
|ExternalDataTranField||Not supported, but support could be added|
494501
|ExternalDataTranObject||Not supported, but support could be added|
495502
|FavoriteTransferDestination||Not supported, but support could be added|
496503
|IndustriesAutomotiveSettings|||
497504
|InvLatePymntRiskCalcSettings|||
498-
|MarketingAppExtAction||Not supported, but support could be added|
499505
|PaymentsManagementEnabledSettings|||
500506
|RegisteredExternalService||Not supported, but support could be added|
501507
|StreamingAppDataConnector||Not supported, but support could be added|

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@salesforce/kit": "^1.5.32",
2929
"@salesforce/ts-types": "^1.4.2",
3030
"archiver": "^5.3.0",
31-
"deasync": "^0.1.24",
3231
"fast-xml-parser": "^3.17.4",
3332
"graceful-fs": "^4.2.8",
3433
"ignore": "^5.1.8",
@@ -42,7 +41,6 @@
4241
"@salesforce/prettier-config": "^0.0.2",
4342
"@salesforce/ts-sinon": "^1.1.2",
4443
"@types/archiver": "^5.1.1",
45-
"@types/deasync": "^0.1.2",
4644
"@types/deep-equal-in-any-order": "^1.0.1",
4745
"@types/jsforce": "^1.9.38",
4846
"@types/mime": "2.0.3",

src/resolve/treeContainers.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { join, dirname, basename, normalize, sep } from 'path';
88
import { Readable } from 'stream';
99
import { statSync, existsSync, readdirSync, createReadStream, readFileSync } from 'graceful-fs';
1010
import * as unzipper from 'unzipper';
11-
import deasync = require('deasync');
1211
import { baseName, parseMetadataXml } from '../utils';
1312
import { LibraryError } from '../errors';
1413
import { SourcePath } from '../common';
@@ -167,23 +166,9 @@ export class ZipTreeContainer extends TreeContainer {
167166
throw new LibraryError('error_expected_file_path', fsPath);
168167
}
169168

169+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
170170
public readFileSync(fsPath: string): Buffer {
171-
let done = false;
172-
let dataBuffer: Buffer;
173-
this.readFile(fsPath)
174-
.then((buffer) => {
175-
dataBuffer = buffer;
176-
done = true;
177-
})
178-
.catch((error) => {
179-
done = true;
180-
throw error;
181-
});
182-
183-
deasync.loopWhile(() => {
184-
return !done;
185-
});
186-
return dataBuffer;
171+
throw new Error('Method not implemented');
187172
}
188173

189174
public stream(fsPath: string): Readable {

test/resolve/treeContainers.test.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,8 @@ describe('Tree Containers', () => {
229229
});
230230

231231
describe('readFileSync', () => {
232-
it('should syncrounsly read contents of zip entry into buffer.', () => {
233-
const path = join(filesRoot, 'test.txt');
234-
const contents = tree.readFileSync(path).toString();
235-
expect(contents).to.equal('test text');
236-
});
237-
238-
it('should throw a library error if readFile throws', () => {
239-
assert.throws(
240-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
241-
() => tree.readFileSync(filesRoot),
242-
LibraryError,
243-
nls.localize('error_expected_file_path', filesRoot)
244-
);
232+
it('should throw an error because it is not implemented yet', () => {
233+
assert.throws(() => tree.readFileSync(join(filesRoot, 'test.txt')), Error, 'Method not implemented');
245234
});
246235
});
247236

yarn.lock

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,6 @@
784784
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
785785
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
786786

787-
"@types/deasync@^0.1.2":
788-
version "0.1.2"
789-
resolved "https://registry.yarnpkg.com/@types/deasync/-/deasync-0.1.2.tgz#a64b68d6ebc145d0a5fe004a53e8e0f4e6d2ec7e"
790-
integrity sha512-sCBFlGCEmZMPS06wdnQELcYzyUYio2K1Hp6g0fjJSKP1jkGKQpIdjRNUQAvdSCCJCWxIMCkX2CL7pi4BCm8Ydg==
791-
792787
"@types/deep-equal-in-any-order@^1.0.1":
793788
version "1.0.1"
794789
resolved "https://registry.npmjs.org/@types/deep-equal-in-any-order/-/deep-equal-in-any-order-1.0.1.tgz#0559d855797a5034e187f248b23a4490e5444f2e"
@@ -1372,13 +1367,6 @@ binary@~0.3.0:
13721367
buffers "~0.1.1"
13731368
chainsaw "~0.1.0"
13741369

1375-
bindings@^1.5.0:
1376-
version "1.5.0"
1377-
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
1378-
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
1379-
dependencies:
1380-
file-uri-to-path "1.0.0"
1381-
13821370
bl@^4.0.3:
13831371
version "4.0.3"
13841372
resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.3.tgz#12d6287adc29080e22a705e5764b2a9522cdc489"
@@ -2060,14 +2048,6 @@ dayjs@^1.8.16:
20602048
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.36.tgz#be36e248467afabf8f5a86bae0de0cdceecced50"
20612049
integrity sha512-3VmRXEtw7RZKAf+4Tv1Ym9AGeo8r8+CjDi26x+7SYQil1UqtqdaokhzoEJohqlzt0m5kacJSDhJQkG/LWhpRBw==
20622050

2063-
deasync@^0.1.24:
2064-
version "0.1.24"
2065-
resolved "https://registry.yarnpkg.com/deasync/-/deasync-0.1.24.tgz#6ecc9c6ff9eba64a4f4572ae3c4db77fed09268a"
2066-
integrity sha512-i98vg42xNfRZCymummMAN0rIcQ1gZFinSe3btvPIvy6JFTaeHcumeKybRo2HTv86nasfmT0nEgAn2ggLZhOCVA==
2067-
dependencies:
2068-
bindings "^1.5.0"
2069-
node-addon-api "^1.7.1"
2070-
20712051
20722052
version "4.3.1"
20732053
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
@@ -2800,11 +2780,6 @@ file-entry-cache@^6.0.1:
28002780
dependencies:
28012781
flat-cache "^3.0.4"
28022782

2803-
2804-
version "1.0.0"
2805-
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
2806-
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
2807-
28082783
fill-range@^4.0.0:
28092784
version "4.0.0"
28102785
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
@@ -4777,11 +4752,6 @@ nise@^4.1.0:
47774752
just-extend "^4.0.2"
47784753
path-to-regexp "^1.7.0"
47794754

4780-
node-addon-api@^1.7.1:
4781-
version "1.7.2"
4782-
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d"
4783-
integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==
4784-
47854755
node-preload@^0.2.1:
47864756
version "0.2.1"
47874757
resolved "https://registry.yarnpkg.com/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301"

0 commit comments

Comments
 (0)