@teambit/pkg 1.0.228 → 1.0.229

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.
Files changed (35) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/preview/static/css/teambit.pkg/{pkg-preview.6879221c.css → pkg-preview.382859be.css} +6 -6
  3. package/artifacts/preview/teambit_pkg_pkg-preview.js +6 -6
  4. package/artifacts/schema.json +464 -112
  5. package/dist/exceptions/index.d.ts +3 -0
  6. package/dist/exceptions/package-tar-filet-not-found.d.ts +6 -0
  7. package/dist/exceptions/pkg-artifact-not-found.d.ts +6 -0
  8. package/dist/exceptions/scope-not-found.d.ts +5 -0
  9. package/dist/index.d.ts +6 -0
  10. package/dist/pack.cmd.d.ts +25 -0
  11. package/dist/pack.task.d.ts +17 -0
  12. package/dist/package-dependency/index.d.ts +2 -0
  13. package/dist/package-dependency/package-dependency-factory.d.ts +8 -0
  14. package/dist/package-dependency/package-dependency.d.ts +7 -0
  15. package/dist/package-env-type.d.ts +8 -0
  16. package/dist/package-generator.d.ts +19 -0
  17. package/dist/package.fragment.d.ts +16 -0
  18. package/dist/package.route.d.ts +18 -0
  19. package/dist/packer.d.ts +42 -0
  20. package/dist/pkg-artifact.d.ts +5 -0
  21. package/dist/pkg.aspect.d.ts +3 -0
  22. package/dist/pkg.composition.d.ts +1 -0
  23. package/dist/pkg.graphql.d.ts +3 -0
  24. package/dist/pkg.main.runtime.d.ts +194 -0
  25. package/dist/pkg.service.d.ts +18 -0
  26. package/dist/pkg.ui.runtime.d.ts +10 -0
  27. package/dist/prepare-packages.task.d.ts +31 -0
  28. package/dist/{preview-1712805335812.js → preview-1712822929999.js} +2 -2
  29. package/dist/publish-dry-run.task.d.ts +18 -0
  30. package/dist/publish.cmd.d.ts +24 -0
  31. package/dist/publish.task.d.ts +15 -0
  32. package/dist/publisher.d.ts +32 -0
  33. package/dist/write-npm-ignore.d.ts +3 -0
  34. package/package.json +17 -17
  35. package/tsconfig.json +1 -43
@@ -0,0 +1,3 @@
1
+ export { PkgArtifactNotFound } from './pkg-artifact-not-found';
2
+ export { ScopeNotFound } from './scope-not-found';
3
+ export { PackageTarFiletNotFound } from './package-tar-filet-not-found';
@@ -0,0 +1,6 @@
1
+ import { ComponentID } from '@teambit/component';
2
+ import { BitError } from '@teambit/bit-error';
3
+ export declare class PackageTarFiletNotFound extends BitError {
4
+ readonly componentId: ComponentID;
5
+ constructor(componentId: ComponentID);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { ComponentID } from '@teambit/component';
2
+ import { BitError } from '@teambit/bit-error';
3
+ export declare class PkgArtifactNotFound extends BitError {
4
+ readonly componentId: ComponentID;
5
+ constructor(componentId: ComponentID);
6
+ }
@@ -0,0 +1,5 @@
1
+ import { BitError } from '@teambit/bit-error';
2
+ export declare class ScopeNotFound extends BitError {
3
+ readonly scopePath?: string | undefined;
4
+ constructor(scopePath?: string | undefined);
5
+ }
@@ -0,0 +1,6 @@
1
+ export type { PkgMain, PackageJsonProps, ComponentPackageManifest, ComponentPkgExtensionData, VersionPackageManifest, } from './pkg.main.runtime';
2
+ export type { PackageDependency, PackageDependencyFactory } from './package-dependency';
3
+ export type { PackageEnv } from './package-env-type';
4
+ export { PackageGenerator } from './package-generator';
5
+ export { PkgAspect as default, PkgAspect } from './pkg.aspect';
6
+ export { PkgUI } from './pkg.ui.runtime';
@@ -0,0 +1,25 @@
1
+ import { Command, CommandOptions } from '@teambit/cli';
2
+ import { Packer } from './packer';
3
+ type PackArgs = [string, string];
4
+ type PackCmdOptions = {
5
+ outDir?: string;
6
+ override?: boolean;
7
+ prefix?: boolean;
8
+ keep?: boolean;
9
+ };
10
+ export declare class PackCmd implements Command {
11
+ private packer;
12
+ name: string;
13
+ description: string;
14
+ options: CommandOptions;
15
+ alias: string;
16
+ group: string;
17
+ private: boolean;
18
+ constructor(packer: Packer);
19
+ report(args: PackArgs, options: PackCmdOptions): Promise<string>;
20
+ json([componentId, scopePath]: PackArgs, options: PackCmdOptions): Promise<{
21
+ data: import("./packer").PackResultWithId;
22
+ code: number;
23
+ }>;
24
+ }
25
+ export {};
@@ -0,0 +1,17 @@
1
+ import { BuildContext, BuiltTaskResult, BuildTask, TaskLocation } from '@teambit/builder';
2
+ import { Logger } from '@teambit/logger';
3
+ import { Packer } from './packer';
4
+ /**
5
+ * pack components to a .tgz file
6
+ */
7
+ export declare class PackTask implements BuildTask {
8
+ readonly aspectId: string;
9
+ private packer;
10
+ private logger;
11
+ readonly name = "PackComponents";
12
+ readonly description = "Packing components into a .tgz file";
13
+ readonly location: TaskLocation;
14
+ readonly dependencies: string[];
15
+ constructor(aspectId: string, packer: Packer, logger: Logger);
16
+ execute(context: BuildContext): Promise<BuiltTaskResult>;
17
+ }
@@ -0,0 +1,2 @@
1
+ export { PackageDependency, SerializedPackageDependency } from './package-dependency';
2
+ export { PackageDependencyFactory } from './package-dependency-factory';
@@ -0,0 +1,8 @@
1
+ import { SerializedDependency, DependencyFactory, DependencyList } from '@teambit/dependency-resolver';
2
+ import LegacyComponent from '@teambit/legacy/dist/consumer/component';
3
+ export declare class PackageDependencyFactory implements DependencyFactory {
4
+ type: string;
5
+ constructor();
6
+ parse<PackageDependency, S extends SerializedDependency>(serialized: S): PackageDependency;
7
+ fromLegacyComponent(legacyComponent: LegacyComponent): Promise<DependencyList>;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseDependency, SerializedDependency, DependencyLifecycleType, DependencySource } from '@teambit/dependency-resolver';
2
+ export interface SerializedPackageDependency extends SerializedDependency {
3
+ }
4
+ export declare class PackageDependency extends BaseDependency {
5
+ constructor(id: string, version: string, lifecycle: DependencyLifecycleType, source?: DependencySource, hidden?: boolean, optional?: boolean);
6
+ getPackageName(): string;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { EnvHandler } from '@teambit/envs';
2
+ import { PackageGenerator } from './package-generator';
3
+ export interface PackageEnv {
4
+ /**
5
+ * return a PackageGenerator instance.
6
+ */
7
+ package(): EnvHandler<PackageGenerator>;
8
+ }
@@ -0,0 +1,19 @@
1
+ import { EnvContext, EnvHandler } from '@teambit/envs';
2
+ import { PackageJsonProps } from './pkg.main.runtime';
3
+ export type PackageGeneratorOptions = {
4
+ packageJson: PackageJsonProps;
5
+ npmIgnore?: string[];
6
+ };
7
+ /**
8
+ * create and maintain build pipelines for component
9
+ * dev environments.
10
+ */
11
+ export declare class PackageGenerator {
12
+ private _packageJson;
13
+ private _npmIgnore;
14
+ private context;
15
+ constructor(_packageJson: PackageJsonProps, _npmIgnore: string[], context: EnvContext);
16
+ get packageJsonProps(): PackageJsonProps;
17
+ get npmIgnore(): string[];
18
+ static from(options: PackageGeneratorOptions): EnvHandler<PackageGenerator>;
19
+ }
@@ -0,0 +1,16 @@
1
+ import { Component, ShowFragment } from '@teambit/component';
2
+ import { PkgMain } from './pkg.main.runtime';
3
+ export declare class PackageFragment implements ShowFragment {
4
+ private pkg;
5
+ constructor(pkg: PkgMain);
6
+ title: string;
7
+ renderRow(component: Component): Promise<{
8
+ title: string;
9
+ content: string;
10
+ }>;
11
+ json(component: Component): Promise<{
12
+ title: string;
13
+ json: string;
14
+ }>;
15
+ weight: number;
16
+ }
@@ -0,0 +1,18 @@
1
+ /// <reference types="express" />
2
+ import { Request, Response, Route } from '@teambit/express';
3
+ import { PkgMain } from './pkg.main.runtime';
4
+ export declare const routePath = "package";
5
+ export declare class PackageRoute implements Route {
6
+ /**
7
+ * pkg extension.
8
+ */
9
+ private pkg;
10
+ constructor(
11
+ /**
12
+ * pkg extension.
13
+ */
14
+ pkg: PkgMain);
15
+ route: string;
16
+ method: string;
17
+ middlewares: ((req: Request, res: Response) => Promise<import("express").Response<any, Record<string, any>>>)[];
18
+ }
@@ -0,0 +1,42 @@
1
+ import { ComponentFactory } from '@teambit/component';
2
+ import { ComponentResult, ArtifactDefinition } from '@teambit/builder';
3
+ import { Capsule, IsolatorMain } from '@teambit/isolator';
4
+ import { ScopeMain } from '@teambit/scope';
5
+ import { Logger } from '@teambit/logger';
6
+ export type PackResult = Omit<ComponentResult, 'component'>;
7
+ export type PackResultWithId = PackResult & {
8
+ id: string;
9
+ };
10
+ export declare const DEFAULT_TAR_DIR_IN_CAPSULE = "package-tar";
11
+ export declare const TAR_FILE_ARTIFACT_NAME = "package tar file";
12
+ export type PackResultMetadata = {
13
+ pkgJson: Record<any, string>;
14
+ tarPath: string;
15
+ tarName: string;
16
+ checksum?: string;
17
+ integrity?: string;
18
+ };
19
+ export type PackWriteOptions = {
20
+ outDir?: string;
21
+ override?: boolean;
22
+ };
23
+ export type PackOptions = {
24
+ writeOptions: PackWriteOptions;
25
+ prefix?: boolean;
26
+ keep?: boolean;
27
+ loadScopeFromCache?: boolean;
28
+ dryRun?: boolean;
29
+ };
30
+ export declare class Packer {
31
+ private isolator;
32
+ private logger;
33
+ private host;
34
+ private scope?;
35
+ constructor(isolator: IsolatorMain, logger: Logger, host: ComponentFactory, scope?: ScopeMain | undefined);
36
+ packComponent(componentId: string, scopePath: string | undefined, options: PackOptions): Promise<PackResultWithId>;
37
+ packMultipleCapsules(capsules: Capsule[], writeOptions?: PackWriteOptions, dryRun?: boolean, omitFullTarPath?: boolean): Promise<ComponentResult[]>;
38
+ packCapsule(capsule: Capsule, writeOptions?: PackWriteOptions, dryRun?: boolean, omitFullTarPath?: boolean): Promise<ComponentResult>;
39
+ pnpmPack(cwd: string, outputPath: string, override?: boolean, dryRun?: boolean): Promise<PackResult>;
40
+ getArtifactDefInCapsule(outDir?: string): ArtifactDefinition;
41
+ private getCapsule;
42
+ }
@@ -0,0 +1,5 @@
1
+ import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
2
+ export declare class PkgArtifact {
3
+ private artifacts;
4
+ constructor(artifacts: AbstractVinyl[]);
5
+ }
@@ -0,0 +1,3 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const PkgAspect: Aspect;
3
+ export default PkgAspect;
@@ -0,0 +1 @@
1
+ export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { Schema } from '@teambit/graphql';
2
+ import { PkgMain } from './pkg.main.runtime';
3
+ export declare function pkgSchema(pkg: PkgMain): Schema;
@@ -0,0 +1,194 @@
1
+ import { CLIMain } from '@teambit/cli';
2
+ import { Component, ComponentMain, IComponent, Snap } from '@teambit/component';
3
+ import { EnvsMain } from '@teambit/envs';
4
+ import { SlotRegistry } from '@teambit/harmony';
5
+ import { IsolatorMain } from '@teambit/isolator';
6
+ import { LoggerMain, Logger } from '@teambit/logger';
7
+ import { ScopeMain } from '@teambit/scope';
8
+ import { Workspace } from '@teambit/workspace';
9
+ import { BuilderMain } from '@teambit/builder';
10
+ import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
11
+ import { GraphqlMain } from '@teambit/graphql';
12
+ import { DependencyResolverMain } from '@teambit/dependency-resolver';
13
+ import { Packer, PackOptions, PackResult } from './packer';
14
+ import { PublishTask } from './publish.task';
15
+ import { PkgArtifact } from './pkg-artifact';
16
+ export interface PackageJsonProps {
17
+ [key: string]: any;
18
+ }
19
+ export type PackageJsonPropsRegistry = SlotRegistry<PackageJsonProps>;
20
+ export type PkgExtensionConfig = {
21
+ packageManagerPublishArgs?: string[];
22
+ packageJson?: Record<string, any>;
23
+ avoidPublishToNPM?: boolean;
24
+ };
25
+ type GetModulePathOptions = {
26
+ absPath?: boolean;
27
+ };
28
+ /**
29
+ * Config for variants
30
+ */
31
+ export type ComponentPkgExtensionConfig = {
32
+ /**
33
+ * properties to add to the package.json of the component.
34
+ */
35
+ packageJson: Record<string, any>;
36
+ };
37
+ /**
38
+ * Data stored in the component
39
+ */
40
+ export type ComponentPkgExtensionData = {
41
+ /**
42
+ * properties to add to the package.json of the component.
43
+ */
44
+ packageJsonModification: Record<string, any>;
45
+ /**
46
+ * Final package.json after creating tar file
47
+ */
48
+ pkgJson?: Record<string, any>;
49
+ /**
50
+ * integrity of the tar file
51
+ */
52
+ integrity?: string;
53
+ /**
54
+ * Checksum of the tar file
55
+ */
56
+ checksum?: string;
57
+ };
58
+ export type ComponentPackageManifest = {
59
+ name: string;
60
+ distTags: Record<string, string>;
61
+ externalRegistry: boolean;
62
+ versions: VersionPackageManifest[];
63
+ };
64
+ export type VersionPackageManifest = {
65
+ [key: string]: any;
66
+ dist: {
67
+ tarball: string;
68
+ shasum: string;
69
+ };
70
+ };
71
+ export declare class PkgMain {
72
+ /**
73
+ * logger extension
74
+ */
75
+ readonly logger: Logger;
76
+ /**
77
+ * pkg extension configuration.
78
+ */
79
+ readonly config: PkgExtensionConfig;
80
+ /**
81
+ * Registry for changes by other extensions.
82
+ */
83
+ private packageJsonPropsRegistry;
84
+ private workspace;
85
+ private scope;
86
+ private builder;
87
+ /**
88
+ * A utils class to packing components into tarball
89
+ */
90
+ private packer;
91
+ /**
92
+ * envs extension.
93
+ */
94
+ private envs;
95
+ private componentAspect;
96
+ /**
97
+ * keep it as public. external env might want to register it to the snap pipeline
98
+ */
99
+ publishTask: PublishTask;
100
+ private dependencyResolver;
101
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
102
+ static dependencies: import("@teambit/harmony").Aspect[];
103
+ static slots: ((registerFn: () => string) => SlotRegistry<PackageJsonProps>)[];
104
+ static defaultConfig: {};
105
+ static provider([cli, scope, envs, isolator, logger, workspace, builder, dependencyResolver, componentAspect, graphql]: [
106
+ CLIMain,
107
+ ScopeMain,
108
+ EnvsMain,
109
+ IsolatorMain,
110
+ LoggerMain,
111
+ Workspace,
112
+ BuilderMain,
113
+ DependencyResolverMain,
114
+ ComponentMain,
115
+ GraphqlMain
116
+ ], config: PkgExtensionConfig, [packageJsonPropsRegistry]: [PackageJsonPropsRegistry]): Promise<PkgMain>;
117
+ /**
118
+ * get the package name of a component.
119
+ */
120
+ getPackageName(component: Component): string;
121
+ getRuntimeModulePath(component: Component, options?: GetModulePathOptions): string;
122
+ /**
123
+ * returns the package path in the /node_modules/ folder
124
+ * In case you call this in order to run the code from the path, please refer to the `getRuntimeModulePath` API
125
+ */
126
+ getModulePath(component: Component, options?: GetModulePathOptions): string;
127
+ isModulePathExists(component: Component): boolean;
128
+ addMissingLinksFromNodeModulesIssue(component: Component): Promise<undefined>;
129
+ private manifestCache;
130
+ constructor(
131
+ /**
132
+ * logger extension
133
+ */
134
+ logger: Logger,
135
+ /**
136
+ * pkg extension configuration.
137
+ */
138
+ config: PkgExtensionConfig,
139
+ /**
140
+ * Registry for changes by other extensions.
141
+ */
142
+ packageJsonPropsRegistry: PackageJsonPropsRegistry, workspace: Workspace, scope: ScopeMain, builder: BuilderMain,
143
+ /**
144
+ * A utils class to packing components into tarball
145
+ */
146
+ packer: Packer,
147
+ /**
148
+ * envs extension.
149
+ */
150
+ envs: EnvsMain, componentAspect: ComponentMain,
151
+ /**
152
+ * keep it as public. external env might want to register it to the snap pipeline
153
+ */
154
+ publishTask: PublishTask, dependencyResolver: DependencyResolverMain);
155
+ /**
156
+ * register changes in the package.json
157
+ */
158
+ registerPackageJsonNewProps(props: PackageJsonProps): void;
159
+ /**
160
+ * Pack a component and generate a tarball suitable for npm registry
161
+ *
162
+ * @param {string} componentId
163
+ * @param {(string | undefined)} scopePath
164
+ * @param {string} outDir
165
+ * @param {boolean} [prefix=false]
166
+ * @param {boolean} [override=false]
167
+ * @param {boolean} [keep=false]
168
+ * @returns {Promise<PackResult>}
169
+ * @memberof PkgExtension
170
+ */
171
+ packComponent(componentId: string, scopePath: string | undefined, options: PackOptions): Promise<PackResult>;
172
+ /**
173
+ * Merge the configs provided by:
174
+ * 1. envs configured in the component - via getPackageJsonProps method
175
+ * 2. extensions that registered to the registerPackageJsonNewProps slot (and configured for the component)
176
+ * 3. props defined by the user (they are the strongest one)
177
+ */
178
+ mergePackageJsonProps(component: Component): Promise<PackageJsonProps>;
179
+ getPackageJsonModifications(component: Component): Record<string, any>;
180
+ getPkgArtifact(component: Component): Promise<PkgArtifact>;
181
+ getManifest(component: Component): Promise<ComponentPackageManifest>;
182
+ private getAllSnapsManifests;
183
+ /**
184
+ * Check if the component should be fetched from bit registry or from another registry
185
+ * This will usually determined by the latest version of the component
186
+ * @param component
187
+ */
188
+ isPublishedToExternalRegistry(component: IComponent): boolean;
189
+ private getComponentBuildData;
190
+ getSnapManifest(component: Component, snap: Snap): Promise<VersionPackageManifest | undefined>;
191
+ getPackageTarFile(component: Component): Promise<AbstractVinyl>;
192
+ transformPackageJson(component: Component, packageJsonObject: Record<string, any>): Promise<Record<string, any>>;
193
+ }
194
+ export {};
@@ -0,0 +1,18 @@
1
+ import { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap, GetNpmIgnoreContext } from '@teambit/envs';
2
+ import { PackageJsonProps } from './pkg.main.runtime';
3
+ export type PkgDescriptor = {
4
+ id: string;
5
+ displayName: string;
6
+ config?: string;
7
+ };
8
+ type PkgTransformationMap = ServiceTransformationMap & {
9
+ getPackageJsonProps: () => PackageJsonProps;
10
+ getNpmIgnore: (npmIgnoreContext?: GetNpmIgnoreContext) => string[];
11
+ };
12
+ export declare class PkgService implements EnvService<{}, PkgDescriptor> {
13
+ name: string;
14
+ render(env: EnvDefinition): Promise<string>;
15
+ transform(env: Env, context: EnvContext): PkgTransformationMap | undefined;
16
+ getDescriptor(env: EnvDefinition): PkgDescriptor | undefined;
17
+ }
18
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ComponentUI } from '@teambit/component';
2
+ export declare class PkgUI {
3
+ private compUI;
4
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
5
+ static dependencies: import("@teambit/harmony").Aspect[];
6
+ static provider([componentUI]: [ComponentUI]): Promise<PkgUI>;
7
+ constructor(compUI: ComponentUI);
8
+ private npmConsumeMethod;
9
+ }
10
+ export default PkgUI;
@@ -0,0 +1,31 @@
1
+ import { BuildContext, BuiltTaskResult, BuildTask } from '@teambit/builder';
2
+ import { EnvsMain } from '@teambit/envs';
3
+ import { Logger } from '@teambit/logger';
4
+ /**
5
+ * prepare packages for publishing.
6
+ */
7
+ export declare class PreparePackagesTask implements BuildTask {
8
+ readonly aspectId: string;
9
+ private logger;
10
+ private envs;
11
+ readonly name = "PreparePackages";
12
+ readonly location = "end";
13
+ constructor(aspectId: string, logger: Logger, envs: EnvsMain);
14
+ execute(context: BuildContext): Promise<BuiltTaskResult>;
15
+ private writeNpmIgnoreFile;
16
+ /**
17
+ * remove the source files and copy the dists files
18
+ * into the root of the capsule.
19
+ * this is needed when components import from other components internal paths. without this task,
20
+ * the internal paths are the source, so node will throw an error when trying to use them. this
21
+ * task makes sure that the internal paths point to the consumable code (dists).
22
+ */
23
+ private executeDistAsRootTask;
24
+ private removeSourceFiles;
25
+ private moveDistToRoot;
26
+ /**
27
+ * by default, the "main" prop points to the dist file (e.g. "dist/index./js").
28
+ * here, we have to change it because there is no dist dir anymore.
29
+ */
30
+ private updatePackageJson;
31
+ }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@1.0.228/dist/pkg.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@1.0.228/dist/pkg.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@1.0.229/dist/pkg.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@1.0.229/dist/pkg.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -0,0 +1,18 @@
1
+ import { BuildContext, BuiltTaskResult, BuildTask } from '@teambit/builder';
2
+ import { Logger } from '@teambit/logger';
3
+ import { Publisher } from './publisher';
4
+ import { Packer } from './packer';
5
+ /**
6
+ * publish build task is running "publish --dry-run" to avoid later npm errors during export
7
+ */
8
+ export declare class PublishDryRunTask implements BuildTask {
9
+ readonly aspectId: string;
10
+ private publisher;
11
+ private packer;
12
+ private logger;
13
+ readonly name = "PublishDryRun";
14
+ readonly location = "end";
15
+ dependencies: string[];
16
+ constructor(aspectId: string, publisher: Publisher, packer: Packer, logger: Logger);
17
+ execute(context: BuildContext): Promise<BuiltTaskResult>;
18
+ }
@@ -0,0 +1,24 @@
1
+ import { ComponentResult } from '@teambit/builder';
2
+ import { Command, CommandOptions } from '@teambit/cli';
3
+ import { Publisher, PublisherOptions } from './publisher';
4
+ type PublishArgs = [string];
5
+ export declare class PublishCmd implements Command {
6
+ private publisher;
7
+ name: string;
8
+ description: string;
9
+ arguments: {
10
+ name: string;
11
+ description: string;
12
+ }[];
13
+ options: CommandOptions;
14
+ alias: string;
15
+ private: boolean;
16
+ group: string;
17
+ constructor(publisher: Publisher);
18
+ report(args: PublishArgs, options: PublisherOptions): Promise<string>;
19
+ json([pattern]: PublishArgs, options: PublisherOptions): Promise<{
20
+ data: ComponentResult[];
21
+ code: number;
22
+ }>;
23
+ }
24
+ export {};
@@ -0,0 +1,15 @@
1
+ import { BuildContext, BuiltTaskResult, BuildTask, TaskLocation } from '@teambit/builder';
2
+ import { Logger } from '@teambit/logger';
3
+ import { Publisher } from './publisher';
4
+ /**
5
+ * publish components by running "npm publish"
6
+ */
7
+ export declare class PublishTask implements BuildTask {
8
+ readonly aspectId: string;
9
+ private publisher;
10
+ private logger;
11
+ readonly name = "PublishComponents";
12
+ readonly location: TaskLocation;
13
+ constructor(aspectId: string, publisher: Publisher, logger: Logger);
14
+ execute(context: BuildContext): Promise<BuiltTaskResult>;
15
+ }
@@ -0,0 +1,32 @@
1
+ import { ComponentResult } from '@teambit/builder';
2
+ import { Capsule, IsolatorMain } from '@teambit/isolator';
3
+ import { Logger } from '@teambit/logger';
4
+ import { Workspace } from '@teambit/workspace';
5
+ import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
6
+ import { Scope } from '@teambit/legacy/dist/scope';
7
+ export type PublisherOptions = {
8
+ dryRun?: boolean;
9
+ allowStaged?: boolean;
10
+ };
11
+ export declare class Publisher {
12
+ private isolator;
13
+ private logger;
14
+ private scope;
15
+ private workspace;
16
+ options: PublisherOptions;
17
+ packageManager: string;
18
+ constructor(isolator: IsolatorMain, logger: Logger, scope: Scope, workspace: Workspace, options?: PublisherOptions);
19
+ publish(componentPattern: string, options: PublisherOptions): Promise<ComponentResult[]>;
20
+ publishMultipleCapsules(capsules: Capsule[]): Promise<ComponentResult[]>;
21
+ private publishOneCapsule;
22
+ private getTagFlagForPreRelease;
23
+ private getComponentCapsules;
24
+ /**
25
+ * only components that use pkg extension and configure "publishConfig" with their own registry
26
+ * or custom "name", should be published. ignore the rest.
27
+ */
28
+ private getIdsToPublish;
29
+ shouldPublish(extensions: ExtensionDataList): boolean;
30
+ private getExtraArgsFromConfig;
31
+ private throwForNonStagedOrTaggedComponents;
32
+ }
@@ -0,0 +1,3 @@
1
+ import { EnvsMain } from '@teambit/envs';
2
+ import { Capsule } from '@teambit/isolator';
3
+ export declare function writeNpmIgnore(capsule: Capsule, envs: EnvsMain): Promise<void>;