Update package configuration and TypeScript settings; add build script, versioning, and output directories. Refactor NamedType equality check for conciseness. Change import statements to use 'type' for IDisposable in Disposable and DisposableList classes.
This commit is contained in:
@@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "platform-ts",
|
"name": "platform-ts",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
|
"version": "0.0.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"lint": "eslint --max-warnings 0 ./src",
|
"lint": "eslint --max-warnings 0 ./src",
|
||||||
"prelint:fix": "bun run format",
|
"prelint:fix": "bun run format",
|
||||||
"lint:fix": "eslint --fix ./src"
|
"lint:fix": "eslint --fix ./src",
|
||||||
|
"build": "tsc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/css": "0.13.0",
|
"@eslint/css": "0.13.0",
|
||||||
|
|||||||
@@ -13,11 +13,7 @@ export default class NamedType extends Type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override equals(other: Type): boolean {
|
public override equals(other: Type): boolean {
|
||||||
return (
|
return super.equals(other) && other instanceof NamedType && this.getName() === other.getName();
|
||||||
super.equals(other) &&
|
|
||||||
other instanceof NamedType &&
|
|
||||||
this.getName() === other.getName()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public overridetoURN(): string {
|
public overridetoURN(): string {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import IDisposable from './IDisposable';
|
import type IDisposable from './IDisposable';
|
||||||
|
|
||||||
export default class Disposable implements IDisposable {
|
export default class Disposable implements IDisposable {
|
||||||
private readonly _cleanup: () => void;
|
private readonly _cleanup: () => void;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import IDisposable from './IDisposable';
|
import type IDisposable from './IDisposable';
|
||||||
|
|
||||||
export default class DisposableList implements IDisposable {
|
export default class DisposableList implements IDisposable {
|
||||||
private readonly _list: IDisposable[];
|
private readonly _list: IDisposable[];
|
||||||
@@ -15,7 +15,7 @@ export default class DisposableList implements IDisposable {
|
|||||||
while (this._list.length) {
|
while (this._list.length) {
|
||||||
const disposable = this._list.shift();
|
const disposable = this._list.shift();
|
||||||
|
|
||||||
disposable.dispose();
|
disposable!.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,18 @@
|
|||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
"outDir": "./dist",
|
||||||
|
"rootDir": "./src",
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"declarationDir": "./dist/types",
|
||||||
|
|
||||||
// Bundler mode
|
// Bundler mode
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": false,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"noEmit": true,
|
"noEmit": false,
|
||||||
|
|
||||||
// Best practices
|
// Best practices
|
||||||
"strict": true,
|
"strict": true,
|
||||||
@@ -25,5 +31,7 @@
|
|||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noPropertyAccessFromIndexSignature": false
|
"noPropertyAccessFromIndexSignature": false
|
||||||
}
|
},
|
||||||
|
"include": ["src/**/*"],
|
||||||
|
"exclude": ["node_modules/**/*", "test/**/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user