@teambit/checkout 0.0.5

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,27 @@
1
+ import { Command, CommandOptions } from '@teambit/cli';
2
+ import { CheckoutMain } from './checkout.main.runtime';
3
+ export declare class CheckoutCmd implements Command {
4
+ private checkout;
5
+ name: string;
6
+ description: string;
7
+ group: string;
8
+ extendedDescription: string;
9
+ alias: string;
10
+ options: CommandOptions;
11
+ loader: boolean;
12
+ constructor(checkout: CheckoutMain);
13
+ report([values]: [string[]], { interactiveMerge, ours, theirs, manual, reset, all, verbose, skipNpmInstall, skipDependencyInstallation, ignorePackageJson, conf, ignoreDist, }: {
14
+ interactiveMerge?: boolean;
15
+ ours?: boolean;
16
+ theirs?: boolean;
17
+ manual?: boolean;
18
+ reset?: boolean;
19
+ all?: boolean;
20
+ verbose?: boolean;
21
+ skipNpmInstall?: boolean;
22
+ skipDependencyInstallation?: boolean;
23
+ ignorePackageJson?: boolean;
24
+ conf?: string;
25
+ ignoreDist?: boolean;
26
+ }): Promise<string>;
27
+ }
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ require("core-js/modules/es.array.iterator.js");
6
+
7
+ require("core-js/modules/es.promise.js");
8
+
9
+ Object.defineProperty(exports, "__esModule", {
10
+ value: true
11
+ });
12
+ exports.CheckoutCmd = void 0;
13
+
14
+ function _defineProperty2() {
15
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
+
17
+ _defineProperty2 = function () {
18
+ return data;
19
+ };
20
+
21
+ return data;
22
+ }
23
+
24
+ function _chalk() {
25
+ const data = _interopRequireDefault(require("chalk"));
26
+
27
+ _chalk = function () {
28
+ return data;
29
+ };
30
+
31
+ return data;
32
+ }
33
+
34
+ function _constants() {
35
+ const data = require("@teambit/legacy/dist/constants");
36
+
37
+ _constants = function () {
38
+ return data;
39
+ };
40
+
41
+ return data;
42
+ }
43
+
44
+ function _mergeVersion() {
45
+ const data = require("@teambit/legacy/dist/consumer/versions-ops/merge-version");
46
+
47
+ _mergeVersion = function () {
48
+ return data;
49
+ };
50
+
51
+ return data;
52
+ }
53
+
54
+ class CheckoutCmd {
55
+ constructor(checkout) {
56
+ this.checkout = checkout;
57
+ (0, _defineProperty2().default)(this, "name", 'checkout [values...]');
58
+ (0, _defineProperty2().default)(this, "description", 'switch between component versions or remove local changes');
59
+ (0, _defineProperty2().default)(this, "group", 'development');
60
+ (0, _defineProperty2().default)(this, "extendedDescription", `
61
+ \`bit checkout <version> [ids...]\` => checkout the specified ids (or all components when --all is used) to the specified version
62
+ \`bit checkout head\` => checkout all components to their latest versions
63
+ \`bit checkout head [ids...]\` => checkout the specified ids to their latest versions
64
+ \`bit checkout [ids...] --reset\` => remove local modifications from the specified ids (or all components when --all is used)
65
+ ${(0, _constants().WILDCARD_HELP)('checkout 0.0.1')}`);
66
+ (0, _defineProperty2().default)(this, "alias", 'U');
67
+ (0, _defineProperty2().default)(this, "options", [['i', 'interactive-merge', 'when a component is modified and the merge process found conflicts, display options to resolve them'], ['o', 'ours', 'in case of a conflict, override the used version with the current modification'], ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['r', 'reset', 'revert changes that were not snapped/tagged'], ['a', 'all', 'all components'], ['v', 'verbose', 'showing verbose output for inspection'], ['', 'skip-npm-install', 'DEPRECATED. use "--skip-dependency-installation" instead'], ['', 'skip-dependency-installation', 'do not install packages of the imported components'], ['', 'ignore-package-json', 'do not generate package.json for the imported component(s). (it automatically enables skip-npm-install and save-dependencies-as-components flags)'], ['', 'conf [path]', 'write the configuration file (bit.json) and the envs configuration files (use --conf without path to write to the default dir)'], ['', 'ignore-dist', 'do not write dist files (when exist)']]);
68
+ (0, _defineProperty2().default)(this, "loader", true);
69
+ }
70
+
71
+ async report([values = []], {
72
+ interactiveMerge = false,
73
+ ours = false,
74
+ theirs = false,
75
+ manual = false,
76
+ reset = false,
77
+ all = false,
78
+ verbose = false,
79
+ skipNpmInstall = false,
80
+ skipDependencyInstallation = false,
81
+ ignorePackageJson = false,
82
+ conf,
83
+ ignoreDist = false
84
+ }) {
85
+ if (skipNpmInstall) {
86
+ // eslint-disable-next-line no-console
87
+ console.log(_chalk().default.yellow(`"--skip-npm-install" has been deprecated, please use "--skip-dependency-installation" instead`));
88
+ skipDependencyInstallation = true;
89
+ }
90
+
91
+ const checkoutProps = {
92
+ promptMergeOptions: interactiveMerge,
93
+ mergeStrategy: (0, _mergeVersion().getMergeStrategy)(ours, theirs, manual),
94
+ reset,
95
+ all,
96
+ verbose,
97
+ isLane: false,
98
+ skipNpmInstall: skipDependencyInstallation,
99
+ ignoreDist,
100
+ ignorePackageJson,
101
+ writeConfig: !!conf
102
+ };
103
+ const {
104
+ components,
105
+ version,
106
+ failedComponents,
107
+ leftUnresolvedConflicts
108
+ } = await this.checkout.checkout(values, checkoutProps);
109
+ const isLatest = Boolean(version && version === _constants().LATEST);
110
+ const isReset = !version;
111
+
112
+ const getFailureOutput = () => {
113
+ // components that failed for no legitimate reason. e.g. merge-conflict.
114
+ const realFailedComponents = failedComponents === null || failedComponents === void 0 ? void 0 : failedComponents.filter(f => !f.unchangedLegitimately);
115
+ if (!realFailedComponents || !realFailedComponents.length) return '';
116
+ const title = 'the checkout has been canceled on the following component(s)';
117
+ const body = realFailedComponents.map(failedComponent => `${_chalk().default.bold(failedComponent.id.toString())} - ${_chalk().default.red(failedComponent.failureMessage)}`).join('\n');
118
+ return `${title}\n${body}\n\n`;
119
+ };
120
+
121
+ const getNeutralOutput = () => {
122
+ // components that weren't checked out for legitimate reasons, e.g. up-to-date.
123
+ const neutralComponents = (failedComponents || []).filter(f => f.unchangedLegitimately);
124
+ if (!neutralComponents.length) return '';
125
+
126
+ if (!verbose && all) {
127
+ return _chalk().default.green(`checkout was not needed for ${_chalk().default.bold(neutralComponents.length.toString())} components (use --verbose to get more details)\n`);
128
+ }
129
+
130
+ const title = 'the checkout was not needed on the following component(s)';
131
+ const body = neutralComponents.map(failedComponent => `${_chalk().default.bold(failedComponent.id.toString())} - ${failedComponent.failureMessage}`).join('\n');
132
+ return `${title}\n${body}\n\n`;
133
+ };
134
+
135
+ const getConflictSummary = () => {
136
+ if (!components || !components.length || !leftUnresolvedConflicts) return '';
137
+ const title = `\n\nfiles with conflicts summary\n`;
138
+ const suggestion = `\n\nfix the conflicts above manually and then run "bit install" and "bit compile".
139
+ once ready, snap/tag the components to persist the changes`;
140
+ return _chalk().default.underline(title) + (0, _mergeVersion().conflictSummaryReport)(components) + _chalk().default.yellow(suggestion);
141
+ };
142
+
143
+ const getSuccessfulOutput = () => {
144
+ if (!components || !components.length) return '';
145
+
146
+ if (components.length === 1) {
147
+ const component = components[0];
148
+ const componentName = isReset ? component.id.toString() : component.id.toStringWithoutVersion();
149
+ if (isReset) return `successfully reset ${_chalk().default.bold(componentName)}\n`;
150
+ const title = `successfully switched ${_chalk().default.bold(componentName)} to version ${_chalk().default.bold( // $FlowFixMe version is defined when !isReset
151
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
152
+ isLatest ? component.id.version : version)}\n`;
153
+ return `${title} ${(0, _mergeVersion().applyVersionReport)(components, false)}`;
154
+ }
155
+
156
+ if (isReset) {
157
+ const title = 'successfully reset the following components\n\n';
158
+ const body = components.map(component => _chalk().default.bold(component.id.toString())).join('\n');
159
+ return title + body;
160
+ } // $FlowFixMe version is defined when !isReset
161
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
162
+
163
+
164
+ const versionOutput = isLatest ? 'their latest version' : `version ${_chalk().default.bold(version)}`;
165
+ const title = `successfully switched the following components to ${versionOutput}\n\n`;
166
+ const showVersion = isLatest || isReset;
167
+ const componentsStr = (0, _mergeVersion().applyVersionReport)(components, true, showVersion);
168
+ return title + componentsStr;
169
+ };
170
+
171
+ return getFailureOutput() + getNeutralOutput() + getSuccessfulOutput() + getConflictSummary();
172
+ }
173
+
174
+ }
175
+
176
+ exports.CheckoutCmd = CheckoutCmd;
177
+
178
+ //# sourceMappingURL=checkout-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CheckoutCmd","constructor","checkout","WILDCARD_HELP","report","values","interactiveMerge","ours","theirs","manual","reset","all","verbose","skipNpmInstall","skipDependencyInstallation","ignorePackageJson","conf","ignoreDist","console","log","chalk","yellow","checkoutProps","promptMergeOptions","mergeStrategy","getMergeStrategy","isLane","writeConfig","components","version","failedComponents","leftUnresolvedConflicts","isLatest","Boolean","LATEST","isReset","getFailureOutput","realFailedComponents","filter","f","unchangedLegitimately","length","title","body","map","failedComponent","bold","id","toString","red","failureMessage","join","getNeutralOutput","neutralComponents","green","getConflictSummary","suggestion","underline","conflictSummaryReport","getSuccessfulOutput","component","componentName","toStringWithoutVersion","applyVersionReport","versionOutput","showVersion","componentsStr"],"sources":["checkout-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { LATEST, WILDCARD_HELP } from '@teambit/legacy/dist/constants';\nimport { CheckoutProps } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n ApplyVersionResults,\n getMergeStrategy,\n applyVersionReport,\n conflictSummaryReport,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { CheckoutMain } from './checkout.main.runtime';\n\nexport class CheckoutCmd implements Command {\n name = 'checkout [values...]';\n description = 'switch between component versions or remove local changes';\n group = 'development';\n extendedDescription = `\n \\`bit checkout <version> [ids...]\\` => checkout the specified ids (or all components when --all is used) to the specified version\n \\`bit checkout head\\` => checkout all components to their latest versions\n \\`bit checkout head [ids...]\\` => checkout the specified ids to their latest versions\n \\`bit checkout [ids...] --reset\\` => remove local modifications from the specified ids (or all components when --all is used)\n ${WILDCARD_HELP('checkout 0.0.1')}`;\n alias = 'U';\n options = [\n [\n 'i',\n 'interactive-merge',\n 'when a component is modified and the merge process found conflicts, display options to resolve them',\n ],\n ['o', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['t', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['m', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['r', 'reset', 'revert changes that were not snapped/tagged'],\n ['a', 'all', 'all components'],\n ['v', 'verbose', 'showing verbose output for inspection'],\n ['', 'skip-npm-install', 'DEPRECATED. use \"--skip-dependency-installation\" instead'],\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n [\n '',\n 'ignore-package-json',\n 'do not generate package.json for the imported component(s). (it automatically enables skip-npm-install and save-dependencies-as-components flags)',\n ],\n [\n '',\n 'conf [path]',\n 'write the configuration file (bit.json) and the envs configuration files (use --conf without path to write to the default dir)',\n ],\n ['', 'ignore-dist', 'do not write dist files (when exist)'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private checkout: CheckoutMain) {}\n\n async report(\n [values = []]: [string[]],\n {\n interactiveMerge = false,\n ours = false,\n theirs = false,\n manual = false,\n reset = false,\n all = false,\n verbose = false,\n skipNpmInstall = false,\n skipDependencyInstallation = false,\n ignorePackageJson = false,\n conf,\n ignoreDist = false,\n }: {\n interactiveMerge?: boolean;\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n reset?: boolean;\n all?: boolean;\n verbose?: boolean;\n skipNpmInstall?: boolean;\n skipDependencyInstallation?: boolean;\n ignorePackageJson?: boolean;\n conf?: string;\n ignoreDist?: boolean;\n }\n ) {\n if (skipNpmInstall) {\n // eslint-disable-next-line no-console\n console.log(\n chalk.yellow(`\"--skip-npm-install\" has been deprecated, please use \"--skip-dependency-installation\" instead`)\n );\n skipDependencyInstallation = true;\n }\n const checkoutProps: CheckoutProps = {\n promptMergeOptions: interactiveMerge,\n mergeStrategy: getMergeStrategy(ours, theirs, manual),\n reset,\n all,\n verbose,\n isLane: false,\n skipNpmInstall: skipDependencyInstallation,\n ignoreDist,\n ignorePackageJson,\n writeConfig: !!conf,\n };\n const { components, version, failedComponents, leftUnresolvedConflicts }: ApplyVersionResults =\n await this.checkout.checkout(values, checkoutProps);\n const isLatest = Boolean(version && version === LATEST);\n const isReset = !version;\n const getFailureOutput = () => {\n // components that failed for no legitimate reason. e.g. merge-conflict.\n const realFailedComponents = failedComponents?.filter((f) => !f.unchangedLegitimately);\n if (!realFailedComponents || !realFailedComponents.length) return '';\n const title = 'the checkout has been canceled on the following component(s)';\n const body = realFailedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.failureMessage)}`\n )\n .join('\\n');\n return `${title}\\n${body}\\n\\n`;\n };\n const getNeutralOutput = () => {\n // components that weren't checked out for legitimate reasons, e.g. up-to-date.\n const neutralComponents = (failedComponents || []).filter((f) => f.unchangedLegitimately);\n if (!neutralComponents.length) return '';\n if (!verbose && all) {\n return chalk.green(\n `checkout was not needed for ${chalk.bold(\n neutralComponents.length.toString()\n )} components (use --verbose to get more details)\\n`\n );\n }\n\n const title = 'the checkout was not needed on the following component(s)';\n const body = neutralComponents\n .map((failedComponent) => `${chalk.bold(failedComponent.id.toString())} - ${failedComponent.failureMessage}`)\n .join('\\n');\n return `${title}\\n${body}\\n\\n`;\n };\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `\\n\\nfiles with conflicts summary\\n`;\n const suggestion = `\\n\\nfix the conflicts above manually and then run \"bit install\" and \"bit compile\".\nonce ready, snap/tag the components to persist the changes`;\n return chalk.underline(title) + conflictSummaryReport(components) + chalk.yellow(suggestion);\n };\n\n const getSuccessfulOutput = () => {\n if (!components || !components.length) return '';\n if (components.length === 1) {\n const component = components[0];\n const componentName = isReset ? component.id.toString() : component.id.toStringWithoutVersion();\n if (isReset) return `successfully reset ${chalk.bold(componentName)}\\n`;\n const title = `successfully switched ${chalk.bold(componentName)} to version ${chalk.bold(\n // $FlowFixMe version is defined when !isReset\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n isLatest ? component.id.version : version\n )}\\n`;\n return `${title} ${applyVersionReport(components, false)}`;\n }\n if (isReset) {\n const title = 'successfully reset the following components\\n\\n';\n const body = components.map((component) => chalk.bold(component.id.toString())).join('\\n');\n return title + body;\n }\n // $FlowFixMe version is defined when !isReset\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const versionOutput = isLatest ? 'their latest version' : `version ${chalk.bold(version)}`;\n const title = `successfully switched the following components to ${versionOutput}\\n\\n`;\n const showVersion = isLatest || isReset;\n const componentsStr = applyVersionReport(components, true, showVersion);\n return title + componentsStr;\n };\n\n return getFailureOutput() + getNeutralOutput() + getSuccessfulOutput() + getConflictSummary();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAQO,MAAMA,WAAN,CAAqC;EAuC1CC,WAAW,CAASC,QAAT,EAAiC;IAAA,KAAxBA,QAAwB,GAAxBA,QAAwB;IAAA,8CAtCrC,sBAsCqC;IAAA,qDArC9B,2DAqC8B;IAAA,+CApCpC,aAoCoC;IAAA,6DAnCrB;AACzB;AACA;AACA;AACA;AACA,IAAI,IAAAC,0BAAA,EAAc,gBAAd,CAAgC,EA8BU;IAAA,+CA7BpC,GA6BoC;IAAA,iDA5BlC,CACR,CACE,GADF,EAEE,mBAFF,EAGE,qGAHF,CADQ,EAMR,CAAC,GAAD,EAAM,MAAN,EAAc,gFAAd,CANQ,EAOR,CAAC,GAAD,EAAM,QAAN,EAAgB,qFAAhB,CAPQ,EAQR,CAAC,GAAD,EAAM,QAAN,EAAgB,6FAAhB,CARQ,EASR,CAAC,GAAD,EAAM,OAAN,EAAe,6CAAf,CATQ,EAUR,CAAC,GAAD,EAAM,KAAN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M0B,IAAN,EAC7E;QACA;QACAd,QAAQ,GAAG4B,SAAS,CAACb,EAAV,CAAalB,OAAhB,GAA0BA,OAH2C,CAI7E,IAJF;QAKA,OAAQ,GAAEa,KAAM,IAAG,IAAAqB,kCAAA,EAAmBnC,UAAnB,EAA+B,KAA/B,CAAsC,EAAzD;MACD;;MACD,IAAIO,OAAJ,EAAa;QACX,MAAMO,KAAK,GAAG,iDAAd;QACA,MAAMC,IAAI,GAAGf,UAAU,CAACgB,GAAX,CAAgBgB,SAAD,IAAexC,gBAAA,CAAM0B,IAAN,CAAWc,SAAS,CAACb,EAAV,CAAaC,QAAb,EAAX,CAA9B,EAAmEG,IAAnE,CAAwE,IAAxE,CAAb;QACA,OAAOT,KAAK,GAAGC,IAAf;MACD,CAjB+B,CAkBhC;MACA;;;MACA,MAAMqB,aAAa,GAAGhC,QAAQ,GAAG,sBAAH,GAA6B,WAAUZ,gBAAA,CAAM0B,IAAN,CAAWjB,OAAX,CAAoB,EAAzF;MACA,MAAMa,KAAK,GAAI,qDAAoDsB,aAAc,MAAjF;MACA,MAAMC,WAAW,GAAGjC,QAAQ,IAAIG,OAAhC;MACA,MAAM+B,aAAa,GAAG,IAAAH,kCAAA,EAAmBnC,UAAnB,EAA+B,IAA/B,EAAqCqC,WAArC,CAAtB;MACA,OAAOvB,KAAK,GAAGwB,aAAf;IACD,CAzBD;;IA2BA,OAAO9B,gBAAgB,KAAKgB,gBAAgB,EAArC,GAA0CO,mBAAmB,EAA7D,GAAkEJ,kBAAkB,EAA3F;EACD;;AAjKyC"}
@@ -0,0 +1,2 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const CheckoutAspect: Aspect;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CheckoutAspect = 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 CheckoutAspect = _harmony().Aspect.create({
19
+ id: 'teambit.component/checkout'
20
+ });
21
+
22
+ exports.CheckoutAspect = CheckoutAspect;
23
+
24
+ //# sourceMappingURL=checkout.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CheckoutAspect","Aspect","create","id"],"sources":["checkout.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const CheckoutAspect = Aspect.create({\n id: 'teambit.component/checkout',\n});\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,cAAc,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EAC1CC,EAAE,EAAE;AADsC,CAAd,CAAvB"}
@@ -0,0 +1,23 @@
1
+ import { CLIMain } from '@teambit/cli';
2
+ import { Logger, LoggerMain } from '@teambit/logger';
3
+ import { Workspace } from '@teambit/workspace';
4
+ import { CheckoutProps } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';
5
+ import { ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
6
+ export declare class CheckoutMain {
7
+ private workspace;
8
+ private logger;
9
+ constructor(workspace: Workspace, logger: Logger);
10
+ checkout(values: string[], checkoutProps: CheckoutProps): Promise<ApplyVersionResults>;
11
+ private parseValues;
12
+ /**
13
+ * when user didn't enter any id and used '--all' flag, populate all ids.
14
+ */
15
+ private populateAllIds;
16
+ private getIdsMatchedByWildcard;
17
+ private getCandidateIds;
18
+ static slots: never[];
19
+ static dependencies: import("@teambit/harmony").Aspect[];
20
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
21
+ static provider([cli, workspace, loggerMain]: [CLIMain, Workspace, LoggerMain]): Promise<CheckoutMain>;
22
+ }
23
+ export default CheckoutMain;
@@ -0,0 +1,284 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ require("core-js/modules/es.array.iterator.js");
6
+
7
+ require("core-js/modules/es.promise.js");
8
+
9
+ Object.defineProperty(exports, "__esModule", {
10
+ value: true
11
+ });
12
+ exports.default = exports.CheckoutMain = void 0;
13
+
14
+ function _defineProperty2() {
15
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
+
17
+ _defineProperty2 = function () {
18
+ return data;
19
+ };
20
+
21
+ return data;
22
+ }
23
+
24
+ function _cli() {
25
+ const data = require("@teambit/cli");
26
+
27
+ _cli = function () {
28
+ return data;
29
+ };
30
+
31
+ return data;
32
+ }
33
+
34
+ function _logger() {
35
+ const data = require("@teambit/logger");
36
+
37
+ _logger = function () {
38
+ return data;
39
+ };
40
+
41
+ return data;
42
+ }
43
+
44
+ function _workspace() {
45
+ const data = _interopRequireDefault(require("@teambit/workspace"));
46
+
47
+ _workspace = function () {
48
+ return data;
49
+ };
50
+
51
+ return data;
52
+ }
53
+
54
+ function _ramda() {
55
+ const data = _interopRequireDefault(require("ramda"));
56
+
57
+ _ramda = function () {
58
+ return data;
59
+ };
60
+
61
+ return data;
62
+ }
63
+
64
+ function _bitId() {
65
+ const data = require("@teambit/legacy/dist/bit-id");
66
+
67
+ _bitId = function () {
68
+ return data;
69
+ };
70
+
71
+ return data;
72
+ }
73
+
74
+ function _loaderMessages() {
75
+ const data = require("@teambit/legacy/dist/cli/loader/loader-messages");
76
+
77
+ _loaderMessages = function () {
78
+ return data;
79
+ };
80
+
81
+ return data;
82
+ }
83
+
84
+ function _constants() {
85
+ const data = require("@teambit/legacy/dist/constants");
86
+
87
+ _constants = function () {
88
+ return data;
89
+ };
90
+
91
+ return data;
92
+ }
93
+
94
+ function _componentsList() {
95
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/components-list"));
96
+
97
+ _componentsList = function () {
98
+ return data;
99
+ };
100
+
101
+ return data;
102
+ }
103
+
104
+ function _checkoutVersion() {
105
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/versions-ops/checkout-version"));
106
+
107
+ _checkoutVersion = function () {
108
+ return data;
109
+ };
110
+
111
+ return data;
112
+ }
113
+
114
+ function _generalError() {
115
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
116
+
117
+ _generalError = function () {
118
+ return data;
119
+ };
120
+
121
+ return data;
122
+ }
123
+
124
+ function _hasWildcard() {
125
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/utils/string/has-wildcard"));
126
+
127
+ _hasWildcard = function () {
128
+ return data;
129
+ };
130
+
131
+ return data;
132
+ }
133
+
134
+ function _exceptions() {
135
+ const data = require("@teambit/legacy/dist/consumer/exceptions");
136
+
137
+ _exceptions = function () {
138
+ return data;
139
+ };
140
+
141
+ return data;
142
+ }
143
+
144
+ function _noIdMatchWildcard() {
145
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/api/consumer/lib/exceptions/no-id-match-wildcard"));
146
+
147
+ _noIdMatchWildcard = function () {
148
+ return data;
149
+ };
150
+
151
+ return data;
152
+ }
153
+
154
+ function _checkoutCmd() {
155
+ const data = require("./checkout-cmd");
156
+
157
+ _checkoutCmd = function () {
158
+ return data;
159
+ };
160
+
161
+ return data;
162
+ }
163
+
164
+ function _checkout() {
165
+ const data = require("./checkout.aspect");
166
+
167
+ _checkout = function () {
168
+ return data;
169
+ };
170
+
171
+ return data;
172
+ }
173
+
174
+ class CheckoutMain {
175
+ constructor(workspace, logger) {
176
+ this.workspace = workspace;
177
+ this.logger = logger;
178
+ }
179
+
180
+ async checkout(values, checkoutProps) {
181
+ this.logger.setStatusLine(_loaderMessages().BEFORE_CHECKOUT);
182
+ if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
183
+ const consumer = this.workspace.consumer;
184
+ await this.parseValues(values, checkoutProps);
185
+ const checkoutResults = await (0, _checkoutVersion().default)(consumer, checkoutProps);
186
+ await consumer.onDestroy();
187
+ return checkoutResults;
188
+ }
189
+
190
+ async parseValues(values, checkoutProps) {
191
+ const consumer = this.workspace.consumer;
192
+
193
+ const firstValue = _ramda().default.head(values);
194
+
195
+ checkoutProps.version = firstValue && (_bitId().BitId.isValidVersion(firstValue) || firstValue === _constants().LATEST || firstValue === _constants().HEAD) ? firstValue : undefined;
196
+ const ids = checkoutProps.version ? _ramda().default.tail(values) : values; // if first value is a version, the rest are ids
197
+
198
+ checkoutProps.latestVersion = Boolean(checkoutProps.version && (checkoutProps.version === _constants().LATEST || checkoutProps.version === _constants().HEAD));
199
+
200
+ if (checkoutProps.latestVersion && checkoutProps.version === _constants().LATEST) {
201
+ this.logger.console(`"latest" is deprecated. please use "${_constants().HEAD}" instead`);
202
+ }
203
+
204
+ if (checkoutProps.latestVersion && !ids.length) {
205
+ if (checkoutProps.all) {
206
+ this.logger.console(`"--all" is deprecated for "bit checkout ${_constants().HEAD}", please omit it.`);
207
+ }
208
+
209
+ checkoutProps.all = true;
210
+ }
211
+
212
+ if (!firstValue && !checkoutProps.reset && !checkoutProps.all) {
213
+ throw new (_generalError().default)('please enter [values...] or use --reset --all flags');
214
+ }
215
+
216
+ if (checkoutProps.reset && checkoutProps.version) {
217
+ throw new (_generalError().default)(`the first argument "${checkoutProps.version}" seems to be a version. however, --reset flag doesn't support a version`);
218
+ }
219
+
220
+ if (ids.length && checkoutProps.all) {
221
+ throw new (_generalError().default)('please specify either [ids...] or --all, not both');
222
+ }
223
+
224
+ if (!checkoutProps.reset && !checkoutProps.version) {
225
+ if (ids.length) throw new (_generalError().default)(`the specified version "${ids[0]}" is not a valid version`);else throw new (_generalError().default)('please specify a version');
226
+ }
227
+
228
+ if (!ids.length) {
229
+ this.populateAllIds(consumer, checkoutProps);
230
+ } else {
231
+ const idsHasWildcard = (0, _hasWildcard().default)(ids);
232
+ checkoutProps.ids = idsHasWildcard ? this.getIdsMatchedByWildcard(consumer, checkoutProps, ids) : ids.map(id => consumer.getParsedId(id));
233
+ }
234
+ }
235
+ /**
236
+ * when user didn't enter any id and used '--all' flag, populate all ids.
237
+ */
238
+
239
+
240
+ populateAllIds(consumer, checkoutProps) {
241
+ if (!checkoutProps.all) {
242
+ throw new (_generalError().default)('please specify [ids...] or use --all flag');
243
+ }
244
+
245
+ checkoutProps.ids = this.getCandidateIds(consumer, checkoutProps);
246
+ }
247
+
248
+ getIdsMatchedByWildcard(consumer, checkoutProps, ids) {
249
+ const candidateIds = this.getCandidateIds(consumer, checkoutProps);
250
+
251
+ const matchedIds = _componentsList().default.filterComponentsByWildcard(candidateIds, ids);
252
+
253
+ if (!matchedIds.length) throw new (_noIdMatchWildcard().default)(ids);
254
+ return matchedIds;
255
+ }
256
+
257
+ getCandidateIds(consumer, checkoutProps) {
258
+ const idsFromBitMap = consumer.bitMap.getAllBitIds();
259
+ return idsFromBitMap.map(bitId => {
260
+ const version = checkoutProps.latestVersion ? _constants().LATEST : bitId.version;
261
+ return bitId.changeVersion(version);
262
+ });
263
+ }
264
+
265
+ static async provider([cli, workspace, loggerMain]) {
266
+ const logger = loggerMain.createLogger(_checkout().CheckoutAspect.id);
267
+ const checkoutMain = new CheckoutMain(workspace, logger);
268
+ cli.register(new (_checkoutCmd().CheckoutCmd)(checkoutMain));
269
+ return checkoutMain;
270
+ }
271
+
272
+ }
273
+
274
+ exports.CheckoutMain = CheckoutMain;
275
+ (0, _defineProperty2().default)(CheckoutMain, "slots", []);
276
+ (0, _defineProperty2().default)(CheckoutMain, "dependencies", [_cli().CLIAspect, _workspace().default, _logger().LoggerAspect]);
277
+ (0, _defineProperty2().default)(CheckoutMain, "runtime", _cli().MainRuntime);
278
+
279
+ _checkout().CheckoutAspect.addRuntime(CheckoutMain);
280
+
281
+ var _default = CheckoutMain;
282
+ exports.default = _default;
283
+
284
+ //# sourceMappingURL=checkout.main.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CheckoutMain","constructor","workspace","logger","checkout","values","checkoutProps","setStatusLine","BEFORE_CHECKOUT","ConsumerNotFound","consumer","parseValues","checkoutResults","checkoutVersion","onDestroy","firstValue","R","head","version","BitId","isValidVersion","LATEST","HEAD","undefined","ids","tail","latestVersion","Boolean","console","length","all","reset","GeneralError","populateAllIds","idsHasWildcard","hasWildcard","getIdsMatchedByWildcard","map","id","getParsedId","getCandidateIds","candidateIds","matchedIds","ComponentsList","filterComponentsByWildcard","NoIdMatchWildcard","idsFromBitMap","bitMap","getAllBitIds","bitId","changeVersion","provider","cli","loggerMain","createLogger","CheckoutAspect","checkoutMain","register","CheckoutCmd","CLIAspect","WorkspaceAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["checkout.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { BitId } from '@teambit/legacy/dist/bit-id';\nimport { BEFORE_CHECKOUT } from '@teambit/legacy/dist/cli/loader/loader-messages';\nimport { HEAD, LATEST } from '@teambit/legacy/dist/constants';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport checkoutVersion, { CheckoutProps } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport { ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport NoIdMatchWildcard from '@teambit/legacy/dist/api/consumer/lib/exceptions/no-id-match-wildcard';\nimport { CheckoutCmd } from './checkout-cmd';\nimport { CheckoutAspect } from './checkout.aspect';\n\nexport class CheckoutMain {\n constructor(private workspace: Workspace, private logger: Logger) {}\n async checkout(values: string[], checkoutProps: CheckoutProps): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(BEFORE_CHECKOUT);\n if (!this.workspace) throw new ConsumerNotFound();\n const consumer = this.workspace.consumer;\n await this.parseValues(values, checkoutProps);\n const checkoutResults = await checkoutVersion(consumer, checkoutProps);\n await consumer.onDestroy();\n return checkoutResults;\n }\n\n private async parseValues(values: string[], checkoutProps: CheckoutProps) {\n const consumer = this.workspace.consumer;\n const firstValue = R.head(values);\n checkoutProps.version =\n firstValue && (BitId.isValidVersion(firstValue) || firstValue === LATEST || firstValue === HEAD)\n ? firstValue\n : undefined;\n const ids = checkoutProps.version ? R.tail(values) : values; // if first value is a version, the rest are ids\n checkoutProps.latestVersion = Boolean(\n checkoutProps.version && (checkoutProps.version === LATEST || checkoutProps.version === HEAD)\n );\n if (checkoutProps.latestVersion && checkoutProps.version === LATEST) {\n this.logger.console(`\"latest\" is deprecated. please use \"${HEAD}\" instead`);\n }\n if (checkoutProps.latestVersion && !ids.length) {\n if (checkoutProps.all) {\n this.logger.console(`\"--all\" is deprecated for \"bit checkout ${HEAD}\", please omit it.`);\n }\n checkoutProps.all = true;\n }\n if (!firstValue && !checkoutProps.reset && !checkoutProps.all) {\n throw new GeneralError('please enter [values...] or use --reset --all flags');\n }\n if (checkoutProps.reset && checkoutProps.version) {\n throw new GeneralError(\n `the first argument \"${checkoutProps.version}\" seems to be a version. however, --reset flag doesn't support a version`\n );\n }\n if (ids.length && checkoutProps.all) {\n throw new GeneralError('please specify either [ids...] or --all, not both');\n }\n if (!checkoutProps.reset && !checkoutProps.version) {\n if (ids.length) throw new GeneralError(`the specified version \"${ids[0]}\" is not a valid version`);\n else throw new GeneralError('please specify a version');\n }\n if (!ids.length) {\n this.populateAllIds(consumer, checkoutProps);\n } else {\n const idsHasWildcard = hasWildcard(ids);\n checkoutProps.ids = idsHasWildcard\n ? this.getIdsMatchedByWildcard(consumer, checkoutProps, ids)\n : ids.map((id) => consumer.getParsedId(id));\n }\n }\n\n /**\n * when user didn't enter any id and used '--all' flag, populate all ids.\n */\n private populateAllIds(consumer: Consumer, checkoutProps: CheckoutProps) {\n if (!checkoutProps.all) {\n throw new GeneralError('please specify [ids...] or use --all flag');\n }\n checkoutProps.ids = this.getCandidateIds(consumer, checkoutProps);\n }\n\n private getIdsMatchedByWildcard(consumer: Consumer, checkoutProps: CheckoutProps, ids: string[]): BitId[] {\n const candidateIds = this.getCandidateIds(consumer, checkoutProps);\n const matchedIds = ComponentsList.filterComponentsByWildcard(candidateIds, ids);\n if (!matchedIds.length) throw new NoIdMatchWildcard(ids);\n return matchedIds;\n }\n\n private getCandidateIds(consumer: Consumer, checkoutProps: CheckoutProps): BitId[] {\n const idsFromBitMap = consumer.bitMap.getAllBitIds();\n return idsFromBitMap.map((bitId) => {\n const version = checkoutProps.latestVersion ? LATEST : bitId.version;\n return bitId.changeVersion(version);\n });\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace, loggerMain]: [CLIMain, Workspace, LoggerMain]) {\n const logger = loggerMain.createLogger(CheckoutAspect.id);\n const checkoutMain = new CheckoutMain(workspace, logger);\n cli.register(new CheckoutCmd(checkoutMain));\n return checkoutMain;\n }\n}\n\nCheckoutAspect.addRuntime(CheckoutMain);\n\nexport default CheckoutMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA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Ad,GAA8BL,mBAA9B,GAAuC4B,KAAK,CAAC/B,OAA7D;MACA,OAAO+B,KAAK,CAACC,aAAN,CAAoBhC,OAApB,CAAP;IACD,CAHM,CAAP;EAID;;EAOoB,aAARiC,QAAQ,CAAC,CAACC,GAAD,EAAMlD,SAAN,EAAiBmD,UAAjB,CAAD,EAAiE;IACpF,MAAMlD,MAAM,GAAGkD,UAAU,CAACC,YAAX,CAAwBC,0BAAA,CAAejB,EAAvC,CAAf;IACA,MAAMkB,YAAY,GAAG,IAAIxD,YAAJ,CAAiBE,SAAjB,EAA4BC,MAA5B,CAArB;IACAiD,GAAG,CAACK,QAAJ,CAAa,KAAIC,0BAAJ,EAAgBF,YAAhB,CAAb;IACA,OAAOA,YAAP;EACD;;AA5FuB;;;gCAAbxD,Y,WAkFI,E;gCAlFJA,Y,kBAmFW,CAAC2D,gBAAD,EAAYC,oBAAZ,EAA6BC,sBAA7B,C;gCAnFX7D,Y,aAqFM8D,kB;;AAUnBP,0BAAA,CAAeQ,UAAf,CAA0B/D,YAA1B;;eAEeA,Y"}
@@ -0,0 +1,4 @@
1
+ import { CheckoutAspect } from './checkout.aspect';
2
+ export type { CheckoutMain } from './checkout.main.runtime';
3
+ export default CheckoutAspect;
4
+ export { CheckoutAspect };
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, "CheckoutAspect", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _checkout().CheckoutAspect;
10
+ }
11
+ });
12
+ exports.default = void 0;
13
+
14
+ function _checkout() {
15
+ const data = require("./checkout.aspect");
16
+
17
+ _checkout = function () {
18
+ return data;
19
+ };
20
+
21
+ return data;
22
+ }
23
+
24
+ var _default = _checkout().CheckoutAspect;
25
+
26
+ exports.default = _default;
27
+
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CheckoutAspect"],"sources":["index.ts"],"sourcesContent":["import { CheckoutAspect } from './checkout.aspect';\n\nexport type { CheckoutMain } from './checkout.main.runtime';\nexport default CheckoutAspect;\nexport { CheckoutAspect };\n"],"mappings":";;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;eAGeA,0B"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@teambit/checkout",
3
+ "version": "0.0.5",
4
+ "main": "dist/index.js",
5
+ "componentId": {
6
+ "scope": "teambit.component",
7
+ "name": "checkout",
8
+ "version": "0.0.5"
9
+ },
10
+ "dependencies": {
11
+ "chalk": "2.4.2",
12
+ "ramda": "0.27.1",
13
+ "@babel/runtime": "7.12.18",
14
+ "core-js": "^3.0.0",
15
+ "@teambit/harmony": "0.3.3",
16
+ "@teambit/cli": "0.0.561",
17
+ "@teambit/logger": "0.0.654",
18
+ "@teambit/workspace": "0.0.836"
19
+ },
20
+ "devDependencies": {
21
+ "@types/mocha": "9.1.0",
22
+ "@types/testing-library__jest-dom": "5.9.5",
23
+ "@types/jest": "^26.0.0",
24
+ "@types/react-dom": "^17.0.5",
25
+ "@types/react": "^17.0.8",
26
+ "@types/node": "12.20.4"
27
+ },
28
+ "peerDependencies": {
29
+ "@teambit/legacy": "1.0.342",
30
+ "react-dom": "^16.8.0 || ^17.0.0",
31
+ "react": "^16.8.0 || ^17.0.0"
32
+ },
33
+ "license": "Apache-2.0",
34
+ "private": false,
35
+ "engines": {
36
+ "node": ">=12.22.0"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/teambit/bit"
41
+ },
42
+ "keywords": [
43
+ "bit",
44
+ "bit-aspect",
45
+ "components",
46
+ "collaboration",
47
+ "web",
48
+ "react",
49
+ "react-components",
50
+ "angular",
51
+ "angular-components"
52
+ ]
53
+ }
@@ -0,0 +1,5 @@
1
+ ;
2
+ ;
3
+
4
+ export const compositions = [];
5
+ export const overview = [];
package/tsconfig.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "es2019",
5
+ "DOM",
6
+ "ES6",
7
+ "DOM.Iterable",
8
+ "ScriptHost"
9
+ ],
10
+ "target": "es2015",
11
+ "module": "commonjs",
12
+ "jsx": "react",
13
+ "allowJs": true,
14
+ "composite": true,
15
+ "declaration": true,
16
+ "sourceMap": true,
17
+ "skipLibCheck": true,
18
+ "experimentalDecorators": true,
19
+ "outDir": "dist",
20
+ "moduleResolution": "node",
21
+ "esModuleInterop": true,
22
+ "rootDir": ".",
23
+ "resolveJsonModule": true,
24
+ "emitDeclarationOnly": true,
25
+ "emitDecoratorMetadata": true,
26
+ "allowSyntheticDefaultImports": true,
27
+ "strictPropertyInitialization": false,
28
+ "strict": true,
29
+ "noImplicitAny": false,
30
+ "preserveConstEnums": true
31
+ },
32
+ "exclude": [
33
+ "dist",
34
+ "package.json"
35
+ ],
36
+ "include": [
37
+ "**/*",
38
+ "**/*.json"
39
+ ]
40
+ }
@@ -0,0 +1,29 @@
1
+ declare module '*.png' {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module '*.svg' {
6
+ import type { FunctionComponent, SVGProps } from 'react';
7
+
8
+ export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
+ const src: string;
10
+ export default src;
11
+ }
12
+
13
+ // @TODO Gilad
14
+ declare module '*.jpg' {
15
+ const value: any;
16
+ export = value;
17
+ }
18
+ declare module '*.jpeg' {
19
+ const value: any;
20
+ export = value;
21
+ }
22
+ declare module '*.gif' {
23
+ const value: any;
24
+ export = value;
25
+ }
26
+ declare module '*.bmp' {
27
+ const value: any;
28
+ export = value;
29
+ }
@@ -0,0 +1,42 @@
1
+ declare module '*.module.css' {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+ declare module '*.module.scss' {
6
+ const classes: { readonly [key: string]: string };
7
+ export default classes;
8
+ }
9
+ declare module '*.module.sass' {
10
+ const classes: { readonly [key: string]: string };
11
+ export default classes;
12
+ }
13
+
14
+ declare module '*.module.less' {
15
+ const classes: { readonly [key: string]: string };
16
+ export default classes;
17
+ }
18
+
19
+ declare module '*.less' {
20
+ const classes: { readonly [key: string]: string };
21
+ export default classes;
22
+ }
23
+
24
+ declare module '*.css' {
25
+ const classes: { readonly [key: string]: string };
26
+ export default classes;
27
+ }
28
+
29
+ declare module '*.sass' {
30
+ const classes: { readonly [key: string]: string };
31
+ export default classes;
32
+ }
33
+
34
+ declare module '*.scss' {
35
+ const classes: { readonly [key: string]: string };
36
+ export default classes;
37
+ }
38
+
39
+ declare module '*.mdx' {
40
+ const component: any;
41
+ export default component;
42
+ }