@teambit/snapping 0.0.1

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.
@@ -0,0 +1,4 @@
1
+ import { SnappingAspect } from './snapping.aspect';
2
+ export type { SnappingMain } from './snapping.main.runtime';
3
+ export default SnappingAspect;
4
+ export { SnappingAspect };
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "SnappingAspect", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _snapping().SnappingAspect;
10
+ }
11
+ });
12
+ exports.default = void 0;
13
+
14
+ function _snapping() {
15
+ const data = require("./snapping.aspect");
16
+
17
+ _snapping = function () {
18
+ return data;
19
+ };
20
+
21
+ return data;
22
+ }
23
+
24
+ var _default = _snapping().SnappingAspect;
25
+
26
+ exports.default = _default;
27
+
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"names":["SnappingAspect"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;eAGeA,0B","sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport type { SnappingMain } from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\n"]}
@@ -0,0 +1,25 @@
1
+ import { Command, CommandOptions } from '@teambit/cli';
2
+ import { SnappingMain } from './snapping.main.runtime';
3
+ export declare class SnapCmd implements Command {
4
+ private snapping;
5
+ name: string;
6
+ description: string;
7
+ alias: string;
8
+ options: CommandOptions;
9
+ loader: boolean;
10
+ private: boolean;
11
+ migration: boolean;
12
+ constructor(docsDomain: string, snapping: SnappingMain);
13
+ report([id]: string[], { message, all, force, verbose, ignoreIssues, build, skipTests, skipAutoSnap, disableSnapPipeline, forceDeploy, }: {
14
+ message?: string;
15
+ all?: boolean;
16
+ force?: boolean;
17
+ verbose?: boolean;
18
+ ignoreIssues?: string;
19
+ build?: boolean;
20
+ skipTests?: boolean;
21
+ skipAutoSnap?: boolean;
22
+ disableSnapPipeline?: boolean;
23
+ forceDeploy?: boolean;
24
+ }): Promise<string>;
25
+ }
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ require("core-js/modules/es.symbol.description.js");
6
+
7
+ require("core-js/modules/es.array.iterator.js");
8
+
9
+ require("core-js/modules/es.promise.js");
10
+
11
+ Object.defineProperty(exports, "__esModule", {
12
+ value: true
13
+ });
14
+ exports.SnapCmd = void 0;
15
+
16
+ function _defineProperty2() {
17
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
+
19
+ _defineProperty2 = function () {
20
+ return data;
21
+ };
22
+
23
+ return data;
24
+ }
25
+
26
+ function _chalk() {
27
+ const data = _interopRequireDefault(require("chalk"));
28
+
29
+ _chalk = function () {
30
+ return data;
31
+ };
32
+
33
+ return data;
34
+ }
35
+
36
+ function _componentIssues() {
37
+ const data = require("@teambit/component-issues");
38
+
39
+ _componentIssues = function () {
40
+ return data;
41
+ };
42
+
43
+ return data;
44
+ }
45
+
46
+ function _featureToggle() {
47
+ const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
48
+
49
+ _featureToggle = function () {
50
+ return data;
51
+ };
52
+
53
+ return data;
54
+ }
55
+
56
+ function _constants() {
57
+ const data = require("@teambit/legacy/dist/constants");
58
+
59
+ _constants = function () {
60
+ return data;
61
+ };
62
+
63
+ return data;
64
+ }
65
+
66
+ function _bitError() {
67
+ const data = require("@teambit/bit-error");
68
+
69
+ _bitError = function () {
70
+ return data;
71
+ };
72
+
73
+ return data;
74
+ }
75
+
76
+ class SnapCmd {
77
+ constructor(docsDomain, snapping) {
78
+ this.snapping = snapping;
79
+ (0, _defineProperty2().default)(this, "name", 'snap [id]');
80
+ (0, _defineProperty2().default)(this, "description", void 0);
81
+ (0, _defineProperty2().default)(this, "alias", '');
82
+ (0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user changes'], ['a', 'all', 'snap all new and modified components'], ['f', 'force', 'force-snap even if tests are failing and even when component has not changed'], ['v', 'verbose', 'show specs output on failure'], ['', 'build', 'Harmony only. run the pipeline build and complete the tag'], ['', 'skip-tests', 'skip running component tests during snap process'], ['', 'skip-auto-snap', 'skip auto snapping dependents'], ['', 'disable-snap-pipeline', 'skip the snap pipeline'], ['', 'force-deploy', 'Harmony only. run the deploy pipeline although the build failed'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
83
+ [${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
84
+ to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`]]);
85
+ (0, _defineProperty2().default)(this, "loader", true);
86
+ (0, _defineProperty2().default)(this, "private", true);
87
+ (0, _defineProperty2().default)(this, "migration", true);
88
+ this.description = `record component changes.
89
+ https://${docsDomain}/components/snaps
90
+ ${(0, _constants().WILDCARD_HELP)('snap')}`;
91
+ }
92
+
93
+ async report([id], {
94
+ message = '',
95
+ all = false,
96
+ force = false,
97
+ verbose = false,
98
+ ignoreIssues,
99
+ build,
100
+ skipTests = false,
101
+ skipAutoSnap = false,
102
+ disableSnapPipeline = false,
103
+ forceDeploy = false
104
+ }) {
105
+ build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
106
+
107
+ if (!id && !all) {
108
+ throw new (_bitError().BitError)('missing [id]. to snap all components, please use --all flag');
109
+ }
110
+
111
+ if (id && all) {
112
+ throw new (_bitError().BitError)('you can use either a specific component [id] to snap a particular component or --all flag to snap them all');
113
+ }
114
+
115
+ const disableTagAndSnapPipelines = disableSnapPipeline;
116
+
117
+ if (disableTagAndSnapPipelines && forceDeploy) {
118
+ throw new (_bitError().BitError)('you can use either force-deploy or disable-snap-pipeline, but not both');
119
+ }
120
+
121
+ const results = await this.snapping.snap({
122
+ id,
123
+ message,
124
+ force,
125
+ verbose,
126
+ ignoreIssues,
127
+ build,
128
+ skipTests,
129
+ skipAutoSnap,
130
+ disableTagAndSnapPipelines,
131
+ forceDeploy
132
+ });
133
+ if (!results) return _chalk().default.yellow(_constants().NOTHING_TO_SNAP_MSG);
134
+ const {
135
+ snappedComponents,
136
+ autoSnappedResults,
137
+ warnings,
138
+ newComponents,
139
+ laneName
140
+ } = results;
141
+ const changedComponents = snappedComponents.filter(component => !newComponents.searchWithoutVersion(component.id));
142
+ const addedComponents = snappedComponents.filter(component => newComponents.searchWithoutVersion(component.id));
143
+ const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;
144
+ const warningsOutput = warnings && warnings.length ? `${_chalk().default.yellow(warnings.join('\n'))}\n\n` : '';
145
+ const tagExplanation = `\n(use "bit export" to push these components to a remote")
146
+ (use "bit untag" to unstage versions)\n`;
147
+
148
+ const outputComponents = comps => {
149
+ return comps.map(component => {
150
+ let componentOutput = ` > ${component.id.toString()}`;
151
+ const autoTag = autoSnappedResults.filter(result => result.triggeredBy.searchWithoutScopeAndVersion(component.id));
152
+
153
+ if (autoTag.length) {
154
+ const autoTagComp = autoTag.map(a => a.component.id.toString());
155
+ componentOutput += `\n ${_constants().AUTO_SNAPPED_MSG}: ${autoTagComp.join(', ')}`;
156
+ }
157
+
158
+ return componentOutput;
159
+ }).join('\n');
160
+ };
161
+
162
+ const outputIfExists = (label, explanation, components) => {
163
+ if (!components.length) return '';
164
+ return `\n${_chalk().default.underline(label)}\n(${explanation})\n${outputComponents(components)}\n`;
165
+ };
166
+
167
+ const laneStr = laneName ? ` on "${laneName}" lane` : '';
168
+ return warningsOutput + _chalk().default.green(`${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) + tagExplanation + outputIfExists('new components', 'first version for components', addedComponents) + outputIfExists('changed components', 'components that got a version bump', changedComponents);
169
+ }
170
+
171
+ }
172
+
173
+ exports.SnapCmd = SnapCmd;
174
+
175
+ //# sourceMappingURL=snap-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["snap-cmd.ts"],"names":["SnapCmd","constructor","docsDomain","snapping","Object","keys","IssuesClasses","join","description","report","id","message","all","force","verbose","ignoreIssues","build","skipTests","skipAutoSnap","disableSnapPipeline","forceDeploy","BUILD_ON_CI","Boolean","BitError","disableTagAndSnapPipelines","results","snap","chalk","yellow","NOTHING_TO_SNAP_MSG","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","changedComponents","filter","component","searchWithoutVersion","addedComponents","autoTaggedCount","length","warningsOutput","tagExplanation","outputComponents","comps","map","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","green"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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;;AAIO,MAAMA,OAAN,CAAiC;AA0BtCC,EAAAA,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAAqD;AAAA,SAAxBA,QAAwB,GAAxBA,QAAwB;AAAA,kDAzBzD,WAyByD;AAAA;AAAA,mDAvBxD,EAuBwD;AAAA,qDAtBtD,CACR,CAAC,GAAD,EAAM,mBAAN,EAA2B,yCAA3B,CADQ,EAER,CAAC,GAAD,EAAM,KAAN,EAAa,sCAAb,CAFQ,EAGR,CAAC,GAAD,EAAM,OAAN,EAAe,8EAAf,CAHQ,EAIR,CAAC,GAAD,EAAM,SAAN,EAAiB,8BAAjB,CAJQ,EAKR,CAAC,EAAD,EAAK,OAAL,EAAc,2DAAd,CALQ,EAMR,CAAC,EAAD,EAAK,YAAL,E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EAAV,CAAasC,QAAb,EAAwB,EAAxD;AACA,cAAMC,OAAO,GAAGlB,kBAAkB,CAACK,MAAnB,CAA2Bc,MAAD,IACxCA,MAAM,CAACC,WAAP,CAAmBC,4BAAnB,CAAgDf,SAAS,CAAC3B,EAA1D,CADc,CAAhB;;AAGA,YAAIuC,OAAO,CAACR,MAAZ,EAAoB;AAClB,gBAAMY,WAAW,GAAGJ,OAAO,CAACH,GAAR,CAAaQ,CAAD,IAAOA,CAAC,CAACjB,SAAF,CAAY3B,EAAZ,CAAesC,QAAf,EAAnB,CAApB;AACAD,UAAAA,eAAe,IAAK,YAAWQ,6BAAiB,KAAIF,WAAW,CAAC9C,IAAZ,CAAiB,IAAjB,CAAuB,EAA3E;AACD;;AACD,eAAOwC,eAAP;AACD,OAXI,EAYJxC,IAZI,CAYC,IAZD,CAAP;AAaD,KAdD;;AAgBA,UAAMiD,cAAc,GAAG,CAACC,KAAD,EAAQC,WAAR,EAAqBC,UAArB,KAAoC;AACzD,UAAI,CAACA,UAAU,CAAClB,MAAhB,EAAwB,OAAO,EAAP;AACxB,aAAQ,KAAId,iBAAMiC,SAAN,CAAgBH,KAAhB,CAAuB,MAAKC,WAAY,MAAKd,gBAAgB,CAACe,UAAD,CAAa,IAAtF;AACD,KAHD;;AAIA,UAAME,OAAO,GAAG3B,QAAQ,GAAI,QAAOA,QAAS,QAApB,GAA8B,EAAtD;AAEA,WACEQ,cAAc,GACdf,iBAAMmC,KAAN,CAAa,GAAEhC,iBAAiB,CAACW,MAAlB,GAA2BD,eAAgB,wBAAuBqB,OAAQ,EAAzF,CADA,GAEAlB,cAFA,GAGAa,cAAc,CAAC,gBAAD,EAAmB,8BAAnB,EAAmDjB,eAAnD,CAHd,GAIAiB,cAAc,CAAC,oBAAD,EAAuB,oCAAvB,EAA6DrB,iBAA7D,CALhB;AAOD;;AA9HqC","sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { WILDCARD_HELP, NOTHING_TO_SNAP_MSG, AUTO_SNAPPED_MSG } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport class SnapCmd implements Command {\n name = 'snap [id]';\n description: string;\n alias = '';\n options = [\n ['m', 'message <message>', 'log message describing the user changes'],\n ['a', 'all', 'snap all new and modified components'],\n ['f', 'force', 'force-snap even if tests are failing and even when component has not changed'],\n ['v', 'verbose', 'show specs output on failure'],\n ['', 'build', 'Harmony only. run the pipeline build and complete the tag'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'skip-auto-snap', 'skip auto snapping dependents'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'force-deploy', 'Harmony only. run the deploy pipeline although the build failed'],\n [\n 'i',\n 'ignore-issues [issues]',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(docsDomain: string, private snapping: SnappingMain) {\n this.description = `record component changes.\nhttps://${docsDomain}/components/snaps\n${WILDCARD_HELP('snap')}`;\n }\n\n async report(\n [id]: string[],\n {\n message = '',\n all = false,\n force = false,\n verbose = false,\n ignoreIssues,\n build,\n skipTests = false,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n forceDeploy = false,\n }: {\n message?: string;\n all?: boolean;\n force?: boolean;\n verbose?: boolean;\n ignoreIssues?: string;\n build?: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n }\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n if (!id && !all) {\n throw new BitError('missing [id]. to snap all components, please use --all flag');\n }\n if (id && all) {\n throw new BitError(\n 'you can use either a specific component [id] to snap a particular component or --all flag to snap them all'\n );\n }\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && forceDeploy) {\n throw new BitError('you can use either force-deploy or disable-snap-pipeline, but not both');\n }\n\n const results = await this.snapping.snap({\n id,\n message,\n force,\n verbose,\n ignoreIssues,\n build,\n skipTests,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n forceDeploy,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n const { snappedComponents, autoSnappedResults, warnings, newComponents, laneName }: SnapResults = results;\n const changedComponents = snappedComponents.filter(\n (component) => !newComponents.searchWithoutVersion(component.id)\n );\n const addedComponents = snappedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit untag\" to unstage versions)\\n`;\n\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoSnappedResults.filter((result) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n componentOutput += `\\n ${AUTO_SNAPPED_MSG}: ${autoTagComp.join(', ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const outputIfExists = (label, explanation, components) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n const laneStr = laneName ? ` on \"${laneName}\" lane` : '';\n\n return (\n warningsOutput +\n chalk.green(`${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n tagExplanation +\n outputIfExists('new components', 'first version for components', addedComponents) +\n outputIfExists('changed components', 'components that got a version bump', changedComponents)\n );\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const SnappingAspect: Aspect;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SnappingAspect = void 0;
7
+
8
+ function _harmony() {
9
+ const data = require("@teambit/harmony");
10
+
11
+ _harmony = function () {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ const SnappingAspect = _harmony().Aspect.create({
19
+ id: 'teambit.component/snapping'
20
+ });
21
+
22
+ exports.SnappingAspect = SnappingAspect;
23
+
24
+ //# sourceMappingURL=snapping.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["snapping.aspect.ts"],"names":["SnappingAspect","Aspect","create","id"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,cAAc,GAAGC,kBAAOC,MAAP,CAAc;AAC1CC,EAAAA,EAAE,EAAE;AADsC,CAAd,CAAvB","sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SnappingAspect = Aspect.create({\n id: 'teambit.component/snapping',\n});\n"]}
@@ -0,0 +1,46 @@
1
+ import { CLIMain } from '@teambit/cli';
2
+ import { CommunityMain } from '@teambit/community';
3
+ import { Workspace } from '@teambit/workspace';
4
+ import { BitIds } from '@teambit/legacy/dist/bit-id';
5
+ import { TagParams, TagResults } from '@teambit/legacy/dist/api/consumer/lib/tag';
6
+ import { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';
7
+ import { Logger, LoggerMain } from '@teambit/logger';
8
+ export declare class SnappingMain {
9
+ private workspace;
10
+ private logger;
11
+ constructor(workspace: Workspace, logger: Logger);
12
+ /**
13
+ * tag the given component ids or all modified/new components if "all" param is set.
14
+ * tag is a similar operation as a snap, which saves the changes into the local scope, but it also creates an alias
15
+ * with a valid semver to that version.
16
+ * tag can be done only on main, not on a lane.
17
+ */
18
+ tag(tagParams: TagParams): Promise<TagResults | null>;
19
+ /**
20
+ * save the local changes of a component(s) into the scope. snap can be done on main or on a lane.
21
+ * once a component is snapped on a lane, it becomes part of it.
22
+ */
23
+ snap({ id, // @todo: rename to "patterns"
24
+ legacyBitIds, // @todo: change to ComponentID[]. pass only if have the ids already parsed.
25
+ resolveUnmerged, message, force, verbose, ignoreIssues, skipTests, skipAutoSnap, build, disableTagAndSnapPipelines, forceDeploy, }: {
26
+ id?: string;
27
+ legacyBitIds?: BitIds;
28
+ resolveUnmerged?: boolean;
29
+ message?: string;
30
+ force?: boolean;
31
+ verbose?: boolean;
32
+ ignoreIssues?: string;
33
+ build: boolean;
34
+ skipTests?: boolean;
35
+ skipAutoSnap?: boolean;
36
+ disableTagAndSnapPipelines?: boolean;
37
+ forceDeploy?: boolean;
38
+ }): Promise<SnapResults | null>;
39
+ private loadComponentsForTag;
40
+ private throwForComponentIssues;
41
+ private getComponentsToTag;
42
+ static slots: never[];
43
+ static dependencies: import("@teambit/harmony").Aspect[];
44
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
45
+ static provider([workspace, cli, community, loggerMain]: [Workspace, CLIMain, CommunityMain, LoggerMain]): Promise<SnappingMain>;
46
+ }