constants.js -> ts, more config cleanup

This commit is contained in:
Max Leiter 2022-05-02 20:41:13 -07:00
parent 60f2532e81
commit 0ce89950e9
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
12 changed files with 20 additions and 31 deletions

View file

@ -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 || "";

View file

@ -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"
}
}

View file

@ -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",

View file

@ -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);
});
}

View file

@ -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),

View file

@ -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": ".",

View file

@ -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
View file

@ -0,0 +1,7 @@
type PackageInfo = {
packageName: string;
thelounge?: {supports: any};
version: string;
type?: string;
files?: string[];
};

View file

@ -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"]

View file

@ -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/*"],

View file

@ -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: {