diff --git a/.gitignore b/.gitignore index 53b1d74d..6b0a34ef 100644 --- a/.gitignore +++ b/.gitignore @@ -68,7 +68,7 @@ typings/ # Output of 'npm pack' *.tgz -# Redundant ignore files +# Redundant files packages/*/.npmignore packages/*/.drone.yml packages/*/LICENSE diff --git a/.gulp/gitignore.diff b/.gulp/gitignore.diff index f7c91f6b..7ed2e1ff 100644 Binary files a/.gulp/gitignore.diff and b/.gulp/gitignore.diff differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 0efba437..09c7949a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## TSProjectGenerator [Unreleased] -[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v1.1.0...dev) +[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v1.1.1...dev) + +## TSProjectGenerator v1.1.1 +### Fixed + - Fixed broken `.gitignore` file creation + +### Updated + - The code for creating `launch.json` files + - The terminoloy of some file-processors + +[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v1.1.0...v1.1.1) ## TSProjectGenerator v1.1.0 ### Added diff --git a/lerna.json b/lerna.json index 787e3def..985ae179 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.1.0", + "version": "1.1.1", "packages": [ "./packages/*" ], diff --git a/packages/generator-my-ts-project/package-lock.json b/packages/generator-my-ts-project/package-lock.json index 36702853..dd41ad5a 100644 --- a/packages/generator-my-ts-project/package-lock.json +++ b/packages/generator-my-ts-project/package-lock.json @@ -1,6 +1,6 @@ { "name": "@manuth/generator-my-ts-project", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -139,6 +139,31 @@ "yeoman-test": "^3.0.0" } }, + "@manuth/temp-files": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@manuth/temp-files/-/temp-files-1.2.0.tgz", + "integrity": "sha512-PM+2/0ZqVDuCQLIxMlaY1fPUL8LTALJ98iTFEl5XGB07rLAzFG+ZtnMWXFH/VAxD7XHykPMXVQpSPY+JvHrZbg==", + "requires": { + "@types/tmp": "0.2.0", + "fs-extra": "^9.0.1", + "tmp": "0.2.1" + }, + "dependencies": { + "@types/tmp": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.2.0.tgz", + "integrity": "sha512-flgpHJjntpBAdJD43ShRosQvNC0ME97DCfGvZEDlAThQmnerRXrLbX6YgzRBQCZTthET9eAWFAMaYP0m0Y4HzQ==" + }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "requires": { + "rimraf": "^3.0.0" + } + } + } + }, "@manuth/tsconfig": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@manuth/tsconfig/-/tsconfig-1.2.2.tgz", @@ -525,7 +550,8 @@ "@types/tmp": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-6IwZ9HzWbCq6XoQWhxLpDjuADodH/MKXRUIDFudvgjcVdjFknvmR+DNsoUeer4XPrEnrZs04Jj+kfV9pFsrhmA==" + "integrity": "sha512-6IwZ9HzWbCq6XoQWhxLpDjuADodH/MKXRUIDFudvgjcVdjFknvmR+DNsoUeer4XPrEnrZs04Jj+kfV9pFsrhmA==", + "dev": true }, "@types/vinyl": { "version": "2.0.4", @@ -7616,6 +7642,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/temp-filesystem/-/temp-filesystem-1.1.3.tgz", "integrity": "sha512-np/Jd8Zem6FPZAhGq9Y+DAm6oPxrSVKVN6CCGf/jCtkVhpCYCR5zt6McvfcPgwrJwYYH8ZBs8UbgMIaiCrbObQ==", + "dev": true, "requires": { "@types/tmp": "0.1.0", "fs-extra": "^8.1.0", @@ -7626,6 +7653,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -7636,6 +7664,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -7644,6 +7673,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -7652,6 +7682,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "dev": true, "requires": { "rimraf": "^2.6.3" } @@ -7659,7 +7690,8 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, diff --git a/packages/generator-my-ts-project/package.json b/packages/generator-my-ts-project/package.json index 1baaaf22..d29f1fd3 100644 --- a/packages/generator-my-ts-project/package.json +++ b/packages/generator-my-ts-project/package.json @@ -1,6 +1,6 @@ { "name": "@manuth/generator-my-ts-project", - "version": "1.1.0", + "version": "1.1.1", "description": "Generates TypeScript-Projects with custom additions", "author": "Manuel Thalmann ", "keywords": [ @@ -41,13 +41,13 @@ }, "dependencies": { "@manuth/extended-yo-generator": "^7.3.3", - "@manuth/generator-ts-project": "^1.1.0", + "@manuth/generator-ts-project": "^1.1.1", + "@manuth/temp-files": "^1.2.0", "chalk": "^4.1.0", "dedent": "^0.7.0", "detect-newline": "^3.1.0", "eol": "^0.9.1", "fs-extra": "^9.0.1", - "temp-filesystem": "^1.1.3", "yaml": "^1.10.0", "yosay": "^2.0.2" }, diff --git a/packages/generator-my-ts-project/src/tests/MarkdownFileProcessor.test.ts b/packages/generator-my-ts-project/src/tests/MarkdownFileProcessor.test.ts index 6fa21069..940a9849 100644 --- a/packages/generator-my-ts-project/src/tests/MarkdownFileProcessor.test.ts +++ b/packages/generator-my-ts-project/src/tests/MarkdownFileProcessor.test.ts @@ -1,9 +1,9 @@ import Assert = require("assert"); import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { TestContext, TestGenerator, ITestGeneratorOptions, ITestOptions, ITestGeneratorSettings, FileMappingTester } from "@manuth/extended-yo-generator-test"; +import { TempFile } from "@manuth/temp-files"; import dedent = require("dedent"); import { writeFile } from "fs-extra"; -import { TempFile } from "temp-filesystem"; import { MarkdownFileProcessor } from "../MarkdownFileProcessor"; /** diff --git a/packages/generator-ts-project/package-lock.json b/packages/generator-ts-project/package-lock.json index 4ce98521..0f0eec05 100644 --- a/packages/generator-ts-project/package-lock.json +++ b/packages/generator-ts-project/package-lock.json @@ -1,6 +1,6 @@ { "name": "@manuth/generator-ts-project", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -190,6 +190,31 @@ "upath": "^1.2.0" } }, + "@manuth/temp-files": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@manuth/temp-files/-/temp-files-1.2.0.tgz", + "integrity": "sha512-PM+2/0ZqVDuCQLIxMlaY1fPUL8LTALJ98iTFEl5XGB07rLAzFG+ZtnMWXFH/VAxD7XHykPMXVQpSPY+JvHrZbg==", + "requires": { + "@types/tmp": "0.2.0", + "fs-extra": "^9.0.1", + "tmp": "0.2.1" + }, + "dependencies": { + "@types/tmp": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.2.0.tgz", + "integrity": "sha512-flgpHJjntpBAdJD43ShRosQvNC0ME97DCfGvZEDlAThQmnerRXrLbX6YgzRBQCZTthET9eAWFAMaYP0m0Y4HzQ==" + }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "requires": { + "rimraf": "^3.0.0" + } + } + } + }, "@manuth/tsconfig": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@manuth/tsconfig/-/tsconfig-1.2.2.tgz", @@ -713,7 +738,8 @@ "@types/tmp": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-6IwZ9HzWbCq6XoQWhxLpDjuADodH/MKXRUIDFudvgjcVdjFknvmR+DNsoUeer4XPrEnrZs04Jj+kfV9pFsrhmA==" + "integrity": "sha512-6IwZ9HzWbCq6XoQWhxLpDjuADodH/MKXRUIDFudvgjcVdjFknvmR+DNsoUeer4XPrEnrZs04Jj+kfV9pFsrhmA==", + "dev": true }, "@types/validate-npm-package-name": { "version": "3.0.0", @@ -8151,6 +8177,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/temp-filesystem/-/temp-filesystem-1.1.3.tgz", "integrity": "sha512-np/Jd8Zem6FPZAhGq9Y+DAm6oPxrSVKVN6CCGf/jCtkVhpCYCR5zt6McvfcPgwrJwYYH8ZBs8UbgMIaiCrbObQ==", + "dev": true, "requires": { "@types/tmp": "0.1.0", "fs-extra": "^8.1.0", @@ -8161,6 +8188,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -8171,6 +8199,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -8179,6 +8208,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -8187,6 +8217,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "dev": true, "requires": { "rimraf": "^2.6.3" } @@ -8194,7 +8225,8 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, diff --git a/packages/generator-ts-project/package.json b/packages/generator-ts-project/package.json index 5db6ff12..61e12401 100644 --- a/packages/generator-ts-project/package.json +++ b/packages/generator-ts-project/package.json @@ -1,6 +1,6 @@ { "name": "@manuth/generator-ts-project", - "version": "1.1.0", + "version": "1.1.1", "description": "A Set of Generators for Creating Projects Written in TypeScript", "author": "Manuel Thalmann ", "license": "MIT", @@ -44,6 +44,7 @@ "dependencies": { "@manuth/extended-yo-generator": "^7.3.3", "@manuth/package-json-editor": "^1.4.1", + "@manuth/temp-files": "^1.2.0", "@types/vscode": "^1.48.0", "chalk": "^4.1.0", "comment-json": "^4.0.4", @@ -58,7 +59,6 @@ "npm-which": "^3.0.1", "parse-pkg-name": "^2.0.0", "shusher": "^0.1.1", - "temp-filesystem": "^1.1.3", "ts-morph": "^8.1.0", "typescript": "^4.0.2", "validate-npm-package-name": "^3.0.0", diff --git a/packages/generator-ts-project/src/Project/TSProjectGenerator.ts b/packages/generator-ts-project/src/Project/TSProjectGenerator.ts index 25982319..5b56c5a9 100644 --- a/packages/generator-ts-project/src/Project/TSProjectGenerator.ts +++ b/packages/generator-ts-project/src/Project/TSProjectGenerator.ts @@ -3,6 +3,7 @@ import { EOL } from "os"; import { relative } from "path"; import { Generator, GeneratorOptions, Question, IComponentCollection, IFileMapping, GeneratorSettingKey } from "@manuth/extended-yo-generator"; import { Package } from "@manuth/package-json-editor"; +import { TempDirectory } from "@manuth/temp-files"; import chalk = require("chalk"); import JSON = require("comment-json"); import dedent = require("dedent"); @@ -10,7 +11,6 @@ import { split } from "eol"; import { ESLint } from "eslint"; import { readFile, writeJSON, readJSON, writeFile } from "fs-extra"; import npmWhich = require("npm-which"); -import { TempDirectory } from "temp-filesystem"; import { Linter } from "tslint"; import { Program } from "typescript"; import { join, resolve } from "upath"; diff --git a/packages/generator-ts-project/src/Project/VSCode/TSProjectLaunchFileProcessor.ts b/packages/generator-ts-project/src/Project/VSCode/TSProjectLaunchSettingsProcessor.ts similarity index 81% rename from packages/generator-ts-project/src/Project/VSCode/TSProjectLaunchFileProcessor.ts rename to packages/generator-ts-project/src/Project/VSCode/TSProjectLaunchSettingsProcessor.ts index b45eb198..d4a8d8a4 100644 --- a/packages/generator-ts-project/src/Project/VSCode/TSProjectLaunchFileProcessor.ts +++ b/packages/generator-ts-project/src/Project/VSCode/TSProjectLaunchSettingsProcessor.ts @@ -1,17 +1,18 @@ import { GeneratorOptions } from "@manuth/extended-yo-generator"; +import { normalize } from "upath"; import { DebugConfiguration } from "vscode"; import { CodeWorkspaceComponent } from "../../VSCode/Components/CodeWorkspaceComponent"; import { ILaunchSettings } from "../../VSCode/ILaunchSettings"; -import { LaunchFileProcessor } from "../../VSCode/LaunchFileProcessor"; +import { LaunchSettingsProcessor } from "../../VSCode/LaunchSettingsProcessor"; import { ITSProjectSettings } from "../Settings/ITSProjectSettings"; /** * Provides the functionality to process debug-configurations for `TSProject`s. */ -export class TSProjectLaunchFileProcessor extends LaunchFileProcessor +export class TSProjectLaunchSettingsProcessor extends LaunchSettingsProcessor { /** - * Initializes a new instance of the `TSProjectLaunchFileProcessor` class. + * Initializes a new instance of the `TSProjectLaunchDataProcessor` class. * * @param component * The component of the processor. @@ -48,8 +49,8 @@ export class TSProjectLaunchFileProcessor { return !( - debugConfig.name.toLowerCase().includes("yeoman") || - debugConfig.name.toLowerCase().includes("mytsproject")); + normalize(debugConfig.program ?? "").toLowerCase().endsWith("yo/lib/cli.js") || + (debugConfig.program ?? "").includes("${workspaceFolder:MyTSProjectGenerator}")); } /** diff --git a/packages/generator-ts-project/src/Project/VSCode/TSProjectWorkspaceProcessor.ts b/packages/generator-ts-project/src/Project/VSCode/TSProjectWorkspaceProcessor.ts index d9b717ea..110a283f 100644 --- a/packages/generator-ts-project/src/Project/VSCode/TSProjectWorkspaceProcessor.ts +++ b/packages/generator-ts-project/src/Project/VSCode/TSProjectWorkspaceProcessor.ts @@ -7,7 +7,7 @@ import { ITaskSettings } from "../../VSCode/ITaskSettings"; import { WorkspaceProcessor } from "../../VSCode/WorkspaceProcessor"; import { ITSProjectSettings } from "../Settings/ITSProjectSettings"; import { TSProjectExtensionsProcessor } from "./TSProjectExtensionsProcessor"; -import { TSProjectLaunchFileProcessor } from "./TSProjectLaunchFileProcessor"; +import { TSProjectLaunchSettingsProcessor } from "./TSProjectLaunchSettingsProcessor"; import { TSProjectSettingsProcessor } from "./TSProjectSettingsProcessor"; import { TSProjectTasksProcessor } from "./TSProjectTasksProcessor"; @@ -38,9 +38,9 @@ export class TSProjectWorkspaceProcessor + protected get LaunchSettingsProcessor(): JSONProcessor { - return new TSProjectLaunchFileProcessor(this.Component); + return new TSProjectLaunchSettingsProcessor(this.Component); } /** diff --git a/packages/generator-ts-project/src/VSCode/LaunchFileProcessor.ts b/packages/generator-ts-project/src/VSCode/LaunchSettingsProcessor.ts similarity index 82% rename from packages/generator-ts-project/src/VSCode/LaunchFileProcessor.ts rename to packages/generator-ts-project/src/VSCode/LaunchSettingsProcessor.ts index a718636d..6dd65816 100644 --- a/packages/generator-ts-project/src/VSCode/LaunchFileProcessor.ts +++ b/packages/generator-ts-project/src/VSCode/LaunchSettingsProcessor.ts @@ -7,10 +7,10 @@ import { VSCodeJSONProcessor } from "./VSCodeJSONProcessor"; /** * Provides the functionality to process vscode debug configurations. */ -export class LaunchFileProcessor extends VSCodeJSONProcessor +export class LaunchSettingsProcessor extends VSCodeJSONProcessor { /** - * Initializes a new instance of the `LaunchFileProcessor` class. + * Initializes a new instance of the `LaunchSettingsProcessor` class. * * @param component * The component of the processor. @@ -23,15 +23,15 @@ export class LaunchFileProcessor + public async Process(launchSettings: ILaunchSettings): Promise { - let result = await super.Process(data); + let result = await super.Process(launchSettings); if (result?.configurations) { diff --git a/packages/generator-ts-project/src/VSCode/WorkspaceProcessor.ts b/packages/generator-ts-project/src/VSCode/WorkspaceProcessor.ts index bf35016a..9e49a7f5 100644 --- a/packages/generator-ts-project/src/VSCode/WorkspaceProcessor.ts +++ b/packages/generator-ts-project/src/VSCode/WorkspaceProcessor.ts @@ -6,7 +6,7 @@ import { IExtensionSettings } from "./IExtensionSettings"; import { ILaunchSettings } from "./ILaunchSettings"; import { ITaskSettings } from "./ITaskSettings"; import { IWorkspaceMetadata } from "./IWorkspaceMetadata"; -import { LaunchFileProcessor } from "./LaunchFileProcessor"; +import { LaunchSettingsProcessor } from "./LaunchSettingsProcessor"; import { SettingsProcessor } from "./SettingsProcessor"; import { TasksProcessor } from "./TasksProcessor"; import { VSCodeJSONProcessor } from "./VSCodeJSONProcessor"; @@ -47,7 +47,7 @@ export class WorkspaceProcessor + protected get LaunchSettingsProcessor(): JSONProcessor { - return new LaunchFileProcessor(this.Component); + return new LaunchSettingsProcessor(this.Component); } /** diff --git a/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorLaunchFileProcessor.ts b/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorLaunchSettingsProcessor.ts similarity index 85% rename from packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorLaunchFileProcessor.ts rename to packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorLaunchSettingsProcessor.ts index 0900993e..3aa80035 100644 --- a/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorLaunchFileProcessor.ts +++ b/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorLaunchSettingsProcessor.ts @@ -1,7 +1,8 @@ import { GeneratorOptions, GeneratorSettingKey } from "@manuth/extended-yo-generator"; +import { normalize } from "upath"; import { DebugConfiguration } from "vscode"; import { TSProjectSettingKey } from "../../../Project/Settings/TSProjectSettingKey"; -import { TSProjectLaunchFileProcessor } from "../../../Project/VSCode/TSProjectLaunchFileProcessor"; +import { TSProjectLaunchSettingsProcessor } from "../../../Project/VSCode/TSProjectLaunchSettingsProcessor"; import { CodeWorkspaceComponent } from "../../../VSCode/Components/CodeWorkspaceComponent"; import { ILaunchSettings } from "../../../VSCode/ILaunchSettings"; import { ISubGenerator } from "../Settings/ISubGenerator"; @@ -13,10 +14,10 @@ import { TSGeneratorSettingKey } from "../Settings/TSGeneratorSettingKey"; /** * Provides the functionality to process vscode debug configurations for `TSGenerator`s. */ -export class TSGeneratorLaunchFileProcessor extends TSProjectLaunchFileProcessor +export class TSGeneratorLaunchSettingsProcessor extends TSProjectLaunchSettingsProcessor { /** - * Initializes a new instance of the `TSGeneratorLaunchFileProcessor` class. + * Initializes a new instance of the `TSGeneratorLaunchSettingsProcessor` class. * * @param component * The component of the processor. @@ -37,7 +38,7 @@ export class TSGeneratorLaunchFileProcessor { - return debugConfig.name.toLowerCase().includes("yeoman"); + return normalize(debugConfig.program ?? "").toLowerCase().endsWith("yo/lib/cli.js"); })); })(); } diff --git a/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorWorkspaceProcessor.ts b/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorWorkspaceProcessor.ts index 34180059..0199e3df 100644 --- a/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorWorkspaceProcessor.ts +++ b/packages/generator-ts-project/src/generators/generator/VSCode/TSGeneratorWorkspaceProcessor.ts @@ -6,7 +6,7 @@ import { ExtensionsProcessor } from "../../../VSCode/ExtensionsProcessor"; import { IExtensionSettings } from "../../../VSCode/IExtensionSettings"; import { ILaunchSettings } from "../../../VSCode/ILaunchSettings"; import { ITSGeneratorSettings } from "../Settings/ITSGeneratorSettings"; -import { TSGeneratorLaunchFileProcessor } from "./TSGeneratorLaunchFileProcessor"; +import { TSGeneratorLaunchSettingsProcessor } from "./TSGeneratorLaunchSettingsProcessor"; /** * Provides the functionality to process workspaces for `TSGenerator`s. @@ -35,8 +35,8 @@ export class TSGeneratorWorkspaceProcessor + protected get LaunchSettingsProcessor(): JSONProcessor { - return new TSGeneratorLaunchFileProcessor(this.Component); + return new TSGeneratorLaunchSettingsProcessor(this.Component); } } diff --git a/packages/generator-ts-project/src/generators/module/VSCode/TSModuleLaunchFileProcessor.ts b/packages/generator-ts-project/src/generators/module/VSCode/TSModuleLaunchSettingsProcessor.ts similarity index 76% rename from packages/generator-ts-project/src/generators/module/VSCode/TSModuleLaunchFileProcessor.ts rename to packages/generator-ts-project/src/generators/module/VSCode/TSModuleLaunchSettingsProcessor.ts index ac178b88..63ee348d 100644 --- a/packages/generator-ts-project/src/generators/module/VSCode/TSModuleLaunchFileProcessor.ts +++ b/packages/generator-ts-project/src/generators/module/VSCode/TSModuleLaunchSettingsProcessor.ts @@ -1,16 +1,16 @@ import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { ITSProjectSettings } from "../../../Project/Settings/ITSProjectSettings"; -import { TSProjectLaunchFileProcessor } from "../../../Project/VSCode/TSProjectLaunchFileProcessor"; +import { TSProjectLaunchSettingsProcessor } from "../../../Project/VSCode/TSProjectLaunchSettingsProcessor"; import { CodeWorkspaceComponent } from "../../../VSCode/Components/CodeWorkspaceComponent"; import { ILaunchSettings } from "../../../VSCode/ILaunchSettings"; /** * Provides the functionality to process debug-configurations for `TSModule`s. */ -export class TSModuleLaunchFileProcessor extends TSProjectLaunchFileProcessor +export class TSModuleLaunchSettingsProcessor extends TSProjectLaunchSettingsProcessor { /** - * Initializes a new instance of the `TSModuleLaunchFileProcessor` class. + * Initializes a new instance of the `TSModuleLaunchSettingsProcessor` class. * * @param component * The component of the processor. diff --git a/packages/generator-ts-project/src/generators/module/VSCode/TSModuleWorkspaceProcessor.ts b/packages/generator-ts-project/src/generators/module/VSCode/TSModuleWorkspaceProcessor.ts index 6c630723..21c31828 100644 --- a/packages/generator-ts-project/src/generators/module/VSCode/TSModuleWorkspaceProcessor.ts +++ b/packages/generator-ts-project/src/generators/module/VSCode/TSModuleWorkspaceProcessor.ts @@ -4,7 +4,7 @@ import { ITSProjectSettings } from "../../../Project/Settings/ITSProjectSettings import { TSProjectWorkspaceProcessor } from "../../../Project/VSCode/TSProjectWorkspaceProcessor"; import { CodeWorkspaceComponent } from "../../../VSCode/Components/CodeWorkspaceComponent"; import { ILaunchSettings } from "../../../VSCode/ILaunchSettings"; -import { TSModuleLaunchFileProcessor } from "./TSModuleLaunchFileProcessor"; +import { TSModuleLaunchSettingsProcessor } from "./TSModuleLaunchSettingsProcessor"; /** * Provides the functionality to process workspaces for `TSModule`s. @@ -25,8 +25,8 @@ export class TSModuleWorkspaceProcessor + protected get LaunchSettingsProcessor(): JSONProcessor { - return new TSModuleLaunchFileProcessor(this.Component); + return new TSModuleLaunchSettingsProcessor(this.Component); } } diff --git a/packages/generator-ts-project/src/index.ts b/packages/generator-ts-project/src/index.ts index e8aade99..339f4aad 100644 --- a/packages/generator-ts-project/src/index.ts +++ b/packages/generator-ts-project/src/index.ts @@ -31,14 +31,14 @@ export { SubGeneratorSettingKey } from "./generators/generator/Settings/SubGener export { TSGeneratorComponent } from "./generators/generator/Settings/TSGeneratorComponent"; export { TSGeneratorSettingKey } from "./generators/generator/Settings/TSGeneratorSettingKey"; export { TSGeneratorGenerator } from "./generators/generator/TSGeneratorGenerator"; -export { TSGeneratorLaunchFileProcessor } from "./generators/generator/VSCode/TSGeneratorLaunchFileProcessor"; +export { TSGeneratorLaunchSettingsProcessor } from "./generators/generator/VSCode/TSGeneratorLaunchSettingsProcessor"; export { TSGeneratorWorkspaceProcessor } from "./generators/generator/VSCode/TSGeneratorWorkspaceProcessor"; export { TSModuleCodeWorkspace } from "./generators/module/Components/TSModuleCodeWorkspace"; export { TSModuleComponentCollection } from "./generators/module/Components/TSModuleComponentCollection"; export { TSModuleGeneralCategory } from "./generators/module/Components/TSModuleGeneralCategory"; export { TSModulePackageFileMapping } from "./generators/module/FileMappings/NPMPackaging/TSModulePackageFileMapping"; export { TSModuleGenerator } from "./generators/module/TSModuleGenerator"; -export { TSModuleLaunchFileProcessor } from "./generators/module/VSCode/TSModuleLaunchFileProcessor"; +export { TSModuleLaunchSettingsProcessor } from "./generators/module/VSCode/TSModuleLaunchSettingsProcessor"; export { TSModuleWorkspaceProcessor } from "./generators/module/VSCode/TSModuleWorkspaceProcessor"; export { LintingComponent } from "./Linting/Components/LintingComponent"; export { ESLintRCFileMapping } from "./Linting/FileMappings/ESLintRCFileMapping"; @@ -67,7 +67,7 @@ export { TSProjectComponent } from "./Project/Settings/TSProjectComponent"; export { TSProjectSettingKey } from "./Project/Settings/TSProjectSettingKey"; export { TSProjectGenerator } from "./Project/TSProjectGenerator"; export { TSProjectExtensionsProcessor } from "./Project/VSCode/TSProjectExtensionsProcessor"; -export { TSProjectLaunchFileProcessor } from "./Project/VSCode/TSProjectLaunchFileProcessor"; +export { TSProjectLaunchSettingsProcessor } from "./Project/VSCode/TSProjectLaunchSettingsProcessor"; export { TSProjectSettingsProcessor } from "./Project/VSCode/TSProjectSettingsProcessor"; export { TSProjectTasksProcessor } from "./Project/VSCode/TSProjectTasksProcessor"; export { TSProjectWorkspaceProcessor } from "./Project/VSCode/TSProjectWorkspaceProcessor"; @@ -83,7 +83,7 @@ export { IExtensionSettings } from "./VSCode/IExtensionSettings"; export { ILaunchSettings } from "./VSCode/ILaunchSettings"; export { ITaskSettings } from "./VSCode/ITaskSettings"; export { IWorkspaceMetadata } from "./VSCode/IWorkspaceMetadata"; -export { LaunchFileProcessor } from "./VSCode/LaunchFileProcessor"; +export { LaunchSettingsProcessor } from "./VSCode/LaunchSettingsProcessor"; export { SettingsProcessor } from "./VSCode/SettingsProcessor"; export { TasksProcessor } from "./VSCode/TasksProcessor"; export { VSCodeJSONProcessor } from "./VSCode/VSCodeJSONProcessor"; diff --git a/packages/generator-ts-project/src/tests/Components/FileMappingBase.test.ts b/packages/generator-ts-project/src/tests/Components/FileMappingBase.test.ts index 6a6dba40..560bbbff 100644 --- a/packages/generator-ts-project/src/tests/Components/FileMappingBase.test.ts +++ b/packages/generator-ts-project/src/tests/Components/FileMappingBase.test.ts @@ -1,8 +1,8 @@ import Assert = require("assert"); import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { FileMappingTester, TestGenerator, ITestGeneratorOptions, ITestOptions, ITestGeneratorSettings } from "@manuth/extended-yo-generator-test"; +import { TempFile } from "@manuth/temp-files"; import { writeFile } from "fs-extra"; -import { TempFile } from "temp-filesystem"; import { FileMappingBase } from "../../Components/FileMappingBase"; import { TestContext } from "../TestContext"; diff --git a/packages/generator-ts-project/src/tests/Components/Transformation/JSONTransformMapping.test.ts b/packages/generator-ts-project/src/tests/Components/Transformation/JSONTransformMapping.test.ts index 8b8f51e5..0b7d113c 100644 --- a/packages/generator-ts-project/src/tests/Components/Transformation/JSONTransformMapping.test.ts +++ b/packages/generator-ts-project/src/tests/Components/Transformation/JSONTransformMapping.test.ts @@ -1,8 +1,8 @@ import Assert = require("assert"); import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { FileMappingTester, TestGenerator, ITestGeneratorOptions, ITestOptions, ITestGeneratorSettings } from "@manuth/extended-yo-generator-test"; +import { TempFile } from "@manuth/temp-files"; import { writeFile } from "fs-extra"; -import { TempFile } from "temp-filesystem"; import { JSONTransformMapping } from "../../../Components/Transformation/JSONTransformMapping"; import { TestContext } from "../../TestContext"; diff --git a/packages/generator-ts-project/src/tests/Components/Transformation/TransformFileMapping.test.ts b/packages/generator-ts-project/src/tests/Components/Transformation/TransformFileMapping.test.ts index 5fcf79bf..1b4063f4 100644 --- a/packages/generator-ts-project/src/tests/Components/Transformation/TransformFileMapping.test.ts +++ b/packages/generator-ts-project/src/tests/Components/Transformation/TransformFileMapping.test.ts @@ -1,7 +1,7 @@ import Assert = require("assert"); import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { TestGenerator, ITestGeneratorOptions, ITestOptions, ITestGeneratorSettings, JSONFileMappingTester } from "@manuth/extended-yo-generator-test"; -import { TempFile } from "temp-filesystem"; +import { TempFile } from "@manuth/temp-files"; import { TransformFileMapping } from "../../../Components/Transformation/TransformFileMapping"; import { TestContext } from "../../TestContext"; diff --git a/packages/generator-ts-project/src/tests/Components/Transformation/TypeScriptTransformMapping.test.ts b/packages/generator-ts-project/src/tests/Components/Transformation/TypeScriptTransformMapping.test.ts index 4d0084e0..5a78a79c 100644 --- a/packages/generator-ts-project/src/tests/Components/Transformation/TypeScriptTransformMapping.test.ts +++ b/packages/generator-ts-project/src/tests/Components/Transformation/TypeScriptTransformMapping.test.ts @@ -1,9 +1,9 @@ import Assert = require("assert"); import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { TestGenerator, ITestGeneratorSettings, ITestGeneratorOptions, ITestOptions, FileMappingTester } from "@manuth/extended-yo-generator-test"; +import { TempFile } from "@manuth/temp-files"; import dedent = require("dedent"); import { writeFile, readFile } from "fs-extra"; -import { TempFile } from "temp-filesystem"; import { SourceFile, VariableDeclarationKind } from "ts-morph"; import { TypeScriptTransformMapping } from "../../../Components/Transformation/TypeScriptTransformMapping"; import { TestContext } from "../../TestContext"; diff --git a/packages/generator-ts-project/src/tests/Components/Transformation/YAMLTransformMapping.test.ts b/packages/generator-ts-project/src/tests/Components/Transformation/YAMLTransformMapping.test.ts index b79a3190..f0f9ca17 100644 --- a/packages/generator-ts-project/src/tests/Components/Transformation/YAMLTransformMapping.test.ts +++ b/packages/generator-ts-project/src/tests/Components/Transformation/YAMLTransformMapping.test.ts @@ -1,9 +1,9 @@ import Assert = require("assert"); import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { TestGenerator, ITestGeneratorOptions, ITestOptions, ITestGeneratorSettings, FileMappingTester } from "@manuth/extended-yo-generator-test"; +import { TempFile } from "@manuth/temp-files"; import dedent = require("dedent"); import { writeFile } from "fs-extra"; -import { TempFile } from "temp-filesystem"; import { Document, parse, stringify, parseAllDocuments } from "yaml"; import { YAMLTransformMapping } from "../../../Components/Transformation/YAMLTransformMapping"; import { TestContext } from "../../TestContext"; diff --git a/packages/generator-ts-project/src/tests/Generators/App/AppGenerator.test.ts b/packages/generator-ts-project/src/tests/Generators/App/AppGenerator.test.ts index 15215637..6bdf6398 100644 --- a/packages/generator-ts-project/src/tests/Generators/App/AppGenerator.test.ts +++ b/packages/generator-ts-project/src/tests/Generators/App/AppGenerator.test.ts @@ -1,8 +1,8 @@ import Assert = require("assert"); import { spawnSync } from "child_process"; import { TestContext as GeneratorContext } from "@manuth/extended-yo-generator-test"; +import { TempDirectory } from "@manuth/temp-files"; import npmWhich = require("npm-which"); -import { TempDirectory } from "temp-filesystem"; import { AppGenerator } from "../../../generators/app/AppGenerator"; import { ProjectType } from "../../../generators/app/ProjectType"; import { ProjectSelectorSettingKey } from "../../../generators/app/Settings/ProjectSelectorSettingKey"; diff --git a/packages/generator-ts-project/src/tests/Generators/Generator/Components/TSGeneratorCategory.test.ts b/packages/generator-ts-project/src/tests/Generators/Generator/Components/TSGeneratorCategory.test.ts index d291ce75..060206de 100644 --- a/packages/generator-ts-project/src/tests/Generators/Generator/Components/TSGeneratorCategory.test.ts +++ b/packages/generator-ts-project/src/tests/Generators/Generator/Components/TSGeneratorCategory.test.ts @@ -2,8 +2,8 @@ import Assert = require("assert"); import { spawnSync } from "child_process"; import { GeneratorOptions, GeneratorSettingKey } from "@manuth/extended-yo-generator"; import { TestContext as GeneratorContext, IRunContext } from "@manuth/extended-yo-generator-test"; +import { TempDirectory } from "@manuth/temp-files"; import npmWhich = require("npm-which"); -import { TempDirectory } from "temp-filesystem"; import { TSGeneratorCategory } from "../../../../generators/generator/Components/TSGeneratorCategory"; import { ITSGeneratorSettings } from "../../../../generators/generator/Settings/ITSGeneratorSettings"; import { SubGeneratorSettingKey } from "../../../../generators/generator/Settings/SubGeneratorSettingKey"; diff --git a/packages/generator-ts-project/src/tests/Generators/Generator/TSGeneratorGenerator.test.ts b/packages/generator-ts-project/src/tests/Generators/Generator/TSGeneratorGenerator.test.ts index 4a7c83ff..77a33d98 100644 --- a/packages/generator-ts-project/src/tests/Generators/Generator/TSGeneratorGenerator.test.ts +++ b/packages/generator-ts-project/src/tests/Generators/Generator/TSGeneratorGenerator.test.ts @@ -2,8 +2,8 @@ import Assert = require("assert"); import { spawnSync } from "child_process"; import { GeneratorSettingKey } from "@manuth/extended-yo-generator"; import { TestContext as GeneratorContext, IRunContext } from "@manuth/extended-yo-generator-test"; +import { TempDirectory } from "@manuth/temp-files"; import npmWhich = require("npm-which"); -import { TempDirectory } from "temp-filesystem"; import { ITSGeneratorSettings } from "../../../generators/generator/Settings/ITSGeneratorSettings"; import { SubGeneratorSettingKey } from "../../../generators/generator/Settings/SubGeneratorSettingKey"; import { TSGeneratorComponent } from "../../../generators/generator/Settings/TSGeneratorComponent"; diff --git a/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/TSGeneratorLaunchFileProcessor.test.ts b/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/TSGeneratorLaunchSettingsProcessor.test.ts similarity index 82% rename from packages/generator-ts-project/src/tests/Generators/Generator/VSCode/TSGeneratorLaunchFileProcessor.test.ts rename to packages/generator-ts-project/src/tests/Generators/Generator/VSCode/TSGeneratorLaunchSettingsProcessor.test.ts index d56e5b21..ee190697 100644 --- a/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/TSGeneratorLaunchFileProcessor.test.ts +++ b/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/TSGeneratorLaunchSettingsProcessor.test.ts @@ -8,24 +8,24 @@ import { SubGeneratorSettingKey } from "../../../../generators/generator/Setting import { TSGeneratorComponent } from "../../../../generators/generator/Settings/TSGeneratorComponent"; import { TSGeneratorSettingKey } from "../../../../generators/generator/Settings/TSGeneratorSettingKey"; import { TSGeneratorGenerator } from "../../../../generators/generator/TSGeneratorGenerator"; -import { TSGeneratorLaunchFileProcessor } from "../../../../generators/generator/VSCode/TSGeneratorLaunchFileProcessor"; +import { TSGeneratorLaunchSettingsProcessor } from "../../../../generators/generator/VSCode/TSGeneratorLaunchSettingsProcessor"; import { TestContext } from "../../../TestContext"; /** - * Registers tests for the `TSGeneratorLaunchFileProcessor` class. + * Registers tests for the `TSGeneratorLaunchSettingsProcessor` class. * * @param context * The test-context. */ -export function TSGeneratorLaunchFileProcessorTests(context: TestContext): void +export function TSGeneratorLaunchSettingsProcessorTests(context: TestContext): void { suite( - "TSGeneratorLaunchFileProcessor", + "TSGeneratorLaunchSettingsProcessor", () => { let settings: Partial; let component: CodeWorkspaceComponent; - let processor: TSGeneratorLaunchFileProcessor; + let processor: TSGeneratorLaunchSettingsProcessor; suiteSetup( async function() @@ -51,7 +51,7 @@ export function TSGeneratorLaunchFileProcessorTests(context: TestContext { - let launchFile = await processor.Process(await component.Source.LaunchMetadata); - let debugConfigs = launchFile.configurations ?? []; + let launchSettings = await processor.Process(await component.Source.LaunchMetadata); + let debugConfigs = launchSettings.configurations ?? []; Assert.ok( debugConfigs.some( diff --git a/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/index.ts b/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/index.ts index 03390e45..6fc4a0a9 100644 --- a/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/index.ts +++ b/packages/generator-ts-project/src/tests/Generators/Generator/VSCode/index.ts @@ -1,6 +1,6 @@ import { TSGeneratorGenerator } from "../../../../generators/generator/TSGeneratorGenerator"; import { TestContext } from "../../../TestContext"; -import { TSGeneratorLaunchFileProcessorTests } from "./TSGeneratorLaunchFileProcessor.test"; +import { TSGeneratorLaunchSettingsProcessorTests } from "./TSGeneratorLaunchSettingsProcessor.test"; /** * Registers tests for VSCode-components for `TSGenerator`s. @@ -14,6 +14,6 @@ export function VSCodeTests(context: TestContext): void "VSCode", () => { - TSGeneratorLaunchFileProcessorTests(context); + TSGeneratorLaunchSettingsProcessorTests(context); }); } diff --git a/packages/generator-ts-project/src/tests/Generators/Module/VSCode/TSModuleLaunchFileProcessor.test.ts b/packages/generator-ts-project/src/tests/Generators/Module/VSCode/TSModuleLaunchSettingsProcessor.test.ts similarity index 74% rename from packages/generator-ts-project/src/tests/Generators/Module/VSCode/TSModuleLaunchFileProcessor.test.ts rename to packages/generator-ts-project/src/tests/Generators/Module/VSCode/TSModuleLaunchSettingsProcessor.test.ts index c374de40..f8df4aa4 100644 --- a/packages/generator-ts-project/src/tests/Generators/Module/VSCode/TSModuleLaunchFileProcessor.test.ts +++ b/packages/generator-ts-project/src/tests/Generators/Module/VSCode/TSModuleLaunchSettingsProcessor.test.ts @@ -3,30 +3,30 @@ import { GeneratorOptions } from "@manuth/extended-yo-generator"; import { ITSProjectSettings } from "../../../../Project/Settings/ITSProjectSettings"; import { TSModuleCodeWorkspace } from "../../../../generators/module/Components/TSModuleCodeWorkspace"; import { TSModuleGenerator } from "../../../../generators/module/TSModuleGenerator"; -import { TSModuleLaunchFileProcessor } from "../../../../generators/module/VSCode/TSModuleLaunchFileProcessor"; +import { TSModuleLaunchSettingsProcessor } from "../../../../generators/module/VSCode/TSModuleLaunchSettingsProcessor"; import { TestContext } from "../../../TestContext"; /** - * Registers tests for the `TSModuleLaunchFileProcessor` class. + * Registers tests for the `TSModuleLaunchSettingsProcessor` class. * * @param context * The test-context. */ -export function TSModuleLaunchFileProcessorTests(context: TestContext): void +export function TSModuleLaunchSettingsProcessorTests(context: TestContext): void { suite( - "TSModuleLaunchFileProcessor", + "TSModuleLaunchSettingsProcessor", () => { let component: TSModuleCodeWorkspace; - let processor: TSModuleLaunchFileProcessor; + let processor: TSModuleLaunchSettingsProcessor; suiteSetup( async function() { this.timeout(0); component = new TSModuleCodeWorkspace(await context.Generator); - processor = new TSModuleLaunchFileProcessor(component); + processor = new TSModuleLaunchSettingsProcessor(component); }); test( diff --git a/packages/generator-ts-project/src/tests/Generators/Module/VSCode/index.ts b/packages/generator-ts-project/src/tests/Generators/Module/VSCode/index.ts index 4d82632a..d0fef0d4 100644 --- a/packages/generator-ts-project/src/tests/Generators/Module/VSCode/index.ts +++ b/packages/generator-ts-project/src/tests/Generators/Module/VSCode/index.ts @@ -1,6 +1,6 @@ import { TSModuleGenerator } from "../../../../generators/module/TSModuleGenerator"; import { TestContext } from "../../../TestContext"; -import { TSModuleLaunchFileProcessorTests } from "./TSModuleLaunchFileProcessor.test"; +import { TSModuleLaunchSettingsProcessorTests } from "./TSModuleLaunchSettingsProcessor.test"; /** * Registers tests for vscode components for `TSModule`s. @@ -14,6 +14,6 @@ export function VSCodeTests(context: TestContext): void "VSCode", () => { - TSModuleLaunchFileProcessorTests(context); + TSModuleLaunchSettingsProcessorTests(context); }); } diff --git a/packages/generator-ts-project/src/tests/Project/Inquiry/TSProjectDestinationQuestion.test.ts b/packages/generator-ts-project/src/tests/Project/Inquiry/TSProjectDestinationQuestion.test.ts index 490ebaf2..c3c124fe 100644 --- a/packages/generator-ts-project/src/tests/Project/Inquiry/TSProjectDestinationQuestion.test.ts +++ b/packages/generator-ts-project/src/tests/Project/Inquiry/TSProjectDestinationQuestion.test.ts @@ -1,7 +1,7 @@ import Assert = require("assert"); import { resolve } from "path"; import { GeneratorOptions } from "@manuth/extended-yo-generator"; -import { TempDirectory } from "temp-filesystem"; +import { TempDirectory } from "@manuth/temp-files"; import chdir = require("util.chdir"); import { TSProjectDestinationQuestion } from "../../../Project/Inquiry/TSProjectDestinationQuestion"; import { ITSProjectSettings } from "../../../Project/Settings/ITSProjectSettings"; diff --git a/packages/generator-ts-project/src/tests/Project/VSCode/TSProjectLaunchFileProcessor.test.ts b/packages/generator-ts-project/src/tests/Project/VSCode/TSProjectLaunchSettingsProcessor.test.ts similarity index 75% rename from packages/generator-ts-project/src/tests/Project/VSCode/TSProjectLaunchFileProcessor.test.ts rename to packages/generator-ts-project/src/tests/Project/VSCode/TSProjectLaunchSettingsProcessor.test.ts index 4c2ac7a2..f54edde5 100644 --- a/packages/generator-ts-project/src/tests/Project/VSCode/TSProjectLaunchFileProcessor.test.ts +++ b/packages/generator-ts-project/src/tests/Project/VSCode/TSProjectLaunchSettingsProcessor.test.ts @@ -1,45 +1,45 @@ import Assert = require("assert"); import { GeneratorOptions } from "@manuth/extended-yo-generator"; -import { join } from "upath"; +import { join, normalize } from "upath"; import { TSProjectWorkspaceFolder } from "../../../Project/Components/TSProjectCodeWorkspaceComponent"; import { ITSProjectSettings } from "../../../Project/Settings/ITSProjectSettings"; import { TSProjectGenerator } from "../../../Project/TSProjectGenerator"; -import { TSProjectLaunchFileProcessor } from "../../../Project/VSCode/TSProjectLaunchFileProcessor"; +import { TSProjectLaunchSettingsProcessor } from "../../../Project/VSCode/TSProjectLaunchSettingsProcessor"; import { ILaunchSettings } from "../../../VSCode/ILaunchSettings"; import { TestContext } from "../../TestContext"; /** - * Registers tests for the `TSProjectLaunchFileProcessor` class. + * Registers tests for the `TSProjectLaunchSettingsProcessor` class. * * @param context * The test-context. */ -export function TSProjectLaunchFileProcessorTests(context: TestContext): void +export function TSProjectLaunchSettingsProcessorTests(context: TestContext): void { suite( - "TSProjectLaunchFileProcessor", + "TSProjectLaunchSettingsProcessor", () => { let component: TSProjectWorkspaceFolder; - let processor: TSProjectLaunchFileProcessor; + let processor: TSProjectLaunchSettingsProcessor; suiteSetup( async function() { this.timeout(0); component = new TSProjectWorkspaceFolder(await context.Generator); - processor = new TSProjectLaunchFileProcessor(component); + processor = new TSProjectLaunchSettingsProcessor(component); }); test( "Checking whether `yeoman` debug-configurations are not present…", async () => { - let launchFile = await processor.Process(await component.Source.LaunchMetadata); + let launchSettings = await processor.Process(await component.Source.LaunchMetadata); Assert.ok( - launchFile.configurations.every( - (debugConfig) => !debugConfig.name.toLowerCase().includes("yeoman"))); + launchSettings.configurations.every( + (debugConfig) => !normalize(debugConfig.program ?? "").toLowerCase().endsWith("yo/lib/cli.js"))); }); test( @@ -53,7 +53,7 @@ export function TSProjectLaunchFileProcessorTests(context: TestContext config.name === name); + let debugConfig = processedSettings.configurations.find((config) => config.name === name); let actual: string; switch (debugConfig.name) diff --git a/packages/generator-ts-project/src/tests/Project/VSCode/index.ts b/packages/generator-ts-project/src/tests/Project/VSCode/index.ts index ffc838d8..7f7ac867 100644 --- a/packages/generator-ts-project/src/tests/Project/VSCode/index.ts +++ b/packages/generator-ts-project/src/tests/Project/VSCode/index.ts @@ -1,7 +1,7 @@ import { TSProjectGenerator } from "../../../Project/TSProjectGenerator"; import { TestContext } from "../../TestContext"; import { TSProjectExtensionsProcessorTests } from "./TSProjectExtensionsProcessor.test"; -import { TSProjectLaunchFileProcessorTests } from "./TSProjectLaunchFileProcessor.test"; +import { TSProjectLaunchSettingsProcessorTests } from "./TSProjectLaunchSettingsProcessor.test"; import { TSProjectSettingsProcessorTests } from "./TSProjectSettingsProcessor.test"; import { TSProjectTasksProcessorTests } from "./TSProjectTasksProcessor.test"; @@ -18,7 +18,7 @@ export function VSCodeTests(context: TestContext): void () => { TSProjectExtensionsProcessorTests(context); - TSProjectLaunchFileProcessorTests(context); + TSProjectLaunchSettingsProcessorTests(context); TSProjectSettingsProcessorTests(context); TSProjectTasksProcessorTests(context); }); diff --git a/packages/generator-ts-project/src/tests/VSCode/Components/TestWorkspaceProcessor.ts b/packages/generator-ts-project/src/tests/VSCode/Components/TestWorkspaceProcessor.ts index 7fc2d5c9..bd1b0f5d 100644 --- a/packages/generator-ts-project/src/tests/VSCode/Components/TestWorkspaceProcessor.ts +++ b/packages/generator-ts-project/src/tests/VSCode/Components/TestWorkspaceProcessor.ts @@ -18,7 +18,7 @@ export class TestWorkspaceProcessor = new JSONProcessor(this.Generator); + private launchSettingsProcessor: JSONProcessor = new JSONProcessor(this.Generator); /** * A component for processing settings. @@ -49,17 +49,17 @@ export class TestWorkspaceProcessor + public get LaunchSettingsProcessor(): JSONProcessor { - return this.launchFileProcessor; + return this.launchSettingsProcessor; } /** * @inheritdoc */ - public set LaunchFileProcessor(value: JSONProcessor) + public set LaunchSettingsProcessor(value: JSONProcessor) { - this.launchFileProcessor = value; + this.launchSettingsProcessor = value; } /** diff --git a/packages/generator-ts-project/src/tests/VSCode/FileMappings/CodeWorkspaceProvider.test.ts b/packages/generator-ts-project/src/tests/VSCode/FileMappings/CodeWorkspaceProvider.test.ts index b5feb506..983c581b 100644 --- a/packages/generator-ts-project/src/tests/VSCode/FileMappings/CodeWorkspaceProvider.test.ts +++ b/packages/generator-ts-project/src/tests/VSCode/FileMappings/CodeWorkspaceProvider.test.ts @@ -1,9 +1,9 @@ import Assert = require("assert"); import { GeneratorOptions, IFileMapping } from "@manuth/extended-yo-generator"; import { TestGenerator, ITestGeneratorSettings, ITestGeneratorOptions, ITestOptions, FileMappingTester } from "@manuth/extended-yo-generator-test"; +import { TempDirectory } from "@manuth/temp-files"; import dedent = require("dedent"); import { writeFile, remove, pathExists } from "fs-extra"; -import { TempDirectory } from "temp-filesystem"; import { CodeWorkspaceComponent } from "../../../VSCode/Components/CodeWorkspaceComponent"; import { IExtensionSettings } from "../../../VSCode/IExtensionSettings"; import { ILaunchSettings } from "../../../VSCode/ILaunchSettings"; diff --git a/packages/generator-ts-project/src/tests/VSCode/FileMappings/WorkspaceFolderLoader.test.ts b/packages/generator-ts-project/src/tests/VSCode/FileMappings/WorkspaceFolderLoader.test.ts index 683b5e7a..017b75da 100644 --- a/packages/generator-ts-project/src/tests/VSCode/FileMappings/WorkspaceFolderLoader.test.ts +++ b/packages/generator-ts-project/src/tests/VSCode/FileMappings/WorkspaceFolderLoader.test.ts @@ -1,6 +1,6 @@ import Assert = require("assert"); import { TestGenerator, ITestGeneratorOptions, ITestOptions, FileMappingTester } from "@manuth/extended-yo-generator-test"; -import { TempDirectory } from "temp-filesystem"; +import { TempDirectory } from "@manuth/temp-files"; import { WorkspaceFolderLoader } from "../../../VSCode/FileMappings/WorkspaceFolderLoader"; import { IExtensionSettings } from "../../../VSCode/IExtensionSettings"; import { ILaunchSettings } from "../../../VSCode/ILaunchSettings"; @@ -25,7 +25,7 @@ export function WorkspaceFolderLoaderTests(context: TestContext; let randomTasks: ITaskSettings; @@ -53,14 +53,14 @@ export function WorkspaceFolderLoaderTests(context: TestContext { randomExtensions = context.RandomObject; - randomLaunchFile = context.RandomObject; + randomLaunchSettings = context.RandomObject; randomSettings = context.RandomObject; randomTasks = context.RandomObject; let component = new TestCodeWorkspaceComponent(generator); let workspace = await component.Source.WorkspaceMetadata; workspace.extensions = randomExtensions; - workspace.launch = randomLaunchFile; + workspace.launch = randomLaunchSettings; workspace.settings = randomSettings; workspace.tasks = randomTasks; @@ -76,7 +76,7 @@ export function WorkspaceFolderLoaderTests(context: TestContext>): void +export function LaunchSettingsProcessorTests(context: TestContext>): void { suite( - "LaunchFileProcessor", + "LaunchSettingsProcessor", () => { - let launchMetadata: ILaunchSettings; + let launchSettings: ILaunchSettings; let includedDebugConfig: DebugConfiguration; let excludedDebugConfig: DebugConfiguration; let mutatedDebugConfig: DebugConfiguration; let newName: string; - let processor: LaunchFileProcessor; + let processor: LaunchSettingsProcessor; /** - * Provides an implementation of the `LaunchFileProcessor`class for testing. + * Provides an implementation of the `LaunchSettingsProcessor`class for testing. */ - class TestLaunchFileProcessor extends LaunchFileProcessor + class TestLaunchSettingsProcessor extends LaunchSettingsProcessor { /** * @inheritdoc @@ -69,7 +69,7 @@ export function LaunchFileProcessorTests(context: TestContext { - Assert.ok((await processor.Process(launchMetadata)).configurations.includes(includedDebugConfig)); - Assert.ok(!(await processor.Process(launchMetadata)).configurations.includes(excludedDebugConfig)); + Assert.ok((await processor.Process(launchSettings)).configurations.includes(includedDebugConfig)); + Assert.ok(!(await processor.Process(launchSettings)).configurations.includes(excludedDebugConfig)); }); }); @@ -141,7 +141,7 @@ export function LaunchFileProcessorTests(context: TestContext { Assert.ok( - (await processor.Process(launchMetadata)).configurations.some( + (await processor.Process(launchSettings)).configurations.some( (configuration) => configuration.name === newName)); }); }); diff --git a/packages/generator-ts-project/src/tests/VSCode/WorkspaceProcessor.test.ts b/packages/generator-ts-project/src/tests/VSCode/WorkspaceProcessor.test.ts index cab2b94a..56ecebef 100644 --- a/packages/generator-ts-project/src/tests/VSCode/WorkspaceProcessor.test.ts +++ b/packages/generator-ts-project/src/tests/VSCode/WorkspaceProcessor.test.ts @@ -61,7 +61,7 @@ export function WorkspaceProcessorTests(context: TestContext