From e8e65204c04bfb7c9e7549c27b7fecd34dc32fc8 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Thu, 9 Mar 2023 16:28:16 -0800 Subject: [PATCH] Remove just-scripts-utils and just-task-logger packages --- .github/workflows/pr.yml | 2 +- README.md | 9 - ...-2ad7c739-81e1-4ca6-8658-b9eedb028588.json | 18 + packages/just-scripts-utils/.npmignore | 9 - packages/just-scripts-utils/CHANGELOG.json | 892 ------------------ packages/just-scripts-utils/CHANGELOG.md | 337 ------- .../just-scripts-utils/api-extractor.json | 4 - .../etc/just-scripts-utils.api.md | 100 -- packages/just-scripts-utils/jest.config.js | 1 - packages/just-scripts-utils/package.json | 29 - .../src/interfaces/RushJson.ts | 12 - packages/just-scripts-utils/src/logger.ts | 1 - packages/just-scripts-utils/tsconfig.json | 7 - packages/just-scripts/etc/just-scripts.api.md | 11 +- packages/just-scripts/package.json | 1 - packages/just-scripts/src/index.ts | 2 +- .../src/interfaces/PackageJson.ts | 0 .../src/tasks/__tests__/mockExecFactory.ts | 29 - .../src/tasks/__tests__/tscTask.spec.ts | 16 +- packages/just-scripts/src/tasks/eslintTask.ts | 2 +- packages/just-scripts/src/tasks/jestTask.ts | 2 +- .../just-scripts/src/tasks/nodeExecTask.ts | 2 +- .../just-scripts/src/tasks/prettierTask.ts | 2 +- packages/just-scripts/src/tasks/tscTask.ts | 2 +- packages/just-scripts/src/tasks/tslintTask.ts | 2 +- .../just-scripts/src/tasks/webpackCliTask.ts | 2 +- .../src/tasks/webpackDevServerTask.ts | 2 +- .../src/utils}/__tests__/exec.spec.ts | 0 .../utils}/__tests__/mergePackageJson.spec.ts | 2 +- .../src/utils}/__tests__/paths.spec.ts | 0 .../utils}/__tests__/readPackageJson.spec.ts | 0 .../src => just-scripts/src/utils}/exec.ts | 0 .../src => just-scripts/src/utils}/index.ts | 3 - .../src/utils}/mergePackageJson.ts | 2 +- .../src => just-scripts/src/utils}/paths.ts | 0 .../src/utils}/readPackageJson.ts | 2 +- packages/just-task-logger/.npmignore | 9 - packages/just-task-logger/CHANGELOG.json | 333 ------- packages/just-task-logger/CHANGELOG.md | 120 --- packages/just-task-logger/api-extractor.json | 4 - packages/just-task-logger/jest.config.js | 1 - packages/just-task-logger/package.json | 28 - packages/just-task-logger/src/index.ts | 2 - packages/just-task-logger/src/logger.ts | 70 -- packages/just-task-logger/src/perf.ts | 15 - packages/just-task-logger/tsconfig.json | 7 - .../etc/just-task-logger.api.md | 0 packages/just-task/etc/just-task.api.md | 20 +- packages/just-task/package.json | 1 - .../src/__tests__/logger.spec.ts | 0 packages/just-task/src/cache.ts | 2 +- packages/just-task/src/cli.ts | 2 +- packages/just-task/src/config.ts | 2 +- packages/just-task/src/enableTypeScript.ts | 2 +- packages/just-task/src/logger.ts | 86 +- .../just-task/src/package/findDependents.ts | 2 +- 56 files changed, 158 insertions(+), 2053 deletions(-) create mode 100644 change/change-2ad7c739-81e1-4ca6-8658-b9eedb028588.json delete mode 100644 packages/just-scripts-utils/.npmignore delete mode 100644 packages/just-scripts-utils/CHANGELOG.json delete mode 100644 packages/just-scripts-utils/CHANGELOG.md delete mode 100644 packages/just-scripts-utils/api-extractor.json delete mode 100644 packages/just-scripts-utils/etc/just-scripts-utils.api.md delete mode 100644 packages/just-scripts-utils/jest.config.js delete mode 100644 packages/just-scripts-utils/package.json delete mode 100644 packages/just-scripts-utils/src/interfaces/RushJson.ts delete mode 100644 packages/just-scripts-utils/src/logger.ts delete mode 100644 packages/just-scripts-utils/tsconfig.json rename packages/{just-scripts-utils => just-scripts}/src/interfaces/PackageJson.ts (100%) delete mode 100644 packages/just-scripts/src/tasks/__tests__/mockExecFactory.ts rename packages/{just-scripts-utils/src => just-scripts/src/utils}/__tests__/exec.spec.ts (100%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/__tests__/mergePackageJson.spec.ts (99%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/__tests__/paths.spec.ts (100%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/__tests__/readPackageJson.spec.ts (100%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/exec.ts (100%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/index.ts (56%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/mergePackageJson.ts (97%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/paths.ts (100%) rename packages/{just-scripts-utils/src => just-scripts/src/utils}/readPackageJson.ts (90%) delete mode 100644 packages/just-task-logger/.npmignore delete mode 100644 packages/just-task-logger/CHANGELOG.json delete mode 100644 packages/just-task-logger/CHANGELOG.md delete mode 100644 packages/just-task-logger/api-extractor.json delete mode 100644 packages/just-task-logger/jest.config.js delete mode 100644 packages/just-task-logger/package.json delete mode 100644 packages/just-task-logger/src/index.ts delete mode 100644 packages/just-task-logger/src/logger.ts delete mode 100644 packages/just-task-logger/src/perf.ts delete mode 100644 packages/just-task-logger/tsconfig.json rename packages/{just-task-logger => just-task}/etc/just-task-logger.api.md (100%) rename packages/{just-task-logger => just-task}/src/__tests__/logger.spec.ts (100%) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 33c7bf41..c0919a96 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -39,7 +39,7 @@ jobs: - run: yarn lint - - run: yarn lage build test api + - run: yarn lage build test api --verbose - name: Check for modified files uses: ecraig12345/beachball-actions/check-for-modified-files@9b56d6fd4983b949be3313f95846788edb738c9b # v1 diff --git a/README.md b/README.md index f2924cc0..e21f56c8 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,6 @@ All the documentation is online at https://microsoft.github.io/just/ See the [contributing instructions](./.github/CONTRIBUTING.md). -## Packages - -| Package | Description | -| -------------------- | -------------------------------------------------------------------------------- | -| `just-task` | The task definition library that wraps `undertaker` and `yargs-parser` libraries | -| `just-scripts` | A reusable preset of frequently used tasks in node and browser projects | -| `just-scripts-utils` | A set of utilities for `just-scripts` | -| `just-task-logger` | A shared pretty logger used to display timestamps along with a message | - ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. Please refer [Contribution guide](https://github.com/microsoft/just/.github/CONTRIBUTING.md) for more details diff --git a/change/change-2ad7c739-81e1-4ca6-8658-b9eedb028588.json b/change/change-2ad7c739-81e1-4ca6-8658-b9eedb028588.json new file mode 100644 index 00000000..b26567f0 --- /dev/null +++ b/change/change-2ad7c739-81e1-4ca6-8658-b9eedb028588.json @@ -0,0 +1,18 @@ +{ + "changes": [ + { + "type": "minor", + "comment": "Merge just-scripts-utils into this package", + "packageName": "just-scripts", + "email": "elcraig@microsoft.com", + "dependentChangeType": "patch" + }, + { + "type": "minor", + "comment": "Merge just-task-logger into this package", + "packageName": "just-task", + "email": "elcraig@microsoft.com", + "dependentChangeType": "patch" + } + ] +} \ No newline at end of file diff --git a/packages/just-scripts-utils/.npmignore b/packages/just-scripts-utils/.npmignore deleted file mode 100644 index e5cc9f63..00000000 --- a/packages/just-scripts-utils/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -__tests__ -*.log -*.tgz -api-extractor.json -CHANGELOG.* -etc/ -jest.config.js -package-deps.json -tsconfig.json \ No newline at end of file diff --git a/packages/just-scripts-utils/CHANGELOG.json b/packages/just-scripts-utils/CHANGELOG.json deleted file mode 100644 index be71ed2a..00000000 --- a/packages/just-scripts-utils/CHANGELOG.json +++ /dev/null @@ -1,892 +0,0 @@ -{ - "name": "just-scripts-utils", - "entries": [ - { - "date": "Fri, 28 Mar 2025 08:01:48 GMT", - "version": "2.1.0", - "tag": "just-scripts-utils_v2.1.0", - "comments": { - "minor": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "b08901cb0e1ca7833027ae1e6473ff8dff7b4529", - "comment": "Build with TypeScript 4.5" - }, - { - "author": "beachball", - "package": "just-scripts-utils", - "comment": "Bump just-task-logger to v1.3.0", - "commit": "not available" - } - ] - } - }, - { - "date": "Sat, 02 Mar 2024 08:01:34 GMT", - "version": "2.0.1", - "tag": "just-scripts-utils_v2.0.1", - "comments": { - "none": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "feb6217bf318c7d606c6147a4f5d6568572bb2f3", - "comment": "Update build setup" - } - ] - } - }, - { - "date": "Tue, 12 Sep 2023 08:02:05 GMT", - "version": "2.0.1", - "tag": "just-scripts-utils_v2.0.1", - "comments": { - "none": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "5b4e7073ffd1f06a7383deccee6883aa7e63342c", - "comment": "Set up API Extractor" - } - ], - "patch": [ - { - "author": "renovate@whitesourcesoftware.com", - "package": "just-scripts-utils", - "commit": "e849046a3d1e5c1b4c1a81e12c400391a108323e", - "comment": "Update dependency fs-extra to v11" - } - ] - } - }, - { - "date": "Thu, 09 Mar 2023 08:02:09 GMT", - "tag": "just-scripts-utils_v2.0.0", - "version": "2.0.0", - "comments": { - "patch": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "a509c1d0a5483b3e688f400c73da5969f5ae42c7", - "comment": "Remove unused dep on `yargs`" - }, - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "8d487af7c6de3abe574921f3c408e0eeb922867e", - "comment": "Remove unused deps on `glob` and `tar`" - } - ], - "major": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "8d487af7c6de3abe574921f3c408e0eeb922867e", - "comment": "Remove unused `prettyPrintMarkdown` function and related deps (`marked`, `marked-terminal`)" - }, - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "8d487af7c6de3abe574921f3c408e0eeb922867e", - "comment": "Remove unused `findMonoRepoRootPath` function" - }, - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "8d487af7c6de3abe574921f3c408e0eeb922867e", - "comment": "Remove unused functions `rushUpdate`, `readRushJson`, `rushAddPackage` and related dep `jju`" - }, - { - "author": "beachball", - "package": "just-scripts-utils", - "comment": "Bump just-task-logger to v1.2.1", - "commit": "77dab724dfe9e042887caa13e8f2a7e66e33b570" - } - ] - } - }, - { - "date": "Thu, 09 Mar 2023 05:44:11 GMT", - "tag": "just-scripts-utils_v1.2.1", - "version": "1.2.1", - "comments": { - "none": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "c3711804c41b2abfb2df4766acc83be68b137b56", - "comment": "Update mock-fs usage in tests" - } - ], - "patch": [ - { - "author": "renovate@whitesourcesoftware.com", - "package": "just-scripts-utils", - "commit": "b85a978f31cbda6e61635389255190046089ce35", - "comment": "Update dependency marked-terminal to v5" - } - ] - } - }, - { - "date": "Fri, 17 Feb 2023 23:04:40 GMT", - "tag": "just-scripts-utils_v1.2.0", - "version": "1.2.0", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "db5d23d8fce67da62801311c83ff7c9036b21547", - "comment": "Update devDependency @types/tar to v6.1.4" - } - ] - } - }, - { - "date": "Wed, 15 Feb 2023 08:01:34 GMT", - "tag": "just-scripts-utils_v1.2.0", - "version": "1.2.0", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "df8892c64a12d738ee6e3af85b1faa69691d6dbf", - "comment": "Update devDependency @types/yargs to v15.0.15" - } - ] - } - }, - { - "date": "Fri, 16 Dec 2022 08:02:09 GMT", - "tag": "just-scripts-utils_v1.2.0", - "version": "1.2.0", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "7130869cff3e99722dcfad1823ae31611e7662bd", - "comment": "Update @types devDependencies" - } - ] - } - }, - { - "date": "Sat, 19 Nov 2022 08:02:12 GMT", - "tag": "just-scripts-utils_v1.2.0", - "version": "1.2.0", - "comments": { - "none": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "a1d4ca0f23c165cffc4c673c7a098c60401922c9", - "comment": "Hoist widely-used devDependencies" - }, - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "61b714896f9600fb0d494927dedd92d52fa355d3", - "comment": "Remove unused devDependency" - } - ] - } - }, - { - "date": "Fri, 18 Nov 2022 22:40:12 GMT", - "tag": "just-scripts-utils_v1.2.0", - "version": "1.2.0", - "comments": { - "minor": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "85d42c8a7e89413ee51b4fe9f731ad0e869addcd", - "comment": "Require Node 14" - }, - { - "author": "beachball", - "package": "just-scripts-utils", - "comment": "Bump just-task-logger to v1.2.0", - "commit": "cccdde9738e63849969dc75300ff98d8f3fa9ffc" - } - ] - } - }, - { - "date": "Thu, 10 Nov 2022 08:02:07 GMT", - "tag": "just-scripts-utils_v1.1.7", - "version": "1.1.7", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "78a1861afef421619ade087cc978f4253301ee84", - "comment": "Update devDependency @types/semver to v7.3.13" - } - ] - } - }, - { - "date": "Fri, 30 Sep 2022 08:05:55 GMT", - "tag": "just-scripts-utils_v1.1.7", - "version": "1.1.7", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "713b2a4514bc0b682b773f93749db41d02149723", - "comment": "Update devDependency @types/tar to v6.1.3" - } - ] - } - }, - { - "date": "Sat, 10 Sep 2022 08:02:45 GMT", - "tag": "just-scripts-utils_v1.1.7", - "version": "1.1.7", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "d2e870d10683d1809a4c11fda827aa5c3acb99b0", - "comment": "Update devDependency @types/tar to v6" - }, - { - "author": "renovate@whitesourcesoftware.com", - "package": "just-scripts-utils", - "commit": "a0b21703c4b4330b1c885261c11486cb786eac0e", - "comment": "Update devDependency @types/fs-extra to v9" - } - ], - "patch": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "0760a3c3afe3b93c501fb2cf9f0ffdf6ff995f2d", - "comment": "Update dependency fs-extra to v10" - } - ] - } - }, - { - "date": "Sat, 10 Sep 2022 00:19:03 GMT", - "tag": "just-scripts-utils_v1.1.6", - "version": "1.1.6", - "comments": { - "patch": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "commit": "9fd466eb0c24ae5f5fed3381acfe229e74cc1bde", - "comment": "Specify Node 12+ engines requirement" - }, - { - "author": "beachball", - "package": "just-scripts-utils", - "comment": "Bump just-task-logger to v1.1.2", - "commit": "9fd466eb0c24ae5f5fed3381acfe229e74cc1bde" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 08:02:06 GMT", - "tag": "just-scripts-utils_v1.1.5", - "version": "1.1.5", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "c08c46745a95efabab5dbfc0f216d2e3b94ae03f", - "comment": "Update devDependency mock-fs to v4.14.0" - }, - { - "author": "renovate@whitesourcesoftware.com", - "package": "just-scripts-utils", - "commit": "32b2d44a637fcfca27c0a2c1fbc80d25bb60d7ce", - "comment": "Update devDependency ts-jest to v26.5.6" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 01:49:38 GMT", - "tag": "just-scripts-utils_v1.1.5", - "version": "1.1.5", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "f080946c01915c3cff7445928b2697729fc2e93d", - "comment": "Update @types packages" - }, - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "468be8479149975f59ee25f7f006afcc26746303", - "comment": "Update devDependency @types/jju to v1.4.2" - }, - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "a88704b4f1f046e1440c0944145a8045273904c3", - "comment": "Update devDependency @types/node to v12" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 00:10:40 GMT", - "tag": "just-scripts-utils_v1.1.5", - "version": "1.1.5", - "comments": { - "none": [ - { - "author": "renovate@whitesourcesoftware.com", - "package": "just-scripts-utils", - "comment": "Update devDependency @types/marked to v4.0.7", - "commit": "3c53024cf02a739c5cdc9f37db64020d190ad916" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 00:10:23 GMT", - "tag": "just-scripts-utils_v1.1.5", - "version": "1.1.5", - "comments": { - "none": [ - { - "author": "renovate@whitesourcesoftware.com", - "package": "just-scripts-utils", - "comment": "Update devDependency @types/marked to v4.0.7", - "commit": "ac702fe1b1b115a243f418fea2821729e38eb3ec" - }, - { - "author": "email not defined", - "package": "just-scripts-utils", - "comment": "Update devDependency @types/fs-extra to v8.1.2", - "commit": "ac702fe1b1b115a243f418fea2821729e38eb3ec" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 00:04:18 GMT", - "tag": "just-scripts-utils_v1.1.5", - "version": "1.1.5", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-scripts-utils", - "comment": "Pin devDependencies", - "commit": "0dca4fef66c833623c3b923f426ee44d6887c5fe" - }, - { - "author": "email not defined", - "package": "just-scripts-utils", - "commit": "0dca4fef66c833623c3b923f426ee44d6887c5fe", - "comment": "Bump just-scripts-utils to v1.1.5" - } - ] - } - }, - { - "date": "Thu, 27 Jan 2022 23:06:07 GMT", - "tag": "just-scripts-utils_v1.1.5", - "version": "1.1.5", - "comments": { - "patch": [ - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "comment": "Bump marked to 4.0.12", - "commit": "61ff9720d4347a4d050615472eb658c8ade55573" - }, - { - "author": "elcraig@microsoft.com", - "package": "just-scripts-utils", - "comment": "Remove unused handlebars dep", - "commit": "61ff9720d4347a4d050615472eb658c8ade55573" - } - ] - } - }, - { - "date": "Wed, 04 Aug 2021 17:43:24 GMT", - "tag": "just-scripts-utils_v1.1.4", - "version": "1.1.4", - "comments": { - "patch": [ - { - "comment": "Bump tar from 6.1.0 to 6.1.6", - "author": "not specified", - "commit": "10aa4fa4fa3f05e4cd7f963d130c131026241bc2", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Tue, 13 Jul 2021 17:19:50 GMT", - "tag": "just-scripts-utils_v1.1.3", - "version": "1.1.3", - "comments": { - "patch": [ - { - "comment": "Error when parallel process is terminated", - "author": "iancra@microsoft.com", - "commit": "9a06e82c44800efb1eab26b0614c9a3136889dee", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Tue, 09 Feb 2021 03:08:41 GMT", - "tag": "just-scripts-utils_v1.1.2", - "version": "1.1.2", - "comments": { - "patch": [ - { - "comment": "Bump marked to 2.0.0", - "author": "dannyvv@microsoft.com", - "commit": "a26e07ee6d0625f223a986e417f35f30b739437c", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Thu, 14 Jan 2021 20:55:06 GMT", - "tag": "just-scripts-utils_v1.1.1", - "version": "1.1.1", - "comments": { - "patch": [ - { - "comment": "fixing release pipeline and the empty lib folder", - "author": "kchau@microsoft.com", - "commit": "dd4f1b0db3fb6ce3769ed38ebf410bcc6d4da567", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Wed, 13 Jan 2021 23:22:52 GMT", - "tag": "just-scripts-utils_v1.1.0", - "version": "1.1.0", - "comments": { - "minor": [ - { - "comment": "Update typescript and other dependencies", - "author": "elcraig@microsoft.com", - "commit": "560caa2639b064a15764d7b5b58b64b620b59c35", - "package": "just-scripts-utils" - } - ], - "patch": [ - { - "comment": "Bump just-task-logger to v1.1.0", - "author": "elcraig@microsoft.com", - "commit": "560caa2639b064a15764d7b5b58b64b620b59c35", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Mon, 02 Nov 2020 18:02:45 GMT", - "tag": "just-scripts-utils_v1.0.3", - "version": "1.0.3", - "comments": { - "patch": [ - { - "comment": "Update marked dependency to latest", - "author": "1581488+christiango@users.noreply.github.com", - "commit": "9ca62fa5f119301a4e6ece35d872dc89d2a0b3ce", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Mon, 02 Nov 2020 16:42:46 GMT", - "tag": "just-scripts-utils_v1.0.2", - "version": "1.0.2", - "comments": { - "patch": [ - { - "comment": "Bump yargs dependency", - "author": "1581488+christiango@users.noreply.github.com", - "commit": "bbbf4bb4b366c4df0cebb429c944d610b67d6d0f", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Mon, 02 Nov 2020 16:26:27 GMT", - "tag": "just-scripts-utils_v1.0.1", - "version": "1.0.1", - "comments": { - "patch": [ - { - "comment": "Publish src folder", - "author": "1581488+christiango@users.noreply.github.com", - "commit": "b5b171c31a995398d4bd6cbb0aa3ff2cf559afc3", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Tue, 06 Oct 2020 23:06:25 GMT", - "tag": "just-scripts-utils_v1.0.0", - "version": "1.0.0", - "comments": { - "patch": [ - { - "comment": "Remove implicit SDI usage", - "author": "darthtrevino@gmail.com", - "commit": "2301badd04f2581b262ff7ec304f612c717efc8c", - "package": "just-scripts-utils" - }, - { - "comment": "fixes publish", - "author": "kchau@microsoft.com", - "commit": "2d81870dfead736767e12ab220d7f4001b5fe94e", - "package": "just-scripts-utils" - } - ], - "major": [ - { - "comment": "removed just-stack-*", - "author": "kchau@microsoft.com", - "commit": "7f6c1c32d5715a33b2a8be066796e941b4d9558b", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Fri, 12 Jun 2020 00:43:50 GMT", - "tag": "just-scripts-utils_v0.9.1", - "version": "0.9.1", - "comments": { - "patch": [ - { - "comment": "Fix downloadPackage unit test on clients running Node 12.", - "author": "jagore@microsoft.com", - "commit": "e4bcba65f863450ec4d82f6de24591e6eec82948", - "package": "just-scripts-utils" - } - ] - } - }, - { - "date": "Mon, 13 Apr 2020 15:57:30 GMT", - "tag": "just-scripts-utils_v0.9.0", - "version": "0.9.0", - "comments": { - "minor": [ - { - "comment": "Add execSync utility", - "author": "elcraig@microsoft.com", - "commit": "91c6179993b4cc25076b8511b4d5d4726cd402d4" - } - ] - } - }, - { - "date": "Tue, 13 Aug 2019 21:00:51 GMT", - "tag": "just-scripts-utils_v0.8.4", - "version": "0.8.4", - "comments": { - "patch": [ - { - "comment": "Upgraded marked to 0.7.0 and marked-terminal to 3.3.0", - "author": "altinokd@microsoft.com", - "commit": "003c41cf6d3d3ac5bce48c6966475fcb6ceb7406" - } - ] - } - }, - { - "date": "Mon, 05 Aug 2019 06:10:22 GMT", - "tag": "just-scripts-utils_v0.8.3", - "version": "0.8.3", - "comments": { - "patch": [ - { - "comment": "Switches to using plop.js for codegen", - "author": "kchau@microsoft.com", - "commit": "2ea4e433c300ed8323aaab0fcf03f927ba8ab78b" - } - ] - } - }, - { - "version": "0.8.1", - "tag": "just-scripts-utils_v0.8.1", - "date": "Sat, 01 Jun 2019 04:59:34 GMT", - "comments": { - "patch": [ - { - "comment": "Fix downloadPackage tests" - } - ] - } - }, - { - "version": "0.8.0", - "tag": "just-scripts-utils_v0.8.0", - "date": "Fri, 31 May 2019 21:15:02 GMT", - "comments": { - "minor": [ - { - "comment": "Adds the ability to override registry in downloadPackage" - } - ] - } - }, - { - "version": "0.7.3", - "tag": "just-scripts-utils_v0.7.3", - "date": "Wed, 15 May 2019 18:44:04 GMT", - "comments": { - "patch": [ - { - "comment": "Switch microsoft in repo URL to lowercase" - } - ], - "dependency": [ - { - "comment": "Updating dependency \"just-task-logger\" from `>=0.2.0 <1.0.0` to `>=0.2.1 <1.0.0`" - } - ] - } - }, - { - "version": "0.7.2", - "tag": "just-scripts-utils_v0.7.2", - "date": "Thu, 25 Apr 2019 18:29:49 GMT", - "comments": { - "patch": [ - { - "comment": "Fix #78 by using Spawn instead of Exec" - } - ] - } - }, - { - "version": "0.7.1", - "tag": "just-scripts-utils_v0.7.1", - "date": "Wed, 24 Apr 2019 23:38:23 GMT", - "comments": { - "patch": [ - { - "comment": "up dep" - }, - { - "comment": "add ability to use path for template" - } - ] - } - }, - { - "version": "0.7.0", - "tag": "just-scripts-utils_v0.7.0", - "date": "Wed, 10 Apr 2019 20:30:38 GMT", - "comments": { - "minor": [ - { - "comment": "Fixing up the temp path to also use version in path" - } - ] - } - }, - { - "version": "0.6.1", - "tag": "just-scripts-utils_v0.6.1", - "date": "Tue, 12 Mar 2019 20:07:18 GMT", - "comments": { - "patch": [ - { - "comment": "Exec error handling improvements" - } - ] - } - }, - { - "version": "0.6.0", - "tag": "just-scripts-utils_v0.6.0", - "date": "Fri, 22 Feb 2019 23:37:36 GMT", - "comments": { - "minor": [ - { - "comment": "Consistent interface naming" - } - ], - "dependency": [ - { - "comment": "Updating dependency \"just-task-logger\" from `>=0.1.2 <1.0.0` to `>=0.2.0 <1.0.0`" - } - ] - } - }, - { - "version": "0.5.0", - "tag": "just-scripts-utils_v0.5.0", - "date": "Fri, 22 Feb 2019 22:50:01 GMT", - "comments": { - "minor": [ - { - "comment": "Move exec to just-scripts-utils" - } - ] - } - }, - { - "version": "0.4.2", - "tag": "just-scripts-utils_v0.4.2", - "date": "Fri, 22 Feb 2019 19:03:38 GMT", - "comments": { - "patch": [ - { - "comment": "Update package metadata" - } - ], - "dependency": [ - { - "comment": "Updating dependency \"just-task-logger\" from `>=0.1.1 <1.0.0` to `>=0.1.2 <1.0.0`" - } - ] - } - }, - { - "version": "0.4.1", - "tag": "just-scripts-utils_v0.4.1", - "date": "Thu, 21 Feb 2019 23:25:53 GMT", - "comments": { - "patch": [ - { - "comment": "Use new logger package" - } - ], - "dependency": [ - { - "comment": "Updating dependency \"just-task-logger\" from `>=0.1.0 <1.0.0` to `>=0.1.1 <1.0.0`" - } - ] - } - }, - { - "version": "0.4.0", - "tag": "just-scripts-utils_v0.4.0", - "date": "Wed, 13 Feb 2019 22:31:47 GMT", - "comments": { - "minor": [ - { - "comment": "API updates and error checking" - } - ] - } - }, - { - "version": "0.3.3", - "tag": "just-scripts-utils_v0.3.3", - "date": "Mon, 04 Feb 2019 05:47:04 GMT", - "comments": { - "patch": [ - { - "comment": "flexibility change" - } - ] - } - }, - { - "version": "0.3.2", - "tag": "just-scripts-utils_v0.3.2", - "date": "Fri, 25 Jan 2019 07:08:59 GMT", - "comments": { - "patch": [ - { - "comment": "Fixes" - } - ] - } - }, - { - "version": "0.3.1", - "tag": "just-scripts-utils_v0.3.1", - "date": "Wed, 23 Jan 2019 00:05:38 GMT", - "comments": { - "patch": [ - { - "comment": "info as it is adding package" - } - ] - } - }, - { - "version": "0.3.0", - "tag": "just-scripts-utils_v0.3.0", - "date": "Tue, 22 Jan 2019 22:31:23 GMT", - "comments": { - "minor": [ - { - "comment": "move utils from scripts to here" - } - ] - } - }, - { - "version": "0.2.2", - "tag": "just-scripts-utils_v0.2.2", - "date": "Mon, 21 Jan 2019 03:27:17 GMT", - "comments": { - "patch": [ - { - "comment": "fix scripts to transform correctly with subdirs" - } - ] - } - }, - { - "version": "0.2.1", - "tag": "just-scripts-utils_v0.2.1", - "date": "Mon, 21 Jan 2019 02:54:15 GMT", - "comments": { - "patch": [ - { - "comment": "fix upgrade stack task" - } - ] - } - }, - { - "version": "0.2.0", - "tag": "just-scripts-utils_v0.2.0", - "date": "Mon, 21 Jan 2019 02:21:01 GMT", - "comments": { - "minor": [ - { - "comment": "new publish!" - } - ] - } - } - ] -} diff --git a/packages/just-scripts-utils/CHANGELOG.md b/packages/just-scripts-utils/CHANGELOG.md deleted file mode 100644 index 131b9ec2..00000000 --- a/packages/just-scripts-utils/CHANGELOG.md +++ /dev/null @@ -1,337 +0,0 @@ -# Change Log - just-scripts-utils - - - - - -## 2.1.0 - -Fri, 28 Mar 2025 08:01:48 GMT - -### Minor changes - -- Build with TypeScript 4.5 (elcraig@microsoft.com) -- Bump just-task-logger to v1.3.0 - -## 2.0.1 - -Tue, 12 Sep 2023 08:02:05 GMT - -### Patches - -- Update dependency fs-extra to v11 (renovate@whitesourcesoftware.com) - -## 2.0.0 - -Thu, 09 Mar 2023 08:02:09 GMT - -### Major changes - -- Remove unused `prettyPrintMarkdown` function and related deps (`marked`, `marked-terminal`) (elcraig@microsoft.com) -- Remove unused `findMonoRepoRootPath` function (elcraig@microsoft.com) -- Remove unused functions `rushUpdate`, `readRushJson`, `rushAddPackage` and related dep `jju` (elcraig@microsoft.com) -- Bump just-task-logger to v1.2.1 - -### Patches - -- Remove unused dep on `yargs` (elcraig@microsoft.com) -- Remove unused deps on `glob` and `tar` (elcraig@microsoft.com) - -## 1.2.1 - -Thu, 09 Mar 2023 05:44:11 GMT - -### Patches - -- Update dependency marked-terminal to v5 (renovate@whitesourcesoftware.com) - -## 1.2.0 - -Fri, 18 Nov 2022 22:40:12 GMT - -### Minor changes - -- Require Node 14 (elcraig@microsoft.com) -- Bump just-task-logger to v1.2.0 - -## 1.1.7 - -Sat, 10 Sep 2022 08:02:45 GMT - -### Patches - -- Update dependency fs-extra to v10 (email not defined) - -## 1.1.6 - -Sat, 10 Sep 2022 00:19:03 GMT - -### Patches - -- Specify Node 12+ engines requirement (elcraig@microsoft.com) -- Bump just-task-logger to v1.1.2 - -## 1.1.5 - -Thu, 27 Jan 2022 23:06:07 GMT - -### Patches - -- Bump marked to 4.0.12 (elcraig@microsoft.com) -- Remove unused handlebars dep (elcraig@microsoft.com) - -## 1.1.4 - -Wed, 04 Aug 2021 17:43:24 GMT - -### Patches - -- Bump tar from 6.1.0 to 6.1.6 (not specified) - -## 1.1.3 - -Tue, 13 Jul 2021 17:19:50 GMT - -### Patches - -- Error when parallel process is terminated (iancra@microsoft.com) - -## 1.1.2 - -Tue, 09 Feb 2021 03:08:41 GMT - -### Patches - -- Bump marked to 2.0.0 (dannyvv@microsoft.com) - -## 1.1.1 - -Thu, 14 Jan 2021 20:55:06 GMT - -### Patches - -- fixing release pipeline and the empty lib folder (kchau@microsoft.com) - -## 1.1.0 - -Wed, 13 Jan 2021 23:22:52 GMT - -### Minor changes - -- Update typescript and other dependencies (elcraig@microsoft.com) - -### Patches - -- Bump just-task-logger to v1.1.0 (elcraig@microsoft.com) - -## 1.0.3 - -Mon, 02 Nov 2020 18:02:45 GMT - -### Patches - -- Update marked dependency to latest (1581488+christiango@users.noreply.github.com) - -## 1.0.2 - -Mon, 02 Nov 2020 16:42:46 GMT - -### Patches - -- Bump yargs dependency (1581488+christiango@users.noreply.github.com) - -## 1.0.1 - -Mon, 02 Nov 2020 16:26:27 GMT - -### Patches - -- Publish src folder (1581488+christiango@users.noreply.github.com) - -## 1.0.0 - -Tue, 06 Oct 2020 23:06:25 GMT - -### Major changes - -- removed just-stack-* (kchau@microsoft.com) - -### Patches - -- Remove implicit SDI usage (darthtrevino@gmail.com) -- fixes publish (kchau@microsoft.com) - -## 0.9.1 - -Fri, 12 Jun 2020 00:43:50 GMT - -### Patches - -- Fix downloadPackage unit test on clients running Node 12. (jagore@microsoft.com) - -## 0.9.0 -Mon, 13 Apr 2020 15:57:30 GMT - -### Minor changes - -- Add execSync utility (elcraig@microsoft.com) -## 0.8.4 -Tue, 13 Aug 2019 21:00:51 GMT - -### Patches - -- Upgraded marked to 0.7.0 and marked-terminal to 3.3.0 (altinokd@microsoft.com) - -## 0.8.3 -Mon, 05 Aug 2019 06:10:22 GMT - -### Patches - -- Switches to using plop.js for codegen (kchau@microsoft.com) - -## 0.8.2 -Mon, 01 Jul 2019 20:15:20 GMT - -### Patches - -- introduce ESLint to sources (43081j@users.noreply.github.com) - -## 0.8.1 -Wed, 12 Jun 2019 02:03:29 GMT - -## 0.8.1 -Wed, 12 Jun 2019 01:49:55 GMT - -## 0.8.1 -Sat, 01 Jun 2019 04:59:34 GMT - -### Patches - -- Fix downloadPackage tests - -## 0.8.0 -Fri, 31 May 2019 21:15:02 GMT - -### Minor changes - -- Adds the ability to override registry in downloadPackage - -## 0.7.3 -Wed, 15 May 2019 18:44:04 GMT - -### Patches - -- Switch microsoft in repo URL to lowercase - -## 0.7.2 -Thu, 25 Apr 2019 18:29:49 GMT - -### Patches - -- Fix #78 by using Spawn instead of Exec - -## 0.7.1 -Wed, 24 Apr 2019 23:38:23 GMT - -### Patches - -- up dep -- add ability to use path for template - -## 0.7.0 -Wed, 10 Apr 2019 20:30:38 GMT - -### Minor changes - -- Fixing up the temp path to also use version in path - -## 0.6.1 -Tue, 12 Mar 2019 20:07:18 GMT - -### Patches - -- Exec error handling improvements - -## 0.6.0 -Fri, 22 Feb 2019 23:37:36 GMT - -### Minor changes - -- Consistent interface naming - -## 0.5.0 -Fri, 22 Feb 2019 22:50:01 GMT - -### Minor changes - -- Move exec to just-scripts-utils - -## 0.4.2 -Fri, 22 Feb 2019 19:03:38 GMT - -### Patches - -- Update package metadata - -## 0.4.1 -Thu, 21 Feb 2019 23:25:53 GMT - -### Patches - -- Use new logger package - -## 0.4.0 -Wed, 13 Feb 2019 22:31:47 GMT - -### Minor changes - -- API updates and error checking - -## 0.3.3 -Mon, 04 Feb 2019 05:47:04 GMT - -### Patches - -- flexibility change - -## 0.3.2 -Fri, 25 Jan 2019 07:08:59 GMT - -### Patches - -- Fixes - -## 0.3.1 -Wed, 23 Jan 2019 00:05:38 GMT - -### Patches - -- info as it is adding package - -## 0.3.0 -Tue, 22 Jan 2019 22:31:23 GMT - -### Minor changes - -- move utils from scripts to here - -## 0.2.2 -Mon, 21 Jan 2019 03:27:17 GMT - -### Patches - -- fix scripts to transform correctly with subdirs - -## 0.2.1 -Mon, 21 Jan 2019 02:54:15 GMT - -### Patches - -- fix upgrade stack task - -## 0.2.0 -Mon, 21 Jan 2019 02:21:01 GMT - -### Minor changes - -- new publish! diff --git a/packages/just-scripts-utils/api-extractor.json b/packages/just-scripts-utils/api-extractor.json deleted file mode 100644 index e72b0db5..00000000 --- a/packages/just-scripts-utils/api-extractor.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "just-task-scripts/api-extractor.base.json" -} diff --git a/packages/just-scripts-utils/etc/just-scripts-utils.api.md b/packages/just-scripts-utils/etc/just-scripts-utils.api.md deleted file mode 100644 index 35818373..00000000 --- a/packages/just-scripts-utils/etc/just-scripts-utils.api.md +++ /dev/null @@ -1,100 +0,0 @@ -## API Report File for "just-scripts-utils" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -/// - -import * as cp from 'child_process'; - -// @public (undocumented) -export interface Dependencies { - // (undocumented) - [key: string]: string; -} - -// @public -export function encodeArgs(cmdArgs: string[]): string[]; - -// @public -export function exec(cmd: string, opts?: cp.ExecOptions & { - stdout?: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream; -}): Promise; - -// @public (undocumented) -export interface ExecError extends cp.ExecException { - // (undocumented) - stderr?: string; - // (undocumented) - stdout?: string; -} - -// @public -export function execSync(cmd: string, cwd?: string, returnOutput?: boolean): string | undefined; - -// @public -export function mergePackageJson(original: PackageJson, incoming: PackageJson): PackageJson; - -// @public (undocumented) -export interface PackageJson { - // (undocumented) - [key: string]: any; - // (undocumented) - dependencies?: Dependencies; - // (undocumented) - description?: string; - // (undocumented) - devDependencies?: Dependencies; - // (undocumented) - just?: { - stack?: string; - }; - // (undocumented) - keywords?: string; - // (undocumented) - name: string; -} - -// @public (undocumented) -export const paths: { - projectPath: string; - tempPath(...segments: string[]): string; -}; - -// @public -export function readPackageJson(folderPath: string): PackageJson | undefined; - -// @public (undocumented) -export interface RushJson { - // (undocumented) - projects: RushProject[]; - // (undocumented) - rushVersion: string; -} - -// @public (undocumented) -export interface RushProject { - // (undocumented) - packageName: string; - // (undocumented) - projectFolder: string; - // (undocumented) - shouldPublish?: boolean; - // (undocumented) - versionPolicyName?: string; -} - -// @public -export function spawn(cmd: string, args?: ReadonlyArray, opts?: cp.SpawnOptions & { - stdout?: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream; -}): Promise; - - -export * from "just-task-logger"; - -// (No @packageDocumentation comment for this package) - -``` diff --git a/packages/just-scripts-utils/jest.config.js b/packages/just-scripts-utils/jest.config.js deleted file mode 100644 index d9a90c61..00000000 --- a/packages/just-scripts-utils/jest.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../scripts/jest.config'); diff --git a/packages/just-scripts-utils/package.json b/packages/just-scripts-utils/package.json deleted file mode 100644 index 163f7ac8..00000000 --- a/packages/just-scripts-utils/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "just-scripts-utils", - "version": "2.1.0", - "description": "Utilities for Just stack scripts", - "repository": { - "type": "git", - "url": "https://github.com/microsoft/just" - }, - "main": "./lib/index.js", - "scripts": { - "api": "api-extractor run", - "api:update": "api-extractor run --local", - "build": "tsc", - "start": "tsc -w --preserveWatchOutput", - "test": "jest", - "start-test": "jest --watch" - }, - "keywords": [], - "author": "", - "license": "MIT", - "engines": { - "node": ">=14" - }, - "dependencies": { - "fs-extra": "^11.0.0", - "just-task-logger": ">=1.3.0 <2.0.0", - "semver": "^7.0.0" - } -} diff --git a/packages/just-scripts-utils/src/interfaces/RushJson.ts b/packages/just-scripts-utils/src/interfaces/RushJson.ts deleted file mode 100644 index b98a2379..00000000 --- a/packages/just-scripts-utils/src/interfaces/RushJson.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface RushProject { - packageName: string; - projectFolder: string; - shouldPublish?: boolean; - versionPolicyName?: string; -} - -export interface RushJson { - projects: RushProject[]; - rushVersion: string; - // more properties can be added as needed -} diff --git a/packages/just-scripts-utils/src/logger.ts b/packages/just-scripts-utils/src/logger.ts deleted file mode 100644 index 70d1c329..00000000 --- a/packages/just-scripts-utils/src/logger.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'just-task-logger'; diff --git a/packages/just-scripts-utils/tsconfig.json b/packages/just-scripts-utils/tsconfig.json deleted file mode 100644 index 1b551f4e..00000000 --- a/packages/just-scripts-utils/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["src"] -} diff --git a/packages/just-scripts/etc/just-scripts.api.md b/packages/just-scripts/etc/just-scripts.api.md index 25edfbb5..234aa705 100644 --- a/packages/just-scripts/etc/just-scripts.api.md +++ b/packages/just-scripts/etc/just-scripts.api.md @@ -9,7 +9,7 @@ import type * as ApiExtractorTypes from '@microsoft/api-extractor'; import type { BuildOptions } from 'esbuild'; import { Configuration } from 'webpack'; -import { spawn } from 'just-scripts-utils'; +import * as cp from 'child_process'; import { SpawnOptions } from 'child_process'; import { TaskFunction } from 'just-task'; import * as ts from 'typescript'; @@ -146,6 +146,9 @@ export function defaultCleanPaths(): string[]; // @public (undocumented) export const displayBailoutOverlay: () => Partial; +// @public +export function encodeArgs(cmdArgs: string[]): string[]; + // @public (undocumented) export interface EntryHeader { // (undocumented) @@ -334,7 +337,11 @@ export interface SassTaskOptions { postcssPlugins?: any[]; } -export { spawn } +// @public +export function spawn(cmd: string, args?: ReadonlyArray, opts?: cp.SpawnOptions & { + stdout?: NodeJS.WritableStream; + stderr?: NodeJS.WritableStream; +}): Promise; // @public (undocumented) export const stylesOverlay: () => Partial; diff --git a/packages/just-scripts/package.json b/packages/just-scripts/package.json index 011fc0c3..4d483f64 100644 --- a/packages/just-scripts/package.json +++ b/packages/just-scripts/package.json @@ -31,7 +31,6 @@ "diff-match-patch": "1.0.5", "fs-extra": "^11.0.0", "glob": "^7.1.3", - "just-scripts-utils": "^2.1.0", "just-task": ">=1.12.0 <2.0.0", "prompts": "^2.4.0", "run-parallel-limit": "^1.0.6", diff --git a/packages/just-scripts/src/index.ts b/packages/just-scripts/src/index.ts index aef861c8..114791ab 100644 --- a/packages/just-scripts/src/index.ts +++ b/packages/just-scripts/src/index.ts @@ -43,4 +43,4 @@ export { copyInstructions }; export * from 'just-task'; -export { spawn } from 'just-scripts-utils'; +export { encodeArgs, spawn } from './utils'; diff --git a/packages/just-scripts-utils/src/interfaces/PackageJson.ts b/packages/just-scripts/src/interfaces/PackageJson.ts similarity index 100% rename from packages/just-scripts-utils/src/interfaces/PackageJson.ts rename to packages/just-scripts/src/interfaces/PackageJson.ts diff --git a/packages/just-scripts/src/tasks/__tests__/mockExecFactory.ts b/packages/just-scripts/src/tasks/__tests__/mockExecFactory.ts deleted file mode 100644 index 88039017..00000000 --- a/packages/just-scripts/src/tasks/__tests__/mockExecFactory.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Mock factory for the `just-scripts-utils/lib/exec` module. We don't want to really exec or spawn anything, - * but we do want the rest of the exports to work. - */ -export function mockExecFactory() { - const originalModule = jest.requireActual('just-scripts-utils/lib/exec'); - return { - // Use real implementation of exports except for `exec` and `spawn` - ...originalModule, - encodeArgs: jest - .fn((cmdArgs: string[]) => { - // Spy on encodeArgs, but keep its original implementation - return originalModule.encodeArgs(cmdArgs); - }) - .mockName('encodeArgs'), - exec: jest - .fn(() => { - // Don't exec in real life - return Promise.resolve(); - }) - .mockName('exec'), - spawn: jest - .fn(() => { - // Don't spawn in real life - return Promise.resolve(); - }) - .mockName('spawn'), - }; -} diff --git a/packages/just-scripts/src/tasks/__tests__/tscTask.spec.ts b/packages/just-scripts/src/tasks/__tests__/tscTask.spec.ts index 3ed920cc..cfdb2ab2 100644 --- a/packages/just-scripts/src/tasks/__tests__/tscTask.spec.ts +++ b/packages/just-scripts/src/tasks/__tests__/tscTask.spec.ts @@ -1,14 +1,22 @@ import * as mockfs from 'mock-fs'; -import { encodeArgs, exec, spawn } from 'just-scripts-utils'; +import { encodeArgs, exec, spawn } from '../../utils'; import { TaskFunction } from 'just-task'; import { tscTask, tscWatchTask, TscTaskOptions } from '../tscTask'; import { callTaskForTest } from './callTaskForTest'; import { normalizeCmdArgsForTest } from './normalizeCmdArgsForTest'; // Jest will hoist these before the imports above, so these modules will be mocked first -jest.mock('just-scripts-utils/lib/exec', () => { - const { mockExecFactory } = require('./mockExecFactory'); - return mockExecFactory(); +jest.mock('../../utils', () => { + const originalModule = jest.requireActual('../../utils'); + return { + // Use real implementation of most exports + ...originalModule, + // Spy on encodeArgs, but keep its original implementation + encodeArgs: jest.fn((cmdArgs: string[]) => originalModule.encodeArgs(cmdArgs)).mockName('encodeArgs'), + // Don't exec or spawn anything + exec: jest.fn(() => Promise.resolve()).mockName('exec'), + spawn: jest.fn(() => Promise.resolve()).mockName('spawn'), + }; }); jest.mock('just-task/lib/logger'); diff --git a/packages/just-scripts/src/tasks/eslintTask.ts b/packages/just-scripts/src/tasks/eslintTask.ts index c71f61d5..2c859d90 100644 --- a/packages/just-scripts/src/tasks/eslintTask.ts +++ b/packages/just-scripts/src/tasks/eslintTask.ts @@ -1,5 +1,5 @@ import { resolve, logger, resolveCwd, TaskFunction } from 'just-task'; -import { encodeArgs, spawn } from 'just-scripts-utils'; +import { encodeArgs, spawn } from '../utils'; import * as fs from 'fs'; /** diff --git a/packages/just-scripts/src/tasks/jestTask.ts b/packages/just-scripts/src/tasks/jestTask.ts index cd272f4d..c1a93521 100644 --- a/packages/just-scripts/src/tasks/jestTask.ts +++ b/packages/just-scripts/src/tasks/jestTask.ts @@ -1,5 +1,5 @@ import { resolve, logger, resolveCwd, TaskFunction, argv } from 'just-task'; -import { spawn, encodeArgs, readPackageJson } from 'just-scripts-utils'; +import { spawn, encodeArgs, readPackageJson } from '../utils'; import { existsSync } from 'fs'; import * as supportsColor from 'supports-color'; diff --git a/packages/just-scripts/src/tasks/nodeExecTask.ts b/packages/just-scripts/src/tasks/nodeExecTask.ts index 21fbe3ac..6a65cac1 100644 --- a/packages/just-scripts/src/tasks/nodeExecTask.ts +++ b/packages/just-scripts/src/tasks/nodeExecTask.ts @@ -1,5 +1,5 @@ import { SpawnOptions } from 'child_process'; -import { spawn } from 'just-scripts-utils'; +import { spawn } from '../utils'; import { logger, TaskFunction } from 'just-task'; import { resolveCwd, _tryResolve } from 'just-task/lib/resolve'; import { getTsNodeEnv } from '../typescript/getTsNodeEnv'; diff --git a/packages/just-scripts/src/tasks/prettierTask.ts b/packages/just-scripts/src/tasks/prettierTask.ts index f3f070b4..df1cf676 100644 --- a/packages/just-scripts/src/tasks/prettierTask.ts +++ b/packages/just-scripts/src/tasks/prettierTask.ts @@ -1,5 +1,5 @@ import { logger, resolve, TaskFunction } from 'just-task'; -import { spawn } from 'just-scripts-utils'; +import { spawn } from '../utils'; import { splitArrayIntoChunks } from '../arrayUtils/splitArrayIntoChunks'; import * as path from 'path'; import { arrayify } from '../arrayUtils/arrayify'; diff --git a/packages/just-scripts/src/tasks/tscTask.ts b/packages/just-scripts/src/tasks/tscTask.ts index 85783fe7..ad5c05e2 100644 --- a/packages/just-scripts/src/tasks/tscTask.ts +++ b/packages/just-scripts/src/tasks/tscTask.ts @@ -1,6 +1,6 @@ import * as ts from 'typescript'; import { resolve, logger, resolveCwd, TaskFunction } from 'just-task'; -import { exec, encodeArgs, spawn } from 'just-scripts-utils'; +import { exec, encodeArgs, spawn } from '../utils'; import * as fs from 'fs'; export type TscTaskOptions = { [key in keyof ts.CompilerOptions]?: string | boolean | string[] } & { diff --git a/packages/just-scripts/src/tasks/tslintTask.ts b/packages/just-scripts/src/tasks/tslintTask.ts index 4d5cd124..028cbc76 100644 --- a/packages/just-scripts/src/tasks/tslintTask.ts +++ b/packages/just-scripts/src/tasks/tslintTask.ts @@ -1,5 +1,5 @@ import { resolve, logger, resolveCwd, TaskFunction } from 'just-task'; -import { exec, encodeArgs } from 'just-scripts-utils'; +import { exec, encodeArgs } from '../utils'; import * as path from 'path'; import * as fs from 'fs'; diff --git a/packages/just-scripts/src/tasks/webpackCliTask.ts b/packages/just-scripts/src/tasks/webpackCliTask.ts index 95dfeae4..dd81e6ce 100644 --- a/packages/just-scripts/src/tasks/webpackCliTask.ts +++ b/packages/just-scripts/src/tasks/webpackCliTask.ts @@ -1,5 +1,5 @@ import { logger, TaskFunction, resolve } from 'just-task'; -import { spawn } from 'just-scripts-utils'; +import { spawn } from '../utils'; import { getTsNodeEnv } from '../typescript/getTsNodeEnv'; import { findWebpackConfig } from '../webpack/findWebpackConfig'; diff --git a/packages/just-scripts/src/tasks/webpackDevServerTask.ts b/packages/just-scripts/src/tasks/webpackDevServerTask.ts index fad34b1a..71ae48d0 100644 --- a/packages/just-scripts/src/tasks/webpackDevServerTask.ts +++ b/packages/just-scripts/src/tasks/webpackDevServerTask.ts @@ -1,6 +1,6 @@ // // WARNING: Careful about add more imports - only import types from webpack import { Configuration } from 'webpack'; -import { encodeArgs, spawn } from 'just-scripts-utils'; +import { encodeArgs, spawn } from '../utils'; import { logger, resolve, resolveCwd, TaskFunction } from 'just-task'; import * as fs from 'fs'; import * as path from 'path'; diff --git a/packages/just-scripts-utils/src/__tests__/exec.spec.ts b/packages/just-scripts/src/utils/__tests__/exec.spec.ts similarity index 100% rename from packages/just-scripts-utils/src/__tests__/exec.spec.ts rename to packages/just-scripts/src/utils/__tests__/exec.spec.ts diff --git a/packages/just-scripts-utils/src/__tests__/mergePackageJson.spec.ts b/packages/just-scripts/src/utils/__tests__/mergePackageJson.spec.ts similarity index 99% rename from packages/just-scripts-utils/src/__tests__/mergePackageJson.spec.ts rename to packages/just-scripts/src/utils/__tests__/mergePackageJson.spec.ts index 59827ec0..4664620d 100644 --- a/packages/just-scripts-utils/src/__tests__/mergePackageJson.spec.ts +++ b/packages/just-scripts/src/utils/__tests__/mergePackageJson.spec.ts @@ -1,5 +1,5 @@ import { mergePackageJson, _shouldUpdateDep } from '../mergePackageJson'; -import { PackageJson } from '../interfaces/PackageJson'; +import { PackageJson } from '../../interfaces/PackageJson'; describe('_shouldUpdateDep', () => { it('returns true if old version is undefined', () => { diff --git a/packages/just-scripts-utils/src/__tests__/paths.spec.ts b/packages/just-scripts/src/utils/__tests__/paths.spec.ts similarity index 100% rename from packages/just-scripts-utils/src/__tests__/paths.spec.ts rename to packages/just-scripts/src/utils/__tests__/paths.spec.ts diff --git a/packages/just-scripts-utils/src/__tests__/readPackageJson.spec.ts b/packages/just-scripts/src/utils/__tests__/readPackageJson.spec.ts similarity index 100% rename from packages/just-scripts-utils/src/__tests__/readPackageJson.spec.ts rename to packages/just-scripts/src/utils/__tests__/readPackageJson.spec.ts diff --git a/packages/just-scripts-utils/src/exec.ts b/packages/just-scripts/src/utils/exec.ts similarity index 100% rename from packages/just-scripts-utils/src/exec.ts rename to packages/just-scripts/src/utils/exec.ts diff --git a/packages/just-scripts-utils/src/index.ts b/packages/just-scripts/src/utils/index.ts similarity index 56% rename from packages/just-scripts-utils/src/index.ts rename to packages/just-scripts/src/utils/index.ts index 75aab8b2..3c5958f3 100644 --- a/packages/just-scripts-utils/src/index.ts +++ b/packages/just-scripts/src/utils/index.ts @@ -1,7 +1,4 @@ export * from './exec'; -export * from './interfaces/PackageJson'; -export * from './interfaces/RushJson'; -export * from './logger'; export { mergePackageJson } from './mergePackageJson'; export * from './paths'; export * from './readPackageJson'; diff --git a/packages/just-scripts-utils/src/mergePackageJson.ts b/packages/just-scripts/src/utils/mergePackageJson.ts similarity index 97% rename from packages/just-scripts-utils/src/mergePackageJson.ts rename to packages/just-scripts/src/utils/mergePackageJson.ts index e0027811..847af57a 100644 --- a/packages/just-scripts-utils/src/mergePackageJson.ts +++ b/packages/just-scripts/src/utils/mergePackageJson.ts @@ -1,4 +1,4 @@ -import { PackageJson } from './interfaces/PackageJson'; +import { PackageJson } from '../interfaces/PackageJson'; import semver = require('semver'); /** diff --git a/packages/just-scripts-utils/src/paths.ts b/packages/just-scripts/src/utils/paths.ts similarity index 100% rename from packages/just-scripts-utils/src/paths.ts rename to packages/just-scripts/src/utils/paths.ts diff --git a/packages/just-scripts-utils/src/readPackageJson.ts b/packages/just-scripts/src/utils/readPackageJson.ts similarity index 90% rename from packages/just-scripts-utils/src/readPackageJson.ts rename to packages/just-scripts/src/utils/readPackageJson.ts index eef5aaf6..3c71b6cf 100644 --- a/packages/just-scripts-utils/src/readPackageJson.ts +++ b/packages/just-scripts/src/utils/readPackageJson.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import { PackageJson } from './interfaces/PackageJson'; +import { PackageJson } from '../interfaces/PackageJson'; import fse = require('fs-extra'); /** diff --git a/packages/just-task-logger/.npmignore b/packages/just-task-logger/.npmignore deleted file mode 100644 index e5cc9f63..00000000 --- a/packages/just-task-logger/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -__tests__ -*.log -*.tgz -api-extractor.json -CHANGELOG.* -etc/ -jest.config.js -package-deps.json -tsconfig.json \ No newline at end of file diff --git a/packages/just-task-logger/CHANGELOG.json b/packages/just-task-logger/CHANGELOG.json deleted file mode 100644 index 3732ad57..00000000 --- a/packages/just-task-logger/CHANGELOG.json +++ /dev/null @@ -1,333 +0,0 @@ -{ - "name": "just-task-logger", - "entries": [ - { - "date": "Fri, 28 Mar 2025 08:01:48 GMT", - "version": "1.3.0", - "tag": "just-task-logger_v1.3.0", - "comments": { - "minor": [ - { - "author": "elcraig@microsoft.com", - "package": "just-task-logger", - "commit": "b08901cb0e1ca7833027ae1e6473ff8dff7b4529", - "comment": "Build with TypeScript 4.5" - } - ] - } - }, - { - "date": "Sat, 02 Mar 2024 08:01:34 GMT", - "version": "1.2.1", - "tag": "just-task-logger_v1.2.1", - "comments": { - "none": [ - { - "author": "elcraig@microsoft.com", - "package": "just-task-logger", - "commit": "feb6217bf318c7d606c6147a4f5d6568572bb2f3", - "comment": "Update build setup" - } - ] - } - }, - { - "date": "Tue, 12 Sep 2023 08:02:05 GMT", - "version": "1.2.1", - "tag": "just-task-logger_v1.2.1", - "comments": { - "none": [ - { - "author": "elcraig@microsoft.com", - "package": "just-task-logger", - "commit": "5b4e7073ffd1f06a7383deccee6883aa7e63342c", - "comment": "Set up API Extractor" - } - ] - } - }, - { - "date": "Thu, 09 Mar 2023 08:02:09 GMT", - "tag": "just-task-logger_v1.2.1", - "version": "1.2.1", - "comments": { - "patch": [ - { - "author": "elcraig@microsoft.com", - "package": "just-task-logger", - "commit": "a509c1d0a5483b3e688f400c73da5969f5ae42c7", - "comment": "Use `yargs-parser` instead of `yargs` to get the `--verbose` argument" - } - ] - } - }, - { - "date": "Wed, 15 Feb 2023 08:01:34 GMT", - "tag": "just-task-logger_v1.2.0", - "version": "1.2.0", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-task-logger", - "commit": "df8892c64a12d738ee6e3af85b1faa69691d6dbf", - "comment": "Update devDependency @types/yargs to v15.0.15" - } - ] - } - }, - { - "date": "Sat, 19 Nov 2022 08:02:12 GMT", - "tag": "just-task-logger_v1.2.0", - "version": "1.2.0", - "comments": { - "none": [ - { - "author": "elcraig@microsoft.com", - "package": "just-task-logger", - "commit": "a1d4ca0f23c165cffc4c673c7a098c60401922c9", - "comment": "Hoist widely-used devDependencies" - } - ] - } - }, - { - "date": "Fri, 18 Nov 2022 22:40:12 GMT", - "tag": "just-task-logger_v1.2.0", - "version": "1.2.0", - "comments": { - "minor": [ - { - "author": "elcraig@microsoft.com", - "package": "just-task-logger", - "commit": "85d42c8a7e89413ee51b4fe9f731ad0e869addcd", - "comment": "Require Node 14" - } - ] - } - }, - { - "date": "Sat, 10 Sep 2022 00:19:03 GMT", - "tag": "just-task-logger_v1.1.2", - "version": "1.1.2", - "comments": { - "patch": [ - { - "author": "elcraig@microsoft.com", - "package": "just-task-logger", - "commit": "9fd466eb0c24ae5f5fed3381acfe229e74cc1bde", - "comment": "Specify Node 12+ engines requirement" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 08:02:06 GMT", - "tag": "just-task-logger_v1.1.1", - "version": "1.1.1", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-task-logger", - "commit": "c08c46745a95efabab5dbfc0f216d2e3b94ae03f", - "comment": "Update devDependency mock-fs to v4.14.0" - }, - { - "author": "renovate@whitesourcesoftware.com", - "package": "just-task-logger", - "commit": "32b2d44a637fcfca27c0a2c1fbc80d25bb60d7ce", - "comment": "Update devDependency ts-jest to v26.5.6" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 01:49:38 GMT", - "tag": "just-task-logger_v1.1.1", - "version": "1.1.1", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-task-logger", - "commit": "a88704b4f1f046e1440c0944145a8045273904c3", - "comment": "Update devDependency @types/node to v12" - }, - { - "author": "email not defined", - "package": "just-task-logger", - "commit": "f080946c01915c3cff7445928b2697729fc2e93d", - "comment": "Update @types packages" - } - ] - } - }, - { - "date": "Fri, 09 Sep 2022 00:04:18 GMT", - "tag": "just-task-logger_v1.1.1", - "version": "1.1.1", - "comments": { - "none": [ - { - "author": "email not defined", - "package": "just-task-logger", - "comment": "Pin devDependencies", - "commit": "0dca4fef66c833623c3b923f426ee44d6887c5fe" - } - ] - } - }, - { - "date": "Thu, 14 Jan 2021 20:55:06 GMT", - "tag": "just-task-logger_v1.1.1", - "version": "1.1.1", - "comments": { - "patch": [ - { - "comment": "fixing release pipeline and the empty lib folder", - "author": "kchau@microsoft.com", - "commit": "dd4f1b0db3fb6ce3769ed38ebf410bcc6d4da567", - "package": "just-task-logger" - } - ] - } - }, - { - "date": "Wed, 13 Jan 2021 23:22:52 GMT", - "tag": "just-task-logger_v1.1.0", - "version": "1.1.0", - "comments": { - "minor": [ - { - "comment": "Update typescript and other dependencies", - "author": "elcraig@microsoft.com", - "commit": "560caa2639b064a15764d7b5b58b64b620b59c35", - "package": "just-task-logger" - } - ] - } - }, - { - "date": "Mon, 02 Nov 2020 16:42:46 GMT", - "tag": "just-task-logger_v1.0.2", - "version": "1.0.2", - "comments": { - "patch": [ - { - "comment": "Bump yargs dependency", - "author": "1581488+christiango@users.noreply.github.com", - "commit": "bbbf4bb4b366c4df0cebb429c944d610b67d6d0f", - "package": "just-task-logger" - } - ] - } - }, - { - "date": "Mon, 02 Nov 2020 16:26:27 GMT", - "tag": "just-task-logger_v1.0.1", - "version": "1.0.1", - "comments": { - "patch": [ - { - "comment": "Publish src folder", - "author": "1581488+christiango@users.noreply.github.com", - "commit": "b5b171c31a995398d4bd6cbb0aa3ff2cf559afc3", - "package": "just-task-logger" - } - ] - } - }, - { - "date": "Tue, 06 Oct 2020 23:06:25 GMT", - "tag": "just-task-logger_v1.0.0", - "version": "1.0.0", - "comments": { - "patch": [ - { - "comment": "Remove implicit SDI usage", - "author": "darthtrevino@gmail.com", - "commit": "2301badd04f2581b262ff7ec304f612c717efc8c", - "package": "just-task-logger" - }, - { - "comment": "fixes publish", - "author": "kchau@microsoft.com", - "commit": "2d81870dfead736767e12ab220d7f4001b5fe94e", - "package": "just-task-logger" - } - ], - "major": [ - { - "comment": "removed just-stack-*", - "author": "kchau@microsoft.com", - "commit": "7f6c1c32d5715a33b2a8be066796e941b4d9558b", - "package": "just-task-logger" - } - ] - } - }, - { - "date": "Thu, 11 Jul 2019 17:08:46 GMT", - "tag": "just-task-logger_v0.3.0", - "version": "0.3.0", - "comments": { - "minor": [ - { - "comment": "adding perf logging", - "author": "kchau@microsoft.com", - "commit": "41f35e4f9c771f2ffb96d0f5ea8cfb1eb1475afc" - } - ] - } - }, - { - "version": "0.2.1", - "tag": "just-task-logger_v0.2.1", - "date": "Wed, 15 May 2019 18:44:04 GMT", - "comments": { - "patch": [ - { - "comment": "Switch microsoft in repo URL to lowercase" - } - ] - } - }, - { - "version": "0.2.0", - "tag": "just-task-logger_v0.2.0", - "date": "Fri, 22 Feb 2019 23:37:36 GMT", - "comments": { - "minor": [ - { - "comment": "Consistent interface naming" - } - ] - } - }, - { - "version": "0.1.2", - "tag": "just-task-logger_v0.1.2", - "date": "Fri, 22 Feb 2019 19:03:38 GMT", - "comments": { - "patch": [ - { - "comment": "Update package metadata" - } - ] - } - }, - { - "version": "0.1.1", - "tag": "just-task-logger_v0.1.1", - "date": "Thu, 21 Feb 2019 23:25:53 GMT", - "comments": { - "patch": [ - { - "comment": "Add logger package" - } - ] - } - } - ] -} diff --git a/packages/just-task-logger/CHANGELOG.md b/packages/just-task-logger/CHANGELOG.md deleted file mode 100644 index bd3d6f53..00000000 --- a/packages/just-task-logger/CHANGELOG.md +++ /dev/null @@ -1,120 +0,0 @@ -# Change Log - just-task-logger - - - - - -## 1.3.0 - -Fri, 28 Mar 2025 08:01:48 GMT - -### Minor changes - -- Build with TypeScript 4.5 (elcraig@microsoft.com) - -## 1.2.1 - -Thu, 09 Mar 2023 08:02:09 GMT - -### Patches - -- Use `yargs-parser` instead of `yargs` to get the `--verbose` argument (elcraig@microsoft.com) - -## 1.2.0 - -Fri, 18 Nov 2022 22:40:12 GMT - -### Minor changes - -- Require Node 14 (elcraig@microsoft.com) - -## 1.1.2 - -Sat, 10 Sep 2022 00:19:03 GMT - -### Patches - -- Specify Node 12+ engines requirement (elcraig@microsoft.com) - -## 1.1.1 - -Thu, 14 Jan 2021 20:55:06 GMT - -### Patches - -- fixing release pipeline and the empty lib folder (kchau@microsoft.com) - -## 1.1.0 - -Wed, 13 Jan 2021 23:22:52 GMT - -### Minor changes - -- Update typescript and other dependencies (elcraig@microsoft.com) - -## 1.0.2 - -Mon, 02 Nov 2020 16:42:46 GMT - -### Patches - -- Bump yargs dependency (1581488+christiango@users.noreply.github.com) - -## 1.0.1 - -Mon, 02 Nov 2020 16:26:27 GMT - -### Patches - -- Publish src folder (1581488+christiango@users.noreply.github.com) - -## 1.0.0 - -Tue, 06 Oct 2020 23:06:25 GMT - -### Major changes - -- removed just-stack-* (kchau@microsoft.com) - -### Patches - -- Remove implicit SDI usage (darthtrevino@gmail.com) -- fixes publish (kchau@microsoft.com) - -## 0.3.0 -Thu, 11 Jul 2019 17:08:46 GMT - -### Minor changes - -- adding perf logging (kchau@microsoft.com) - -## 0.2.1 -Mon, 01 Jul 2019 20:15:20 GMT - -## 0.2.1 -Wed, 15 May 2019 18:44:04 GMT - -### Patches - -- Switch microsoft in repo URL to lowercase - -## 0.2.0 -Fri, 22 Feb 2019 23:37:36 GMT - -### Minor changes - -- Consistent interface naming - -## 0.1.2 -Fri, 22 Feb 2019 19:03:38 GMT - -### Patches - -- Update package metadata - -## 0.1.1 -Thu, 21 Feb 2019 23:25:53 GMT - -### Patches - -- Add logger package diff --git a/packages/just-task-logger/api-extractor.json b/packages/just-task-logger/api-extractor.json deleted file mode 100644 index e72b0db5..00000000 --- a/packages/just-task-logger/api-extractor.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "just-task-scripts/api-extractor.base.json" -} diff --git a/packages/just-task-logger/jest.config.js b/packages/just-task-logger/jest.config.js deleted file mode 100644 index d9a90c61..00000000 --- a/packages/just-task-logger/jest.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../scripts/jest.config'); diff --git a/packages/just-task-logger/package.json b/packages/just-task-logger/package.json deleted file mode 100644 index 26a89017..00000000 --- a/packages/just-task-logger/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "just-task-logger", - "version": "1.3.0", - "description": "Logger for Just scripts and tasks", - "repository": { - "type": "git", - "url": "https://github.com/microsoft/just" - }, - "main": "./lib/index.js", - "scripts": { - "api": "api-extractor run", - "api:update": "api-extractor run --local", - "build": "tsc", - "start": "tsc -w --preserveWatchOutput", - "test": "jest", - "start-test": "jest --watch" - }, - "keywords": [], - "author": "", - "license": "MIT", - "engines": { - "node": ">=14" - }, - "dependencies": { - "chalk": "^4.0.0", - "yargs-parser": "^20.2.3" - } -} diff --git a/packages/just-task-logger/src/index.ts b/packages/just-task-logger/src/index.ts deleted file mode 100644 index 41e99d3b..00000000 --- a/packages/just-task-logger/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { logger, Logger } from './logger'; -export { mark } from './perf'; diff --git a/packages/just-task-logger/src/logger.ts b/packages/just-task-logger/src/logger.ts deleted file mode 100644 index 8e2d608b..00000000 --- a/packages/just-task-logger/src/logger.ts +++ /dev/null @@ -1,70 +0,0 @@ -import chalk = require('chalk'); -import * as parser from 'yargs-parser'; -import { getDeltaAndClearMark } from './perf'; - -const argv = parser(process.argv.slice(2)); - -function logInternal(method: 'info' | 'warn' | 'error', symbol: string, ...args: any[]) { - const now = new Date(); - const timestamp = chalk.gray(`[${now.toLocaleTimeString()}]`); - - console[method](timestamp, symbol, ...args); -} - -export interface Logger { - /** Whether verbose logging is enabled. Default false unless --verbose arg is given. */ - enableVerbose: boolean; - /** Log to `console.info` with a timestamp, but only if verbose logging is enabled. */ - verbose(...args: any[]): void; - /** Log to `console.info` with a timestamp. */ - info(...args: any[]): void; - /** Log to `console.warn` with a timestamp. */ - warn(...args: any[]): void; - /** Log to `console.error` with a timestamp. */ - error(...args: any[]): void; - /** Log perf marker data to `consold.info` with timestamp, only if verbose is enabled */ - perf(marker: string, ...args: any[]): void; -} - -const emptySquare = '\u25a1'; -const square = '\u25a0'; -const triangle = '\u25b2'; - -export const logger: Logger = { - enableVerbose: !!argv.verbose, - - verbose(...args: any[]) { - if (logger.enableVerbose) { - logInternal('info', chalk.gray(emptySquare), ...args); - } - }, - - info(...args: any[]) { - logInternal('info', chalk.green(square), ...args); - }, - - warn(...args: any[]) { - logInternal('warn', chalk.yellow(triangle), ...args); - }, - - error(...args: any[]) { - logInternal('error', chalk.redBright('x'), ...args); - }, - - perf(marker: string, ...args: any[]) { - if (logger.enableVerbose) { - const delta = getDeltaAndClearMark(marker); - - if (delta) { - const ns = delta[0] * 1e9 + delta[1]; - const deltaMsg = `${ns / 1e9}s`; - logInternal( - 'info', - chalk.cyan(square), - `mark(${chalk.cyanBright(marker)}): took ${chalk.cyanBright(deltaMsg)}`, - ...args, - ); - } - } - }, -}; diff --git a/packages/just-task-logger/src/perf.ts b/packages/just-task-logger/src/perf.ts deleted file mode 100644 index 5224a4f8..00000000 --- a/packages/just-task-logger/src/perf.ts +++ /dev/null @@ -1,15 +0,0 @@ -const markers: { [marker: string]: [number, number] } = {}; - -export function mark(marker: string): void { - markers[marker] = process.hrtime(); -} - -export function getDeltaAndClearMark(marker: string): [number, number] | null { - if (markers[marker]) { - const delta = process.hrtime(markers[marker]); - delete markers[marker]; - return delta; - } - - return null; -} diff --git a/packages/just-task-logger/tsconfig.json b/packages/just-task-logger/tsconfig.json deleted file mode 100644 index 1b551f4e..00000000 --- a/packages/just-task-logger/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["src"] -} diff --git a/packages/just-task-logger/etc/just-task-logger.api.md b/packages/just-task/etc/just-task-logger.api.md similarity index 100% rename from packages/just-task-logger/etc/just-task-logger.api.md rename to packages/just-task/etc/just-task-logger.api.md diff --git a/packages/just-task/etc/just-task.api.md b/packages/just-task/etc/just-task.api.md index ea25a174..11633246 100644 --- a/packages/just-task/etc/just-task.api.md +++ b/packages/just-task/etc/just-task.api.md @@ -9,7 +9,6 @@ import { Arguments } from 'yargs-parser'; import { Duplex } from 'stream'; import type { FSWatcher } from 'chokidar'; -import { Logger } from 'just-task-logger'; import type { Stats } from 'fs'; import { TaskFunction as TaskFunction_2 } from 'undertaker'; import { TaskFunctionParams } from 'undertaker'; @@ -34,6 +33,22 @@ export function clearCache(): void; // @public (undocumented) export function condition(taskName: string, conditional: () => boolean): TaskFunction_2; +// @public (undocumented) +export interface Logger { + enableVerbose: boolean; + error(...args: any[]): void; + info(...args: any[]): void; + perf(marker: string, ...args: any[]): void; + verbose(...args: any[]): void; + warn(...args: any[]): void; +} + +// @public (undocumented) +export const logger: Logger; + +// @public (undocumented) +export function mark(marker: string): void; + // Warning: (ae-forgotten-export) The symbol "OptionConfig" needs to be exported by the entry point index.d.ts // // @public (undocumented) @@ -118,9 +133,6 @@ export function watch(globs: string | string[], optionsOrListener?: WatchListene // @public (undocumented) type WatchListener = (path: string, stats?: Stats) => void; - -export * from "just-task-logger"; - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/just-task/package.json b/packages/just-task/package.json index 97dfe00d..9298e0b5 100644 --- a/packages/just-task/package.json +++ b/packages/just-task/package.json @@ -34,7 +34,6 @@ "chalk": "^4.0.0", "chokidar": "^3.5.2", "fs-extra": "^11.0.0", - "just-task-logger": ">=1.3.0 <2.0.0", "resolve": "^1.19.0", "undertaker": "^2.0.0", "undertaker-registry": "^2.0.0", diff --git a/packages/just-task-logger/src/__tests__/logger.spec.ts b/packages/just-task/src/__tests__/logger.spec.ts similarity index 100% rename from packages/just-task-logger/src/__tests__/logger.spec.ts rename to packages/just-task/src/__tests__/logger.spec.ts diff --git a/packages/just-task/src/cache.ts b/packages/just-task/src/cache.ts index 472f85da..1d7e7583 100644 --- a/packages/just-task/src/cache.ts +++ b/packages/just-task/src/cache.ts @@ -3,7 +3,7 @@ import { argv } from './option'; import { resolveCwd } from './resolve'; import * as fs from 'fs-extra'; import * as path from 'path'; -import { logger, mark } from 'just-task-logger'; +import { logger, mark } from './logger'; import { findDependents } from './package/findDependents'; import { findGitRoot } from './package/findGitRoot'; import { spawnSync } from 'child_process'; diff --git a/packages/just-task/src/cli.ts b/packages/just-task/src/cli.ts index f57bb56b..de9ad6f8 100644 --- a/packages/just-task/src/cli.ts +++ b/packages/just-task/src/cli.ts @@ -1,6 +1,6 @@ import { undertaker } from './undertaker'; import { option, parseCommand } from './option'; -import { logger } from 'just-task-logger'; +import { logger } from './logger'; import { TaskFunction } from './interfaces'; import { readConfig } from './config'; import { task } from './task'; diff --git a/packages/just-task/src/config.ts b/packages/just-task/src/config.ts index 62306958..d2e57a2e 100644 --- a/packages/just-task/src/config.ts +++ b/packages/just-task/src/config.ts @@ -3,7 +3,7 @@ import * as path from 'path'; import { argv } from './option'; import { resolve } from './resolve'; -import { mark, logger } from 'just-task-logger'; +import { mark, logger } from './logger'; import { enableTypeScript } from './enableTypeScript'; import yargsParser = require('yargs-parser'); import { TaskFunction } from './interfaces'; diff --git a/packages/just-task/src/enableTypeScript.ts b/packages/just-task/src/enableTypeScript.ts index 65c59063..f1a76da5 100644 --- a/packages/just-task/src/enableTypeScript.ts +++ b/packages/just-task/src/enableTypeScript.ts @@ -1,5 +1,5 @@ import { resolve } from './resolve'; -import { logger } from 'just-task-logger'; +import { logger } from './logger'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function enableTypeScript({ transpileOnly = true, esm = false }): void { diff --git a/packages/just-task/src/logger.ts b/packages/just-task/src/logger.ts index 70d1c329..073b9484 100644 --- a/packages/just-task/src/logger.ts +++ b/packages/just-task/src/logger.ts @@ -1 +1,85 @@ -export * from 'just-task-logger'; +import chalk = require('chalk'); +import * as parser from 'yargs-parser'; + +const argv = parser(process.argv.slice(2)); + +function logInternal(method: 'info' | 'warn' | 'error', symbol: string, ...args: any[]) { + const now = new Date(); + const timestamp = chalk.gray(`[${now.toLocaleTimeString()}]`); + + console[method](timestamp, symbol, ...args); +} + +const markers: { [marker: string]: [number, number] } = {}; + +export function mark(marker: string): void { + markers[marker] = process.hrtime(); +} + +function getDeltaAndClearMark(marker: string): [number, number] | null { + if (markers[marker]) { + const delta = process.hrtime(markers[marker]); + delete markers[marker]; + return delta; + } + + return null; +} + +export interface Logger { + /** Whether verbose logging is enabled. Default false unless --verbose arg is given. */ + enableVerbose: boolean; + /** Log to `console.info` with a timestamp, but only if verbose logging is enabled. */ + verbose(...args: any[]): void; + /** Log to `console.info` with a timestamp. */ + info(...args: any[]): void; + /** Log to `console.warn` with a timestamp. */ + warn(...args: any[]): void; + /** Log to `console.error` with a timestamp. */ + error(...args: any[]): void; + /** Log perf marker data to `consold.info` with timestamp, only if verbose is enabled */ + perf(marker: string, ...args: any[]): void; +} + +const emptySquare = '\u25a1'; +const square = '\u25a0'; +const triangle = '\u25b2'; + +export const logger: Logger = { + enableVerbose: !!argv.verbose, + + verbose(...args: any[]) { + if (logger.enableVerbose) { + logInternal('info', chalk.gray(emptySquare), ...args); + } + }, + + info(...args: any[]) { + logInternal('info', chalk.green(square), ...args); + }, + + warn(...args: any[]) { + logInternal('warn', chalk.yellow(triangle), ...args); + }, + + error(...args: any[]) { + logInternal('error', chalk.redBright('x'), ...args); + }, + + perf(marker: string, ...args: any[]) { + if (logger.enableVerbose) { + const delta = getDeltaAndClearMark(marker); + + if (delta) { + const ns = delta[0] * 1e9 + delta[1]; + const deltaMsg = `${ns / 1e9}s`; + logInternal( + 'info', + chalk.cyan(square), + `mark(${chalk.cyanBright(marker)}): took ${chalk.cyanBright(deltaMsg)}`, + ...args, + ); + } + } + }, +}; diff --git a/packages/just-task/src/package/findDependents.ts b/packages/just-task/src/package/findDependents.ts index 2df761d4..daa28c37 100644 --- a/packages/just-task/src/package/findDependents.ts +++ b/packages/just-task/src/package/findDependents.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as path from 'path'; import { resolveCwd } from '../resolve'; import { findPackageRoot } from './findPackageRoot'; -import { logger, mark } from 'just-task-logger'; +import { logger, mark } from '../logger'; import { findGitRoot } from './findGitRoot'; import { isChildOf } from '../paths';