@teambit/mover 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 { MoverAspect } from './mover.aspect';
2
+ export type { MoverMain } from './mover.main.runtime';
3
+ export default MoverAspect;
4
+ export { MoverAspect };
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "MoverAspect", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _mover().MoverAspect;
10
+ }
11
+ });
12
+ exports.default = void 0;
13
+ function _mover() {
14
+ const data = require("./mover.aspect");
15
+ _mover = function () {
16
+ return data;
17
+ };
18
+ return data;
19
+ }
20
+ var _default = _mover().MoverAspect;
21
+ exports.default = _default;
22
+
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MoverAspect"],"sources":["index.ts"],"sourcesContent":["import { MoverAspect } from './mover.aspect';\n\nexport type { MoverMain } from './mover.main.runtime';\nexport default MoverAspect;\nexport { MoverAspect };\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6C,eAG9BA,oBAAW;AAAA"}
@@ -0,0 +1,19 @@
1
+ import { Command } from '@teambit/cli';
2
+ import { MoverMain } from './mover.main.runtime';
3
+ export declare class MoveCmd implements Command {
4
+ private mover;
5
+ name: string;
6
+ description: string;
7
+ helpUrl: string;
8
+ arguments: {
9
+ name: string;
10
+ description: string;
11
+ }[];
12
+ group: string;
13
+ extendedDescription: string;
14
+ alias: string;
15
+ loader: boolean;
16
+ options: never[];
17
+ constructor(mover: MoverMain);
18
+ report([from, to]: [string, string]): Promise<string>;
19
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ require("core-js/modules/es.array.iterator.js");
5
+ require("core-js/modules/es.promise.js");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.MoveCmd = void 0;
10
+ function _defineProperty2() {
11
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+ _defineProperty2 = function () {
13
+ return data;
14
+ };
15
+ return data;
16
+ }
17
+ function _chalk() {
18
+ const data = _interopRequireDefault(require("chalk"));
19
+ _chalk = function () {
20
+ return data;
21
+ };
22
+ return data;
23
+ }
24
+ function _constants() {
25
+ const data = require("@teambit/legacy/dist/constants");
26
+ _constants = function () {
27
+ return data;
28
+ };
29
+ return data;
30
+ }
31
+ class MoveCmd {
32
+ constructor(mover) {
33
+ this.mover = mover;
34
+ (0, _defineProperty2().default)(this, "name", 'move <current-component-dir> <new-component-dir>');
35
+ (0, _defineProperty2().default)(this, "description", 'move a component to a different filesystem path');
36
+ (0, _defineProperty2().default)(this, "helpUrl", 'docs/workspace/moving-components');
37
+ (0, _defineProperty2().default)(this, "arguments", [{
38
+ name: 'current-component-dir',
39
+ description: 'the current relative path (in the workspace) to the component directory'
40
+ }, {
41
+ name: 'new-component-dir',
42
+ description: 'the new relative path (in the workspace) to the component directory'
43
+ }]);
44
+ (0, _defineProperty2().default)(this, "group", 'development');
45
+ (0, _defineProperty2().default)(this, "extendedDescription", `move files or directories of component(s)\n https://${_constants().BASE_DOCS_DOMAIN}/workspace/moving-components`);
46
+ (0, _defineProperty2().default)(this, "alias", 'mv');
47
+ (0, _defineProperty2().default)(this, "loader", true);
48
+ (0, _defineProperty2().default)(this, "options", []);
49
+ }
50
+ async report([from, to]) {
51
+ const componentsChanged = await this.mover.movePaths({
52
+ from,
53
+ to
54
+ });
55
+ const output = componentsChanged.map(component => {
56
+ const title = _chalk().default.green(`moved component ${component.id.toString()}:\n`);
57
+ const files = component.changes.map(file => `from ${_chalk().default.bold(file.from)} to ${_chalk().default.bold(file.to)}`).join('\n');
58
+ return title + files;
59
+ });
60
+ return output.join('\n');
61
+ }
62
+ }
63
+ exports.MoveCmd = MoveCmd;
64
+
65
+ //# sourceMappingURL=move-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MoveCmd","constructor","mover","name","description","BASE_DOCS_DOMAIN","report","from","to","componentsChanged","movePaths","output","map","component","title","chalk","green","id","toString","files","changes","file","bold","join"],"sources":["move-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command } from '@teambit/cli';\nimport { BASE_DOCS_DOMAIN } from '@teambit/legacy/dist/constants';\nimport { PathChangeResult } from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport { MoverMain } from './mover.main.runtime';\n\nexport class MoveCmd implements Command {\n name = 'move <current-component-dir> <new-component-dir>';\n description = 'move a component to a different filesystem path';\n helpUrl = 'docs/workspace/moving-components';\n arguments = [\n {\n name: 'current-component-dir',\n description: 'the current relative path (in the workspace) to the component directory',\n },\n {\n name: 'new-component-dir',\n description: 'the new relative path (in the workspace) to the component directory',\n },\n ];\n group = 'development';\n extendedDescription = `move files or directories of component(s)\\n https://${BASE_DOCS_DOMAIN}/workspace/moving-components`;\n alias = 'mv';\n loader = true;\n options = [];\n\n constructor(private mover: MoverMain) {}\n\n async report([from, to]: [string, string]) {\n const componentsChanged: PathChangeResult[] = await this.mover.movePaths({ from, to });\n const output = componentsChanged.map((component) => {\n const title = chalk.green(`moved component ${component.id.toString()}:\\n`);\n const files = component.changes\n .map((file) => `from ${chalk.bold(file.from)} to ${chalk.bold(file.to)}`)\n .join('\\n');\n return title + files;\n });\n return output.join('\\n');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIO,MAAMA,OAAO,CAAoB;EAoBtCC,WAAW,CAASC,KAAgB,EAAE;IAAA,KAAlBA,KAAgB,GAAhBA,KAAgB;IAAA,8CAnB7B,kDAAkD;IAAA,qDAC3C,iDAAiD;IAAA,iDACrD,kCAAkC;IAAA,mDAChC,CACV;MACEC,IAAI,EAAE,uBAAuB;MAC7BC,WAAW,EAAE;IACf,CAAC,EACD;MACED,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAE;IACf,CAAC,CACF;IAAA,+CACO,aAAa;IAAA,6DACE,wDAAuDC,6BAAiB,8BAA6B;IAAA,+CACpH,IAAI;IAAA,gDACH,IAAI;IAAA,iDACH,EAAE;EAE2B;EAEvC,MAAMC,MAAM,CAAC,CAACC,IAAI,EAAEC,EAAE,CAAmB,EAAE;IACzC,MAAMC,iBAAqC,GAAG,MAAM,IAAI,CAACP,KAAK,CAACQ,SAAS,CAAC;MAAEH,IAAI;MAAEC;IAAG,CAAC,CAAC;IACtF,MAAMG,MAAM,GAAGF,iBAAiB,CAACG,GAAG,CAAEC,SAAS,IAAK;MAClD,MAAMC,KAAK,GAAGC,gBAAK,CAACC,KAAK,CAAE,mBAAkBH,SAAS,CAACI,EAAE,CAACC,QAAQ,EAAG,KAAI,CAAC;MAC1E,MAAMC,KAAK,GAAGN,SAAS,CAACO,OAAO,CAC5BR,GAAG,CAAES,IAAI,IAAM,QAAON,gBAAK,CAACO,IAAI,CAACD,IAAI,CAACd,IAAI,CAAE,OAAMQ,gBAAK,CAACO,IAAI,CAACD,IAAI,CAACb,EAAE,CAAE,EAAC,CAAC,CACxEe,IAAI,CAAC,IAAI,CAAC;MACb,OAAOT,KAAK,GAAGK,KAAK;IACtB,CAAC,CAAC;IACF,OAAOR,MAAM,CAACY,IAAI,CAAC,IAAI,CAAC;EAC1B;AACF;AAAC"}
@@ -0,0 +1,2 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const MoverAspect: Aspect;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MoverAspect = void 0;
7
+ function _harmony() {
8
+ const data = require("@teambit/harmony");
9
+ _harmony = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ const MoverAspect = _harmony().Aspect.create({
15
+ id: 'teambit.component/mover'
16
+ });
17
+ exports.MoverAspect = MoverAspect;
18
+
19
+ //# sourceMappingURL=mover.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MoverAspect","Aspect","create","id"],"sources":["mover.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const MoverAspect = Aspect.create({\n id: 'teambit.component/mover',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,WAAW,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACvCC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
@@ -0,0 +1,19 @@
1
+ import { CLIMain } from '@teambit/cli';
2
+ import { Workspace } from '@teambit/workspace';
3
+ import { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';
4
+ import { PathChangeResult } from '@teambit/legacy/dist/consumer/bit-map/bit-map';
5
+ import Component from '@teambit/legacy/dist/consumer/component/consumer-component';
6
+ export declare class MoverMain {
7
+ private workspace;
8
+ constructor(workspace: Workspace);
9
+ movePaths({ from, to }: {
10
+ from: PathOsBasedRelative;
11
+ to: PathOsBasedRelative;
12
+ }): Promise<PathChangeResult[]>;
13
+ moveExistingComponent(component: Component, oldPath: PathOsBasedAbsolute, newPath: PathOsBasedAbsolute): void;
14
+ static slots: never[];
15
+ static dependencies: import("@teambit/harmony").Aspect[];
16
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
17
+ static provider([cli, workspace]: [CLIMain, Workspace]): Promise<MoverMain>;
18
+ }
19
+ export default MoverMain;
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ require("core-js/modules/es.array.iterator.js");
5
+ require("core-js/modules/es.promise.js");
6
+ require("core-js/modules/es.regexp.exec.js");
7
+ require("core-js/modules/es.string.replace.js");
8
+ Object.defineProperty(exports, "__esModule", {
9
+ value: true
10
+ });
11
+ exports.default = exports.MoverMain = void 0;
12
+ function _defineProperty2() {
13
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+ _defineProperty2 = function () {
15
+ return data;
16
+ };
17
+ return data;
18
+ }
19
+ function _fsExtra() {
20
+ const data = _interopRequireDefault(require("fs-extra"));
21
+ _fsExtra = function () {
22
+ return data;
23
+ };
24
+ return data;
25
+ }
26
+ function _bitError() {
27
+ const data = require("@teambit/bit-error");
28
+ _bitError = function () {
29
+ return data;
30
+ };
31
+ return data;
32
+ }
33
+ function _cli() {
34
+ const data = require("@teambit/cli");
35
+ _cli = function () {
36
+ return data;
37
+ };
38
+ return data;
39
+ }
40
+ function _workspace() {
41
+ const data = _interopRequireDefault(require("@teambit/workspace"));
42
+ _workspace = function () {
43
+ return data;
44
+ };
45
+ return data;
46
+ }
47
+ function _ramda() {
48
+ const data = _interopRequireDefault(require("ramda"));
49
+ _ramda = function () {
50
+ return data;
51
+ };
52
+ return data;
53
+ }
54
+ function _bitIds() {
55
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/bit-id/bit-ids"));
56
+ _bitIds = function () {
57
+ return data;
58
+ };
59
+ return data;
60
+ }
61
+ function _generalError() {
62
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
63
+ _generalError = function () {
64
+ return data;
65
+ };
66
+ return data;
67
+ }
68
+ function _links() {
69
+ const data = require("@teambit/legacy/dist/links");
70
+ _links = function () {
71
+ return data;
72
+ };
73
+ return data;
74
+ }
75
+ function _utils() {
76
+ const data = require("@teambit/legacy/dist/utils");
77
+ _utils = function () {
78
+ return data;
79
+ };
80
+ return data;
81
+ }
82
+ function _moveSync() {
83
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/utils/fs/move-sync"));
84
+ _moveSync = function () {
85
+ return data;
86
+ };
87
+ return data;
88
+ }
89
+ function _removePath() {
90
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/sources/remove-path"));
91
+ _removePath = function () {
92
+ return data;
93
+ };
94
+ return data;
95
+ }
96
+ function _mover() {
97
+ const data = require("./mover.aspect");
98
+ _mover = function () {
99
+ return data;
100
+ };
101
+ return data;
102
+ }
103
+ function _moveCmd() {
104
+ const data = require("./move-cmd");
105
+ _moveCmd = function () {
106
+ return data;
107
+ };
108
+ return data;
109
+ }
110
+ class MoverMain {
111
+ constructor(workspace) {
112
+ this.workspace = workspace;
113
+ }
114
+ async movePaths({
115
+ from,
116
+ to
117
+ }) {
118
+ const consumer = await this.workspace.consumer;
119
+ const fromExists = _fsExtra().default.existsSync(from);
120
+ const toExists = _fsExtra().default.existsSync(to);
121
+ if (fromExists && toExists) {
122
+ throw new (_bitError().BitError)(`unable to move because both paths from (${from}) and to (${to}) already exist`);
123
+ }
124
+ if (!fromExists && !toExists) throw new (_generalError().default)(`both paths from (${from}) and to (${to}) do not exist`);
125
+ if (!consumer.isLegacy && fromExists && !(0, _utils().isDir)(from)) {
126
+ throw new (_bitError().BitError)(`bit move supports moving directories only, not files.
127
+ files withing a component dir are automatically tracked, no action is needed.
128
+ to change the main-file, use "bit add <component-dir> --main <new-main-file>"`);
129
+ }
130
+ const fromRelative = consumer.getPathRelativeToConsumer(from);
131
+ const toRelative = consumer.getPathRelativeToConsumer(to);
132
+ const fromAbsolute = consumer.toAbsolutePath(fromRelative);
133
+ const toAbsolute = consumer.toAbsolutePath(toRelative);
134
+ const existingPath = fromExists ? fromAbsolute : toAbsolute;
135
+ const changes = consumer.bitMap.updatePathLocation(fromRelative, toRelative, existingPath);
136
+ if (fromExists && !toExists) {
137
+ // user would like to physically move the file. Otherwise (!fromExists and toExists), user would like to only update bit.map
138
+ (0, _moveSync().default)(fromAbsolute, toAbsolute);
139
+ }
140
+ if (!_ramda().default.isEmpty(changes)) {
141
+ const componentsIds = changes.map(c => c.id);
142
+ const {
143
+ components
144
+ } = await consumer.loadComponents(_bitIds().default.fromArray(componentsIds));
145
+ const nodeModuleLinker = new (_links().NodeModuleLinker)(components, consumer, consumer.bitMap);
146
+ await nodeModuleLinker.link();
147
+ }
148
+ await this.workspace.bitMap.write();
149
+ return changes;
150
+ }
151
+ moveExistingComponent(component, oldPath, newPath) {
152
+ const consumer = this.workspace.consumer;
153
+ if (_fsExtra().default.existsSync(newPath)) {
154
+ throw new (_generalError().default)(`could not move the component ${component.id.toString()} from ${oldPath} to ${newPath} as the destination path already exists`);
155
+ }
156
+ const componentMap = consumer.bitMap.getComponent(component.id);
157
+ const oldPathRelative = consumer.getPathRelativeToConsumer(oldPath);
158
+ const newPathRelative = consumer.getPathRelativeToConsumer(newPath);
159
+ componentMap.updateDirLocation(oldPathRelative, newPathRelative);
160
+ consumer.bitMap.markAsChanged();
161
+ component.dataToPersist.files.forEach(file => {
162
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
163
+ const newRelative = file.relative.replace(oldPathRelative, newPathRelative);
164
+ file.updatePaths({
165
+ newRelative
166
+ });
167
+ });
168
+ component.dataToPersist.removePath(new (_removePath().default)(oldPathRelative));
169
+ component.writtenPath = newPathRelative;
170
+ }
171
+ static async provider([cli, workspace]) {
172
+ const moverMain = new MoverMain(workspace);
173
+ cli.register(new (_moveCmd().MoveCmd)(moverMain));
174
+ return moverMain;
175
+ }
176
+ }
177
+ exports.MoverMain = MoverMain;
178
+ (0, _defineProperty2().default)(MoverMain, "slots", []);
179
+ (0, _defineProperty2().default)(MoverMain, "dependencies", [_cli().CLIAspect, _workspace().default]);
180
+ (0, _defineProperty2().default)(MoverMain, "runtime", _cli().MainRuntime);
181
+ _mover().MoverAspect.addRuntime(MoverMain);
182
+ var _default = MoverMain;
183
+ exports.default = _default;
184
+
185
+ //# sourceMappingURL=mover.main.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MoverMain","constructor","workspace","movePaths","from","to","consumer","fromExists","fs","existsSync","toExists","BitError","GeneralError","isLegacy","isDir","fromRelative","getPathRelativeToConsumer","toRelative","fromAbsolute","toAbsolutePath","toAbsolute","existingPath","changes","bitMap","updatePathLocation","moveSync","R","isEmpty","componentsIds","map","c","id","components","loadComponents","BitIds","fromArray","nodeModuleLinker","NodeModuleLinker","link","write","moveExistingComponent","component","oldPath","newPath","toString","componentMap","getComponent","oldPathRelative","newPathRelative","updateDirLocation","markAsChanged","dataToPersist","files","forEach","file","newRelative","relative","replace","updatePaths","removePath","RemovePath","writtenPath","provider","cli","moverMain","register","MoveCmd","CLIAspect","WorkspaceAspect","MainRuntime","MoverAspect","addRuntime"],"sources":["mover.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport BitIds from '@teambit/legacy/dist/bit-id/bit-ids';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { NodeModuleLinker } from '@teambit/legacy/dist/links';\nimport { isDir } from '@teambit/legacy/dist/utils';\nimport moveSync from '@teambit/legacy/dist/utils/fs/move-sync';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';\nimport { PathChangeResult } from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport { MoverAspect } from './mover.aspect';\nimport { MoveCmd } from './move-cmd';\n\nexport class MoverMain {\n constructor(private workspace: Workspace) {}\n\n async movePaths({ from, to }: { from: PathOsBasedRelative; to: PathOsBasedRelative }): Promise<PathChangeResult[]> {\n const consumer = await this.workspace.consumer;\n const fromExists = fs.existsSync(from);\n const toExists = fs.existsSync(to);\n if (fromExists && toExists) {\n throw new BitError(`unable to move because both paths from (${from}) and to (${to}) already exist`);\n }\n if (!fromExists && !toExists) throw new GeneralError(`both paths from (${from}) and to (${to}) do not exist`);\n if (!consumer.isLegacy && fromExists && !isDir(from)) {\n throw new BitError(`bit move supports moving directories only, not files.\n files withing a component dir are automatically tracked, no action is needed.\n to change the main-file, use \"bit add <component-dir> --main <new-main-file>\"`);\n }\n const fromRelative = consumer.getPathRelativeToConsumer(from);\n const toRelative = consumer.getPathRelativeToConsumer(to);\n const fromAbsolute = consumer.toAbsolutePath(fromRelative);\n const toAbsolute = consumer.toAbsolutePath(toRelative);\n const existingPath = fromExists ? fromAbsolute : toAbsolute;\n const changes = consumer.bitMap.updatePathLocation(fromRelative, toRelative, existingPath);\n if (fromExists && !toExists) {\n // user would like to physically move the file. Otherwise (!fromExists and toExists), user would like to only update bit.map\n moveSync(fromAbsolute, toAbsolute);\n }\n if (!R.isEmpty(changes)) {\n const componentsIds = changes.map((c) => c.id);\n const { components } = await consumer.loadComponents(BitIds.fromArray(componentsIds));\n const nodeModuleLinker = new NodeModuleLinker(components, consumer, consumer.bitMap);\n await nodeModuleLinker.link();\n }\n await this.workspace.bitMap.write();\n return changes;\n }\n\n moveExistingComponent(component: Component, oldPath: PathOsBasedAbsolute, newPath: PathOsBasedAbsolute) {\n const consumer = this.workspace.consumer;\n if (fs.existsSync(newPath)) {\n throw new GeneralError(\n `could not move the component ${component.id.toString()} from ${oldPath} to ${newPath} as the destination path already exists`\n );\n }\n const componentMap = consumer.bitMap.getComponent(component.id);\n const oldPathRelative = consumer.getPathRelativeToConsumer(oldPath);\n const newPathRelative = consumer.getPathRelativeToConsumer(newPath);\n componentMap.updateDirLocation(oldPathRelative, newPathRelative);\n consumer.bitMap.markAsChanged();\n component.dataToPersist.files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const newRelative = file.relative.replace(oldPathRelative, newPathRelative);\n file.updatePaths({ newRelative });\n });\n component.dataToPersist.removePath(new RemovePath(oldPathRelative));\n component.writtenPath = newPathRelative;\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect];\n static runtime = MainRuntime;\n\n static async provider([cli, workspace]: [CLIMain, Workspace]) {\n const moverMain = new MoverMain(workspace);\n cli.register(new MoveCmd(moverMain));\n return moverMain;\n }\n}\n\nMoverAspect.addRuntime(MoverMain);\n\nexport default MoverMain;\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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,SAAS,CAAC;EACrBC,WAAW,CAASC,SAAoB,EAAE;IAAA,KAAtBA,SAAoB,GAApBA,SAAoB;EAAG;EAE3C,MAAMC,SAAS,CAAC;IAAEC,IAAI;IAAEC;EAA2D,CAAC,EAA+B;IACjH,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACJ,SAAS,CAACI,QAAQ;IAC9C,MAAMC,UAAU,GAAGC,kBAAE,CAACC,UAAU,CAACL,IAAI,CAAC;IACtC,MAAMM,QAAQ,GAAGF,kBAAE,CAACC,UAAU,CAACJ,EAAE,CAAC;IAClC,IAAIE,UAAU,IAAIG,QAAQ,EAAE;MAC1B,MAAM,KAAIC,oBAAQ,EAAE,2CAA0CP,IAAK,aAAYC,EAAG,iBAAgB,CAAC;IACrG;IACA,IAAI,CAACE,UAAU,IAAI,CAACG,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CAACE,QAAQ,CAAC,KAAIC,kBAAO,EAACF,SAAS,CAAC,CAAC;IACpC,OAAOA,SAAS;EAClB;AACF;AAAC;AAAA,gCAlEYhE,SAAS,WAyDL,EAAE;AAAA,gCAzDNA,SAAS,kBA0DE,CAACmE,gBAAS,EAAEC,oBAAe,CAAC;AAAA,gCA1DvCpE,SAAS,aA2DHqE,kBAAW;AAS9BC,oBAAW,CAACC,UAAU,CAACvE,SAAS,CAAC;AAAC,eAEnBA,SAAS;AAAA"}
@@ -0,0 +1,7 @@
1
+ ;
2
+ ;
3
+
4
+ export const compositions = [];
5
+ export const overview = [];
6
+
7
+ export const compositions_metadata = {"compositions":[]};
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@teambit/mover",
3
+ "version": "0.0.1",
4
+ "main": "dist/index.js",
5
+ "componentId": {
6
+ "scope": "teambit.component",
7
+ "name": "mover",
8
+ "version": "0.0.1"
9
+ },
10
+ "dependencies": {
11
+ "chalk": "2.4.2",
12
+ "fs-extra": "10.0.0",
13
+ "ramda": "0.27.1",
14
+ "core-js": "^3.0.0",
15
+ "@babel/runtime": "7.20.0",
16
+ "@teambit/harmony": "0.4.6",
17
+ "@teambit/cli": "0.0.650",
18
+ "@teambit/bit-error": "0.0.402",
19
+ "@teambit/workspace": "0.0.970"
20
+ },
21
+ "devDependencies": {
22
+ "@types/fs-extra": "9.0.7",
23
+ "@types/mocha": "9.1.0",
24
+ "@types/node": "12.20.4",
25
+ "@types/react": "^17.0.8",
26
+ "@types/react-dom": "^17.0.5",
27
+ "@types/jest": "^26.0.0",
28
+ "@types/testing-library__jest-dom": "5.9.5"
29
+ },
30
+ "peerDependencies": {
31
+ "@teambit/legacy": "1.0.432",
32
+ "react": "^16.8.0 || ^17.0.0",
33
+ "react-dom": "^16.8.0 || ^17.0.0"
34
+ },
35
+ "license": "Apache-2.0",
36
+ "private": false,
37
+ "engines": {
38
+ "node": ">=12.22.0"
39
+ },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/teambit/bit"
43
+ },
44
+ "keywords": [
45
+ "bit",
46
+ "bit-aspect",
47
+ "components",
48
+ "collaboration",
49
+ "web",
50
+ "react",
51
+ "react-components",
52
+ "angular",
53
+ "angular-components"
54
+ ]
55
+ }
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
+ }