Skip to content

Commit

Permalink
refactor: devScripts update (#416)
Browse files Browse the repository at this point in the history
* chore: updates from devScripts

* fix: type error for retries default

* chore: bump deps, samples from wireit

---------

Co-authored-by: mshanemc <[email protected]>
  • Loading branch information
svc-cli-bot and mshanemc authored Feb 28, 2023
1 parent d4d8413 commit ed57c90
Show file tree
Hide file tree
Showing 5 changed files with 2,302 additions and 598 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ docs
package.json.bak.

# -- CLEAN ALL
*.tsbuildinfo
.eslintcache
.wireit
node_modules

# --
Expand Down
9 changes: 5 additions & 4 deletions .sfdevrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"test": {
"testsPath": "test/**/*.test.ts"
},
"exclude-scripts": ["build"]
"wireit": {
"build": {
"dependencies": ["compile", "lint", "samples"]
}
}
}
105 changes: 93 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@
"types": "lib/index.d.ts",
"repository": "salesforcecli/cli-plugins-testkit",
"scripts": {
"build": "sf-build && yarn samples",
"build": "wireit",
"ci-docs": "yarn sf-ci-docs",
"clean": "sf-clean",
"clean-all": "sf-clean all",
"compile": "sf-compile",
"compile": "wireit",
"docs": "sf-docs",
"format": "sf-format",
"lint": "sf-lint",
"format": "wireit",
"lint": "wireit",
"lint-fix": "yarn sf-lint --fix",
"prepack": "sf-prepack",
"prepare": "sf-install",
"pretest": "sf-compile-test",
"samples": "tsc -p samples && ts-node samples/generateSamplesDoc.ts",
"test": "sf-test"
"test": "wireit",
"test:only": "wireit"
},
"keywords": [
"force",
Expand All @@ -42,8 +41,8 @@
"!lib/**/*.map"
],
"dependencies": {
"@salesforce/core": "^3.33.1",
"@salesforce/kit": "^1.8.0",
"@salesforce/core": "^3.33.5",
"@salesforce/kit": "^1.9.0",
"@salesforce/ts-types": "^1.7.3",
"@types/shelljs": "^0.8.11",
"archiver": "^5.2.0",
Expand All @@ -54,7 +53,7 @@
},
"devDependencies": {
"@salesforce/dev-config": "^3.0.0",
"@salesforce/dev-scripts": "^3.1.1",
"@salesforce/dev-scripts": "^4.1.1",
"@salesforce/prettier-config": "^0.0.2",
"@salesforce/ts-sinon": "^1.4.5",
"@types/archiver": "^5.1.0",
Expand All @@ -77,10 +76,92 @@
"pretty-quick": "^3.1.0",
"sinon": "10.0.0",
"ts-node": "^10.0.0",
"typescript": "^4.9.5"
"typescript": "^4.9.5",
"wireit": "^0.9.5"
},
"config": {},
"publishConfig": {
"access": "public"
},
"wireit": {
"samples": {
"command": "tsc -p samples && ts-node samples/generateSamplesDoc.ts",
"files": [
"samples/**/*.ts",
"samples/**/*.json"
],
"output": [
"SAMPLE.md"
]
},
"build": {
"dependencies": [
"compile",
"lint",
"samples"
]
},
"compile": {
"command": "tsc -p . --pretty --incremental",
"files": [
"src/**/*.ts",
"tsconfig.json",
"messages/**"
],
"output": [
"lib/**",
"*.tsbuildinfo"
],
"clean": "if-file-deleted"
},
"format": {
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
"files": [
"src/**/*.ts",
"test/**/*.ts",
"schemas/**/*.json",
"command-snapshot.json",
".prettier*"
],
"output": []
},
"lint": {
"command": "eslint src test --color --cache --cache-location .eslintcache",
"files": [
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
".eslint*"
],
"output": []
},
"test:compile": {
"command": "tsc -p \"./test\" --pretty",
"files": [
"test/**/*.ts",
"tsconfig.json",
"test/tsconfig.json"
],
"output": []
},
"test": {
"dependencies": [
"test:only",
"test:compile"
]
},
"test:only": {
"command": "nyc mocha \"test/**/*.test.ts\"",
"files": [
"test/**/*.ts",
"src/**/*.ts",
"tsconfig.json",
".mocha*",
"test/tsconfig.json",
"!*.nut.ts",
".nycrc"
],
"output": []
}
}
}
}
2 changes: 1 addition & 1 deletion src/testSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class TestSession<T extends TestSessionOptions = TestSessionOptions> exte

this.createdDate = new Date();
this.id = genUniqueString(`${this.createdDate.valueOf()}%s`);
this.retries = env.getNumber('TESTKIT_SETUP_RETRIES', this.options.retries) ?? 0;
this.retries = env.getNumber('TESTKIT_SETUP_RETRIES', this.options.retries ?? 0);

const shellOverride = env.getString('TESTKIT_EXEC_SHELL');
if (shellOverride) {
Expand Down
Loading

0 comments on commit ed57c90

Please sign in to comment.