Skip to content
This repository was archived by the owner on Dec 4, 2022. It is now read-only.

Commit ed72534

Browse files
committed
fix some errors
1 parent c95034a commit ed72534

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/dependency-builder/path-map.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ function getDependenciesFromLinkFileIfExists(
130130

131131
const dependencies = dependency.importSpecifiers.map((specifier: Specifier) => {
132132
const realDep = findTheRealDependency(pathMap, dependencyPathMap, specifier);
133-
// $FlowFixMe
134133
if (!realDep) return null;
135-
// $FlowFixMe importSpecifiers do exist
134+
// @ts-ignore
136135
const depImportSpecifier = realDep.importSpecifiers.find(depSpecifier => depSpecifier.name === specifier.name);
137136
const importSpecifier: ImportSpecifier = {
138137
mainFile: specifier,

src/package-json/package-json.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ function convertComponentsIdToValidPackageName(registryPrefix: string, id: strin
1313
}
1414

1515
export default class PackageJson {
16+
static hasExisting(componentRootFolder: string): boolean {
17+
const packageJsonPath = composePath(componentRootFolder);
18+
return fs.pathExistsSync(packageJsonPath);
19+
}
20+
1621
/**
1722
* Taken from this package (with some minor changes):
1823
* https://www.npmjs.com/package/find-package
@@ -41,11 +46,12 @@ export default class PackageJson {
4146
*/
4247
static findPackage(dir, addPaths) {
4348
const pathToConfig = this.findPath(dir);
44-
let configJSON = null;
49+
let configJSON: any = null;
4550
// eslint-disable-next-line import/no-dynamic-require, global-require
4651
if (pathToConfig !== null) configJSON = require(path.resolve(pathToConfig));
4752
if (configJSON && addPaths) {
4853
configJSON.paths = {
54+
// @ts-ignore
4955
relative: path.relative(dir, pathToConfig),
5056
absolute: pathToConfig
5157
};

0 commit comments

Comments
 (0)