@teambit/component-issues 0.0.101 → 0.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/circular-dependencies.js +26 -12
- package/dist/circular-dependencies.js.map +1 -1
- package/dist/component-issue.d.ts +8 -6
- package/dist/component-issue.js +81 -56
- package/dist/component-issue.js.map +1 -1
- package/dist/duplicate-component-and-package.js +26 -12
- package/dist/duplicate-component-and-package.js.map +1 -1
- package/dist/external-env-without-version.js +29 -15
- package/dist/external-env-without-version.js.map +1 -1
- package/dist/import-non-main-files.js +23 -10
- package/dist/import-non-main-files.js.map +1 -1
- package/dist/index.js +81 -10
- package/dist/index.js.map +1 -1
- package/dist/issues-list.d.ts +9 -8
- package/dist/issues-list.js +266 -128
- package/dist/issues-list.js.map +1 -1
- package/dist/legacy-inside-harmony.js +26 -12
- package/dist/legacy-inside-harmony.js.map +1 -1
- package/dist/merge-config-has-conflict.js +26 -12
- package/dist/merge-config-has-conflict.js.map +1 -1
- package/dist/missing-components.js +25 -12
- package/dist/missing-components.js.map +1 -1
- package/dist/missing-dependencies-on-fs.js +22 -9
- package/dist/missing-dependencies-on-fs.js.map +1 -1
- package/dist/missing-dists.js +26 -12
- package/dist/missing-dists.js.map +1 -1
- package/dist/missing-links-from-nm-to-src.js +26 -12
- package/dist/missing-links-from-nm-to-src.js.map +1 -1
- package/dist/missing-manually-configured-packages.js +26 -12
- package/dist/missing-manually-configured-packages.js.map +1 -1
- package/dist/missing-packages-dependencies-on-fs.js +22 -9
- package/dist/missing-packages-dependencies-on-fs.js.map +1 -1
- package/dist/multiple-envs.js +27 -12
- package/dist/multiple-envs.js.map +1 -1
- package/dist/non-loaded-env.js +26 -12
- package/dist/non-loaded-env.js.map +1 -1
- package/dist/parse-errors.js +22 -9
- package/dist/parse-errors.js.map +1 -1
- package/dist/relative-components-authored.js +55 -36
- package/dist/relative-components-authored.js.map +1 -1
- package/dist/relative-components.js +26 -13
- package/dist/relative-components.js.map +1 -1
- package/dist/removed-dependencies.js +27 -12
- package/dist/removed-dependencies.js.map +1 -1
- package/dist/resolve-errors.js +22 -9
- package/dist/resolve-errors.js.map +1 -1
- package/dist/untracked-dependencies.js +48 -32
- package/dist/untracked-dependencies.js.map +1 -1
- package/package.json +14 -5
- package/tsconfig.json +10 -2
- package/circular-dependencies.ts +0 -11
- package/component-issue.ts +0 -66
- package/dist/tsconfig.json +0 -32
- package/duplicate-component-and-package.ts +0 -11
- package/external-env-without-version.ts +0 -19
- package/import-non-main-files.ts +0 -8
- package/index.ts +0 -4
- package/issues-list.ts +0 -155
- package/legacy-inside-harmony.ts +0 -11
- package/merge-config-has-conflict.ts +0 -11
- package/missing-components.ts +0 -11
- package/missing-dependencies-on-fs.ts +0 -7
- package/missing-dists.ts +0 -11
- package/missing-links-from-nm-to-src.ts +0 -11
- package/missing-manually-configured-packages.ts +0 -10
- package/missing-packages-dependencies-on-fs.ts +0 -7
- package/multiple-envs.ts +0 -12
- package/non-loaded-env.ts +0 -11
- package/parse-errors.ts +0 -7
- package/relative-components-authored.ts +0 -49
- package/relative-components.ts +0 -12
- package/removed-dependencies.ts +0 -12
- package/resolve-errors.ts +0 -7
- package/untracked-dependencies.ts +0 -41
- /package/dist/{preview-1698418523363.js → preview-1699067946955.js} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, StringsPerFilePath } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class MissingDependenciesOnFs extends ComponentIssue {
|
|
4
|
-
description = 'non-existing dependency files';
|
|
5
|
-
solution = 'make sure all files exists on your workspace';
|
|
6
|
-
data: StringsPerFilePath = {};
|
|
7
|
-
}
|
package/missing-dists.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, formatTitle } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class MissingDists extends ComponentIssue {
|
|
4
|
-
description = 'missing dists';
|
|
5
|
-
solution = 'run "bit compile"';
|
|
6
|
-
data: boolean;
|
|
7
|
-
isTagBlocker = false;
|
|
8
|
-
outputForCLI() {
|
|
9
|
-
return formatTitle(this.descriptionWithSolution, false);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, formatTitle } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class MissingLinksFromNodeModulesToSrc extends ComponentIssue {
|
|
4
|
-
description = 'missing links from node_modules to source';
|
|
5
|
-
solution = 'run "bit link"';
|
|
6
|
-
data: boolean;
|
|
7
|
-
isTagBlocker = false;
|
|
8
|
-
outputForCLI() {
|
|
9
|
-
return formatTitle(this.descriptionWithSolution, false);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, ISSUE_FORMAT_SPACE } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class MissingManuallyConfiguredPackages extends ComponentIssue {
|
|
4
|
-
description = `missing packages that were manually set`;
|
|
5
|
-
solution = `run "bit install"`;
|
|
6
|
-
data: string[] = []; // package names
|
|
7
|
-
dataToString() {
|
|
8
|
-
return ISSUE_FORMAT_SPACE + this.data.join(', ');
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, StringsPerFilePath } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class MissingPackagesDependenciesOnFs extends ComponentIssue {
|
|
4
|
-
description = `missing packages or links from node_modules to the source`;
|
|
5
|
-
solution = `run "bit install --add-missing-deps" to fix both issues`;
|
|
6
|
-
data: StringsPerFilePath = {};
|
|
7
|
-
}
|
package/multiple-envs.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, ISSUE_FORMAT_SPACE } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class MultipleEnvs extends ComponentIssue {
|
|
4
|
-
description = 'multiple envs';
|
|
5
|
-
solution =
|
|
6
|
-
'set the desired env by running "bit env set <component> <env>", if it doesn\'t work, run "bit aspect unset <component> <unwanted-env-id>". to keep troubleshooting run "bit aspect list <component-id>"';
|
|
7
|
-
data: string[]; // env ids
|
|
8
|
-
isTagBlocker = true;
|
|
9
|
-
dataToString() {
|
|
10
|
-
return ISSUE_FORMAT_SPACE + this.data.join(', ');
|
|
11
|
-
}
|
|
12
|
-
}
|
package/non-loaded-env.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, ISSUE_FORMAT_SPACE } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class NonLoadedEnv extends ComponentIssue {
|
|
4
|
-
description = 'failed loading env';
|
|
5
|
-
solution = `run "bit install"`;
|
|
6
|
-
data: string;
|
|
7
|
-
isTagBlocker = true;
|
|
8
|
-
dataToString() {
|
|
9
|
-
return ISSUE_FORMAT_SPACE + this.data;
|
|
10
|
-
}
|
|
11
|
-
}
|
package/parse-errors.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ComponentID } from '@teambit/component-id';
|
|
2
|
-
import { ComponentIssue } from './component-issue';
|
|
3
|
-
|
|
4
|
-
export type RelativeComponentsAuthoredEntry = {
|
|
5
|
-
importSource: string;
|
|
6
|
-
componentId: ComponentID;
|
|
7
|
-
relativePath: {
|
|
8
|
-
sourceRelativePath: string;
|
|
9
|
-
importSpecifiers?: any[];
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export class RelativeComponentsAuthored extends ComponentIssue {
|
|
14
|
-
description = 'components with relative import statements found';
|
|
15
|
-
solution = 'replace to module paths or use "bit link --rewire" to replace';
|
|
16
|
-
data: { [fileName: string]: RelativeComponentsAuthoredEntry[] } = {};
|
|
17
|
-
isCacheBlocker = false;
|
|
18
|
-
formatDataFunction = relativeComponentsAuthoredIssuesToString;
|
|
19
|
-
|
|
20
|
-
serialize(): string {
|
|
21
|
-
const obj = Object.keys(this.data).reduce((acc, fileName) => {
|
|
22
|
-
acc[fileName] = this.data[fileName].map((record) => ({
|
|
23
|
-
importSource: record.importSource,
|
|
24
|
-
componentId: record.componentId.serialize(),
|
|
25
|
-
relativePath: record.relativePath,
|
|
26
|
-
}));
|
|
27
|
-
return acc;
|
|
28
|
-
}, {});
|
|
29
|
-
return JSON.stringify(obj);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
deserialize(dataStr: string) {
|
|
33
|
-
const data = JSON.parse(dataStr);
|
|
34
|
-
Object.keys(data).forEach((fileName) => {
|
|
35
|
-
data[fileName] = data[fileName].map((record) => ({
|
|
36
|
-
importSource: record.importSource,
|
|
37
|
-
componentId: ComponentID.deserialize(record.componentId),
|
|
38
|
-
relativePath: record.relativePath,
|
|
39
|
-
}));
|
|
40
|
-
});
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function relativeComponentsAuthoredIssuesToString(relativeEntries: RelativeComponentsAuthoredEntry[]) {
|
|
46
|
-
const stringifyEntry = (entry: RelativeComponentsAuthoredEntry) =>
|
|
47
|
-
`"${entry.importSource}" (${entry.componentId.toString()})`;
|
|
48
|
-
return relativeEntries.map(stringifyEntry).join(', ');
|
|
49
|
-
}
|
package/relative-components.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ComponentID } from '@teambit/component-id';
|
|
2
|
-
import { ComponentIssue, deserializeWithBitId } from './component-issue';
|
|
3
|
-
|
|
4
|
-
export class RelativeComponents extends ComponentIssue {
|
|
5
|
-
description = 'components with relative import statements found';
|
|
6
|
-
solution = 'use module paths for imported components';
|
|
7
|
-
data: { [filePath: string]: ComponentID[] } = {};
|
|
8
|
-
isCacheBlocker = false;
|
|
9
|
-
deserialize(data: string) {
|
|
10
|
-
return deserializeWithBitId(data);
|
|
11
|
-
}
|
|
12
|
-
}
|
package/removed-dependencies.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue, ISSUE_FORMAT_SPACE } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class RemovedDependencies extends ComponentIssue {
|
|
4
|
-
description = 'removed dependencies';
|
|
5
|
-
solution =
|
|
6
|
-
'either "bit install" another version of the dependency that was not removed or edit the code to remove references to the dependency.';
|
|
7
|
-
data: string[]; // deps ids
|
|
8
|
-
isTagBlocker = true;
|
|
9
|
-
dataToString() {
|
|
10
|
-
return ISSUE_FORMAT_SPACE + this.data.join(', ');
|
|
11
|
-
}
|
|
12
|
-
}
|
package/resolve-errors.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentIssue } from './component-issue';
|
|
2
|
-
|
|
3
|
-
export class ResolveErrors extends ComponentIssue {
|
|
4
|
-
description = 'error found while resolving the file dependencies';
|
|
5
|
-
solution = 'see the log for the full error';
|
|
6
|
-
data: { [filePath: string]: string } = {};
|
|
7
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { ComponentIssue, ISSUE_FORMAT_SPACE, ISSUE_FORMAT_SPACE_COUNT } from './component-issue';
|
|
3
|
-
|
|
4
|
-
export const MISSING_NESTED_DEPS_SPACE = ' '.repeat(ISSUE_FORMAT_SPACE_COUNT + 2);
|
|
5
|
-
|
|
6
|
-
interface UntrackedFileEntry {
|
|
7
|
-
relativePath: string;
|
|
8
|
-
existing: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface UntrackedFileDependencyEntry {
|
|
12
|
-
nested: boolean;
|
|
13
|
-
untrackedFiles: Array<UntrackedFileEntry>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class UntrackedDependencies extends ComponentIssue {
|
|
17
|
-
description = 'untracked file dependencies';
|
|
18
|
-
solution = 'use "bit add <file>" to track untracked files as components';
|
|
19
|
-
data: { [filePath: string]: UntrackedFileDependencyEntry } = {};
|
|
20
|
-
dataToString() {
|
|
21
|
-
return Object.keys(this.data)
|
|
22
|
-
.map((k) => {
|
|
23
|
-
let space = ISSUE_FORMAT_SPACE;
|
|
24
|
-
if (this.data[k].nested) {
|
|
25
|
-
space = MISSING_NESTED_DEPS_SPACE;
|
|
26
|
-
}
|
|
27
|
-
return `${space}${k} -> ${untrackedFilesComponentIssueToString(this.data[k])}`;
|
|
28
|
-
})
|
|
29
|
-
.join('\n');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function untrackedFilesComponentIssueToString(value: UntrackedFileDependencyEntry) {
|
|
34
|
-
const colorizedMap = value.untrackedFiles.map((curr) => {
|
|
35
|
-
if (curr.existing) {
|
|
36
|
-
return `${chalk.yellow(curr.relativePath)}`;
|
|
37
|
-
}
|
|
38
|
-
return curr.relativePath;
|
|
39
|
-
});
|
|
40
|
-
return colorizedMap.join(', ');
|
|
41
|
-
}
|
|
File without changes
|