mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-01 13:22:29 +02:00
constants.js -> ts, more config cleanup
This commit is contained in:
parent
60f2532e81
commit
0ce89950e9
|
@ -15,8 +15,6 @@ import "./socket-events";
|
|||
import "./webpush";
|
||||
import "./keybinds";
|
||||
|
||||
import type {Channel} from "../../src/types/modules/channel";
|
||||
|
||||
const favicon = document.getElementById("favicon");
|
||||
const faviconNormal = favicon?.getAttribute("href") || "";
|
||||
const faviconAlerted = favicon?.dataset.other || "";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"include": ["./**/*.ts", "./**/*.js", "./**/*.d.ts", "./**/*/json"],
|
||||
"exclude": ["./dist/*"],
|
||||
"include": ["./**/*"],
|
||||
"files": ["../src/types/models/channel.d.ts"],
|
||||
"compilerOptions": {
|
||||
// https://v2.vuejs.org/v2/guide/typescript.html?redirect=true#Recommended-Configuration
|
||||
|
@ -9,10 +8,7 @@
|
|||
"strict": true,
|
||||
"lib": ["ES2020", "dom"],
|
||||
"sourceMap": false,
|
||||
"outDir": "./dist",
|
||||
"noImplicitAny": false,
|
||||
"baseUrl": "./",
|
||||
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"scripts": {
|
||||
"build": "webpack",
|
||||
"coverage": "run-s test:* && nyc --nycrc-path=test/.nycrc-report.json report",
|
||||
"dev": "TS_NODE_PROJECT='./src/tsconfig.json' ts-node index start --dev",
|
||||
"dev": "ts-node index start --dev",
|
||||
"format:prettier": "prettier --write \"**/*.*\"",
|
||||
"lint:check-eslint": "eslint-config-prettier .eslintrc.cjs",
|
||||
"lint:eslint": "eslint . --ext .js,.vue --report-unused-disable-directives --color",
|
||||
|
|
|
@ -44,7 +44,7 @@ program.addCommand(require("./uninstall").default);
|
|||
program.addCommand(require("./upgrade").default);
|
||||
program.addCommand(require("./outdated").default);
|
||||
if (!Config.values.public) {
|
||||
require("./users").default.forEach((command) => {
|
||||
require("./users").default.forEach((command: Command) => {
|
||||
if (command) program.addCommand(command);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ const packageMap = new Map();
|
|||
import inputs from "../inputs";
|
||||
import fs from "fs";
|
||||
import Utils from "../../command-line/utils";
|
||||
import Client from "client";
|
||||
import Client from "../../client";
|
||||
|
||||
const stylesheets: string[] = [];
|
||||
const files: string[] = [];
|
||||
|
@ -34,7 +34,7 @@ export default {
|
|||
};
|
||||
|
||||
// TODO: verify binds worked. Used to be 'this' instead of 'packageApis'
|
||||
const packageApis = function (packageInfo) {
|
||||
const packageApis = function (packageInfo: PackageInfo) {
|
||||
return {
|
||||
Stylesheets: {
|
||||
addFile: addStylesheet.bind(packageApis, packageInfo.packageName),
|
||||
|
|
|
@ -2,15 +2,10 @@
|
|||
"extends": "../tsconfig.base.json",
|
||||
"files": [
|
||||
"../package.json",
|
||||
"../client/js/constants.js",
|
||||
"../client/js/constants.ts",
|
||||
"../client/js/helpers/ircmessageparser/findLinks.ts"
|
||||
],
|
||||
// "exclude": ["../client/*", "./dist/*"],
|
||||
"exclude": ["./dist/*"],
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
"include": ["./**/*.ts", "./**/*.js", "./**/*.d.ts"],
|
||||
"include": ["**/*"],
|
||||
"compilerOptions": {
|
||||
"types": ["node"],
|
||||
"baseUrl": ".",
|
||||
|
|
9
src/types/packages/index.d.ts
vendored
9
src/types/packages/index.d.ts
vendored
|
@ -1,9 +1,2 @@
|
|||
/// <reference path="themes.d.ts" />
|
||||
|
||||
type PackageInfo = {
|
||||
packageName: string;
|
||||
thelounge?: {supports: any};
|
||||
version: string;
|
||||
type?: string;
|
||||
files?: string[];
|
||||
};
|
||||
/// <reference path="packages.d.ts" />
|
||||
|
|
7
src/types/packages/packages.d.ts
vendored
Normal file
7
src/types/packages/packages.d.ts
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
type PackageInfo = {
|
||||
packageName: string;
|
||||
thelounge?: {supports: any};
|
||||
version: string;
|
||||
type?: string;
|
||||
files?: string[];
|
||||
};
|
|
@ -1,21 +1,21 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"declaration": true,
|
||||
// "lib": ["es2019" ],
|
||||
"module": "commonjs",
|
||||
"target": "ESNext",
|
||||
"baseUrl": ".",
|
||||
"rootDir": "./",
|
||||
"allowJs": true,
|
||||
"noImplicitAny": false,
|
||||
"checkJs": true,
|
||||
"resolveJsonModule": true,
|
||||
"composite": true,
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
"typeRoots": ["./src/"],
|
||||
"typeRoots": ["./src/types/"],
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
// "skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
||||
},
|
||||
"files": ["./src/index.d.ts"]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": ["./webpack.config.ts", "./babel.config.cjs"],
|
||||
"files": ["./webpack.config.ts", "./babel.config.cjs", "./src/helper.ts"],
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@src/*": ["src/*"],
|
||||
|
|
|
@ -40,7 +40,7 @@ const config: webpack.Configuration = {
|
|||
},
|
||||
},
|
||||
{
|
||||
test: /\.{js,ts}$/,
|
||||
test: /\.{js,ts,d.ts}$/,
|
||||
include: [path.resolve(__dirname, "client/")],
|
||||
exclude: path.resolve(__dirname, "node_modules"),
|
||||
use: {
|
||||
|
|
Loading…
Reference in a new issue