@teambit/install 0.0.0-038c3ec7ffafaeb6a0ef7e522053a6312c90ac14
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/esm.mjs +7 -0
- package/dist/exceptions/dependency-type-not-supported-in-policy.d.ts +4 -0
- package/dist/exceptions/dependency-type-not-supported-in-policy.js +21 -0
- package/dist/exceptions/dependency-type-not-supported-in-policy.js.map +1 -0
- package/dist/exceptions/index.d.ts +1 -0
- package/dist/exceptions/index.js +20 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/install.aspect.d.ts +2 -0
- package/dist/install.aspect.js +18 -0
- package/dist/install.aspect.js.map +1 -0
- package/dist/install.cmd.d.ts +55 -0
- package/dist/install.cmd.js +155 -0
- package/dist/install.cmd.js.map +1 -0
- package/dist/install.main.runtime.d.ts +248 -0
- package/dist/install.main.runtime.js +1408 -0
- package/dist/install.main.runtime.js.map +1 -0
- package/dist/link/component-list-links.d.ts +10 -0
- package/dist/link/component-list-links.js +102 -0
- package/dist/link/component-list-links.js.map +1 -0
- package/dist/link/core-aspects-links.d.ts +7 -0
- package/dist/link/core-aspects-links.js +83 -0
- package/dist/link/core-aspects-links.js.map +1 -0
- package/dist/link/get-package-name-from-target.d.ts +1 -0
- package/dist/link/get-package-name-from-target.js +13 -0
- package/dist/link/get-package-name-from-target.js.map +1 -0
- package/dist/link/index.d.ts +1 -0
- package/dist/link/index.js +20 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/link-row.d.ts +12 -0
- package/dist/link/link-row.js +32 -0
- package/dist/link/link-row.js.map +1 -0
- package/dist/link/link-to-dir.d.ts +2 -0
- package/dist/link/link-to-dir.js +35 -0
- package/dist/link/link-to-dir.js.map +1 -0
- package/dist/link/link.cmd.d.ts +47 -0
- package/dist/link/link.cmd.js +145 -0
- package/dist/link/link.cmd.js.map +1 -0
- package/dist/link/nested-deps-in-nm-links.d.ts +7 -0
- package/dist/link/nested-deps-in-nm-links.js +59 -0
- package/dist/link/nested-deps-in-nm-links.js.map +1 -0
- package/dist/link/rewire-row.d.ts +6 -0
- package/dist/link/rewire-row.js +26 -0
- package/dist/link/rewire-row.js.map +1 -0
- package/dist/pick-outdated-pkgs.d.ts +12 -0
- package/dist/pick-outdated-pkgs.js +180 -0
- package/dist/pick-outdated-pkgs.js.map +1 -0
- package/dist/pick-outdated-pkgs.spec.d.ts +1 -0
- package/dist/pick-outdated-pkgs.spec.js +171 -0
- package/dist/pick-outdated-pkgs.spec.js.map +1 -0
- package/dist/preview-1753890535938.js +7 -0
- package/dist/uninstall.cmd.d.ts +12 -0
- package/dist/uninstall.cmd.js +26 -0
- package/dist/uninstall.cmd.js.map +1 -0
- package/dist/update.cmd.d.ts +26 -0
- package/dist/update.cmd.js +52 -0
- package/dist/update.cmd.js.map +1 -0
- package/esm.mjs +7 -0
- package/exceptions/dependency-type-not-supported-in-policy.ts +7 -0
- package/exceptions/index.ts +1 -0
- package/install.cmd.tsx +191 -0
- package/link/component-list-links.ts +79 -0
- package/link/core-aspects-links.ts +57 -0
- package/link/get-package-name-from-target.ts +5 -0
- package/link/index.ts +1 -0
- package/link/link-row.ts +20 -0
- package/link/link-to-dir.ts +13 -0
- package/link/link.cmd.ts +118 -0
- package/link/nested-deps-in-nm-links.ts +47 -0
- package/link/rewire-row.ts +17 -0
- package/package.json +96 -0
- package/types/asset.d.ts +41 -0
- package/types/style.d.ts +42 -0
- package/uninstall.cmd.tsx +18 -0
- package/update.cmd.tsx +67 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
import type { CoreAspectLinkResult } from '@teambit/dependency-resolver';
|
2
|
+
import chalk from 'chalk';
|
3
|
+
|
4
|
+
import { getPackageNameFromTarget } from './get-package-name-from-target';
|
5
|
+
import { LinkRow, VerboseLinkRow } from './link-row';
|
6
|
+
|
7
|
+
type CoreAspectsLinksProps = {
|
8
|
+
coreAspectsLinks?: CoreAspectLinkResult[];
|
9
|
+
verbose: boolean;
|
10
|
+
};
|
11
|
+
|
12
|
+
export function CoreAspectsLinks({ coreAspectsLinks, verbose = false }: CoreAspectsLinksProps) {
|
13
|
+
if (!coreAspectsLinks || !coreAspectsLinks.length) {
|
14
|
+
return chalk.cyan('No core aspects were linked');
|
15
|
+
}
|
16
|
+
|
17
|
+
if (verbose) {
|
18
|
+
const title = chalk.cyan('Core aspects links');
|
19
|
+
const links = coreAspectsLinks.map((link) => CoreAspectLinkRow({ coreAspectLink: link, verbose })).join('\n');
|
20
|
+
return `${title}\n${links}`;
|
21
|
+
}
|
22
|
+
|
23
|
+
// Show summary by default
|
24
|
+
const count = coreAspectsLinks.length;
|
25
|
+
return chalk.cyan(`${count} core-aspects were linked`);
|
26
|
+
}
|
27
|
+
|
28
|
+
type CoreAspectLinkProps = {
|
29
|
+
coreAspectLink: CoreAspectLinkResult;
|
30
|
+
verbose: boolean;
|
31
|
+
};
|
32
|
+
function CoreAspectLinkRow({ coreAspectLink, verbose = false }: CoreAspectLinkProps) {
|
33
|
+
if (verbose) return VerboseCoreAspectLink({ coreAspectLink });
|
34
|
+
return RegularCoreAspectLink({ coreAspectLink });
|
35
|
+
}
|
36
|
+
|
37
|
+
type RegularCoreAspectLinkProps = {
|
38
|
+
coreAspectLink: CoreAspectLinkResult;
|
39
|
+
};
|
40
|
+
function RegularCoreAspectLink({ coreAspectLink }: RegularCoreAspectLinkProps) {
|
41
|
+
const id = coreAspectLink.aspectId.toString();
|
42
|
+
const packagePath = getPackageNameFromTarget(coreAspectLink.linkDetail.to);
|
43
|
+
return LinkRow({ title: id, target: packagePath, padding: 50 });
|
44
|
+
}
|
45
|
+
|
46
|
+
type VerboseCoreAspectLinkProps = {
|
47
|
+
coreAspectLink: CoreAspectLinkResult;
|
48
|
+
};
|
49
|
+
function VerboseCoreAspectLink({ coreAspectLink }: VerboseCoreAspectLinkProps) {
|
50
|
+
const id = coreAspectLink.aspectId.toString();
|
51
|
+
const title = chalk.bold.cyan(id);
|
52
|
+
const link = VerboseLinkRow({
|
53
|
+
from: coreAspectLink.linkDetail.from,
|
54
|
+
to: coreAspectLink.linkDetail.to,
|
55
|
+
});
|
56
|
+
return `${title}\n${link}`;
|
57
|
+
}
|
package/link/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { LinkCommand } from './link.cmd';
|
package/link/link-row.ts
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import chalk from 'chalk';
|
2
|
+
|
3
|
+
type LinkRowProps = {
|
4
|
+
title: string;
|
5
|
+
target: string;
|
6
|
+
padding?: number;
|
7
|
+
};
|
8
|
+
export function LinkRow({ title, target, padding = 50 }: LinkRowProps) {
|
9
|
+
return chalk.bold(`${title.padEnd(padding)} ${'>'} ${target}`);
|
10
|
+
}
|
11
|
+
|
12
|
+
type VerboseLinkRowProps = {
|
13
|
+
from: string;
|
14
|
+
to: string;
|
15
|
+
};
|
16
|
+
export function VerboseLinkRow({ from, to }: VerboseLinkRowProps) {
|
17
|
+
return `${chalk.bold('from')}: ${from}
|
18
|
+
${chalk.bold('to')}: ${to}
|
19
|
+
`;
|
20
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { LinkToDirResult } from '@teambit/dependency-resolver';
|
2
|
+
import chalk from 'chalk';
|
3
|
+
import { LinkRow } from './link-row';
|
4
|
+
|
5
|
+
export function linkToDir(links?: LinkToDirResult[]) {
|
6
|
+
if (!links || !links.length) return '';
|
7
|
+
const title = chalk.bold.cyan('Target Links');
|
8
|
+
const linksOutput = links
|
9
|
+
.map(({ componentId, linksDetail }) => LinkRow({ title: componentId, target: linksDetail.to }))
|
10
|
+
.join('\n');
|
11
|
+
|
12
|
+
return `${title}\n${linksOutput}`;
|
13
|
+
}
|
package/link/link.cmd.ts
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
import type { Logger } from '@teambit/logger';
|
3
|
+
import { timeFormat } from '@teambit/toolbox.time.time-format';
|
4
|
+
import { compact } from 'lodash';
|
5
|
+
import chalk from 'chalk';
|
6
|
+
import type { Workspace } from '@teambit/workspace';
|
7
|
+
import type { InstallMain, WorkspaceLinkOptions, WorkspaceLinkResults } from '../install.main.runtime';
|
8
|
+
import { ComponentListLinks, packageListLinks } from './component-list-links';
|
9
|
+
import { CoreAspectsLinks } from './core-aspects-links';
|
10
|
+
import { NestedComponentLinksLinks } from './nested-deps-in-nm-links';
|
11
|
+
import { RewireRow } from './rewire-row';
|
12
|
+
import { linkToDir } from './link-to-dir';
|
13
|
+
|
14
|
+
type LinkCommandOpts = {
|
15
|
+
rewire: boolean;
|
16
|
+
verbose: boolean;
|
17
|
+
target: string;
|
18
|
+
skipFetchingObjects?: boolean;
|
19
|
+
peers?: boolean;
|
20
|
+
compSummary?: boolean;
|
21
|
+
};
|
22
|
+
export class LinkCommand implements Command {
|
23
|
+
name = 'link [component-names...]';
|
24
|
+
alias = '';
|
25
|
+
description = 'create links in the node_modules directory, to core aspects and to components in the workspace';
|
26
|
+
helpUrl = 'reference/workspace/component-links';
|
27
|
+
extendedDescription: string;
|
28
|
+
group = 'dependencies';
|
29
|
+
private = false;
|
30
|
+
arguments = [{ name: 'component-names...', description: 'names or IDs of the components to link' }];
|
31
|
+
options = [
|
32
|
+
['j', 'json', 'return the output as JSON'],
|
33
|
+
['', 'verbose', 'verbose output'],
|
34
|
+
['r', 'rewire', 'Replace relative paths with module paths in code (e.g. "../foo" => "@bit/foo")'],
|
35
|
+
[
|
36
|
+
'',
|
37
|
+
'target <dir>',
|
38
|
+
'link to an external directory (similar to npm-link) so other projects could use these components',
|
39
|
+
],
|
40
|
+
['', 'skip-fetching-objects', 'skip fetch missing objects from remotes before linking'],
|
41
|
+
['', 'peers', 'link peer dependencies of the components too'],
|
42
|
+
['', 'comp-summary', 'show only a summary of component links instead of listing all components'],
|
43
|
+
] as CommandOptions;
|
44
|
+
|
45
|
+
constructor(
|
46
|
+
private install: InstallMain,
|
47
|
+
/**
|
48
|
+
* workspace extension.
|
49
|
+
*/
|
50
|
+
private workspace: Workspace,
|
51
|
+
|
52
|
+
/**
|
53
|
+
* logger extension.
|
54
|
+
*/
|
55
|
+
private logger: Logger
|
56
|
+
) {}
|
57
|
+
|
58
|
+
async report([ids]: [string[]], opts: LinkCommandOpts) {
|
59
|
+
const startTime = Date.now();
|
60
|
+
const linkResults = await this.json([ids], opts);
|
61
|
+
const endTime = Date.now();
|
62
|
+
const numOfComponents = linkResults.legacyLinkResults?.length;
|
63
|
+
const timeDiff = timeFormat(endTime - startTime);
|
64
|
+
const coreAspectsLinksWithMainAspect = linkResults.coreAspectsLinks || [];
|
65
|
+
if (linkResults.teambitBitLink) {
|
66
|
+
coreAspectsLinksWithMainAspect.unshift(linkResults.teambitBitLink);
|
67
|
+
}
|
68
|
+
const numOfCoreAspects = coreAspectsLinksWithMainAspect.length;
|
69
|
+
|
70
|
+
const title = `Linked ${numOfComponents} components and ${numOfCoreAspects} core aspects to node_modules for workspace: ${this.workspace.name}`;
|
71
|
+
const coreLinks = CoreAspectsLinks({
|
72
|
+
coreAspectsLinks: coreAspectsLinksWithMainAspect,
|
73
|
+
verbose: opts.verbose,
|
74
|
+
});
|
75
|
+
const nonCorePackagesLinks = packageListLinks(linkResults.slotOriginatedLinks);
|
76
|
+
const compsLinks = ComponentListLinks({
|
77
|
+
componentListLinks: linkResults.legacyLinkResults,
|
78
|
+
verbose: opts.verbose,
|
79
|
+
compSummary: opts.compSummary,
|
80
|
+
});
|
81
|
+
const rewireRow = RewireRow({ legacyCodemodResults: linkResults.legacyLinkCodemodResults });
|
82
|
+
const nestedLinks = NestedComponentLinksLinks({
|
83
|
+
nestedDepsInNmLinks: linkResults.nestedDepsInNmLinks,
|
84
|
+
verbose: opts.verbose,
|
85
|
+
});
|
86
|
+
const targetLinks = linkToDir(linkResults.linkToDirResults);
|
87
|
+
const footer = `Finished. ${timeDiff}`;
|
88
|
+
return compact([
|
89
|
+
title,
|
90
|
+
coreLinks,
|
91
|
+
nonCorePackagesLinks,
|
92
|
+
compsLinks,
|
93
|
+
rewireRow,
|
94
|
+
nestedLinks,
|
95
|
+
targetLinks,
|
96
|
+
footer,
|
97
|
+
]).join('\n');
|
98
|
+
}
|
99
|
+
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
101
|
+
async json([ids]: [string[]], opts: LinkCommandOpts): Promise<WorkspaceLinkResults> {
|
102
|
+
this.logger.console(
|
103
|
+
`Linking components and core aspects to node_modules for workspaces: '${chalk.cyan(this.workspace.name)}'`
|
104
|
+
);
|
105
|
+
|
106
|
+
const linkOpts: WorkspaceLinkOptions = {
|
107
|
+
linkToBitRoots: true,
|
108
|
+
rewire: opts.rewire,
|
109
|
+
linkCoreAspects: true,
|
110
|
+
linkTeambitBit: true,
|
111
|
+
linkToDir: opts.target,
|
112
|
+
fetchObject: !opts.skipFetchingObjects,
|
113
|
+
includePeers: opts.peers,
|
114
|
+
};
|
115
|
+
const linkResults = await this.install.link(linkOpts);
|
116
|
+
return linkResults;
|
117
|
+
}
|
118
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import chalk from 'chalk';
|
2
|
+
import type { NestedNMDepsLinksResult } from '@teambit/dependency-resolver';
|
3
|
+
import { VerboseLinkRow } from './link-row';
|
4
|
+
|
5
|
+
type NestedComponentLinksLinksProps = {
|
6
|
+
nestedDepsInNmLinks?: NestedNMDepsLinksResult[];
|
7
|
+
verbose: boolean;
|
8
|
+
};
|
9
|
+
|
10
|
+
export function NestedComponentLinksLinks({ nestedDepsInNmLinks, verbose = false }: NestedComponentLinksLinksProps) {
|
11
|
+
if (!verbose) return '';
|
12
|
+
if (!nestedDepsInNmLinks || !nestedDepsInNmLinks.length) {
|
13
|
+
return '';
|
14
|
+
}
|
15
|
+
const title = chalk.bold.cyan('Nested dependencies links');
|
16
|
+
const links = nestedDepsInNmLinks
|
17
|
+
.map((nestedComponentLinks) =>
|
18
|
+
NestedComponentLinks({
|
19
|
+
nestedComponentLinks,
|
20
|
+
verbose,
|
21
|
+
})
|
22
|
+
)
|
23
|
+
.join('\n');
|
24
|
+
return `${title}\n${links}`;
|
25
|
+
}
|
26
|
+
|
27
|
+
type NestedComponentLinksProps = {
|
28
|
+
nestedComponentLinks: NestedNMDepsLinksResult;
|
29
|
+
verbose: boolean;
|
30
|
+
};
|
31
|
+
function NestedComponentLinks({ nestedComponentLinks, verbose = false }: NestedComponentLinksProps) {
|
32
|
+
if (!nestedComponentLinks.linksDetail || nestedComponentLinks.linksDetail.length < 1) return '';
|
33
|
+
if (verbose) return VerboseNestedComponentLinks({ nestedComponentLinks });
|
34
|
+
return '';
|
35
|
+
}
|
36
|
+
|
37
|
+
type VerboseNestedComponentLinksProps = {
|
38
|
+
nestedComponentLinks: NestedNMDepsLinksResult;
|
39
|
+
};
|
40
|
+
function VerboseNestedComponentLinks({ nestedComponentLinks }: VerboseNestedComponentLinksProps) {
|
41
|
+
const id = nestedComponentLinks.componentId.toString();
|
42
|
+
const title = chalk.cyan.bold(id);
|
43
|
+
const links = nestedComponentLinks.linksDetail
|
44
|
+
.map((link) => VerboseLinkRow({ from: link.from, to: link.to }))
|
45
|
+
.join('\n');
|
46
|
+
return `${title}\n${links}\n`;
|
47
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { CodemodResult } from '@teambit/workspace.modules.node-modules-linker';
|
2
|
+
import chalk from 'chalk';
|
3
|
+
|
4
|
+
type RewireRowProps = {
|
5
|
+
legacyCodemodResults?: CodemodResult[];
|
6
|
+
};
|
7
|
+
export function RewireRow({ legacyCodemodResults }: RewireRowProps) {
|
8
|
+
if (!legacyCodemodResults || legacyCodemodResults.length < 1) return '';
|
9
|
+
const totalComps = legacyCodemodResults?.length;
|
10
|
+
const totalFiles = legacyCodemodResults.reduce((acc, curr) => {
|
11
|
+
return acc + curr.changedFiles.length || 0;
|
12
|
+
}, 0);
|
13
|
+
|
14
|
+
return `rewired ${chalk.cyan(totalComps.toString())} components and total of ${chalk.cyan(
|
15
|
+
totalFiles.toString()
|
16
|
+
)} files`;
|
17
|
+
}
|
package/package.json
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
{
|
2
|
+
"name": "@teambit/install",
|
3
|
+
"version": "0.0.0-038c3ec7ffafaeb6a0ef7e522053a6312c90ac14",
|
4
|
+
"homepage": "https://bit.cloud/teambit/workspace/install",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"componentId": {
|
7
|
+
"scope": "teambit.workspace",
|
8
|
+
"name": "install",
|
9
|
+
"version": "038c3ec7ffafaeb6a0ef7e522053a6312c90ac14"
|
10
|
+
},
|
11
|
+
"dependencies": {
|
12
|
+
"chalk": "4.1.2",
|
13
|
+
"validate-npm-package-name": "6.0.0",
|
14
|
+
"@pnpm/types": "1000.7.0",
|
15
|
+
"fs-extra": "10.0.0",
|
16
|
+
"lodash": "4.17.21",
|
17
|
+
"object-hash": "2.1.1",
|
18
|
+
"p-filter": "2.1.0",
|
19
|
+
"p-map-series": "2.1.0",
|
20
|
+
"yesno": "0.4.0",
|
21
|
+
"@pnpm/colorize-semver-diff": "1.0.1",
|
22
|
+
"@pnpm/semver-diff": "1.1.0",
|
23
|
+
"enquirer": "2.4.1",
|
24
|
+
"table": "6.7.3",
|
25
|
+
"@teambit/harmony": "0.4.7",
|
26
|
+
"@teambit/component-package-version": "0.0.440",
|
27
|
+
"@teambit/workspace.root-components": "1.0.0",
|
28
|
+
"@teambit/bit-error": "0.0.404",
|
29
|
+
"@teambit/toolbox.time.time-format": "0.0.500",
|
30
|
+
"@teambit/cli": "0.0.0-f7e6c20ddf8f0a93ba9777b53b544a2f7863fc4f",
|
31
|
+
"@teambit/dependency-resolver": "0.0.0-3ab533bc6af4b8ca1d9285f280f1a79daf930077",
|
32
|
+
"@teambit/logger": "0.0.0-592a4ef21f4b9d26b18c5e0971686a97b501a0a1",
|
33
|
+
"@teambit/workspace": "0.0.0-c7940a4baf90445edd7e9033b8434f5d80fe038e",
|
34
|
+
"@teambit/application": "0.0.0-a4ec4dde0c75755d46b636ebe6e07c0d0d008bf7",
|
35
|
+
"@teambit/aspect-loader": "0.0.0-e6c7a39eed2b4b4167c095ca99c8eade1484e706",
|
36
|
+
"@teambit/bundler": "0.0.0-e3c8e0b1a136126f68e70f97e32e2e180a75cc48",
|
37
|
+
"@teambit/compiler": "0.0.0-5a109004193c52dce54789d219e4f757eb572db8",
|
38
|
+
"@teambit/component-issues": "0.0.0-f928b2b9aa7154752bf5f8c79c7fc90acdf8a7b4",
|
39
|
+
"@teambit/component.sources": "0.0.0-7b6a4ccce12d2707bc825d62eb48db1fc690f49e",
|
40
|
+
"@teambit/component": "0.0.0-7319855059cc608414b740f0efb15f4e202d010e",
|
41
|
+
"@teambit/dependencies.fs.linked-dependencies": "0.0.0-e2f45997664a1f754e9870404dbab25f55c6785f",
|
42
|
+
"@teambit/envs": "0.0.0-0cf397f83996ed58f4b582655b7b8f4a242a40e0",
|
43
|
+
"@teambit/generator": "0.0.0-03ea6d15c26a7db641da6e5be4f4bdda1c6131fc",
|
44
|
+
"@teambit/ipc-events": "0.0.0-22d084b6cd626336c4491e9400901abaa8107618",
|
45
|
+
"@teambit/issues": "0.0.0-8f3f4eb3d91e6df4515599f4e8095bac15623393",
|
46
|
+
"@teambit/objects": "0.0.0-a87bf9fef6d5e2bf6414bc6cd8dc1063bca5a92e",
|
47
|
+
"@teambit/pkg.modules.component-package-name": "0.0.0-e43c96b7db9e74b67bc14726e92cf92df94375e0",
|
48
|
+
"@teambit/ui": "0.0.0-377341f5a8dcbcde784570d0b38be23e3afe59cc",
|
49
|
+
"@teambit/variants": "0.0.0-55de696c3b255d880f10269900bc125eea70d403",
|
50
|
+
"@teambit/workspace-config-files": "0.0.0-8bf994a9969e8e3331e1f59bddfb302759737392",
|
51
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.0-34ceda903ba6f36ab56e62ae2f308dbdcba21d2d"
|
52
|
+
},
|
53
|
+
"devDependencies": {
|
54
|
+
"@types/fs-extra": "9.0.7",
|
55
|
+
"@types/lodash": "4.14.165",
|
56
|
+
"@types/object-hash": "1.3.4",
|
57
|
+
"strip-ansi": "6.0.0",
|
58
|
+
"@types/mocha": "9.1.0",
|
59
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.72"
|
60
|
+
},
|
61
|
+
"peerDependencies": {
|
62
|
+
"chai": "5.2.1",
|
63
|
+
"@types/chai": "5.2.2"
|
64
|
+
},
|
65
|
+
"license": "Apache-2.0",
|
66
|
+
"optionalDependencies": {},
|
67
|
+
"peerDependenciesMeta": {},
|
68
|
+
"exports": {
|
69
|
+
".": {
|
70
|
+
"node": {
|
71
|
+
"require": "./dist/index.js",
|
72
|
+
"import": "./dist/esm.mjs"
|
73
|
+
},
|
74
|
+
"default": "./dist/index.js"
|
75
|
+
},
|
76
|
+
"./dist/*": "./dist/*",
|
77
|
+
"./artifacts/*": "./artifacts/*",
|
78
|
+
"./*": "./*.ts"
|
79
|
+
},
|
80
|
+
"private": false,
|
81
|
+
"engines": {
|
82
|
+
"node": ">=16.0.0"
|
83
|
+
},
|
84
|
+
"repository": {
|
85
|
+
"type": "git",
|
86
|
+
"url": "https://github.com/teambit/bit"
|
87
|
+
},
|
88
|
+
"keywords": [
|
89
|
+
"bit",
|
90
|
+
"bit-aspect",
|
91
|
+
"bit-core-aspect",
|
92
|
+
"components",
|
93
|
+
"collaboration",
|
94
|
+
"web"
|
95
|
+
]
|
96
|
+
}
|
package/types/asset.d.ts
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
declare module '*.png' {
|
2
|
+
const value: any;
|
3
|
+
export = value;
|
4
|
+
}
|
5
|
+
declare module '*.svg' {
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
7
|
+
|
8
|
+
export const ReactComponent: FunctionComponent<
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
10
|
+
>;
|
11
|
+
const src: string;
|
12
|
+
export default src;
|
13
|
+
}
|
14
|
+
declare module '*.jpg' {
|
15
|
+
const value: any;
|
16
|
+
export = value;
|
17
|
+
}
|
18
|
+
declare module '*.jpeg' {
|
19
|
+
const value: any;
|
20
|
+
export = value;
|
21
|
+
}
|
22
|
+
declare module '*.gif' {
|
23
|
+
const value: any;
|
24
|
+
export = value;
|
25
|
+
}
|
26
|
+
declare module '*.bmp' {
|
27
|
+
const value: any;
|
28
|
+
export = value;
|
29
|
+
}
|
30
|
+
declare module '*.otf' {
|
31
|
+
const value: any;
|
32
|
+
export = value;
|
33
|
+
}
|
34
|
+
declare module '*.woff' {
|
35
|
+
const value: any;
|
36
|
+
export = value;
|
37
|
+
}
|
38
|
+
declare module '*.woff2' {
|
39
|
+
const value: any;
|
40
|
+
export = value;
|
41
|
+
}
|
package/types/style.d.ts
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
declare module '*.module.css' {
|
2
|
+
const classes: { readonly [key: string]: string };
|
3
|
+
export default classes;
|
4
|
+
}
|
5
|
+
declare module '*.module.scss' {
|
6
|
+
const classes: { readonly [key: string]: string };
|
7
|
+
export default classes;
|
8
|
+
}
|
9
|
+
declare module '*.module.sass' {
|
10
|
+
const classes: { readonly [key: string]: string };
|
11
|
+
export default classes;
|
12
|
+
}
|
13
|
+
|
14
|
+
declare module '*.module.less' {
|
15
|
+
const classes: { readonly [key: string]: string };
|
16
|
+
export default classes;
|
17
|
+
}
|
18
|
+
|
19
|
+
declare module '*.less' {
|
20
|
+
const classes: { readonly [key: string]: string };
|
21
|
+
export default classes;
|
22
|
+
}
|
23
|
+
|
24
|
+
declare module '*.css' {
|
25
|
+
const classes: { readonly [key: string]: string };
|
26
|
+
export default classes;
|
27
|
+
}
|
28
|
+
|
29
|
+
declare module '*.sass' {
|
30
|
+
const classes: { readonly [key: string]: string };
|
31
|
+
export default classes;
|
32
|
+
}
|
33
|
+
|
34
|
+
declare module '*.scss' {
|
35
|
+
const classes: { readonly [key: string]: string };
|
36
|
+
export default classes;
|
37
|
+
}
|
38
|
+
|
39
|
+
declare module '*.mdx' {
|
40
|
+
const component: any;
|
41
|
+
export default component;
|
42
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
|
3
|
+
import type { InstallMain } from './install.main.runtime';
|
4
|
+
|
5
|
+
export default class UninstallCmd implements Command {
|
6
|
+
name = 'uninstall [packages...]';
|
7
|
+
description = 'uninstall dependencies';
|
8
|
+
alias = 'un';
|
9
|
+
group = 'dependencies';
|
10
|
+
options = [] as CommandOptions;
|
11
|
+
|
12
|
+
constructor(private install: InstallMain) {}
|
13
|
+
|
14
|
+
async report([packages = []]: [string[]]) {
|
15
|
+
await this.install.uninstallDependencies(packages);
|
16
|
+
return '';
|
17
|
+
}
|
18
|
+
}
|
package/update.cmd.tsx
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
|
3
|
+
import type { InstallMain } from './install.main.runtime';
|
4
|
+
|
5
|
+
type UpdateCmdOptions = {
|
6
|
+
yes?: boolean;
|
7
|
+
patterns?: string[];
|
8
|
+
major?: boolean;
|
9
|
+
minor?: boolean;
|
10
|
+
patch?: boolean;
|
11
|
+
semver?: boolean;
|
12
|
+
};
|
13
|
+
|
14
|
+
export default class UpdateCmd implements Command {
|
15
|
+
name = 'update [package-patterns...]';
|
16
|
+
description = 'update dependencies. By default, dependencies are updated to the highest semver compatible versions.';
|
17
|
+
helpUrl = 'reference/dependencies/configuring-dependencies/#update-dependencies';
|
18
|
+
alias = 'up';
|
19
|
+
group = 'dependencies';
|
20
|
+
arguments = [
|
21
|
+
{
|
22
|
+
name: 'package-patterns...',
|
23
|
+
description:
|
24
|
+
'a string list of package names, or patterns (separated by spaces or commas), e.g. "@teambit/**,@my-org/ui.**". The patterns should be in glob format. By default, all packages are selected.',
|
25
|
+
},
|
26
|
+
];
|
27
|
+
options = [
|
28
|
+
[
|
29
|
+
'y',
|
30
|
+
'yes',
|
31
|
+
'automatically update all outdated versions for packages specified in pattern (all if no pattern supplied) - use carefully as could result in breaking updates for dependencies',
|
32
|
+
],
|
33
|
+
['', 'patch', 'update to the latest patch version. Semver rules are ignored'],
|
34
|
+
['', 'minor', 'update to the latest minor version. Semver rules are ignored'],
|
35
|
+
['', 'major', 'update to the latest major version. Semver rules are ignored'],
|
36
|
+
['', 'semver', 'update to the newest version respecting semver'],
|
37
|
+
] as CommandOptions;
|
38
|
+
|
39
|
+
constructor(private install: InstallMain) {}
|
40
|
+
|
41
|
+
async report([patterns = []]: [string[]], options: UpdateCmdOptions) {
|
42
|
+
let forceVersionBump: 'major' | 'minor' | 'patch' | 'compatible' | undefined;
|
43
|
+
if (options.major) {
|
44
|
+
forceVersionBump = 'major';
|
45
|
+
} else if (options.minor) {
|
46
|
+
forceVersionBump = 'minor';
|
47
|
+
} else if (options.patch) {
|
48
|
+
forceVersionBump = 'patch';
|
49
|
+
} else if (options.semver) {
|
50
|
+
forceVersionBump = 'compatible';
|
51
|
+
}
|
52
|
+
await this.install.updateDependencies({
|
53
|
+
all: options.yes === true,
|
54
|
+
patterns: splitPatterns(patterns),
|
55
|
+
forceVersionBump,
|
56
|
+
});
|
57
|
+
return '';
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
function splitPatterns(patterns: string[]): string[] {
|
62
|
+
const splittedPatterns: string[] = [];
|
63
|
+
for (const pattern of patterns) {
|
64
|
+
splittedPatterns.push(...pattern.split(/[, ]/));
|
65
|
+
}
|
66
|
+
return splittedPatterns;
|
67
|
+
}
|