I discovered a weird bug today. My folder structure is as follows:
- packages/
- sys/
- api/ -
@internal/api
- core/ -
@internal/core
Each of the packages in sys has an @lib alias pointing to src.
Running tsc-alias --debug in the @internal/api package returns:
tsc-alias debug: default replacer - alias: {
shouldPrefixMatchWildly: true,
prefix: '@lib/',
paths: [
{
path: 'src/',
basePath: '/Users/<redact>/packages/sys/api/dist/api',
isExtra: false
},
[length]: 1
]
}
The base path has an extra /api appended to it, resulting in an Invalid path warning and no substitution taking place. Meanwhile, the @internal/core package has exactly the same config but no problems.
I changed the structure to
- packages/
- sys/
- api-models/ -
@internal/api-models
- core/ -
@internal/core
And after running again I get the correct output:
tsc-alias debug: default replacer - alias: {
shouldPrefixMatchWildly: true,
prefix: '@lib/',
paths: [
{
path: 'src/',
basePath: '/Users/<redact>/packages/sys/api-models/dist',
isExtra: false
},
[length]: 1
]
}
I can recreate the same issue in @internal/core by adding a core folder to the src directory.
I discovered a weird bug today. My folder structure is as follows:
@internal/api@internal/coreEach of the packages in
syshas an@libalias pointing tosrc.Running
tsc-alias --debugin the@internal/apipackage returns:The base path has an extra
/apiappended to it, resulting in an Invalid path warning and no substitution taking place. Meanwhile, the@internal/corepackage has exactly the same config but no problems.I changed the structure to
@internal/api-models@internal/coreAnd after running again I get the correct output:
I can recreate the same issue in
@internal/coreby adding acorefolder to thesrcdirectory.