@teambit/workspace 1.0.750 → 1.0.752

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.
@@ -71,7 +71,10 @@ export class LocalOnlyListCmd implements Command {
71
71
 
72
72
  export class LocalOnlyCmd implements Command {
73
73
  name = 'local-only <sub-command>';
74
- description = 'manage local-only components, which reside only in the workspace and are not snapped/tagged';
74
+ description = 'manage components that exist only in the workspace';
75
+ extendedDescription = `controls components that are excluded from versioning (snap/tag) and exporting operations.
76
+ local-only components are useful for workspace-specific tools, configs, or temporary components.
77
+ these components remain in the workspace but won't be shared or versioned.`;
75
78
  group = 'component-config';
76
79
  alias = '';
77
80
  commands: Command[] = [];
@@ -185,11 +185,10 @@ class CapsuleCmd {
185
185
  this.workspace = workspace;
186
186
  this.scope = scope;
187
187
  _defineProperty(this, "name", 'capsule');
188
- _defineProperty(this, "description", 'manage capsules');
189
- _defineProperty(this, "extendedDescription", `a capsule is a directory containing the component code, isolated from the workspace.
190
- normally, capsules are created during the build process, the component files are copied and the packages are installed
191
- via the configured package-manager. the purpose is to compile/test them in isolation to make sure they will work for
192
- other users after publishing/exporting them.`);
188
+ _defineProperty(this, "description", 'manage isolated component environments');
189
+ _defineProperty(this, "extendedDescription", `capsules are temporary isolated directories containing component code and dependencies.
190
+ automatically created during build processes to compile and test components in isolation.
191
+ ensures components work independently before publishing, similar to how they'll be consumed.`);
193
192
  _defineProperty(this, "alias", '');
194
193
  _defineProperty(this, "group", 'advanced');
195
194
  _defineProperty(this, "commands", []);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CapsuleCreateCmd","constructor","workspace","scope","isolator","create","componentIds","baseDir","rootBaseDir","alwaysNew","id","installPackages","seedersOnly","useHash","Array","isArray","finalUseHash","undefined","shouldUseHashForCapsules","baseInstallOptions","additionalInstallOptions","copyPeerToRuntimeOnRoot","useNesting","copyPeerToRuntimeOnComponents","installPeersFromEnvs","installOptions","capsuleOptions","includeFromNestedHosts","name","host","ids","resolveMultipleComponentIds","network","isolateComponents","capsules","graphCapsules","report","opts","capsuleOutput","map","capsule","chalk","bold","component","toString","path","join","title","green","json","c","exports","CapsuleListCmd","Error","workspaceCapsulesRootDir","scopeAspectsCapsulesRootDir","scopeCapsulesRootDir","getCapsulesRootDirs","listWs","list","listScope","hostPath","numOfWsCapsules","hostType","cyan","wsLine","scopeAspectLine","scopeLine","suggestLine","lines","x","rootDirs","scopeCapsules","CapsuleDeleteCmd","args","all","scopeAspects","capsuleBaseDirToDelete","capsuleBaseDir","deletedDir","deleteCapsules","CapsuleCmd","getCapsulesRootDir","getCapsulePath","getAspectCapsulePath","process","cwd"],"sources":["capsule.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { CapsuleList, IsolateComponentsOptions, IsolatorMain } from '@teambit/isolator';\nimport type { ScopeMain } from '@teambit/scope';\nimport chalk from 'chalk';\nimport type { Workspace } from './workspace';\n\ntype CreateOpts = {\n baseDir?: string;\n rootBaseDir?: string;\n alwaysNew?: boolean;\n seedersOnly?: boolean;\n useHash?: boolean;\n id: string;\n installPackages?: boolean;\n};\n\nexport class CapsuleCreateCmd implements Command {\n name = 'create [component-id...]';\n description = `create capsules for components`;\n helpUrl = 'reference/build-pipeline/capsule';\n group = 'advanced';\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 ['', 'use-hash', 'whether to use hash function (of base dir) as capsules root dir 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(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private isolator: IsolatorMain\n ) {}\n\n async create(\n [componentIds = []]: [string[]],\n { baseDir, rootBaseDir, alwaysNew = false, id, installPackages = false, seedersOnly = false, useHash }: CreateOpts\n ): Promise<CapsuleList> {\n // @todo: why it is not an array?\n if (componentIds && !Array.isArray(componentIds)) componentIds = [componentIds];\n let finalUseHash = useHash;\n if (useHash === undefined) {\n if (baseDir) {\n finalUseHash = false;\n } else {\n finalUseHash = this.workspace\n ? this.workspace?.shouldUseHashForCapsules()\n : this.scope.shouldUseHashForCapsules();\n }\n }\n\n const baseInstallOptions = { installPackages };\n const additionalInstallOptions = this.workspace\n ? {}\n : {\n copyPeerToRuntimeOnRoot: true,\n useNesting: true,\n copyPeerToRuntimeOnComponents: true,\n installPeersFromEnvs: true,\n };\n const installOptions = { ...baseInstallOptions, ...additionalInstallOptions };\n\n const capsuleOptions: IsolateComponentsOptions = {\n baseDir,\n rootBaseDir,\n installOptions,\n alwaysNew,\n seedersOnly,\n includeFromNestedHosts: true,\n name: id,\n useHash: finalUseHash,\n };\n const host = this.workspace || this.scope;\n const ids = await host.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 the capsules generated for this workspace`;\n group = 'advanced';\n alias = '';\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(\n private isolator: IsolatorMain,\n private workspace: Workspace | undefined,\n private scope: ScopeMain\n ) {}\n\n async report() {\n if (!this.workspace && !this.scope) {\n throw new Error(`This command requires a Bit workspace or scope.\nTo initialize a workspace: bit init`);\n }\n\n const { workspaceCapsulesRootDir, scopeAspectsCapsulesRootDir, scopeCapsulesRootDir } = this.getCapsulesRootDirs();\n const listWs = workspaceCapsulesRootDir ? await this.isolator.list(workspaceCapsulesRootDir) : undefined;\n const listScope = await this.isolator.list(scopeAspectsCapsulesRootDir);\n\n const hostPath = this.workspace ? this.workspace.path : this.scope.path;\n const numOfWsCapsules = listWs ? listWs.capsules.length : listScope.capsules.length;\n const hostType = this.workspace ? 'workspace' : 'scope';\n\n const title = chalk.green(\n `found ${chalk.cyan(numOfWsCapsules.toString())} capsule(s) for ${hostType}: ${chalk.cyan(hostPath)}`\n );\n const wsLine = listWs\n ? chalk.green(`workspace capsules root-dir: ${chalk.cyan(workspaceCapsulesRootDir)}`)\n : undefined;\n const scopeAspectLine = chalk.green(\n `scope's aspects capsules root-dir: ${chalk.cyan(scopeAspectsCapsulesRootDir)}`\n );\n const scopeLine = chalk.green(`scope's capsules root-dir: ${chalk.cyan(scopeCapsulesRootDir)}`);\n const suggestLine = chalk.green(`use --json to get the list of all capsules`);\n const lines = [title, wsLine, scopeAspectLine, scopeLine, suggestLine].filter((x) => x).join('\\n');\n\n // TODO: improve output\n return lines;\n }\n\n async json() {\n if (!this.workspace && !this.scope) {\n throw new Error(`This command requires a Bit workspace or scope.\nTo initialize a workspace: bit init`);\n }\n\n const rootDirs = this.getCapsulesRootDirs();\n const listWs = rootDirs.workspaceCapsulesRootDir\n ? await this.isolator.list(rootDirs.workspaceCapsulesRootDir)\n : undefined;\n const listScope = await this.isolator.list(rootDirs.scopeAspectsCapsulesRootDir);\n const capsules = listWs ? listWs.capsules : [];\n const scopeCapsules = listScope ? listScope.capsules : [];\n return { ...rootDirs, capsules, scopeCapsules };\n }\n\n private getCapsulesRootDirs() {\n return getCapsulesRootDirs(this.isolator, this.scope, this.workspace);\n }\n}\n\nexport class CapsuleDeleteCmd implements Command {\n name = 'delete';\n description = `delete capsules`;\n extendedDescription = `with no args, only workspace's capsules are deleted`;\n group = 'advanced';\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(\n private isolator: IsolatorMain,\n private scope: ScopeMain,\n private workspace?: Workspace\n ) {}\n\n async report(args: [], { all, scopeAspects }: { all: boolean; scopeAspects: boolean }) {\n const capsuleBaseDirToDelete = (): string | undefined => {\n if (all) return undefined;\n if (scopeAspects) {\n const { scopeAspectsCapsulesRootDir } = getCapsulesRootDirs(this.isolator, this.scope, this.workspace);\n return scopeAspectsCapsulesRootDir;\n }\n return undefined;\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';\n description = 'manage capsules';\n extendedDescription = `a capsule is a directory containing 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 = 'advanced';\n commands: Command[] = [];\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(\n private isolator: IsolatorMain,\n private workspace: Workspace | undefined,\n private scope: ScopeMain\n ) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [string]) {\n return new CapsuleListCmd(this.isolator, this.workspace, this.scope).report();\n }\n}\n\nfunction getCapsulesRootDirs(isolator, scope: ScopeMain, workspace) {\n const workspaceCapsulesRootDir = workspace\n ? isolator.getCapsulesRootDir({\n baseDir: workspace.getCapsulePath(),\n useHash: workspace.shouldUseHashForCapsules(),\n })\n : undefined;\n const scopeAspectsCapsulesRootDir = isolator.getCapsulesRootDir({\n baseDir: scope.getAspectCapsulePath(),\n useHash: scope.shouldUseHashForCapsules(),\n });\n const scopeCapsulesRootDir = workspace\n ? undefined\n : isolator.getCapsulesRootDir({\n baseDir: process.cwd(),\n useHash: true,\n });\n\n return { workspaceCapsulesRootDir, scopeAspectsCapsulesRootDir, scopeCapsulesRootDir };\n}\n"],"mappings":";;;;;;AAIA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EA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EN,OAAO;IAAEyC,wBAAwB;IAAEC,2BAA2B;IAAEC;EAAqB,CAAC;AACxF","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CapsuleCreateCmd","constructor","workspace","scope","isolator","create","componentIds","baseDir","rootBaseDir","alwaysNew","id","installPackages","seedersOnly","useHash","Array","isArray","finalUseHash","undefined","shouldUseHashForCapsules","baseInstallOptions","additionalInstallOptions","copyPeerToRuntimeOnRoot","useNesting","copyPeerToRuntimeOnComponents","installPeersFromEnvs","installOptions","capsuleOptions","includeFromNestedHosts","name","host","ids","resolveMultipleComponentIds","network","isolateComponents","capsules","graphCapsules","report","opts","capsuleOutput","map","capsule","chalk","bold","component","toString","path","join","title","green","json","c","exports","CapsuleListCmd","Error","workspaceCapsulesRootDir","scopeAspectsCapsulesRootDir","scopeCapsulesRootDir","getCapsulesRootDirs","listWs","list","listScope","hostPath","numOfWsCapsules","hostType","cyan","wsLine","scopeAspectLine","scopeLine","suggestLine","lines","x","rootDirs","scopeCapsules","CapsuleDeleteCmd","args","all","scopeAspects","capsuleBaseDirToDelete","capsuleBaseDir","deletedDir","deleteCapsules","CapsuleCmd","getCapsulesRootDir","getCapsulePath","getAspectCapsulePath","process","cwd"],"sources":["capsule.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { CapsuleList, IsolateComponentsOptions, IsolatorMain } from '@teambit/isolator';\nimport type { ScopeMain } from '@teambit/scope';\nimport chalk from 'chalk';\nimport type { Workspace } from './workspace';\n\ntype CreateOpts = {\n baseDir?: string;\n rootBaseDir?: string;\n alwaysNew?: boolean;\n seedersOnly?: boolean;\n useHash?: boolean;\n id: string;\n installPackages?: boolean;\n};\n\nexport class CapsuleCreateCmd implements Command {\n name = 'create [component-id...]';\n description = `create capsules for components`;\n helpUrl = 'reference/build-pipeline/capsule';\n group = 'advanced';\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 ['', 'use-hash', 'whether to use hash function (of base dir) as capsules root dir 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(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private isolator: IsolatorMain\n ) {}\n\n async create(\n [componentIds = []]: [string[]],\n { baseDir, rootBaseDir, alwaysNew = false, id, installPackages = false, seedersOnly = false, useHash }: CreateOpts\n ): Promise<CapsuleList> {\n // @todo: why it is not an array?\n if (componentIds && !Array.isArray(componentIds)) componentIds = [componentIds];\n let finalUseHash = useHash;\n if (useHash === undefined) {\n if (baseDir) {\n finalUseHash = false;\n } else {\n finalUseHash = this.workspace\n ? this.workspace?.shouldUseHashForCapsules()\n : this.scope.shouldUseHashForCapsules();\n }\n }\n\n const baseInstallOptions = { installPackages };\n const additionalInstallOptions = this.workspace\n ? {}\n : {\n copyPeerToRuntimeOnRoot: true,\n useNesting: true,\n copyPeerToRuntimeOnComponents: true,\n installPeersFromEnvs: true,\n };\n const installOptions = { ...baseInstallOptions, ...additionalInstallOptions };\n\n const capsuleOptions: IsolateComponentsOptions = {\n baseDir,\n rootBaseDir,\n installOptions,\n alwaysNew,\n seedersOnly,\n includeFromNestedHosts: true,\n name: id,\n useHash: finalUseHash,\n };\n const host = this.workspace || this.scope;\n const ids = await host.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 the capsules generated for this workspace`;\n group = 'advanced';\n alias = '';\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(\n private isolator: IsolatorMain,\n private workspace: Workspace | undefined,\n private scope: ScopeMain\n ) {}\n\n async report() {\n if (!this.workspace && !this.scope) {\n throw new Error(`This command requires a Bit workspace or scope.\nTo initialize a workspace: bit init`);\n }\n\n const { workspaceCapsulesRootDir, scopeAspectsCapsulesRootDir, scopeCapsulesRootDir } = this.getCapsulesRootDirs();\n const listWs = workspaceCapsulesRootDir ? await this.isolator.list(workspaceCapsulesRootDir) : undefined;\n const listScope = await this.isolator.list(scopeAspectsCapsulesRootDir);\n\n const hostPath = this.workspace ? this.workspace.path : this.scope.path;\n const numOfWsCapsules = listWs ? listWs.capsules.length : listScope.capsules.length;\n const hostType = this.workspace ? 'workspace' : 'scope';\n\n const title = chalk.green(\n `found ${chalk.cyan(numOfWsCapsules.toString())} capsule(s) for ${hostType}: ${chalk.cyan(hostPath)}`\n );\n const wsLine = listWs\n ? chalk.green(`workspace capsules root-dir: ${chalk.cyan(workspaceCapsulesRootDir)}`)\n : undefined;\n const scopeAspectLine = chalk.green(\n `scope's aspects capsules root-dir: ${chalk.cyan(scopeAspectsCapsulesRootDir)}`\n );\n const scopeLine = chalk.green(`scope's capsules root-dir: ${chalk.cyan(scopeCapsulesRootDir)}`);\n const suggestLine = chalk.green(`use --json to get the list of all capsules`);\n const lines = [title, wsLine, scopeAspectLine, scopeLine, suggestLine].filter((x) => x).join('\\n');\n\n // TODO: improve output\n return lines;\n }\n\n async json() {\n if (!this.workspace && !this.scope) {\n throw new Error(`This command requires a Bit workspace or scope.\nTo initialize a workspace: bit init`);\n }\n\n const rootDirs = this.getCapsulesRootDirs();\n const listWs = rootDirs.workspaceCapsulesRootDir\n ? await this.isolator.list(rootDirs.workspaceCapsulesRootDir)\n : undefined;\n const listScope = await this.isolator.list(rootDirs.scopeAspectsCapsulesRootDir);\n const capsules = listWs ? listWs.capsules : [];\n const scopeCapsules = listScope ? listScope.capsules : [];\n return { ...rootDirs, capsules, scopeCapsules };\n }\n\n private getCapsulesRootDirs() {\n return getCapsulesRootDirs(this.isolator, this.scope, this.workspace);\n }\n}\n\nexport class CapsuleDeleteCmd implements Command {\n name = 'delete';\n description = `delete capsules`;\n extendedDescription = `with no args, only workspace's capsules are deleted`;\n group = 'advanced';\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(\n private isolator: IsolatorMain,\n private scope: ScopeMain,\n private workspace?: Workspace\n ) {}\n\n async report(args: [], { all, scopeAspects }: { all: boolean; scopeAspects: boolean }) {\n const capsuleBaseDirToDelete = (): string | undefined => {\n if (all) return undefined;\n if (scopeAspects) {\n const { scopeAspectsCapsulesRootDir } = getCapsulesRootDirs(this.isolator, this.scope, this.workspace);\n return scopeAspectsCapsulesRootDir;\n }\n return undefined;\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';\n description = 'manage isolated component environments';\n extendedDescription = `capsules are temporary isolated directories containing component code and dependencies.\nautomatically created during build processes to compile and test components in isolation.\nensures components work independently before publishing, similar to how they'll be consumed.`;\n alias = '';\n group = 'advanced';\n commands: Command[] = [];\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(\n private isolator: IsolatorMain,\n private workspace: Workspace | undefined,\n private scope: ScopeMain\n ) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [string]) {\n return new CapsuleListCmd(this.isolator, this.workspace, this.scope).report();\n }\n}\n\nfunction getCapsulesRootDirs(isolator, scope: ScopeMain, workspace) {\n const workspaceCapsulesRootDir = workspace\n ? isolator.getCapsulesRootDir({\n baseDir: workspace.getCapsulePath(),\n useHash: workspace.shouldUseHashForCapsules(),\n })\n : undefined;\n const scopeAspectsCapsulesRootDir = isolator.getCapsulesRootDir({\n baseDir: scope.getAspectCapsulePath(),\n useHash: scope.shouldUseHashForCapsules(),\n });\n const scopeCapsulesRootDir = workspace\n ? undefined\n : isolator.getCapsulesRootDir({\n baseDir: process.cwd(),\n useHash: true,\n });\n\n return { workspaceCapsulesRootDir, scopeAspectsCapsulesRootDir, scopeCapsulesRootDir };\n}\n"],"mappings":";;;;;;AAIA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,C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D3E,OAAO,EAAEJ,KAAK,CAACiF,oBAAoB,CAAC,CAAC;IACrCvE,OAAO,EAAEV,KAAK,CAACe,wBAAwB,CAAC;EAC1C,CAAC,CAAC;EACF,MAAMsC,oBAAoB,GAAGtD,SAAS,GAClCe,SAAS,GACTb,QAAQ,CAAC8E,kBAAkB,CAAC;IAC1B3E,OAAO,EAAE8E,OAAO,CAACC,GAAG,CAAC,CAAC;IACtBzE,OAAO,EAAE;EACX,CAAC,CAAC;EAEN,OAAO;IAAEyC,wBAAwB;IAAEC,2BAA2B;IAAEC;EAAqB,CAAC;AACxF","ignoreList":[]}
@@ -38,6 +38,7 @@ export declare class LocalOnlyListCmd implements Command {
38
38
  export declare class LocalOnlyCmd implements Command {
39
39
  name: string;
40
40
  description: string;
41
+ extendedDescription: string;
41
42
  group: string;
42
43
  alias: string;
43
44
  commands: Command[];
@@ -86,7 +86,10 @@ exports.LocalOnlyListCmd = LocalOnlyListCmd;
86
86
  class LocalOnlyCmd {
87
87
  constructor() {
88
88
  _defineProperty(this, "name", 'local-only <sub-command>');
89
- _defineProperty(this, "description", 'manage local-only components, which reside only in the workspace and are not snapped/tagged');
89
+ _defineProperty(this, "description", 'manage components that exist only in the workspace');
90
+ _defineProperty(this, "extendedDescription", `controls components that are excluded from versioning (snap/tag) and exporting operations.
91
+ local-only components are useful for workspace-specific tools, configs, or temporary components.
92
+ these components remain in the workspace but won't be shared or versioned.`);
90
93
  _defineProperty(this, "group", 'component-config');
91
94
  _defineProperty(this, "alias", '');
92
95
  _defineProperty(this, "commands", []);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LocalOnlySetCmd","constructor","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","ids","idsByPattern","setLocalOnly","title","chalk","bold","map","id","toString","join","exports","LocalOnlyUnsetCmd","successfullyUnset","unsetLocalOnly","length","yellow","LocalOnlyListCmd","listLocalOnly","LocalOnlyCmd","unrecognizedSubcommand","red"],"sources":["local-only-cmd.ts"],"sourcesContent":["/* eslint max-classes-per-file: 0 */\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '../workspace';\n\nexport class LocalOnlySetCmd implements Command {\n name = 'set <component-pattern>';\n description = 'set a component as local-only';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report([pattern]: [string]) {\n const ids = await this.workspace.idsByPattern(pattern);\n await this.workspace.setLocalOnly(ids);\n const title = chalk.bold(`successfully set the following components as local-only`);\n return `${title}:\\n${ids.map((id) => id.toString()).join('\\n')}`;\n }\n}\n\nexport class LocalOnlyUnsetCmd implements Command {\n name = 'unset <component-pattern>';\n description = 'remove a component from local-only';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report([pattern]: [string]) {\n const ids = await this.workspace.idsByPattern(pattern);\n const successfullyUnset = await this.workspace.unsetLocalOnly(ids);\n if (successfullyUnset.length === 0) {\n return chalk.yellow('no local-only components were found');\n }\n const title = chalk.bold(`successfully unset the following component(s)`);\n return `${title}:\\n${successfullyUnset.map((id) => id.toString()).join('\\n')}`;\n }\n}\n\nexport class LocalOnlyListCmd implements Command {\n name = 'list';\n description = 'list all local-only components';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report() {\n const ids = this.workspace.listLocalOnly();\n if (ids.length === 0) {\n return chalk.yellow('no local-only components were found');\n }\n const title = chalk.bold(`the following component(s) are local-only`);\n return `${title}:\\n${ids.map((id) => id.toString()).join('\\n')}`;\n }\n}\n\nexport class LocalOnlyCmd implements Command {\n name = 'local-only <sub-command>';\n description = 'manage local-only components, which reside only in the workspace and are not snapped/tagged';\n group = 'component-config';\n alias = '';\n commands: Command[] = [];\n options = [] as CommandOptions;\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"local-only\", please run \"bit local-only --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAA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A,CAAAM,gBAAA,GAAAA,gBAAA;AAEM,MAAME,YAAY,CAAoB;EAAAzB,YAAA;IAAAnB,eAAA,eACpC,0BAA0B;IAAAA,eAAA,sBACnB,6FAA6F;IAAAA,eAAA,gBACnG,kBAAkB;IAAAA,eAAA,gBAClB,EAAE;IAAAA,eAAA,mBACY,EAAE;IAAAA,eAAA,kBACd,EAAE;EAAA;EAEZ,MAAMwB,MAAMA,CAAC,CAACqB,sBAAsB,CAAW,EAAE;IAC/C,OAAOf,gBAAK,CAACgB,GAAG,CACd,IAAID,sBAAsB,mGAC5B,CAAC;EACH;AACF;AAACT,OAAA,CAAAQ,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LocalOnlySetCmd","constructor","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","ids","idsByPattern","setLocalOnly","title","chalk","bold","map","id","toString","join","exports","LocalOnlyUnsetCmd","successfullyUnset","unsetLocalOnly","length","yellow","LocalOnlyListCmd","listLocalOnly","LocalOnlyCmd","unrecognizedSubcommand","red"],"sources":["local-only-cmd.ts"],"sourcesContent":["/* eslint max-classes-per-file: 0 */\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '../workspace';\n\nexport class LocalOnlySetCmd implements Command {\n name = 'set <component-pattern>';\n description = 'set a component as local-only';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report([pattern]: [string]) {\n const ids = await this.workspace.idsByPattern(pattern);\n await this.workspace.setLocalOnly(ids);\n const title = chalk.bold(`successfully set the following components as local-only`);\n return `${title}:\\n${ids.map((id) => id.toString()).join('\\n')}`;\n }\n}\n\nexport class LocalOnlyUnsetCmd implements Command {\n name = 'unset <component-pattern>';\n description = 'remove a component from local-only';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report([pattern]: [string]) {\n const ids = await this.workspace.idsByPattern(pattern);\n const successfullyUnset = await this.workspace.unsetLocalOnly(ids);\n if (successfullyUnset.length === 0) {\n return chalk.yellow('no local-only components were found');\n }\n const title = chalk.bold(`successfully unset the following component(s)`);\n return `${title}:\\n${successfullyUnset.map((id) => id.toString()).join('\\n')}`;\n }\n}\n\nexport class LocalOnlyListCmd implements Command {\n name = 'list';\n description = 'list all local-only components';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report() {\n const ids = this.workspace.listLocalOnly();\n if (ids.length === 0) {\n return chalk.yellow('no local-only components were found');\n }\n const title = chalk.bold(`the following component(s) are local-only`);\n return `${title}:\\n${ids.map((id) => id.toString()).join('\\n')}`;\n }\n}\n\nexport class LocalOnlyCmd implements Command {\n name = 'local-only <sub-command>';\n description = 'manage components that exist only in the workspace';\n extendedDescription = `controls components that are excluded from versioning (snap/tag) and exporting operations.\nlocal-only components are useful for workspace-specific tools, configs, or temporary components.\nthese components remain in the workspace but won't be shared or versioned.`;\n group = 'component-config';\n alias = '';\n commands: Command[] = [];\n options = [] as CommandOptions;\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"local-only\", please run \"bit local-only --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,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","ignoreList":[]}
@@ -35,8 +35,12 @@ class EjectConfCmd {
35
35
  constructor(workspace) {
36
36
  this.workspace = workspace;
37
37
  _defineProperty(this, "name", 'eject-conf <pattern>');
38
- _defineProperty(this, "description", 'eject components configuration (create a `component.json` file)');
39
- _defineProperty(this, "extendedDescription", `note this can be reversed at any time by snapping/tagging changes and deleting the component.json file \n${(0, _legacy().PATTERN_HELP)('eject-conf')}`);
38
+ _defineProperty(this, "description", 'create component.json configuration files for components');
39
+ _defineProperty(this, "extendedDescription", `generates component.json files containing component-specific configuration that overrides workspace defaults.
40
+ useful for customizing individual component settings. alternatively, use commands like "bit env set", "bit deps set", or "bit aspect set".
41
+ can be reversed by deleting the component.json file and snapping/tagging the changes.
42
+
43
+ ${(0, _legacy().PATTERN_HELP)('eject-conf')}`);
40
44
  _defineProperty(this, "alias", '');
41
45
  _defineProperty(this, "group", 'component-config');
42
46
  _defineProperty(this, "options", [['p', 'propagate', 'mark propagate true in the config file, so that component.json configs will be merge with workspace configs'], ['o', 'override', 'override file if exist']]);
@@ -1 +1 @@
1
- {"version":3,"names":["_path","data","_interopRequireDefault","require","_chalk","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","EjectConfCmd","constructor","workspace","PATTERN_HELP","report","args","options","ejectResult","json","paths","map","result","configPath","p","path","relative","join","chalk","green","bold","pattern","ejectOptions","propagate","override","componentIds","idsByPattern","results","ejectMultipleConfigs","exports"],"sources":["eject-conf.cmd.ts"],"sourcesContent":["import path from 'path';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { PATTERN_HELP } from '@teambit/legacy.constants';\n\nimport type { 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 <pattern>';\n description = 'eject components configuration (create a `component.json` file)';\n extendedDescription = `note this can be reversed at any time by snapping/tagging changes and deleting the component.json file \\n${PATTERN_HELP(\n 'eject-conf'\n )}`;\n alias = '';\n group = 'component-config';\n options = [\n [\n 'p',\n 'propagate',\n 'mark propagate true in the config file, so that component.json configs will be merge with workspace configs',\n ],\n ['o', 'override', 'override file if exist'],\n ] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report(args: EjectConfArgs, options: EjectConfOptionsCLI): Promise<string> {\n const ejectResult = await this.json(args, options);\n const paths = ejectResult\n .map((result) => result.configPath)\n .map((p) => path.relative(this.workspace.path, p))\n .join('\\n');\n return chalk.green(`successfully ejected config to the following path(s)\n${chalk.bold(paths)}`);\n }\n\n async json([pattern]: 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 componentIds = await this.workspace.idsByPattern(pattern);\n const results = await this.workspace.ejectMultipleConfigs(componentIds, ejectOptions as EjectConfOptions);\n return results;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyD,SAAAC,uB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AAMA,CAACC,IAAmB,EAAEC,OAA4B,EAAmB;IAC/E,MAAMC,WAAW,GAAG,MAAM,IAAI,CAACC,IAAI,CAACH,IAAI,EAAEC,OAAO,CAAC;IAClD,MAAMG,KAAK,GAAGF,WAAW,CACtBG,GAAG,CAAEC,MAAM,IAAKA,MAAM,CAACC,UAAU,CAAC,CAClCF,GAAG,CAAEG,CAAC,IAAKC,eAAI,CAACC,QAAQ,CAAC,IAAI,CAACb,SAAS,CAACY,IAAI,EAAED,CAAC,CAAC,CAAC,CACjDG,IAAI,CAAC,IAAI,CAAC;IACb,OAAOC,gBAAK,CAACC,KAAK,CAAC;AACvB,EAAED,gBAAK,CAACE,IAAI,CAACV,KAAK,CAAC,EAAE,CAAC;EACpB;EAEA,MAAMD,IAAIA,CAAC,CAACY,OAAO,CAAgB,EAAEd,OAA4B,EAA8B;IAC7F,MAAMe,YAAY,GAAGf,OAAO;IAC5B,IAAIe,YAAY,CAACC,SAAS,KAAK,MAAM,EAAE;MACrCD,YAAY,CAACC,SAAS,GAAG,IAAI;IAC/B;IACA,IAAID,YAAY,CAACE,QAAQ,KAAK,MAAM,EAAE;MACpCF,YAAY,CAACE,QAAQ,GAAG,IAAI;IAC9B;IAEA,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACtB,SAAS,CAACuB,YAAY,CAACL,OAAO,CAAC;IAC/D,MAAMM,OAAO,GAAG,MAAM,IAAI,CAACxB,SAAS,CAACyB,oBAAoB,CAACH,YAAY,EAAEH,YAAgC,CAAC;IACzG,OAAOK,OAAO;EAChB;AACF;AAACE,OAAA,CAAA/C,OAAA,GAAAmB,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_path","data","_interopRequireDefault","require","_chalk","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","EjectConfCmd","constructor","workspace","PATTERN_HELP","report","args","options","ejectResult","json","paths","map","result","configPath","p","path","relative","join","chalk","green","bold","pattern","ejectOptions","propagate","override","componentIds","idsByPattern","results","ejectMultipleConfigs","exports"],"sources":["eject-conf.cmd.ts"],"sourcesContent":["import path from 'path';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { PATTERN_HELP } from '@teambit/legacy.constants';\n\nimport type { 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 <pattern>';\n description = 'create component.json configuration files for components';\n extendedDescription = `generates component.json files containing component-specific configuration that overrides workspace defaults.\nuseful for customizing individual component settings. alternatively, use commands like \"bit env set\", \"bit deps set\", or \"bit aspect set\".\ncan be reversed by deleting the component.json file and snapping/tagging the changes.\n\n${PATTERN_HELP('eject-conf')}`;\n alias = '';\n group = 'component-config';\n options = [\n [\n 'p',\n 'propagate',\n 'mark propagate true in the config file, so that component.json configs will be merge with workspace configs',\n ],\n ['o', 'override', 'override file if exist'],\n ] as CommandOptions;\n\n constructor(private workspace: Workspace) {}\n\n async report(args: EjectConfArgs, options: EjectConfOptionsCLI): Promise<string> {\n const ejectResult = await this.json(args, options);\n const paths = ejectResult\n .map((result) => result.configPath)\n .map((p) => path.relative(this.workspace.path, p))\n .join('\\n');\n return chalk.green(`successfully ejected config to the following path(s)\n${chalk.bold(paths)}`);\n }\n\n async json([pattern]: 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 componentIds = await this.workspace.idsByPattern(pattern);\n const results = await this.workspace.ejectMultipleConfigs(componentIds, ejectOptions as EjectConfOptions);\n return results;\n }\n}\n"],"mappings":";;;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,MAAM,IAAI,CAACtB,SAAS,CAACuB,YAAY,CAACL,OAAO,CAAC;IAC/D,MAAMM,OAAO,GAAG,MAAM,IAAI,CAACxB,SAAS,CAACyB,oBAAoB,CAACH,YAAY,EAAEH,YAAgC,CAAC;IACzG,OAAOK,OAAO;EAChB;AACF;AAACE,OAAA,CAAA/C,OAAA,GAAAmB,YAAA","ignoreList":[]}
@@ -27,7 +27,7 @@ class PatternCommand {
27
27
  this.workspace = workspace;
28
28
  _defineProperty(this, "name", 'pattern <pattern>');
29
29
  _defineProperty(this, "alias", '');
30
- _defineProperty(this, "description", 'list the component ids matching the given pattern');
30
+ _defineProperty(this, "description", 'test and validate component patterns');
31
31
  _defineProperty(this, "extendedDescription", `this command helps validating a pattern before using it in other commands.
32
32
  NOTE: always wrap the pattern with quotes to avoid collision with shell commands. depending on your shell, it might be single or double quotes.
33
33
  a pattern can be a simple component-id or component-name. e.g. 'ui/button'.
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_filter","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PatternCommand","constructor","workspace","statesFilter","join","cmd","description","report","pattern","ids","json","title","chalk","green","bold","length","toString","idsByPattern","exports"],"sources":["pattern.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport type { Workspace } from './workspace';\nimport { statesFilter } from './filter';\n\nexport class PatternCommand implements Command {\n name = 'pattern <pattern>';\n alias = '';\n description = 'list the component ids matching the given pattern';\n extendedDescription = `this command helps validating a pattern before using it in other commands.\nNOTE: always wrap the pattern with quotes to avoid collision with shell commands. depending on your shell, it might be single or double quotes.\na pattern can be a simple component-id or component-name. e.g. 'ui/button'.\na pattern can be used with wildcards for multiple component ids, e.g. 'org.scope/utils/**' or '**/utils/**' to capture all org/scopes.\nto enter multiple patterns, separate them by a comma, e.g. 'ui/*, lib/*'\nto exclude, use '!'. e.g. 'ui/**, !ui/button'\nthe matching algorithm is from multimatch (@see https://github.com/sindresorhus/multimatch).\n\nto filter by a state or attribute, prefix the pattern with \"$\". e.g. '$deprecated', '$modified'.\nlist of supported states: [${statesFilter.join(', ')}].\nto filter by multi-params state/attribute, separate the params with \":\", e.g. '$env:teambit.react/react'.\nlist of supported multi-params states: [env].\nto match a state and another criteria, use \" AND \" keyword. e.g. '$modified AND teambit.workspace/** AND $env:teambit.react/react'.\n`;\n examples = [\n { cmd: \"bit pattern '**'\", description: 'matches all components' },\n {\n cmd: \"bit pattern '*/ui/*'\",\n description:\n 'matches components with any scope-name and the \"ui\" namespace. e.g. \"ui/button\" but not \"ui/elements/button\"',\n },\n {\n cmd: \"bit pattern '*/ui/**'\",\n description: 'matches components whose namespace starts with \"ui/\" e.g. \"ui/button\", \"ui/elements/button\"',\n },\n { cmd: \"bit pattern 'bar, foo'\", description: 'matches two components: bar and foo' },\n { cmd: \"bit pattern 'my-scope.org/**'\", description: 'matches all components of the scope \"my-scope.org\"' },\n ];\n group = 'info-analysis';\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"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwC,SAAAC,uBAAAG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sB;MAC3BC,WAAW,EACT;IACJ,CAAC,EACD;MACED,GAAG,EAAE,uBAAuB;MAC5BC,WAAW,EAAE;IACf,CAAC,EACD;MAAED,GAAG,EAAE,wBAAwB;MAAEC,WAAW,EAAE;IAAsC,CAAC,EACrF;MAAED,GAAG,EAAE,+BAA+B;MAAEC,WAAW,EAAE;IAAqD,CAAC,CAC5G;IAAAxB,eAAA,gBACO,eAAe;IAAAA,eAAA,kBACb,KAAK;IAAAA,eAAA,kBACL,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,2BAA2B,CAAC,CAAC;EAEX;EAE3C,MAAMyB,MAAMA,CAAC,CAACC,OAAO,CAAW,EAAE;IAChC,MAAMC,GAAG,GAAG,MAAM,IAAI,CAACC,IAAI,CAAC,CAACF,OAAO,CAAC,CAAC;IACtC,MAAMG,KAAK,GAAGC,gBAAK,CAACC,KAAK,CAAC,SAASD,gBAAK,CAACE,IAAI,CAACL,GAAG,CAACM,MAAM,CAACC,QAAQ,CAAC,CAAC,CAAC,kCAAkC,CAAC;IACvG,OAAO,GAAGL,KAAK,KAAKF,GAAG,CAACL,IAAI,CAAC,IAAI,CAAC,EAAE;EACtC;EAEA,MAAMM,IAAIA,CAAC,CAACF,OAAO,CAAW,EAAE;IAC9B,OAAO,IAAI,CAACN,SAAS,CAACe,YAAY,CAACT,OAAO,EAAE,KAAK,CAAC;EACpD;AACF;AAACU,OAAA,CAAAlB,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_filter","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PatternCommand","constructor","workspace","statesFilter","join","cmd","description","report","pattern","ids","json","title","chalk","green","bold","length","toString","idsByPattern","exports"],"sources":["pattern.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport type { Workspace } from './workspace';\nimport { statesFilter } from './filter';\n\nexport class PatternCommand implements Command {\n name = 'pattern <pattern>';\n alias = '';\n description = 'test and validate component patterns';\n extendedDescription = `this command helps validating a pattern before using it in other commands.\nNOTE: always wrap the pattern with quotes to avoid collision with shell commands. depending on your shell, it might be single or double quotes.\na pattern can be a simple component-id or component-name. e.g. 'ui/button'.\na pattern can be used with wildcards for multiple component ids, e.g. 'org.scope/utils/**' or '**/utils/**' to capture all org/scopes.\nto enter multiple patterns, separate them by a comma, e.g. 'ui/*, lib/*'\nto exclude, use '!'. e.g. 'ui/**, !ui/button'\nthe matching algorithm is from multimatch (@see https://github.com/sindresorhus/multimatch).\n\nto filter by a state or attribute, prefix the pattern with \"$\". e.g. '$deprecated', '$modified'.\nlist of supported states: [${statesFilter.join(', ')}].\nto filter by multi-params state/attribute, separate the params with \":\", e.g. '$env:teambit.react/react'.\nlist of supported multi-params states: [env].\nto match a state and another criteria, use \" AND \" keyword. e.g. '$modified AND teambit.workspace/** AND $env:teambit.react/react'.\n`;\n examples = [\n { cmd: \"bit pattern '**'\", description: 'matches all components' },\n {\n cmd: \"bit pattern '*/ui/*'\",\n description:\n 'matches components with any scope-name and the \"ui\" namespace. e.g. \"ui/button\" but not \"ui/elements/button\"',\n },\n {\n cmd: \"bit pattern '*/ui/**'\",\n description: 'matches components whose namespace starts with \"ui/\" e.g. \"ui/button\", \"ui/elements/button\"',\n },\n { cmd: \"bit pattern 'bar, foo'\", description: 'matches two components: bar and foo' },\n { cmd: \"bit pattern 'my-scope.org/**'\", description: 'matches all components of the scope \"my-scope.org\"' },\n ];\n group = 'info-analysis';\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);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 -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.750/dist/workspace.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.750/dist/workspace.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.752/dist/workspace.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.752/dist/workspace.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -7,22 +7,21 @@ type UseWorkspaceOptions = {
7
7
  onComponentRemoved?: (compId: ComponentID[]) => void;
8
8
  };
9
9
  export declare function useWorkspace(options?: UseWorkspaceOptions): {
10
- errors?: ReadonlyArray<import("graphql").GraphQLFormattedError> | undefined;
11
10
  error?: import("@apollo/client").ApolloError | undefined;
12
11
  loading: boolean;
13
- client: import("@apollo/client").ApolloClient<any>;
14
12
  variables: import("@apollo/client").OperationVariables | undefined;
15
- observable: import("@apollo/client").ObservableQuery<any, import("@apollo/client").OperationVariables>;
16
- networkStatus: import("@apollo/client").NetworkStatus;
17
- called: boolean;
18
13
  startPolling: (pollInterval: number) => void;
19
14
  stopPolling: () => void;
20
- updateQuery: (mapFn: import("@apollo/client").UpdateQueryMapFn<any, import("@apollo/client").OperationVariables>) => void;
15
+ updateQuery: <TVars = import("@apollo/client").OperationVariables>(mapFn: (previousQueryResult: any, options: Pick<import("@apollo/client").WatchQueryOptions<TVars, any>, "variables">) => any) => void;
21
16
  reobserve: (newOptions?: Partial<import("@apollo/client").WatchQueryOptions<import("@apollo/client").OperationVariables, any>> | undefined, newNetworkStatus?: import("@apollo/client").NetworkStatus) => Promise<import("@apollo/client").ApolloQueryResult<any>>;
17
+ client: import("@apollo/client").ApolloClient<any>;
18
+ observable: import("@apollo/client").ObservableQuery<any, import("@apollo/client").OperationVariables>;
19
+ networkStatus: import("@apollo/client").NetworkStatus;
20
+ called: boolean;
22
21
  previousData?: any;
23
22
  fetchMore: (options: import("@apollo/client").FetchMoreQueryOptions<import("@apollo/client").OperationVariables, any>) => Promise<import("@apollo/client").ApolloQueryResult<any>>;
24
23
  refetch: (variables?: Partial<import("@apollo/client").OperationVariables> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<any>>;
25
24
  workspace: Workspace | undefined;
26
- subscribeToMore: import("@apollo/client").SubscribeToMoreFunction<any, import("@apollo/client").OperationVariables>;
25
+ subscribeToMore: <TSubscriptionData = any, TSubscriptionVariables = import("@apollo/client").OperationVariables>(options: import("@apollo/client").SubscribeToMoreOptions<any, TSubscriptionVariables, TSubscriptionData>) => () => void;
27
26
  };
28
27
  export {};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/workspace",
3
- "version": "1.0.750",
3
+ "version": "1.0.752",
4
4
  "homepage": "https://bit.cloud/teambit/workspace/workspace",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.workspace",
8
8
  "name": "workspace",
9
- "version": "1.0.750"
9
+ "version": "1.0.752"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -28,57 +28,57 @@
28
28
  "reset-css": "5.0.1",
29
29
  "@teambit/component-id": "1.2.4",
30
30
  "@teambit/harmony": "0.4.7",
31
- "@teambit/legacy.extension-data": "0.0.75",
32
- "@teambit/legacy.scope": "0.0.73",
31
+ "@teambit/legacy.extension-data": "0.0.76",
32
+ "@teambit/legacy.scope": "0.0.74",
33
33
  "@teambit/component-version": "1.0.4",
34
- "@teambit/legacy.consumer-component": "0.0.74",
35
- "@teambit/legacy.consumer": "0.0.73",
34
+ "@teambit/legacy.consumer-component": "0.0.75",
35
+ "@teambit/legacy.consumer": "0.0.74",
36
36
  "@teambit/bit-error": "0.0.404",
37
37
  "@teambit/lane-id": "0.0.312",
38
- "@teambit/legacy.bit-map": "0.0.130",
38
+ "@teambit/legacy.bit-map": "0.0.131",
39
39
  "@teambit/toolbox.fs.last-modified": "0.0.8",
40
40
  "@teambit/toolbox.path.path": "0.0.10",
41
41
  "@teambit/graph.cleargraph": "0.0.11",
42
- "@teambit/logger": "0.0.1365",
43
- "@teambit/cli": "0.0.1272",
42
+ "@teambit/logger": "0.0.1366",
43
+ "@teambit/cli": "0.0.1273",
44
44
  "@teambit/component.ui.component-status-resolver": "0.0.510",
45
- "@teambit/legacy.constants": "0.0.17",
46
- "@teambit/harmony.modules.resolved-component": "0.0.506",
47
- "@teambit/legacy.utils": "0.0.26",
48
- "@teambit/config-store": "0.0.152",
49
- "@teambit/config": "0.0.1446",
50
- "@teambit/harmony.modules.requireable-component": "0.0.506",
45
+ "@teambit/legacy.constants": "0.0.18",
46
+ "@teambit/harmony.modules.resolved-component": "0.0.507",
47
+ "@teambit/legacy.utils": "0.0.27",
48
+ "@teambit/config-store": "0.0.153",
49
+ "@teambit/config": "0.0.1447",
50
+ "@teambit/harmony.modules.requireable-component": "0.0.507",
51
51
  "@teambit/toolbox.modules.module-resolver": "0.0.13",
52
- "@teambit/workspace.modules.node-modules-linker": "0.0.301",
53
- "@teambit/global-config": "0.0.1275",
54
- "@teambit/legacy.consumer-config": "0.0.73",
55
- "@teambit/variants": "0.0.1539",
56
- "@teambit/component-issues": "0.0.163",
57
- "@teambit/component.sources": "0.0.125",
52
+ "@teambit/workspace.modules.node-modules-linker": "0.0.302",
53
+ "@teambit/global-config": "0.0.1276",
54
+ "@teambit/legacy.consumer-config": "0.0.74",
55
+ "@teambit/variants": "0.0.1540",
56
+ "@teambit/component-issues": "0.0.164",
57
+ "@teambit/component.sources": "0.0.126",
58
58
  "@teambit/dependencies.modules.packages-excluder": "1.0.8",
59
- "@teambit/harmony.modules.in-memory-cache": "0.0.20",
59
+ "@teambit/harmony.modules.in-memory-cache": "0.0.21",
60
60
  "@teambit/legacy-bit-id": "1.1.3",
61
- "@teambit/legacy.component-list": "0.0.127",
62
- "@teambit/legacy.scope-api": "0.0.128",
63
- "@teambit/scope.remotes": "0.0.73",
61
+ "@teambit/legacy.component-list": "0.0.128",
62
+ "@teambit/legacy.scope-api": "0.0.129",
63
+ "@teambit/scope.remotes": "0.0.74",
64
64
  "@teambit/toolbox.path.is-path-inside": "0.0.502",
65
- "@teambit/workspace.modules.match-pattern": "0.0.513",
66
- "@teambit/component.ui.component-drawer": "0.0.465",
65
+ "@teambit/workspace.modules.match-pattern": "0.0.514",
66
+ "@teambit/component.ui.component-drawer": "0.0.466",
67
67
  "@teambit/design.ui.tree": "0.0.16",
68
68
  "@teambit/lanes.hooks.use-lane-components": "0.0.295",
69
69
  "@teambit/lanes.hooks.use-lanes": "0.0.290",
70
70
  "@teambit/lanes.ui.models.lanes-model": "0.0.229",
71
- "@teambit/ui-foundation.ui.side-bar": "0.0.918",
71
+ "@teambit/ui-foundation.ui.side-bar": "0.0.919",
72
72
  "@teambit/component.ui.component-filters.component-filter-context": "0.0.239",
73
73
  "@teambit/component.ui.component-filters.deprecate-filter": "0.0.239",
74
- "@teambit/component.ui.component-filters.env-filter": "0.0.261",
74
+ "@teambit/component.ui.component-filters.env-filter": "0.0.262",
75
75
  "@teambit/component.ui.component-filters.show-main-filter": "0.0.232",
76
76
  "@teambit/design.ui.surfaces.menu.link-item": "1.0.13",
77
77
  "@teambit/ui-foundation.ui.main-dropdown": "0.0.505",
78
78
  "@teambit/ui-foundation.ui.menu": "0.0.503",
79
79
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.518",
80
80
  "@teambit/ui-foundation.ui.tree.drawer": "0.0.518",
81
- "@teambit/harmony.modules.concurrency": "0.0.18",
81
+ "@teambit/harmony.modules.concurrency": "0.0.19",
82
82
  "@teambit/toolbox.promise.map-pool": "0.0.8",
83
83
  "@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.506",
84
84
  "@teambit/workspace.ui.use-workspace-mode": "0.0.2",
@@ -92,7 +92,7 @@
92
92
  "@teambit/ui-foundation.ui.notifications.notification-context": "0.0.501",
93
93
  "@teambit/ui-foundation.ui.top-bar": "0.0.515",
94
94
  "@teambit/workspace.ui.preserve-workspace-mode": "0.0.2",
95
- "@teambit/cloud.hooks.use-cloud-scopes": "0.0.12",
95
+ "@teambit/cloud.hooks.use-cloud-scopes": "0.0.13",
96
96
  "@teambit/design.ui.tooltip": "0.0.381",
97
97
  "@teambit/explorer.ui.component-card": "0.0.51",
98
98
  "@teambit/explorer.ui.gallery.component-grid": "0.0.496",
@@ -100,23 +100,23 @@
100
100
  "@teambit/scopes.scope-id": "0.0.9",
101
101
  "@teambit/workspace.ui.empty-workspace": "0.0.509",
102
102
  "@teambit/workspace.ui.workspace-component-card": "0.0.562",
103
- "@teambit/component": "1.0.750",
104
- "@teambit/dependency-resolver": "1.0.750",
105
- "@teambit/envs": "1.0.750",
106
- "@teambit/objects": "0.0.257",
107
- "@teambit/scope": "1.0.750",
108
- "@teambit/graph": "1.0.750",
109
- "@teambit/isolator": "1.0.750",
110
- "@teambit/component-tree": "1.0.750",
111
- "@teambit/watcher": "1.0.750",
112
- "@teambit/aspect-loader": "1.0.750",
113
- "@teambit/graphql": "1.0.750",
114
- "@teambit/bundler": "1.0.750",
115
- "@teambit/ui": "1.0.750",
116
- "@teambit/command-bar": "1.0.750",
117
- "@teambit/sidebar": "1.0.750",
118
- "@teambit/pubsub": "1.0.750",
119
- "@teambit/deprecation": "1.0.750"
103
+ "@teambit/component": "1.0.752",
104
+ "@teambit/dependency-resolver": "1.0.752",
105
+ "@teambit/envs": "1.0.752",
106
+ "@teambit/objects": "0.0.259",
107
+ "@teambit/scope": "1.0.752",
108
+ "@teambit/graph": "1.0.752",
109
+ "@teambit/isolator": "1.0.752",
110
+ "@teambit/component-tree": "1.0.752",
111
+ "@teambit/watcher": "1.0.752",
112
+ "@teambit/aspect-loader": "1.0.752",
113
+ "@teambit/graphql": "1.0.752",
114
+ "@teambit/bundler": "1.0.752",
115
+ "@teambit/ui": "1.0.752",
116
+ "@teambit/command-bar": "1.0.752",
117
+ "@teambit/sidebar": "1.0.752",
118
+ "@teambit/pubsub": "1.0.752",
119
+ "@teambit/deprecation": "1.0.752"
120
120
  },
121
121
  "devDependencies": {
122
122
  "@types/lodash": "4.14.165",