Skip to content

Commit b085fe4

Browse files
committed
Convert the package to an ESModule
1 parent f08f84d commit b085fe4

File tree

110 files changed

+7879
-4395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+7879
-4395
lines changed

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const { join } = require("path");
2-
const ESLintPresets = require("@manuth/eslint-plugin-typescript");
1+
const { join } = require("node:path");
2+
const { PluginName, PresetName } = require("@manuth/eslint-plugin-typescript");
33

44
module.exports = {
55
extends: [
6-
`plugin:${ESLintPresets.PluginName}/${ESLintPresets.PresetName.RecommendedWithTypeChecking}`
6+
`plugin:${PluginName}/${PresetName.RecommendedWithTypeChecking}`
77
],
88
env: {
99
node: true,

package-lock.json

Lines changed: 7169 additions & 3620 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@manuth/generator-wsc-package",
33
"version": "3.0.3",
4-
"type": "commonjs",
4+
"type": "module",
55
"description": "A Generator for WoltLab Suite Core Packages.",
66
"author": "Manuel Thalmann <[email protected]>",
77
"license": "MIT",
@@ -31,42 +31,43 @@
3131
"rebuild": "npm run clean && npm run build",
3232
"watch": "npm run build -- --watch",
3333
"clean": "npm run build -- --clean && rimraf ./lib",
34-
"lint": "eslint --max-warnings 0 ./src .eslintrc.js",
34+
"lint": "eslint --max-warnings 0 ./src .eslintrc.cjs",
3535
"lint-ide": "npm run lint || exit 0",
3636
"test": "mocha",
3737
"prepare": "npm run patch-ts && npm run rebuild",
3838
"patch-ts": "ts-patch install"
3939
},
4040
"dependencies": {
41-
"@manuth/extended-yo-generator": "^11.0.7",
42-
"@manuth/generator-ts-project": "^3.1.0",
43-
"@manuth/package-json-editor": "^2.2.6",
41+
"@manuth/extended-yo-generator": "^12.1.2",
42+
"@manuth/generator-ts-project": "^4.0.3",
43+
"@manuth/package-json-editor": "^3.0.2",
4444
"@manuth/temp-files": "^2.0.9",
4545
"chalk": "^4.1.2",
4646
"dedent": "^0.7.0",
47+
"dependency-package-path": "^1.0.0",
4748
"fs-extra": "^10.1.0",
4849
"inquirer": "^8.2.4",
4950
"lodash.kebabcase": "^4.1.1",
5051
"pascalcase": "^1.0.0",
51-
"ts-morph": "^15.1.0",
52+
"ts-morph": "^16.0.0",
5253
"upath": "^2.0.1",
5354
"yosay": "^2.0.2"
5455
},
5556
"devDependencies": {
5657
"@manuth/eslint-plugin-typescript": "^3.3.4",
57-
"@manuth/extended-yo-generator-test": "^11.0.7",
58-
"@manuth/generator-ts-project-test": "^3.1.0",
58+
"@manuth/extended-yo-generator-test": "^12.1.2",
59+
"@manuth/generator-ts-project-test": "^4.0.3",
5960
"@manuth/tsconfig": "^3.0.2",
6061
"@manuth/woltlab-compiler": "^3.0.1",
6162
"@types/dedent": "^0.7.0",
6263
"@types/fs-extra": "^9.0.13",
6364
"@types/inquirer": "^8.2.3",
6465
"@types/lodash.kebabcase": "^4.1.7",
6566
"@types/mocha": "^9.1.1",
66-
"@types/mock-require": "^2.0.1",
6767
"@types/mute-stream": "^0.0.1",
6868
"@types/node": "^18.7.16",
6969
"@types/npm": "^7.19.0",
70+
"@types/npm-which": "^3.0.1",
7071
"@types/pascalcase": "^1.0.1",
7172
"@types/sinon": "^10.0.13",
7273
"@types/ts-nameof": "^4.2.1",
@@ -75,9 +76,9 @@
7576
"@types/yosay": "2.0.1",
7677
"eslint": "^8.23.0",
7778
"mocha": "^10.0.0",
78-
"mock-require": "^3.0.3",
7979
"mock-stdin": "^1.0.0",
8080
"mute-stream": "^0.0.8",
81+
"npm-which": "^3.0.1",
8182
"random-js": "^2.1.0",
8283
"rimraf": "^3.0.2",
8384
"sinon": "^14.0.0",

src/Components/FileInstructionComponent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { GeneratorOptions } from "@manuth/extended-yo-generator";
2-
import { IWoltLabComponentOptions } from "../Settings/IWoltLabComponentOptions";
3-
import { IWoltLabSettings } from "../Settings/IWoltLabSettings";
4-
import { InstructionComponent } from "./InstructionComponent";
2+
import { IWoltLabComponentOptions } from "../Settings/IWoltLabComponentOptions.js";
3+
import { IWoltLabSettings } from "../Settings/IWoltLabSettings.js";
4+
import { InstructionComponent } from "./InstructionComponent.js";
55

66
/**
77
* Provides a component for generating instruction-files with a `FileName`-property.

src/Components/FileUploadComponentBase.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { GeneratorOptions, IFileMapping, Question } from "@manuth/extended-yo-generator";
2-
import { FileUploadMapping } from "../FileMappings/FileUploadMapping";
3-
import { IFileUploadComponentOptions } from "../Settings/IFileUploadComponentOptions";
4-
import { IWoltLabSettings } from "../Settings/IWoltLabSettings";
5-
import { WoltLabGenerator } from "../WoltLabGenerator";
6-
import { ApplicationPrompt } from "./Inquiry/Prompts/ApplicationPrompt";
7-
import { IApplicationQuestion } from "./Inquiry/Prompts/IApplicationQuestion";
8-
import { LocalInstructionComponent } from "./LocalInstructionComponent";
2+
import { FileUploadMapping } from "../FileMappings/FileUploadMapping.js";
3+
import { IFileUploadComponentOptions } from "../Settings/IFileUploadComponentOptions.js";
4+
import { IWoltLabSettings } from "../Settings/IWoltLabSettings.js";
5+
import { WoltLabGenerator } from "../WoltLabGenerator.js";
6+
import { ApplicationPrompt } from "./Inquiry/Prompts/ApplicationPrompt.js";
7+
import { IApplicationQuestion } from "./Inquiry/Prompts/IApplicationQuestion.js";
8+
import { LocalInstructionComponent } from "./LocalInstructionComponent.js";
99

1010
/**
1111
* Provides a component for file-uploads.
@@ -62,7 +62,7 @@ export abstract class FileUploadComponentBase<TSettings extends IWoltLabSettings
6262
}
6363
}
6464

65-
return result;
65+
return result as any;
6666
}
6767

6868
/**

src/Components/Inquiry/Prompts/ApplicationPrompt.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { ReadLine } from "readline";
22
import { NestedPrompt } from "@manuth/generator-ts-project";
3-
import { Answers, ChoiceCollection, DistinctQuestion, prompt } from "inquirer";
4-
import { IApplicationAnswerHash } from "./IApplicationAnswerHash";
5-
import { IApplicationQuestion } from "./IApplicationQuestion";
6-
import { IApplicationQuestionOptions } from "./IApplicationQuestionOptions";
7-
import { ISuggestionOptions } from "./ISuggestionOptions";
8-
import { IWoltLabApplication } from "./IWoltLabApplication";
3+
import inquirer, { Answers, ChoiceCollection, DistinctQuestion } from "inquirer";
4+
import { IApplicationAnswerHash } from "./IApplicationAnswerHash.js";
5+
import { IApplicationQuestion } from "./IApplicationQuestion.js";
6+
import { IApplicationQuestionOptions } from "./IApplicationQuestionOptions.js";
7+
import { ISuggestionOptions } from "./ISuggestionOptions.js";
8+
import { IWoltLabApplication } from "./IWoltLabApplication.js";
99

1010
declare module "inquirer"
1111
{
@@ -164,7 +164,7 @@ export class ApplicationPrompt<T extends IApplicationQuestionOptions> extends Ne
164164
when: (answers) => answers.application === null || answers.application === undefined
165165
});
166166

167-
let result = await prompt<IApplicationAnswerHash>(questions);
167+
let result = await inquirer.prompt<IApplicationAnswerHash>(questions);
168168
return result.application ?? result.customApplication;
169169
}
170170
}

src/Components/Inquiry/Prompts/IApplicationAnswerHash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2-
import { ApplicationPrompt } from "./ApplicationPrompt";
2+
import { ApplicationPrompt } from "./ApplicationPrompt.js";
33

44
/**
55
* The internal answer-hash of the {@link ApplicationPrompt `ApplicationPrompt<T>`}.

src/Components/Inquiry/Prompts/IApplicationQuestion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Answers } from "inquirer";
2-
import { ApplicationPrompt } from "./ApplicationPrompt";
3-
import { IApplicationQuestionOptions } from "./IApplicationQuestionOptions";
2+
import { ApplicationPrompt } from "./ApplicationPrompt.js";
3+
import { IApplicationQuestionOptions } from "./IApplicationQuestionOptions.js";
44

55
/**
66
* Provides options for the {@link ApplicationPrompt `ApplicationPrompt<T>`}.

src/Components/Inquiry/Prompts/IApplicationQuestionOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Answers, AsyncDynamicQuestionProperty, InputQuestionOptions } from "inquirer";
22
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3-
import { ApplicationPrompt } from "./ApplicationPrompt";
4-
import { ISuggestionOptions } from "./ISuggestionOptions";
3+
import { ApplicationPrompt } from "./ApplicationPrompt.js";
4+
import { ISuggestionOptions } from "./ISuggestionOptions.js";
55

66
/**
77
* Provides options for the {@link ApplicationPrompt `ApplicationPrompt<T>`}.

src/Components/Inquiry/Prompts/ISuggestionOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IWoltLabApplication } from "./IWoltLabApplication";
1+
import { IWoltLabApplication } from "./IWoltLabApplication.js";
22

33
/**
44
* Provides options for application-suggestions.

0 commit comments

Comments
 (0)