Skip to content

Commit

Permalink
feat: compile inlines messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 13, 2023
1 parent 940d54e commit 4b3dcf7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .sfdevrc.json
@@ -1,5 +1,13 @@
{
"test": {
"testsPath": "test/**/*.test.ts"
},
"wireit": {
"compile": {
"command": "ttsc -p . --pretty --incremental",
"files": ["src/**/*.ts", "tsconfig.json", "messages"],
"output": ["lib/**", "*.tsbuildinfo"],
"clean": "if-file-deleted"
}
}
}
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -84,6 +84,7 @@
"sinon": "^10.0.0",
"ts-node": "^10.9.1",
"ts-prune": "^0.10.3",
"ttypescript": "^1.5.15",
"typescript": "^4.9.5",
"wireit": "^0.9.5"
},
Expand All @@ -99,11 +100,11 @@
]
},
"compile": {
"command": "tsc -p . --pretty --incremental",
"command": "ttsc -p . --pretty --incremental",
"files": [
"src/**/*.ts",
"**/tsconfig.json",
"messages/**"
"tsconfig.json",
"messages"
],
"output": [
"lib/**",
Expand Down Expand Up @@ -163,4 +164,4 @@
"output": []
}
}
}
}
5 changes: 3 additions & 2 deletions src/shared/remoteSourceTrackingService.ts
Expand Up @@ -18,6 +18,9 @@ import { getMetadataKeyFromFileResponse, mappingsForSourceMemberTypesToMetadataT
import { getMetadataKey } from './functions';
import { calculateExpectedSourceMembers } from './expectedSourceMembers';
// represents the contents of the config file stored in 'maxRevision.json'
Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/source-tracking', 'source');

type Contents = {
serverMaxRevisionCounter: number;
sourceMembers: Dictionary<MemberRevision>;
Expand Down Expand Up @@ -554,8 +557,6 @@ export class RemoteSourceTrackingService extends ConfigFile<RemoteSourceTracking

private async query(query: string, quiet = false): Promise<SourceMember[]> {
if (!(await this.org.tracksSource())) {
Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/source-tracking', 'source');
throw new SfError(messages.getMessage('NonSourceTrackedOrgError'), 'NonSourceTrackedOrgError');
}
if (!quiet) {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"outDir": "./lib",
"skipLibCheck": true,
"strictNullChecks": true
"strictNullChecks": true,
"plugins": [{ "transform": "@salesforce/core", "import": "messageTransformer" }]
},
"include": ["src/**/*.ts"]
}
9 changes: 8 additions & 1 deletion yarn.lock
Expand Up @@ -4637,7 +4637,7 @@ resolve-global@1.0.0, resolve-global@^1.0.0:
dependencies:
global-dirs "^0.1.1"

resolve@^1.1.6, resolve@^1.10.0, resolve@^1.22.1:
resolve@>=1.9.0, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.22.1:
version "1.22.2"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f"
integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==
Expand Down Expand Up @@ -5300,6 +5300,13 @@ tsutils@^3.21.0:
dependencies:
tslib "^1.8.1"

ttypescript@^1.5.15:
version "1.5.15"
resolved "https://registry.yarnpkg.com/ttypescript/-/ttypescript-1.5.15.tgz#e45550ad69289d06d3bc3fd4a3c87e7c1ef3eba7"
integrity sha512-48ykDNHzFnPMnv4hYX1P8Q84TvCZyL1QlFxeuxsuZ48X2+ameBgPenvmCkHJtoOSxpoWTWi8NcgNrRnVDOmfSg==
dependencies:
resolve ">=1.9.0"

tunnel-agent@*:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
Expand Down

0 comments on commit 4b3dcf7

Please sign in to comment.