mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
4ac7ce8bc9
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
129 lines
3.6 KiB
TypeScript
129 lines
3.6 KiB
TypeScript
currentDirectory::D:/Work/pkg1
|
|
useCaseSensitiveFileNames::false
|
|
Input::
|
|
//// [D:/Work/pkg1/package.json] *new*
|
|
{
|
|
"name": "ts-specifier-bug",
|
|
"version": "1.0.0",
|
|
"main": "index.js"
|
|
}
|
|
//// [D:/Work/pkg1/src/main.ts] *new*
|
|
import { PartialType } from './utils';
|
|
|
|
class Common {}
|
|
|
|
export class Sub extends PartialType(Common) {
|
|
id: string;
|
|
}
|
|
//// [D:/Work/pkg1/src/utils/index.ts] *new*
|
|
import { MyType, MyReturnType } from './type-helpers';
|
|
|
|
export function PartialType<T>(classRef: MyType<T>) {
|
|
abstract class PartialClassType {
|
|
constructor() {}
|
|
}
|
|
|
|
return PartialClassType as MyReturnType;
|
|
}
|
|
//// [D:/Work/pkg1/src/utils/type-helpers.ts] *new*
|
|
export type MyReturnType = {
|
|
new (...args: any[]): any;
|
|
};
|
|
|
|
export interface MyType<T = any> extends Function {
|
|
new (...args: any[]): T;
|
|
}
|
|
//// [D:/Work/pkg1/tsconfig.json] *new*
|
|
{
|
|
"compilerOptions": {
|
|
"declaration": true,
|
|
"target": "es2017",
|
|
"outDir": "./dist",
|
|
},
|
|
"include": ["src"],
|
|
}
|
|
|
|
tsgo -p D:\Work\pkg1 --explainFiles
|
|
ExitStatus:: DiagnosticsPresent_OutputsGenerated
|
|
Output::
|
|
[96mtsconfig.json[0m:[93m5[0m:[93m9[0m - [91merror[0m[90m TS5011: [0mThe common source directory of 'tsconfig.json' is './src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
|
|
Visit https://aka.ms/ts6 for migration information.
|
|
|
|
[7m5[0m "outDir": "./dist",
|
|
[7m [0m [91m ~~~~~~~~[0m
|
|
|
|
../../home/src/tslibs/TS/Lib/lib.es2017.full.d.ts
|
|
Default library for target 'ES2017'
|
|
src/utils/type-helpers.ts
|
|
Imported via './type-helpers' from file 'src/utils/index.ts'
|
|
Matched by include pattern 'src' in 'tsconfig.json'
|
|
src/utils/index.ts
|
|
Imported via './utils' from file 'src/main.ts'
|
|
Matched by include pattern 'src' in 'tsconfig.json'
|
|
src/main.ts
|
|
Matched by include pattern 'src' in 'tsconfig.json'
|
|
|
|
Found 1 error in tsconfig.json[90m:5[0m
|
|
|
|
//// [D:/Work/pkg1/dist/src/main.d.ts] *new*
|
|
declare const Sub_base: import("./utils/type-helpers").MyReturnType;
|
|
export declare class Sub extends Sub_base {
|
|
id: string;
|
|
}
|
|
export {};
|
|
|
|
//// [D:/Work/pkg1/dist/src/main.js] *new*
|
|
import { PartialType } from './utils';
|
|
class Common {
|
|
}
|
|
export class Sub extends PartialType(Common) {
|
|
}
|
|
|
|
//// [D:/Work/pkg1/dist/src/utils/index.d.ts] *new*
|
|
import { MyType, MyReturnType } from './type-helpers';
|
|
export declare function PartialType<T>(classRef: MyType<T>): MyReturnType;
|
|
|
|
//// [D:/Work/pkg1/dist/src/utils/index.js] *new*
|
|
export function PartialType(classRef) {
|
|
class PartialClassType {
|
|
constructor() { }
|
|
}
|
|
return PartialClassType;
|
|
}
|
|
|
|
//// [D:/Work/pkg1/dist/src/utils/type-helpers.d.ts] *new*
|
|
export type MyReturnType = {
|
|
new (...args: any[]): any;
|
|
};
|
|
export interface MyType<T = any> extends Function {
|
|
new (...args: any[]): T;
|
|
}
|
|
|
|
//// [D:/Work/pkg1/dist/src/utils/type-helpers.js] *new*
|
|
export {};
|
|
|
|
//// [D:/home/src/tslibs/TS/Lib/lib.es2017.full.d.ts] *Lib*
|
|
/// <reference no-default-lib="true"/>
|
|
interface Boolean {}
|
|
interface Function {}
|
|
interface CallableFunction {}
|
|
interface NewableFunction {}
|
|
interface IArguments {}
|
|
interface Number { toExponential: any; }
|
|
interface Object {}
|
|
interface RegExp {}
|
|
interface String { charAt: any; }
|
|
interface Array<T> { length: number; [n: number]: T; }
|
|
interface ReadonlyArray<T> {}
|
|
interface SymbolConstructor {
|
|
(desc?: string | number): symbol;
|
|
for(name: string): symbol;
|
|
readonly toStringTag: symbol;
|
|
}
|
|
declare var Symbol: SymbolConstructor;
|
|
interface Symbol {
|
|
readonly [Symbol.toStringTag]: string;
|
|
}
|
|
declare const console: { log(msg: any): void; };
|
|
|