@bscotch/project
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -138,9 +138,2 @@ import { PackageJson, TsConfig, type DependencyVersion, type PackageJsonDependencyType, type PackageJsonFindOptions, type PackageName, type PackageNameConstructable } from '@bscotch/config'; | ||
allowUnusedLabels?: boolean | undefined; | ||
/** | ||
* Remove built files that don't have a corresponding | ||
* source file. Useful to ensure that tests | ||
* are only running against content from the source, | ||
* and that old files won't be accidentally | ||
* deployed. | ||
*/ | ||
noImplicitReturns?: boolean | undefined; | ||
@@ -147,0 +140,0 @@ noUncheckedIndexedAccess?: boolean | undefined; |
@@ -111,2 +111,3 @@ import { PackageName } from '@bscotch/config'; | ||
const srcDir = await tsconfig.srcDir(); | ||
const depAdds = []; | ||
morpher.getSourceFiles().forEach((f) => { | ||
@@ -116,12 +117,12 @@ const importer = normalizeInternalDependencyPath(new Pathy(f.getFilePath(), { | ||
}), srcDir, outDir, project); | ||
f.getExportDeclarations().forEach((d) => { | ||
addDependencyToSummary(d, importer, deps); | ||
}); | ||
f.getImportDeclarations().forEach((i) => { | ||
addDependencyToSummary(i, importer, deps); | ||
}); | ||
depAdds.push(...f | ||
.getExportDeclarations() | ||
.map((d) => addDependencyToSummary(d, importer, deps, tsconfig)), ...f | ||
.getImportDeclarations() | ||
.map((i) => addDependencyToSummary(i, importer, deps, tsconfig))); | ||
}); | ||
await Promise.all(depAdds); | ||
return deps; | ||
} | ||
function addDependencyToSummary(declaration, importer, deps) { | ||
async function addDependencyToSummary(declaration, importer, deps, tsconfig) { | ||
if (!declaration) { | ||
@@ -134,3 +135,3 @@ return deps; | ||
} | ||
const depType = depName.match(/^([./]|[$@~#]\/)/) | ||
let depType = depName.match(/^([./]|[$@~#]\/)/) | ||
? 'internal' | ||
@@ -140,2 +141,6 @@ : isNodeNativeModule(depName) | ||
: 'external'; | ||
if (depType === 'external' && (await tsconfig.includes(depName))) { | ||
// Then is an alias from the tsconfig. | ||
depType = 'internal'; | ||
} | ||
if (depType === 'internal') { | ||
@@ -142,0 +147,0 @@ // Normalize the path to be relative to the project root |
{ | ||
"name": "@bscotch/project", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"type": "module", | ||
@@ -19,5 +19,5 @@ "exports": { | ||
"dependencies": { | ||
"@bscotch/config": "^0.3.2", | ||
"@bscotch/pathy": "^0.3.1", | ||
"@bscotch/utility": "^5.0.0", | ||
"@bscotch/config": "^0.3.3", | ||
"@bscotch/pathy": "^0.4.0", | ||
"@bscotch/utility": "^5.1.0", | ||
"@bscotch/validation": "^0.2.0", | ||
@@ -24,0 +24,0 @@ "chalk": "^5.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
134508
2198
- Removed@bscotch/pathy@0.3.1(transitive)
Updated@bscotch/config@^0.3.3
Updated@bscotch/pathy@^0.4.0
Updated@bscotch/utility@^5.1.0