@teambit/workspace 0.0.648 → 0.0.652
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/{__preview-1644895398222.js → __preview-1645372601675.js} +0 -0
- package/component-config-file/component-config-file.ts +40 -6
- package/dist/capsule.cmd.d.ts +0 -1
- package/dist/capsule.cmd.js +0 -4
- package/dist/capsule.cmd.js.map +1 -1
- package/dist/component-config-file/component-config-file.d.ts +7 -3
- package/dist/component-config-file/component-config-file.js +46 -6
- package/dist/component-config-file/component-config-file.js.map +1 -1
- package/dist/eject-conf.cmd.js +1 -1
- package/dist/eject-conf.cmd.js.map +1 -1
- package/dist/envs-subcommands/envs-replace.cmd.d.ts +11 -0
- package/dist/envs-subcommands/envs-replace.cmd.js +56 -0
- package/dist/envs-subcommands/envs-replace.cmd.js.map +1 -0
- package/dist/envs-subcommands/envs-set.cmd.js +0 -1
- package/dist/envs-subcommands/envs-set.cmd.js.map +1 -1
- package/dist/pattern.cmd.js +2 -2
- package/dist/pattern.cmd.js.map +1 -1
- package/dist/tag-cmd.js +1 -1
- package/dist/tag-cmd.js.map +1 -1
- package/dist/ui/workspace/workspace-model.d.ts +10 -1
- package/dist/ui/workspace/workspace-model.js +25 -3
- package/dist/ui/workspace/workspace-model.js.map +1 -1
- package/dist/workspace.d.ts +11 -3
- package/dist/workspace.js +94 -30
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.provider.js +13 -2
- package/dist/workspace.provider.js.map +1 -1
- package/eject-conf.cmd.tsx +1 -1
- package/envs-subcommands/envs-replace.cmd.ts +21 -0
- package/envs-subcommands/envs-set.cmd.ts +0 -1
- package/package-tar/teambit-workspace-0.0.652.tgz +0 -0
- package/package.json +50 -49
- package/ui/workspace/workspace-model.ts +14 -3
- package/package-tar/teambit-workspace-0.0.648.tgz +0 -0
|
File without changes
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ComponentID, AspectList } from '@teambit/component';
|
|
1
|
+
import { ComponentID, AspectList, AspectEntry, ResolveComponentIdFunc } from '@teambit/component';
|
|
2
2
|
import { COMPONENT_CONFIG_FILE_NAME } from '@teambit/legacy/dist/constants';
|
|
3
|
-
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
|
|
3
|
+
import { ExtensionDataList, configEntryToDataEntry } from '@teambit/legacy/dist/consumer/config/extension-data';
|
|
4
4
|
import { PathOsBasedAbsolute } from '@teambit/legacy/dist/utils/path';
|
|
5
5
|
import detectIndent from 'detect-indent';
|
|
6
6
|
import detectNewline from 'detect-newline';
|
|
7
7
|
import fs from 'fs-extra';
|
|
8
8
|
import path from 'path';
|
|
9
9
|
import stringifyPackage from 'stringify-package';
|
|
10
|
+
import { REMOVE_EXTENSION_SPECIAL_SIGN } from '@teambit/legacy/dist/consumer/config';
|
|
10
11
|
|
|
11
12
|
import { AlreadyExistsError } from './exceptions';
|
|
12
13
|
|
|
@@ -34,12 +35,12 @@ export class ComponentConfigFile {
|
|
|
34
35
|
constructor(
|
|
35
36
|
public componentId: ComponentID,
|
|
36
37
|
public aspects: AspectList,
|
|
38
|
+
private componentDir: PathOsBasedAbsolute,
|
|
37
39
|
public propagate: boolean = false,
|
|
38
40
|
private options: ComponentConfigFileOptions = { indent: DEFAULT_INDENT, newLine: DEFAULT_NEWLINE },
|
|
39
41
|
public defaultScope?: string
|
|
40
42
|
) {}
|
|
41
43
|
|
|
42
|
-
// TODO: remove consumer from here
|
|
43
44
|
static async load(
|
|
44
45
|
componentDir: PathOsBasedAbsolute,
|
|
45
46
|
aspectListFactory: (extensionDataList: ExtensionDataList) => Promise<AspectList>,
|
|
@@ -57,16 +58,23 @@ export class ComponentConfigFile {
|
|
|
57
58
|
const componentId = ComponentID.fromObject(parsed.componentId, parsed.defaultScope || outsideDefaultScope);
|
|
58
59
|
const aspects = await aspectListFactory(ExtensionDataList.fromConfigObject(parsed.extensions));
|
|
59
60
|
|
|
60
|
-
return new ComponentConfigFile(
|
|
61
|
+
return new ComponentConfigFile(
|
|
62
|
+
componentId,
|
|
63
|
+
aspects,
|
|
64
|
+
componentDir,
|
|
65
|
+
Boolean(parsed.propagate),
|
|
66
|
+
{ indent, newLine },
|
|
67
|
+
parsed.defaultScope
|
|
68
|
+
);
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
static composePath(componentRootFolder: string) {
|
|
64
72
|
return path.join(componentRootFolder, COMPONENT_CONFIG_FILE_NAME);
|
|
65
73
|
}
|
|
66
74
|
|
|
67
|
-
async write(
|
|
75
|
+
async write(options: WriteConfigFileOptions = {}): Promise<void> {
|
|
68
76
|
const json = this.toJson();
|
|
69
|
-
const filePath = ComponentConfigFile.composePath(componentDir);
|
|
77
|
+
const filePath = ComponentConfigFile.composePath(this.componentDir);
|
|
70
78
|
const isExist = await fs.pathExists(filePath);
|
|
71
79
|
if (isExist && !options.override) {
|
|
72
80
|
throw new AlreadyExistsError(filePath);
|
|
@@ -74,6 +82,32 @@ export class ComponentConfigFile {
|
|
|
74
82
|
return fs.writeJsonSync(filePath, json, { spaces: this.options.indent, EOL: this.options.newLine });
|
|
75
83
|
}
|
|
76
84
|
|
|
85
|
+
async addAspect(aspectId: string, config: any, resolveComponentId: ResolveComponentIdFunc) {
|
|
86
|
+
const existing = this.aspects.get(aspectId);
|
|
87
|
+
if (existing) {
|
|
88
|
+
existing.config = config;
|
|
89
|
+
} else {
|
|
90
|
+
const aspectEntry = await this.aspectEntryFromConfigObject(aspectId, config, resolveComponentId);
|
|
91
|
+
this.aspects.entries.push(aspectEntry);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async removeAspect(aspectId: string, markWithMinusIfNotExist: boolean, resolveComponentId: ResolveComponentIdFunc) {
|
|
96
|
+
const existing = this.aspects.get(aspectId);
|
|
97
|
+
if (existing) {
|
|
98
|
+
const aspectList = this.aspects.withoutEntries([aspectId]);
|
|
99
|
+
this.aspects = aspectList;
|
|
100
|
+
} else if (markWithMinusIfNotExist) {
|
|
101
|
+
await this.addAspect(aspectId, REMOVE_EXTENSION_SPECIAL_SIGN, resolveComponentId);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private async aspectEntryFromConfigObject(id: string, config: any, resolveComponentId: ResolveComponentIdFunc) {
|
|
106
|
+
const aspectId = await resolveComponentId(id);
|
|
107
|
+
const legacyEntry = configEntryToDataEntry(id, config);
|
|
108
|
+
return new AspectEntry(aspectId, legacyEntry);
|
|
109
|
+
}
|
|
110
|
+
|
|
77
111
|
toJson(): ComponentConfigFileJson {
|
|
78
112
|
return {
|
|
79
113
|
componentId: this.componentId.toObject(),
|
package/dist/capsule.cmd.d.ts
CHANGED
|
@@ -38,7 +38,6 @@ export declare class CapsuleListCmd implements Command {
|
|
|
38
38
|
report(): Promise<string>;
|
|
39
39
|
json(): Promise<{
|
|
40
40
|
workspaceCapsulesRootDir: string;
|
|
41
|
-
scopeCapsulesRootDir: string;
|
|
42
41
|
scopeAspectsCapsulesRootDir: string;
|
|
43
42
|
workspace: string;
|
|
44
43
|
capsules: string[];
|
package/dist/capsule.cmd.js
CHANGED
|
@@ -110,13 +110,11 @@ class CapsuleListCmd {
|
|
|
110
110
|
const list = await this.isolator.list(this.workspace.path);
|
|
111
111
|
const {
|
|
112
112
|
workspaceCapsulesRootDir,
|
|
113
|
-
scopeCapsulesRootDir,
|
|
114
113
|
scopeAspectsCapsulesRootDir
|
|
115
114
|
} = this.getCapsulesRootDirs(); // TODO: improve output
|
|
116
115
|
|
|
117
116
|
return _chalk().default.green(`found ${_chalk().default.cyan(list.capsules.length.toString())} capsule(s) for workspace: ${_chalk().default.cyan(list.workspace)}
|
|
118
117
|
workspace capsules root-dir: ${_chalk().default.cyan(workspaceCapsulesRootDir)}
|
|
119
|
-
scope capsules root-dir: ${_chalk().default.cyan(scopeCapsulesRootDir)}
|
|
120
118
|
scope's aspects capsules root-dir: ${_chalk().default.cyan(scopeAspectsCapsulesRootDir)}
|
|
121
119
|
use --json to get the list of all workspace capsules`);
|
|
122
120
|
}
|
|
@@ -129,11 +127,9 @@ use --json to get the list of all workspace capsules`);
|
|
|
129
127
|
|
|
130
128
|
getCapsulesRootDirs() {
|
|
131
129
|
const workspaceCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.path);
|
|
132
|
-
const scopeCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.scope.path);
|
|
133
130
|
const scopeAspectsCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.scope.getAspectCapsulePath());
|
|
134
131
|
return {
|
|
135
132
|
workspaceCapsulesRootDir,
|
|
136
|
-
scopeCapsulesRootDir,
|
|
137
133
|
scopeAspectsCapsulesRootDir
|
|
138
134
|
};
|
|
139
135
|
}
|
package/dist/capsule.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["capsule.cmd.ts"],"names":["CapsuleCreateCmd","constructor","workspace","isolator","create","componentIds","baseDir","rootBaseDir","alwaysNew","id","installPackages","seedersOnly","Array","isArray","capsuleOptions","installOptions","includeFromNestedHosts","name","ids","resolveMultipleComponentIds","network","isolateComponents","capsules","graphCapsules","report","opts","capsuleOutput","map","capsule","chalk","bold","component","toString","path","join","title","length","green","json","c","CapsuleListCmd","list","workspaceCapsulesRootDir","scopeCapsulesRootDir","scopeAspectsCapsulesRootDir","getCapsulesRootDirs","cyan","rootDirs","getCapsulesRootDir","scope","getAspectCapsulePath","CapsuleDeleteCmd","args","all","scopeAspects","capsuleBaseDirToDelete","capsuleBaseDir","deletedDir","deleteCapsules","CapsuleCmd"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAaO,MAAMA,gBAAN,CAA0C;AAoB/CC,EAAAA,WAAW,CAASC,SAAT,EAAuCC,QAAvC,EAA+D;AAAA,SAAtDD,SAAsD,GAAtDA,SAAsD;AAAA,SAAxBC,QAAwB,GAAxBA,QAAwB;AAAA,kDAnBnE,0BAm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DAClC,uBADkC;AAAA,8DAEtB,iBAFsB;AAAA,yDAG1B;AACjB;AACA;AACA;AACA,6CAP2C;AAAA,mDAQjC,EARiC;AAAA,mDASjC,UATiC;AAAA,sDAUnB,EAVmB;AAAA,qDAW/B,EAX+B;AAAA;;AAazC;AACY,QAANnC,MAAM,CAAC4B,IAAD,EAAiB;AAC3B;AACA,WAAQ,8BAAR;AACD;;AAjBwC","sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { CapsuleList, IsolateComponentsOptions, IsolatorMain } from '@teambit/isolator';\nimport chalk from 'chalk';\n\nimport { Workspace } from '.';\n\ntype CreateOpts = {\n baseDir?: string;\n rootBaseDir?: string;\n alwaysNew?: boolean;\n seedersOnly?: boolean;\n id: string;\n installPackages?: boolean;\n};\n\nexport class CapsuleCreateCmd implements Command {\n name = 'create [componentIds...]';\n description = `create capsules`;\n group = 'capsules';\n alias = '';\n options = [\n [\n 'b',\n 'base-dir <name>',\n 'set base dir of all capsules (hashed to create the base dir inside the root dir - host path by default)',\n ],\n ['r', 'root-base-dir <name>', 'set root base dir of all capsules (absolute path to use as root dir)'],\n ['a', 'always-new', 'create new environment for capsule'],\n ['s', 'seeders-only', 'create capsules for the seeders only (not for the entire graph)'],\n ['i', 'id <name>', 'reuse capsule of certain name'],\n ['j', 'json', 'json format'],\n ['d', 'install-packages', 'install packages by the package-manager'],\n ['p', 'package-manager <name>', 'npm, yarn or pnpm, default to npm'],\n ] as CommandOptions;\n\n constructor(private workspace: Workspace, private isolator: IsolatorMain) {}\n\n async create(\n [componentIds = []]: [string[]],\n { baseDir, rootBaseDir, alwaysNew = false, id, installPackages = false, seedersOnly = false }: CreateOpts\n ): Promise<CapsuleList> {\n // @todo: why it is not an array?\n if (componentIds && !Array.isArray(componentIds)) componentIds = [componentIds];\n const capsuleOptions: IsolateComponentsOptions = {\n baseDir,\n rootBaseDir,\n installOptions: { installPackages },\n alwaysNew,\n seedersOnly,\n includeFromNestedHosts: true,\n name: id,\n };\n const ids = await this.workspace.resolveMultipleComponentIds(componentIds);\n const network = await this.isolator.isolateComponents(ids, capsuleOptions);\n const capsules = network.graphCapsules;\n return capsules;\n }\n\n async report([componentIds]: [string[]], opts: CreateOpts) {\n // @ts-ignore\n const capsules = await this.create(componentIds, opts);\n const capsuleOutput = capsules\n .map((capsule) => `${chalk.bold(capsule.component.id.toString())} - ${capsule.path}`)\n .join('\\n');\n const title = `${capsules.length} capsule(s) were created successfully`;\n return `${chalk.green(title)}\\n${capsuleOutput}`;\n }\n\n async json([componentIds]: [string[]], opts: CreateOpts) {\n // @ts-ignore\n const capsules = await this.create(componentIds, opts);\n return capsules.map((c) => ({\n id: c.component.id.toString(),\n path: c.path,\n }));\n }\n}\n\nexport class CapsuleListCmd implements Command {\n name = 'list';\n description = `list all capsules`;\n shortDescription = 'list all capsules';\n group = 'capsules';\n alias = '';\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(private isolator: IsolatorMain, private workspace: Workspace) {}\n\n async report() {\n const list = await this.isolator.list(this.workspace.path);\n const { workspaceCapsulesRootDir, scopeCapsulesRootDir, scopeAspectsCapsulesRootDir } = this.getCapsulesRootDirs();\n // TODO: improve output\n return chalk.green(`found ${chalk.cyan(list.capsules.length.toString())} capsule(s) for workspace: ${chalk.cyan(\n list.workspace\n )}\nworkspace capsules root-dir: ${chalk.cyan(workspaceCapsulesRootDir)}\nscope capsules root-dir: ${chalk.cyan(scopeCapsulesRootDir)}\nscope's aspects capsules root-dir: ${chalk.cyan(scopeAspectsCapsulesRootDir)}\nuse --json to get the list of all workspace capsules`);\n }\n\n async json() {\n const list = await this.isolator.list(this.workspace.path);\n const rootDirs = this.getCapsulesRootDirs();\n return { ...list, ...rootDirs };\n }\n\n private getCapsulesRootDirs() {\n const workspaceCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.path);\n const scopeCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.scope.path);\n const scopeAspectsCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.scope.getAspectCapsulePath());\n\n return { workspaceCapsulesRootDir, scopeCapsulesRootDir, scopeAspectsCapsulesRootDir };\n }\n}\n\nexport class CapsuleDeleteCmd implements Command {\n name = 'delete';\n description = `delete capsules. with no args, only workspace's capsules are deleted`;\n shortDescription = `delete capsules`;\n group = 'capsules';\n alias = '';\n options = [\n ['', 'scope-aspects', 'delete scope-aspects capsules'],\n ['a', 'all', 'delete all capsules for all workspaces and scopes'],\n ] as CommandOptions;\n\n constructor(private isolator: IsolatorMain, private workspace: Workspace) {}\n\n async report(args: [], { all, scopeAspects }: { all: boolean; scopeAspects: boolean }) {\n const capsuleBaseDirToDelete = (): string | null => {\n if (all) return null;\n if (scopeAspects) return this.workspace.scope.getAspectCapsulePath();\n return this.workspace.path;\n };\n const capsuleBaseDir = capsuleBaseDirToDelete();\n const deletedDir = await this.isolator.deleteCapsules(capsuleBaseDir);\n return chalk.green(`the following capsules dir has been deleted ${chalk.bold(deletedDir)}`);\n }\n}\n\nexport class CapsuleCmd implements Command {\n name = 'capsule <sub-command>';\n shortDescription = 'manage capsules';\n description = `manage capsules.\na capsule is a directory contains the component code, isolated from the workspace.\nnormally, capsules are created during the build process, the component files are copied and the packages are installed\nvia the configured package-manager. the purpose is to compile/test them in isolation to make sure they will work for\nother users after publishing/exporting them.`;\n alias = '';\n group = 'capsules';\n commands: Command[] = [];\n options = [] as CommandOptions;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [string]) {\n // it should never be here. Yargs throws an error before reaching this method.\n return `Please specify a sub-command`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["capsule.cmd.ts"],"names":["CapsuleCreateCmd","constructor","workspace","isolator","create","componentIds","baseDir","rootBaseDir","alwaysNew","id","installPackages","seedersOnly","Array","isArray","capsuleOptions","installOptions","includeFromNestedHosts","name","ids","resolveMultipleComponentIds","network","isolateComponents","capsules","graphCapsules","report","opts","capsuleOutput","map","capsule","chalk","bold","component","toString","path","join","title","length","green","json","c","CapsuleListCmd","list","workspaceCapsulesRootDir","scopeAspectsCapsulesRootDir","getCapsulesRootDirs","cyan","rootDirs","getCapsulesRootDir","scope","getAspectCapsulePath","CapsuleDeleteCmd","args","all","scopeAspects","capsuleBaseDirToDelete","capsuleBaseDir","deletedDir","deleteCapsules","CapsuleCmd"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAaO,MAAMA,gBAAN,CAA0C;AAoB/CC,EAAAA,WAAW,CAASC,SAAT,EAAuCC,QAAvC,EAA+D;AAAA,SAAtDD,SAAsD,GAAtDA,SAAsD;AAAA,SAAxBC,QAAwB,GAAxBA,QAAwB;AAAA,kDAnBnE,0BAmBmE;AAAA,yDAlB3D,iBAkB2D;AAAA,mDAjBlE,UAiBkE;AAAA,mDAhBlE,EAgBkE;AAAA,qDAfhE,CACR,CACE,GADF,EAEE,iBAFF,EAGE,yGAHF,CADQ,EAMR,CAAC,GAAD,EAAM,sBAAN,EAA8B,sEAA9B,CANQ,EAOR,CAAC,GAAD,EAAM,YAAN,EAAoB,oCAApB,CAPQ,EAQR,CAAC,GAAD,EAAM,cAAN,EAAsB,iEAAtB,CARQ,EASR,CAAC,GAAD,EAAM,WAAN,EAAmB,+BAAnB,CATQ,EAUR,CAAC,GAAD,EAAM,MAAN,EAAc,aAAd,CAVQ,EAWR,CAAC,GAAD,EAAM,kBAAN,EAA0B,yCAA1B,CAXQ,EAYR,CAAC,GAAD,EAAM,wBAAN,EAAgC,mCAAhC,CAZQ,CAegE;AAAE;;AAEhE,QAANC,MAAM,CACV,CAACC,YAAY,GAAG,EAAhB,CADU,EAEV;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,WAAX;AAAwBC,IAAAA,SAAS,GAAG,KAApC;AAA2CC,IAAAA,EAA3C;AAA+CC,IAAAA,eAAe,GAAG,KAAjE;AAAwEC,IAAAA,WAAW,GAAG;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AAKA,UAAMsB,cAAc,GAAGD,sBAAsB,EAA7C;AACA,UAAME,UAAU,GAAG,MAAM,KAAKrD,QAAL,CAAcsD,cAAd,CAA6BF,cAA7B,CAAzB;AACA,WAAO1B,iBAAMQ,KAAN,CAAa,+CAA8CR,iBAAMC,IAAN,CAAW0B,UAAX,CAAuB,EAAlF,CAAP;AACD;;AAtB8C;;;;AAyB1C,MAAME,UAAN,CAAoC;AAAA;AAAA,kDAClC,uBADkC;AAAA,8DAEtB,iBAFsB;AAAA,yDAG1B;AACjB;AACA;AACA;AACA,6CAP2C;AAAA,mDAQjC,EARiC;AAAA,mDASjC,UATiC;AAAA,sDAUnB,EAVmB;AAAA,qDAW/B,EAX+B;AAAA;;AAazC;AACY,QAANlC,MAAM,CAAC2B,IAAD,EAAiB;AAC3B;AACA,WAAQ,8BAAR;AACD;;AAjBwC","sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { CapsuleList, IsolateComponentsOptions, IsolatorMain } from '@teambit/isolator';\nimport chalk from 'chalk';\n\nimport { Workspace } from '.';\n\ntype CreateOpts = {\n baseDir?: string;\n rootBaseDir?: string;\n alwaysNew?: boolean;\n seedersOnly?: boolean;\n id: string;\n installPackages?: boolean;\n};\n\nexport class CapsuleCreateCmd implements Command {\n name = 'create [componentIds...]';\n description = `create capsules`;\n group = 'capsules';\n alias = '';\n options = [\n [\n 'b',\n 'base-dir <name>',\n 'set base dir of all capsules (hashed to create the base dir inside the root dir - host path by default)',\n ],\n ['r', 'root-base-dir <name>', 'set root base dir of all capsules (absolute path to use as root dir)'],\n ['a', 'always-new', 'create new environment for capsule'],\n ['s', 'seeders-only', 'create capsules for the seeders only (not for the entire graph)'],\n ['i', 'id <name>', 'reuse capsule of certain name'],\n ['j', 'json', 'json format'],\n ['d', 'install-packages', 'install packages by the package-manager'],\n ['p', 'package-manager <name>', 'npm, yarn or pnpm, default to npm'],\n ] as CommandOptions;\n\n constructor(private workspace: Workspace, private isolator: IsolatorMain) {}\n\n async create(\n [componentIds = []]: [string[]],\n { baseDir, rootBaseDir, alwaysNew = false, id, installPackages = false, seedersOnly = false }: CreateOpts\n ): Promise<CapsuleList> {\n // @todo: why it is not an array?\n if (componentIds && !Array.isArray(componentIds)) componentIds = [componentIds];\n const capsuleOptions: IsolateComponentsOptions = {\n baseDir,\n rootBaseDir,\n installOptions: { installPackages },\n alwaysNew,\n seedersOnly,\n includeFromNestedHosts: true,\n name: id,\n };\n const ids = await this.workspace.resolveMultipleComponentIds(componentIds);\n const network = await this.isolator.isolateComponents(ids, capsuleOptions);\n const capsules = network.graphCapsules;\n return capsules;\n }\n\n async report([componentIds]: [string[]], opts: CreateOpts) {\n // @ts-ignore\n const capsules = await this.create(componentIds, opts);\n const capsuleOutput = capsules\n .map((capsule) => `${chalk.bold(capsule.component.id.toString())} - ${capsule.path}`)\n .join('\\n');\n const title = `${capsules.length} capsule(s) were created successfully`;\n return `${chalk.green(title)}\\n${capsuleOutput}`;\n }\n\n async json([componentIds]: [string[]], opts: CreateOpts) {\n // @ts-ignore\n const capsules = await this.create(componentIds, opts);\n return capsules.map((c) => ({\n id: c.component.id.toString(),\n path: c.path,\n }));\n }\n}\n\nexport class CapsuleListCmd implements Command {\n name = 'list';\n description = `list all capsules`;\n shortDescription = 'list all capsules';\n group = 'capsules';\n alias = '';\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(private isolator: IsolatorMain, private workspace: Workspace) {}\n\n async report() {\n const list = await this.isolator.list(this.workspace.path);\n const { workspaceCapsulesRootDir, scopeAspectsCapsulesRootDir } = this.getCapsulesRootDirs();\n // TODO: improve output\n return chalk.green(`found ${chalk.cyan(list.capsules.length.toString())} capsule(s) for workspace: ${chalk.cyan(\n list.workspace\n )}\nworkspace capsules root-dir: ${chalk.cyan(workspaceCapsulesRootDir)}\nscope's aspects capsules root-dir: ${chalk.cyan(scopeAspectsCapsulesRootDir)}\nuse --json to get the list of all workspace capsules`);\n }\n\n async json() {\n const list = await this.isolator.list(this.workspace.path);\n const rootDirs = this.getCapsulesRootDirs();\n return { ...list, ...rootDirs };\n }\n\n private getCapsulesRootDirs() {\n const workspaceCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.path);\n const scopeAspectsCapsulesRootDir = this.isolator.getCapsulesRootDir(this.workspace.scope.getAspectCapsulePath());\n\n return { workspaceCapsulesRootDir, scopeAspectsCapsulesRootDir };\n }\n}\n\nexport class CapsuleDeleteCmd implements Command {\n name = 'delete';\n description = `delete capsules. with no args, only workspace's capsules are deleted`;\n shortDescription = `delete capsules`;\n group = 'capsules';\n alias = '';\n options = [\n ['', 'scope-aspects', 'delete scope-aspects capsules'],\n ['a', 'all', 'delete all capsules for all workspaces and scopes'],\n ] as CommandOptions;\n\n constructor(private isolator: IsolatorMain, private workspace: Workspace) {}\n\n async report(args: [], { all, scopeAspects }: { all: boolean; scopeAspects: boolean }) {\n const capsuleBaseDirToDelete = (): string | null => {\n if (all) return null;\n if (scopeAspects) return this.workspace.scope.getAspectCapsulePath();\n return this.workspace.path;\n };\n const capsuleBaseDir = capsuleBaseDirToDelete();\n const deletedDir = await this.isolator.deleteCapsules(capsuleBaseDir);\n return chalk.green(`the following capsules dir has been deleted ${chalk.bold(deletedDir)}`);\n }\n}\n\nexport class CapsuleCmd implements Command {\n name = 'capsule <sub-command>';\n shortDescription = 'manage capsules';\n description = `manage capsules.\na capsule is a directory contains the component code, isolated from the workspace.\nnormally, capsules are created during the build process, the component files are copied and the packages are installed\nvia the configured package-manager. the purpose is to compile/test them in isolation to make sure they will work for\nother users after publishing/exporting them.`;\n alias = '';\n group = 'capsules';\n commands: Command[] = [];\n options = [] as CommandOptions;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [string]) {\n // it should never be here. Yargs throws an error before reaching this method.\n return `Please specify a sub-command`;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentID, AspectList } from '@teambit/component';
|
|
1
|
+
import { ComponentID, AspectList, ResolveComponentIdFunc } from '@teambit/component';
|
|
2
2
|
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
|
|
3
3
|
import { PathOsBasedAbsolute } from '@teambit/legacy/dist/utils/path';
|
|
4
4
|
interface ComponentConfigFileOptions {
|
|
@@ -17,13 +17,17 @@ interface ComponentConfigFileJson {
|
|
|
17
17
|
export declare class ComponentConfigFile {
|
|
18
18
|
componentId: ComponentID;
|
|
19
19
|
aspects: AspectList;
|
|
20
|
+
private componentDir;
|
|
20
21
|
propagate: boolean;
|
|
21
22
|
private options;
|
|
22
23
|
defaultScope?: string | undefined;
|
|
23
|
-
constructor(componentId: ComponentID, aspects: AspectList, propagate?: boolean, options?: ComponentConfigFileOptions, defaultScope?: string | undefined);
|
|
24
|
+
constructor(componentId: ComponentID, aspects: AspectList, componentDir: PathOsBasedAbsolute, propagate?: boolean, options?: ComponentConfigFileOptions, defaultScope?: string | undefined);
|
|
24
25
|
static load(componentDir: PathOsBasedAbsolute, aspectListFactory: (extensionDataList: ExtensionDataList) => Promise<AspectList>, outsideDefaultScope?: string): Promise<ComponentConfigFile | undefined>;
|
|
25
26
|
static composePath(componentRootFolder: string): string;
|
|
26
|
-
write(
|
|
27
|
+
write(options?: WriteConfigFileOptions): Promise<void>;
|
|
28
|
+
addAspect(aspectId: string, config: any, resolveComponentId: ResolveComponentIdFunc): Promise<void>;
|
|
29
|
+
removeAspect(aspectId: string, markWithMinusIfNotExist: boolean, resolveComponentId: ResolveComponentIdFunc): Promise<void>;
|
|
30
|
+
private aspectEntryFromConfigObject;
|
|
27
31
|
toJson(): ComponentConfigFileJson;
|
|
28
32
|
toString(): string;
|
|
29
33
|
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
|
|
5
7
|
require("core-js/modules/es.promise.js");
|
|
6
8
|
|
|
7
9
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -89,6 +91,16 @@ function _stringifyPackage() {
|
|
|
89
91
|
return data;
|
|
90
92
|
}
|
|
91
93
|
|
|
94
|
+
function _config() {
|
|
95
|
+
const data = require("@teambit/legacy/dist/consumer/config");
|
|
96
|
+
|
|
97
|
+
_config = function () {
|
|
98
|
+
return data;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
return data;
|
|
102
|
+
}
|
|
103
|
+
|
|
92
104
|
function _exceptions() {
|
|
93
105
|
const data = require("./exceptions");
|
|
94
106
|
|
|
@@ -103,17 +115,17 @@ const DEFAULT_INDENT = 2;
|
|
|
103
115
|
const DEFAULT_NEWLINE = '\n';
|
|
104
116
|
|
|
105
117
|
class ComponentConfigFile {
|
|
106
|
-
constructor(componentId, aspects, propagate = false, options = {
|
|
118
|
+
constructor(componentId, aspects, componentDir, propagate = false, options = {
|
|
107
119
|
indent: DEFAULT_INDENT,
|
|
108
120
|
newLine: DEFAULT_NEWLINE
|
|
109
121
|
}, defaultScope) {
|
|
110
122
|
this.componentId = componentId;
|
|
111
123
|
this.aspects = aspects;
|
|
124
|
+
this.componentDir = componentDir;
|
|
112
125
|
this.propagate = propagate;
|
|
113
126
|
this.options = options;
|
|
114
127
|
this.defaultScope = defaultScope;
|
|
115
|
-
}
|
|
116
|
-
|
|
128
|
+
}
|
|
117
129
|
|
|
118
130
|
static async load(componentDir, aspectListFactory, outsideDefaultScope) {
|
|
119
131
|
const filePath = ComponentConfigFile.composePath(componentDir);
|
|
@@ -131,7 +143,7 @@ class ComponentConfigFile {
|
|
|
131
143
|
const componentId = _component().ComponentID.fromObject(parsed.componentId, parsed.defaultScope || outsideDefaultScope);
|
|
132
144
|
|
|
133
145
|
const aspects = await aspectListFactory(_extensionData().ExtensionDataList.fromConfigObject(parsed.extensions));
|
|
134
|
-
return new ComponentConfigFile(componentId, aspects,
|
|
146
|
+
return new ComponentConfigFile(componentId, aspects, componentDir, Boolean(parsed.propagate), {
|
|
135
147
|
indent,
|
|
136
148
|
newLine
|
|
137
149
|
}, parsed.defaultScope);
|
|
@@ -141,9 +153,9 @@ class ComponentConfigFile {
|
|
|
141
153
|
return _path().default.join(componentRootFolder, _constants().COMPONENT_CONFIG_FILE_NAME);
|
|
142
154
|
}
|
|
143
155
|
|
|
144
|
-
async write(
|
|
156
|
+
async write(options = {}) {
|
|
145
157
|
const json = this.toJson();
|
|
146
|
-
const filePath = ComponentConfigFile.composePath(componentDir);
|
|
158
|
+
const filePath = ComponentConfigFile.composePath(this.componentDir);
|
|
147
159
|
const isExist = await _fsExtra().default.pathExists(filePath);
|
|
148
160
|
|
|
149
161
|
if (isExist && !options.override) {
|
|
@@ -156,6 +168,34 @@ class ComponentConfigFile {
|
|
|
156
168
|
});
|
|
157
169
|
}
|
|
158
170
|
|
|
171
|
+
async addAspect(aspectId, config, resolveComponentId) {
|
|
172
|
+
const existing = this.aspects.get(aspectId);
|
|
173
|
+
|
|
174
|
+
if (existing) {
|
|
175
|
+
existing.config = config;
|
|
176
|
+
} else {
|
|
177
|
+
const aspectEntry = await this.aspectEntryFromConfigObject(aspectId, config, resolveComponentId);
|
|
178
|
+
this.aspects.entries.push(aspectEntry);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async removeAspect(aspectId, markWithMinusIfNotExist, resolveComponentId) {
|
|
183
|
+
const existing = this.aspects.get(aspectId);
|
|
184
|
+
|
|
185
|
+
if (existing) {
|
|
186
|
+
const aspectList = this.aspects.withoutEntries([aspectId]);
|
|
187
|
+
this.aspects = aspectList;
|
|
188
|
+
} else if (markWithMinusIfNotExist) {
|
|
189
|
+
await this.addAspect(aspectId, _config().REMOVE_EXTENSION_SPECIAL_SIGN, resolveComponentId);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async aspectEntryFromConfigObject(id, config, resolveComponentId) {
|
|
194
|
+
const aspectId = await resolveComponentId(id);
|
|
195
|
+
const legacyEntry = (0, _extensionData().configEntryToDataEntry)(id, config);
|
|
196
|
+
return new (_component().AspectEntry)(aspectId, legacyEntry);
|
|
197
|
+
}
|
|
198
|
+
|
|
159
199
|
toJson() {
|
|
160
200
|
return {
|
|
161
201
|
componentId: this.componentId.toObject(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["component-config-file.ts"],"names":["DEFAULT_INDENT","DEFAULT_NEWLINE","ComponentConfigFile","constructor","componentId","aspects","propagate","options","indent","newLine","defaultScope","load","
|
|
1
|
+
{"version":3,"sources":["component-config-file.ts"],"names":["DEFAULT_INDENT","DEFAULT_NEWLINE","ComponentConfigFile","constructor","componentId","aspects","componentDir","propagate","options","indent","newLine","defaultScope","load","aspectListFactory","outsideDefaultScope","filePath","composePath","isExist","fs","pathExists","undefined","content","readFile","parsed","parseComponentJsonContent","amount","ComponentID","fromObject","ExtensionDataList","fromConfigObject","extensions","Boolean","componentRootFolder","path","join","COMPONENT_CONFIG_FILE_NAME","write","json","toJson","override","AlreadyExistsError","writeJsonSync","spaces","EOL","addAspect","aspectId","config","resolveComponentId","existing","get","aspectEntry","aspectEntryFromConfigObject","entries","push","removeAspect","markWithMinusIfNotExist","aspectList","withoutEntries","REMOVE_EXTENSION_SPECIAL_SIGN","id","legacyEntry","AspectEntry","toObject","toConfigObject","toString","str","dir","JSON","parse","err","Error","message"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA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AAL,CAAaC,MAApC,EAA4C,KAAKD,OAAL,CAAaE,OAAzD,CAAP;AACD;;AAzF8B;;;;AA4FjC,SAASc,yBAAT,CAAmCyC,GAAnC,EAAgDC,GAAhD,EAA6D;AAC3D,MAAI;AACF,WAAOC,IAAI,CAACC,KAAL,CAAWH,GAAX,CAAP;AACD,GAFD,CAEE,OAAOI,GAAP,EAAiB;AACjB,UAAM,IAAIC,KAAJ,CAAW,yCAAwCJ,GAAI,qBAAoBG,GAAG,CAACE,OAAQ,EAAvF,CAAN;AACD;AACF","sourcesContent":["import { ComponentID, AspectList, AspectEntry, ResolveComponentIdFunc } from '@teambit/component';\nimport { COMPONENT_CONFIG_FILE_NAME } from '@teambit/legacy/dist/constants';\nimport { ExtensionDataList, configEntryToDataEntry } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { PathOsBasedAbsolute } from '@teambit/legacy/dist/utils/path';\nimport detectIndent from 'detect-indent';\nimport detectNewline from 'detect-newline';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport stringifyPackage from 'stringify-package';\nimport { REMOVE_EXTENSION_SPECIAL_SIGN } from '@teambit/legacy/dist/consumer/config';\n\nimport { AlreadyExistsError } from './exceptions';\n\ninterface ComponentConfigFileOptions {\n indent: number;\n newLine: '\\r\\n' | '\\n' | undefined;\n}\n\ninterface WriteConfigFileOptions {\n override?: boolean;\n}\n\ninterface ComponentConfigFileJson {\n componentId: any;\n // TODO: think if we want to change it to aspects\n extensions: any;\n propagate: boolean;\n defaultScope?: string;\n}\n\nconst DEFAULT_INDENT = 2;\nconst DEFAULT_NEWLINE = '\\n';\n\nexport class ComponentConfigFile {\n constructor(\n public componentId: ComponentID,\n public aspects: AspectList,\n private componentDir: PathOsBasedAbsolute,\n public propagate: boolean = false,\n private options: ComponentConfigFileOptions = { indent: DEFAULT_INDENT, newLine: DEFAULT_NEWLINE },\n public defaultScope?: string\n ) {}\n\n static async load(\n componentDir: PathOsBasedAbsolute,\n aspectListFactory: (extensionDataList: ExtensionDataList) => Promise<AspectList>,\n outsideDefaultScope?: string\n ): Promise<ComponentConfigFile | undefined> {\n const filePath = ComponentConfigFile.composePath(componentDir);\n const isExist = await fs.pathExists(filePath);\n if (!isExist) {\n return undefined;\n }\n const content = await fs.readFile(filePath, 'utf-8');\n const parsed: ComponentConfigFileJson = parseComponentJsonContent(content, componentDir);\n const indent = detectIndent(content).amount;\n const newLine = detectNewline(content);\n const componentId = ComponentID.fromObject(parsed.componentId, parsed.defaultScope || outsideDefaultScope);\n const aspects = await aspectListFactory(ExtensionDataList.fromConfigObject(parsed.extensions));\n\n return new ComponentConfigFile(\n componentId,\n aspects,\n componentDir,\n Boolean(parsed.propagate),\n { indent, newLine },\n parsed.defaultScope\n );\n }\n\n static composePath(componentRootFolder: string) {\n return path.join(componentRootFolder, COMPONENT_CONFIG_FILE_NAME);\n }\n\n async write(options: WriteConfigFileOptions = {}): Promise<void> {\n const json = this.toJson();\n const filePath = ComponentConfigFile.composePath(this.componentDir);\n const isExist = await fs.pathExists(filePath);\n if (isExist && !options.override) {\n throw new AlreadyExistsError(filePath);\n }\n return fs.writeJsonSync(filePath, json, { spaces: this.options.indent, EOL: this.options.newLine });\n }\n\n async addAspect(aspectId: string, config: any, resolveComponentId: ResolveComponentIdFunc) {\n const existing = this.aspects.get(aspectId);\n if (existing) {\n existing.config = config;\n } else {\n const aspectEntry = await this.aspectEntryFromConfigObject(aspectId, config, resolveComponentId);\n this.aspects.entries.push(aspectEntry);\n }\n }\n\n async removeAspect(aspectId: string, markWithMinusIfNotExist: boolean, resolveComponentId: ResolveComponentIdFunc) {\n const existing = this.aspects.get(aspectId);\n if (existing) {\n const aspectList = this.aspects.withoutEntries([aspectId]);\n this.aspects = aspectList;\n } else if (markWithMinusIfNotExist) {\n await this.addAspect(aspectId, REMOVE_EXTENSION_SPECIAL_SIGN, resolveComponentId);\n }\n }\n\n private async aspectEntryFromConfigObject(id: string, config: any, resolveComponentId: ResolveComponentIdFunc) {\n const aspectId = await resolveComponentId(id);\n const legacyEntry = configEntryToDataEntry(id, config);\n return new AspectEntry(aspectId, legacyEntry);\n }\n\n toJson(): ComponentConfigFileJson {\n return {\n componentId: this.componentId.toObject(),\n propagate: this.propagate,\n defaultScope: this.defaultScope,\n extensions: this.aspects.toConfigObject(),\n };\n }\n\n toString(): string {\n const json = this.toJson();\n return stringifyPackage(json, this.options.indent, this.options.newLine);\n }\n}\n\nfunction parseComponentJsonContent(str: string, dir: string) {\n try {\n return JSON.parse(str);\n } catch (err: any) {\n throw new Error(`failed parsing component.json file at ${dir}. original error: ${err.message}`);\n }\n}\n"]}
|
package/dist/eject-conf.cmd.js
CHANGED
|
@@ -68,7 +68,7 @@ class EjectConfCmd {
|
|
|
68
68
|
const ejectResult = await this.json(args, options);
|
|
69
69
|
const [componentId] = args;
|
|
70
70
|
return /*#__PURE__*/_react().default.createElement(_ink().Text, {
|
|
71
|
-
color: "
|
|
71
|
+
color: "green"
|
|
72
72
|
}, "successfully ejected config for component ", componentId, " in path ", ejectResult.configPath);
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["eject-conf.cmd.tsx"],"names":["EjectConfCmd","constructor","workspace","render","args","options","ejectResult","json","componentId","configPath","report","chalk","bold","green","ejectOptions","propagate","override","id","resolveComponentId","results","ejectConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAWe,MAAMA,YAAN,CAAsC;AAWnDC,EAAAA,WAAW,CAASC,SAAT,EAA+B;AAAA,SAAtBA,SAAsB,GAAtBA,SAAsB;AAAA,kDAVnC,iBAUmC;AAAA,yDAT5B,mCAS4B;AAAA,mDARlC,EAQkC;AAAA,mDAPlC,aAOkC;AAAA,8DANvB,qFAMuB;AAAA,qDALhC,CACR,CAAC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":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { Text } from 'ink';\nimport React from 'react';\n\nimport { EjectConfOptions, EjectConfResult, Workspace } from './workspace';\n\ntype EjectConfArgs = [string];\n// From the cli we might get those as string in case we run it like --propagate true (return string) as opposed to only --propagate\ntype EjectConfOptionsCLI = {\n propagate: string | boolean | undefined;\n override: string | boolean | undefined;\n};\n\nexport default class EjectConfCmd implements Command {\n name = 'eject-conf [id]';\n description = 'ejecting components configuration';\n alias = '';\n group = 'development';\n shortDescription = 'eject the target component configuration file (e.g. create a `component.json` file)';\n options = [\n ['p', 'propagate', 'mark propagate true in the config file'],\n ['o', 'override', 'override file if exist'],\n ] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n // TODO: remove this ts-ignore\n // @ts-ignore\n async render(args: EjectConfArgs, options: EjectConfOptionsCLI) {\n const ejectResult = await this.json(args, options);\n const [componentId] = args;\n return (\n <Text color=\"
|
|
1
|
+
{"version":3,"sources":["eject-conf.cmd.tsx"],"names":["EjectConfCmd","constructor","workspace","render","args","options","ejectResult","json","componentId","configPath","report","chalk","bold","green","ejectOptions","propagate","override","id","resolveComponentId","results","ejectConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAWe,MAAMA,YAAN,CAAsC;AAWnDC,EAAAA,WAAW,CAASC,SAAT,EAA+B;AAAA,SAAtBA,SAAsB,GAAtBA,SAAsB;AAAA,kDAVnC,iBAUmC;AAAA,yDAT5B,mCAS4B;AAAA,mDARlC,EAQkC;AAAA,mDAPlC,aAOkC;AAAA,8DANvB,qFAMuB;AAAA,qDALhC,CACR,CAAC,GAAD,EAAM,WAAN,EAAmB,wCAAnB,CADQ,EAER,CAAC,GAAD,EAAM,UAAN,EAAkB,wBAAlB,CAFQ,CAKgC;AAAE,GAXO,CAanD;AACA;;;AACY,QAANC,MAAM,CAACC,IAAD,EAAsBC,OAAtB,EAAoD;AAC9D,UAAMC,WAAW,GAAG,MAAM,KAAKC,IAAL,CAAUH,IAAV,EAAgBC,OAAhB,CAA1B;AACA,UAAM,CAACG,WAAD,IAAgBJ,IAAtB;AACA,wBACE,+BAAC,WAAD;AAAM,MAAA,KAAK,EAAC;AAAZ,qDAC6CI,WAD7C,eACmEF,WAAW,CAACG,UAD/E,CADF;AAKD;;AAEW,QAANC,MAAM,CAACN,IAAD,EAAsBC,OAAtB,EAAqE;AAC/E,UAAMC,WAAW,GAAG,MAAM,KAAKC,IAAL,CAAUH,IAAV,EAAgBC,OAAhB,CAA1B;AACA,UAAM,CAACG,WAAD,IAAgBJ,IAAtB;AACA,WAAQ,6CAA4CO,iBAAMC,IAAN,CAAWJ,WAAX,CAAwB,YAAWG,iBAAME,KAAN,CACrFP,WAAW,CAACG,UADyE,CAErF,EAFF;AAGD;;AAES,QAAJF,IAAI,CAAC,CAACC,WAAD,CAAD,EAA+BH,OAA/B,EAAuF;AAC/F,UAAMS,YAAY,GAAGT,OAArB;;AACA,QAAIS,YAAY,CAACC,SAAb,KAA2B,MAA/B,EAAuC;AACrCD,MAAAA,YAAY,CAACC,SAAb,GAAyB,IAAzB;AACD;;AACD,QAAID,YAAY,CAACE,QAAb,KAA0B,MAA9B,EAAsC;AACpCF,MAAAA,YAAY,CAACE,QAAb,GAAwB,IAAxB;AACD;;AAED,UAAMC,EAAE,GAAG,MAAM,KAAKf,SAAL,CAAegB,kBAAf,CAAkCV,WAAlC,CAAjB;AAEA,UAAMW,OAAO,GAAG,MAAM,KAAKjB,SAAL,CAAekB,WAAf,CAA2BH,EAA3B,EAA+BH,YAA/B,CAAtB;AACA,WAAOK,OAAP;AACD;;AA9CkD","sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { Text } from 'ink';\nimport React from 'react';\n\nimport { EjectConfOptions, EjectConfResult, Workspace } from './workspace';\n\ntype EjectConfArgs = [string];\n// From the cli we might get those as string in case we run it like --propagate true (return string) as opposed to only --propagate\ntype EjectConfOptionsCLI = {\n propagate: string | boolean | undefined;\n override: string | boolean | undefined;\n};\n\nexport default class EjectConfCmd implements Command {\n name = 'eject-conf [id]';\n description = 'ejecting components configuration';\n alias = '';\n group = 'development';\n shortDescription = 'eject the target component configuration file (e.g. create a `component.json` file)';\n options = [\n ['p', 'propagate', 'mark propagate true in the config file'],\n ['o', 'override', 'override file if exist'],\n ] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n // TODO: remove this ts-ignore\n // @ts-ignore\n async render(args: EjectConfArgs, options: EjectConfOptionsCLI) {\n const ejectResult = await this.json(args, options);\n const [componentId] = args;\n return (\n <Text color=\"green\">\n successfully ejected config for component {componentId} in path {ejectResult.configPath}\n </Text>\n );\n }\n\n async report(args: EjectConfArgs, options: EjectConfOptionsCLI): Promise<string> {\n const ejectResult = await this.json(args, options);\n const [componentId] = args;\n return `successfully ejected config for component ${chalk.bold(componentId)} in path ${chalk.green(\n ejectResult.configPath\n )}`;\n }\n\n async json([componentId]: EjectConfArgs, options: EjectConfOptionsCLI): Promise<EjectConfResult> {\n const ejectOptions = options;\n if (ejectOptions.propagate === 'true') {\n ejectOptions.propagate = true;\n }\n if (ejectOptions.override === 'true') {\n ejectOptions.override = true;\n }\n\n const id = await this.workspace.resolveComponentId(componentId);\n\n const results = await this.workspace.ejectConfig(id, ejectOptions as EjectConfOptions);\n return results;\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@teambit/cli';
|
|
2
|
+
import { Workspace } from '../workspace';
|
|
3
|
+
export declare class EnvsReplaceCmd implements Command {
|
|
4
|
+
private workspace;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
options: never[];
|
|
8
|
+
group: string;
|
|
9
|
+
constructor(workspace: Workspace);
|
|
10
|
+
report([oldEnv, env]: [string, string]): Promise<string>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.promise.js");
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
exports.EnvsReplaceCmd = void 0;
|
|
13
|
+
|
|
14
|
+
function _defineProperty2() {
|
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
|
|
17
|
+
_defineProperty2 = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _chalk() {
|
|
25
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
26
|
+
|
|
27
|
+
_chalk = function () {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class EnvsReplaceCmd {
|
|
35
|
+
constructor(workspace) {
|
|
36
|
+
this.workspace = workspace;
|
|
37
|
+
(0, _defineProperty2().default)(this, "name", 'replace <old-env> <new-env>');
|
|
38
|
+
(0, _defineProperty2().default)(this, "description", 'replace an existing env with another env for all components using the old env');
|
|
39
|
+
(0, _defineProperty2().default)(this, "options", []);
|
|
40
|
+
(0, _defineProperty2().default)(this, "group", 'development');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async report([oldEnv, env]) {
|
|
44
|
+
const envId = await this.workspace.resolveComponentId(env);
|
|
45
|
+
const components = await this.workspace.getComponentsUsingEnv(oldEnv, true);
|
|
46
|
+
const componentIds = components.map(comp => comp.id);
|
|
47
|
+
await this.workspace.setEnvToComponents(envId, componentIds);
|
|
48
|
+
return `added ${_chalk().default.bold(envId.toString())} env to the following component(s):
|
|
49
|
+
${componentIds.map(compId => compId.toString()).join('\n')}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports.EnvsReplaceCmd = EnvsReplaceCmd;
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=envs-replace.cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["envs-replace.cmd.ts"],"names":["EnvsReplaceCmd","constructor","workspace","report","oldEnv","env","envId","resolveComponentId","components","getComponentsUsingEnv","componentIds","map","comp","id","setEnvToComponents","chalk","bold","toString","compId","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,cAAN,CAAwC;AAM7CC,EAAAA,WAAW,CAASC,SAAT,EAA+B;AAAA,SAAtBA,SAAsB,GAAtBA,SAAsB;AAAA,kDALnC,6BAKmC;AAAA,yDAJ5B,+EAI4B;AAAA,qDAHhC,EAGgC;AAAA,mDAFlC,aAEkC;AAAE;;AAEhC,QAANC,MAAM,CAAC,CAACC,MAAD,EAASC,GAAT,CAAD,EAAkC;AAC5C,UAAMC,KAAK,GAAG,MAAM,KAAKJ,SAAL,CAAeK,kBAAf,CAAkCF,GAAlC,CAApB;AACA,UAAMG,UAAU,GAAG,MAAM,KAAKN,SAAL,CAAeO,qBAAf,CAAqCL,MAArC,EAA6C,IAA7C,CAAzB;AACA,UAAMM,YAAY,GAAGF,UAAU,CAACG,GAAX,CAAgBC,IAAD,IAAUA,IAAI,CAACC,EAA9B,CAArB;AACA,UAAM,KAAKX,SAAL,CAAeY,kBAAf,CAAkCR,KAAlC,EAAyCI,YAAzC,CAAN;AACA,WAAQ,SAAQK,iBAAMC,IAAN,CAAWV,KAAK,CAACW,QAAN,EAAX,CAA6B;AACjD,EAAEP,YAAY,CAACC,GAAb,CAAkBO,MAAD,IAAYA,MAAM,CAACD,QAAP,EAA7B,EAAgDE,IAAhD,CAAqD,IAArD,CAA2D,EADzD;AAED;;AAf4C","sourcesContent":["import { Command } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { Workspace } from '../workspace';\n\nexport class EnvsReplaceCmd implements Command {\n name = 'replace <old-env> <new-env>';\n description = 'replace an existing env with another env for all components using the old env';\n options = [];\n group = 'development';\n\n constructor(private workspace: Workspace) {}\n\n async report([oldEnv, env]: [string, string]) {\n const envId = await this.workspace.resolveComponentId(env);\n const components = await this.workspace.getComponentsUsingEnv(oldEnv, true);\n const componentIds = components.map((comp) => comp.id);\n await this.workspace.setEnvToComponents(envId, componentIds);\n return `added ${chalk.bold(envId.toString())} env to the following component(s):\n${componentIds.map((compId) => compId.toString()).join('\\n')}`;\n }\n}\n"]}
|
|
@@ -54,7 +54,6 @@ class EnvsSetCmd {
|
|
|
54
54
|
async report([pattern, env]) {
|
|
55
55
|
const envId = await this.workspace.resolveComponentId(env);
|
|
56
56
|
const componentIds = await this.workspace.idsByPattern(pattern);
|
|
57
|
-
if (!componentIds.length) return _chalk().default.yellow(`unable to find any matching for ${_chalk().default.bold(pattern)} pattern`);
|
|
58
57
|
await this.workspace.setEnvToComponents(envId, componentIds);
|
|
59
58
|
return `added ${_chalk().default.bold(envId.toString())} env to the following component(s):
|
|
60
59
|
${componentIds.map(compId => compId.toString()).join('\n')}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["envs-set.cmd.ts"],"names":["EnvsSetCmd","constructor","workspace","report","pattern","env","envId","resolveComponentId","componentIds","idsByPattern","
|
|
1
|
+
{"version":3,"sources":["envs-set.cmd.ts"],"names":["EnvsSetCmd","constructor","workspace","report","pattern","env","envId","resolveComponentId","componentIds","idsByPattern","setEnvToComponents","chalk","bold","toString","map","compId","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,UAAN,CAAoC;AAOzCC,EAAAA,WAAW,CAASC,SAAT,EAA+B;AAAA,SAAtBA,SAAsB,GAAtBA,SAAsB;AAAA,kDANnC,qBAMmC;AAAA,yDAL5B,qCAK4B;AAAA,qDAJhC,EAIgC;AAAA,mDAHlC,aAGkC;AAAA,iEAFnB,GAAE,+BAAa,SAAb,CAAwB,EAEP;AAAE;;AAEhC,QAANC,MAAM,CAAC,CAACC,OAAD,EAAUC,GAAV,CAAD,EAAmC;AAC7C,UAAMC,KAAK,GAAG,MAAM,KAAKJ,SAAL,CAAeK,kBAAf,CAAkCF,GAAlC,CAApB;AACA,UAAMG,YAAY,GAAG,MAAM,KAAKN,SAAL,CAAeO,YAAf,CAA4BL,OAA5B,CAA3B;AACA,UAAM,KAAKF,SAAL,CAAeQ,kBAAf,CAAkCJ,KAAlC,EAAyCE,YAAzC,CAAN;AACA,WAAQ,SAAQG,iBAAMC,IAAN,CAAWN,KAAK,CAACO,QAAN,EAAX,CAA6B;AACjD,EAAEL,YAAY,CAACM,GAAb,CAAkBC,MAAD,IAAYA,MAAM,CAACF,QAAP,EAA7B,EAAgDG,IAAhD,CAAqD,IAArD,CAA2D,EADzD;AAED;;AAfwC","sourcesContent":["import { Command } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { Workspace } from '../workspace';\n\nexport class EnvsSetCmd implements Command {\n name = 'set <pattern> <env>';\n description = 'set an environment for component(s)';\n options = [];\n group = 'development';\n extendedDescription = `${PATTERN_HELP('env set')}`;\n\n constructor(private workspace: Workspace) {}\n\n async report([pattern, env]: [string, string]) {\n const envId = await this.workspace.resolveComponentId(env);\n const componentIds = await this.workspace.idsByPattern(pattern);\n await this.workspace.setEnvToComponents(envId, componentIds);\n return `added ${chalk.bold(envId.toString())} env to the following component(s):\n${componentIds.map((compId) => compId.toString()).join('\\n')}`;\n }\n}\n"]}
|
package/dist/pattern.cmd.js
CHANGED
|
@@ -43,7 +43,7 @@ class PatternCommand {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
async report([pattern]) {
|
|
46
|
-
const ids = await this.
|
|
46
|
+
const ids = await this.json([pattern]);
|
|
47
47
|
|
|
48
48
|
const title = _chalk().default.green(`found ${_chalk().default.bold(ids.length.toString())} components matching the pattern`);
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ class PatternCommand {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
async json([pattern]) {
|
|
54
|
-
return this.workspace.idsByPattern(pattern);
|
|
54
|
+
return this.workspace.idsByPattern(pattern, false);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
}
|
package/dist/pattern.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["pattern.cmd.ts"],"names":["PatternCommand","constructor","workspace","report","pattern","ids","
|
|
1
|
+
{"version":3,"sources":["pattern.cmd.ts"],"names":["PatternCommand","constructor","workspace","report","pattern","ids","json","title","chalk","green","bold","length","toString","join","idsByPattern"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,cAAN,CAAwC;AAQ7CC,EAAAA,WAAW,CAASC,SAAT,EAA+B;AAAA,SAAtBA,SAAsB,GAAtBA,SAAsB;AAAA,kDAPnC,mBAOmC;AAAA,mDANlC,EAMkC;AAAA,yDAL5B,mDAK4B;AAAA,mDAJlC,aAIkC;AAAA,qDAHhC,KAGgC;AAAA,qDAFhC,CAAC,CAAC,GAAD,EAAM,MAAN,EAAc,2BAAd,CAAD,CAEgC;AAAE;;AAEhC,QAANC,MAAM,CAAC,CAACC,OAAD,CAAD,EAAsB;AAChC,UAAMC,GAAG,GAAG,MAAM,KAAKC,IAAL,CAAU,CAACF,OAAD,CAAV,CAAlB;;AACA,UAAMG,KAAK,GAAGC,iBAAMC,KAAN,CAAa,SAAQD,iBAAME,IAAN,CAAWL,GAAG,CAACM,MAAJ,CAAWC,QAAX,EAAX,CAAkC,kCAAvD,CAAd;;AACA,WAAQ,GAAEL,KAAM,KAAIF,GAAG,CAACQ,IAAJ,CAAS,IAAT,CAAe,EAAnC;AACD;;AAES,QAAJP,IAAI,CAAC,CAACF,OAAD,CAAD,EAAsB;AAC9B,WAAO,KAAKF,SAAL,CAAeY,YAAf,CAA4BV,OAA5B,EAAqC,KAArC,CAAP;AACD;;AAlB4C","sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { Workspace } from './workspace';\n\nexport class PatternCommand implements Command {\n name = 'pattern <pattern>';\n alias = '';\n description = 'list the component ids matching the given pattern';\n group = 'development';\n private = false;\n options = [['j', 'json', 'return the output as JSON']] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report([pattern]: [string]) {\n const ids = await this.json([pattern]);\n const title = chalk.green(`found ${chalk.bold(ids.length.toString())} components matching the pattern`);\n return `${title}\\n${ids.join('\\n')}`;\n }\n\n async json([pattern]: [string]) {\n return this.workspace.idsByPattern(pattern, false);\n }\n}\n"]}
|
package/dist/tag-cmd.js
CHANGED
|
@@ -112,7 +112,7 @@ https://${_constants().BASE_DOCS_DOMAIN}/docs/tag-component-version
|
|
|
112
112
|
${(0, _constants().WILDCARD_HELP)('tag')}`);
|
|
113
113
|
(0, _defineProperty2().default)(this, "alias", 't');
|
|
114
114
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
115
|
-
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user changes'], ['a', 'all [version]', 'tag all new and modified components'], ['s', 'scope [version]', 'tag all components of the current scope'], ['', 'editor [editor]', 'open an editor to edit the tag messages per component, optionally specify the editor-name, default to vim'], ['', 'snapped [version]', 'tag components that their head is a snap (not a tag)'], ['', 'ver <version>', 'tag specified components with the given version'], ['p', 'patch', 'increment the patch version number'], ['', 'minor', 'increment the minor version number'], ['', 'major', 'increment the major version number'], ['', 'pre-release [identifier]', 'EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)'], ['f', 'force', 'force-tag even if tests are failing and even when component has not changed'], ['v', 'verbose', 'show specs output on failure'], ['', 'ignore-unresolved-dependencies', 'DEPRECATED. use --ignore-issues instead'], ['i', 'ignore-issues', 'ignore component issues (shown in "bit status" as "issues found")'], ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'skip-auto-tag', 'skip auto tagging dependents'], ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'], ['', 'soft', 'do not persist. only keep note of the changes to be made'], ['', 'persist', 'persist the changes generated by --soft tag'], ['', 'disable-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead'], ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'], ['', 'force-deploy', 'run the tag pipeline although the build failed'], ['', 'increment-by <number>', '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.']]);
|
|
115
|
+
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user changes'], ['a', 'all [version]', 'tag all new and modified components'], ['s', 'scope [version]', 'tag all components of the current scope'], ['', 'editor [editor]', 'EXPERIMENTAL. open an editor to edit the tag messages per component, optionally specify the editor-name, default to vim'], ['', 'snapped [version]', 'tag components that their head is a snap (not a tag)'], ['', 'ver <version>', 'tag specified components with the given version'], ['p', 'patch', 'increment the patch version number'], ['', 'minor', 'increment the minor version number'], ['', 'major', 'increment the major version number'], ['', 'pre-release [identifier]', 'EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)'], ['f', 'force', 'force-tag even if tests are failing and even when component has not changed'], ['v', 'verbose', 'show specs output on failure'], ['', 'ignore-unresolved-dependencies', 'DEPRECATED. use --ignore-issues instead'], ['i', 'ignore-issues', 'ignore component issues (shown in "bit status" as "issues found")'], ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'skip-auto-tag', 'skip auto tagging dependents'], ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'], ['', 'soft', 'do not persist. only keep note of the changes to be made'], ['', 'persist', 'persist the changes generated by --soft tag'], ['', 'disable-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead'], ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'], ['', 'force-deploy', 'run the tag pipeline although the build failed'], ['', 'increment-by <number>', '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.']]);
|
|
116
116
|
(0, _defineProperty2().default)(this, "migration", true);
|
|
117
117
|
(0, _defineProperty2().default)(this, "remoteOp", true);
|
|
118
118
|
}
|