diff --git a/.gitignore b/.gitignore index fd4127fd..c61419a8 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ docs package.json.bak. # -- CLEAN ALL +.tsbuildinfo +.eslintcache +.wireit node_modules # -- diff --git a/LICENSE.txt b/LICENSE.txt index d1c9164c..f2cee7bb 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2022, Salesforce.com, Inc. +Copyright (c) 2023, Salesforce.com, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/package.json b/package.json index 68b8742e..3abf0ce9 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "shx": "0.3.4", "sinon": "10.0.0", "ts-node": "^10.0.0", - "typescript": "^4.9.4" + "typescript": "^4.9.4", + "wireit": "^0.9.3" }, "config": {}, "engines": { @@ -91,26 +92,135 @@ }, "repository": "salesforcecli/plugin-user", "scripts": { - "build": "sf-build", + "build": "wireit", "clean": "sf-clean", "clean-all": "sf-clean all", "clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json", - "compile": "sf-compile", + "compile": "wireit", "docs": "sf-docs", - "format": "sf-format", - "lint": "sf-lint", + "format": "wireit", + "lint": "wireit", "postpack": "shx rm -f oclif.manifest.json", - "posttest": "yarn lint && yarn test:deprecation-policy && yarn test:command-reference", "prepack": "sf-prepack", "prepare": "sf-install", - "pretest": "sf-compile-test", - "test": "sf-test", - "test:command-reference": "./bin/dev commandreference:generate --erroronwarnings", - "test:deprecation-policy": "./bin/dev snapshot:compare", + "test": "wireit", + "test-compile": "wireit", + "test-only": "wireit", + "test:command-reference": "wireit", + "test:deprecation-policy": "wireit", + "test:json-schema": "wireit", "test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel", + "test:one": "wireit", "version": "oclif readme" }, "publishConfig": { "access": "public" + }, + "wireit": { + "build": { + "dependencies": [ + "compile", + "lint" + ] + }, + "compile": { + "command": "tsc --build --pretty ", + "files": [ + "src/**/*.ts", + "tsconfig.json" + ], + "output": [ + "lib/**", + ".tsbuildinfo" + ], + "clean": "if-file-deleted", + "packageLocks": [ + "yarn.lock" + ] + }, + "format": { + "command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"" + }, + "lint": { + "command": "eslint --color --cache --cache-location .eslintcache", + "files": [ + "src/**/*.ts", + "test/**/*.ts", + ".eslintignore", + ".eslintrc.js" + ], + "output": [], + "packageLocks": [ + "yarn.lock" + ] + }, + "test-compile": { + "command": "tsc -p ./test --pretty", + "files": [ + "test/**/*.ts", + "tsconfig.json", + "test/tsconfig.json" + ], + "output": [] + }, + "test:one": { + "command": "mocha", + "packageLocks": [ + "yarn.lock" + ] + }, + "test": { + "dependencies": [ + "test-only", + "test:command-reference", + "test:deprecation-policy", + "lint", + "test:json-schema" + ], + "packageLocks": [ + "yarn.lock" + ] + }, + "test-only": { + "command": "nyc mocha test/**/*.test.ts", + "dependencies": [ + "test-compile" + ], + "packageLocks": [ + "yarn.lock" + ] + }, + "test:command-reference": { + "command": "./bin/dev commandreference:generate --erroronwarnings", + "files": [ + "src/**/*.ts", + "messages" + ], + "output": [ + "tmp/root" + ] + }, + "test:deprecation-policy": { + "command": "./bin/dev snapshot:compare", + "files": [ + "src/**/*.ts" + ], + "output": [], + "dependencies": [ + "compile" + ] + }, + "test:json-schema": { + "command": "./bin/dev schema:compare", + "files": [ + "src/**/*.ts" + ], + "output": [ + "schemas" + ], + "packageLocks": [ + "yarn.lock" + ] + } } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 92c7df4f..f2676a1d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2275,7 +2275,7 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== -chokidar@3.5.3: +chokidar@3.5.3, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -3442,6 +3442,17 @@ fast-glob@^3.0.3, fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.2.11: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -3943,7 +3954,7 @@ got@^11: p-cancelable "^2.0.0" responselike "^2.0.0" -graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -6192,6 +6203,15 @@ propagate@^2.0.0: resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== +proper-lockfile@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" + integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== + dependencies: + graceful-fs "^4.2.4" + retry "^0.12.0" + signal-exit "^3.0.2" + psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" @@ -7588,6 +7608,17 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" +wireit@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/wireit/-/wireit-0.9.3.tgz#2508f77418d73a632d0653a0dd3275c1808f3f98" + integrity sha512-o31NkFrr+AjGNgarZB094Tw6xWcmNn1uts672B1qKzSo2XMFBt5abjtg/SBUNlBcQPtPryEXJkIUQ6i9p+1Y9w== + dependencies: + braces "^3.0.2" + chokidar "^3.5.3" + fast-glob "^3.2.11" + jsonc-parser "^3.0.0" + proper-lockfile "^4.1.2" + word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"