@teambit/git 1.0.208 → 1.0.210
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/schema.json +2 -2
- package/dist/git.cmd.js +1 -1
- package/dist/git.cmd.js.map +1 -1
- package/dist/git.main.runtime.js +1 -1
- package/dist/git.main.runtime.js.map +1 -1
- package/dist/merge-bitmaps.cmd.js +1 -1
- package/dist/merge-bitmaps.cmd.js.map +1 -1
- package/dist/set-git-merge-driver.cmd.js +1 -1
- package/dist/set-git-merge-driver.cmd.js.map +1 -1
- package/package.json +3 -3
- /package/dist/{preview-1711458141302.js → preview-1711617900376.js} +0 -0
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
3
|
-
<testsuite name="teambit.git/git@1.0.
|
3
|
+
<testsuite name="teambit.git/git@1.0.210" tests="0" failures="0" errors="0" skipped="0"/>
|
4
4
|
</testsuites>
|
package/artifacts/schema.json
CHANGED
@@ -444,7 +444,7 @@
|
|
444
444
|
"line": 28,
|
445
445
|
"character": 3
|
446
446
|
},
|
447
|
-
"signature": "(property) GitExtWorkspaceConfig.mergeStrategy: \"manual\" | \"
|
447
|
+
"signature": "(property) GitExtWorkspaceConfig.mergeStrategy: \"manual\" | \"theirs\" | \"ours\"",
|
448
448
|
"name": "mergeStrategy",
|
449
449
|
"type": {
|
450
450
|
"__schema": "TypeUnionSchema",
|
@@ -1151,7 +1151,7 @@
|
|
1151
1151
|
"componentId": {
|
1152
1152
|
"scope": "teambit.git",
|
1153
1153
|
"name": "git",
|
1154
|
-
"version": "1.0.
|
1154
|
+
"version": "1.0.210"
|
1155
1155
|
},
|
1156
1156
|
"taggedModuleExports": []
|
1157
1157
|
}
|
package/dist/git.cmd.js
CHANGED
@@ -13,7 +13,7 @@ function _chalk() {
|
|
13
13
|
}
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
18
|
const COMMAND_NAME = 'git';
|
19
19
|
class GitCmd {
|
package/dist/git.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","COMMAND_NAME","GitCmd","constructor","report","unrecognizedSubcommand","chalk","red","exports"],"sources":["git.cmd.ts"],"sourcesContent":["import { Command } from '@teambit/cli';\nimport chalk from 'chalk';\n\nconst COMMAND_NAME = 'git';\n\nexport class GitCmd implements Command {\n name = `${COMMAND_NAME} <sub-command>`;\n alias = '';\n description = 'perform git operations';\n options = [];\n group = 'git';\n commands: Command[] = [];\n // helpUrl = '';\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"git\", please run \"bit git --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA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AC/C,OAAOC,gBAAK,CAACC,GAAG,CACb,IAAGF,sBAAuB,qFAC7B,CAAC;EACH;AACF;AAACG,OAAA,CAAAN,MAAA,GAAAA,MAAA","ignoreList":[]}
|
package/dist/git.main.runtime.js
CHANGED
@@ -83,7 +83,7 @@ function _git2() {
|
|
83
83
|
}
|
84
84
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
85
85
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
86
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
86
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
87
87
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
88
88
|
const GIT_BASE_KEY = 'merge.bitmap-driver';
|
89
89
|
const GIT_NAME_KEY = `${GIT_BASE_KEY}.name`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bitError","_os","_path","_gitconfig","_cli","_workspace","_git","_mergeBitmaps","_setGitMergeDriver","_git2","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","GIT_BASE_KEY","GIT_NAME_KEY","GIT_DRIVER_KEY","GIT_NAME_VALUE","GIT_DRIVER_VALUE","GIT_ATTRIBUTES","GitMain","constructor","workspace","config","mergeBitmaps","ancestor","current","other","encoding","currentContent","stripBom","fs","readFileSync","otherContent","opts","mergeStrategy","merged","bitMap","outputFile","setGitMergeDriver","setGitConfig","setGitAttributes","isGit","pathExists","global","BitError","location","gitVal","gitconfig","get","set","attributesPath","getGitAttributesPath","fileExist","writeFile","gitAttributes","readFile","includes","appendFile","fromConfig","xdgConfigHome","process","env","XDG_CONFIG_HOME","join","homedir","str","slice","provider","cli","gitMain","gitCmd","GitCmd","commands","SetGitMergeDriverCmd","MergeBitmapsCmd","register","registerGroup","exports","CLIAspect","WorkspaceAspect","MainRuntime","GitAspect","addRuntime","_default"],"sources":["git.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { BitError } from '@teambit/bit-error';\nimport { homedir } from 'os';\nimport { join } from 'path';\nimport gitconfig from 'gitconfig';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect, Workspace, BitmapMergeOptions } from '@teambit/workspace';\nimport { GitAspect } from './git.aspect';\nimport { MergeBitmapsCmd } from './merge-bitmaps.cmd';\nimport { SetGitMergeDriverCmd } from './set-git-merge-driver.cmd';\nimport { GitCmd } from './git.cmd';\n\ntype SetGitMergeDriverOpts = {\n global?: boolean;\n};\n\nconst GIT_BASE_KEY = 'merge.bitmap-driver';\nconst GIT_NAME_KEY = `${GIT_BASE_KEY}.name`;\nconst GIT_DRIVER_KEY = `${GIT_BASE_KEY}.driver`;\n\nconst GIT_NAME_VALUE = 'A custom merge driver used to resolve conflicts in .bitmap files';\n// const binName = process.argv[1];\nconst GIT_DRIVER_VALUE = 'bd git merge-bitmaps %O %A %B';\n\nconst GIT_ATTRIBUTES = '.bitmap merge=bitmap-driver';\n\nexport interface GitExtWorkspaceConfig {\n mergeStrategy: 'ours' | 'theirs' | 'manual';\n}\nexport class GitMain {\n constructor(\n private workspace: Workspace,\n /**\n * Git extension configuration.\n */\n readonly config: GitExtWorkspaceConfig\n ) {}\n\n async mergeBitmaps(ancestor: string, current: string, other: string) {\n const encoding = 'utf-8';\n // const ancestorContent = this.stripBom(fs.readFileSync(ancestor, encoding));\n const currentContent = this.stripBom(fs.readFileSync(current, encoding));\n const otherContent = this.stripBom(fs.readFileSync(other, encoding));\n const opts: BitmapMergeOptions = {\n mergeStrategy: this.config.mergeStrategy || 'manual',\n };\n const merged = this.workspace.bitMap.mergeBitmaps(currentContent, otherContent, opts);\n await fs.outputFile(current, merged);\n return merged;\n }\n\n async setGitMergeDriver(opts: SetGitMergeDriverOpts) {\n await this.setGitConfig(opts);\n await this.setGitAttributes(opts);\n return true;\n }\n\n private async setGitConfig(opts: SetGitMergeDriverOpts) {\n const isGit = await fs.pathExists('.git');\n if (!isGit && !opts.global) {\n throw new BitError('This is not a git repository');\n }\n const location = opts.global ? 'global' : 'local';\n let gitVal;\n try {\n gitVal = await gitconfig.get(GIT_NAME_KEY, { location });\n } catch {\n // do nothing, it just means that there is no config yet which is fine\n }\n if (gitVal) {\n return; // already set\n }\n await gitconfig.set(GIT_NAME_KEY, GIT_NAME_VALUE, { location });\n await gitconfig.set(GIT_DRIVER_KEY, GIT_DRIVER_VALUE, { location });\n }\n\n private async setGitAttributes(opts: SetGitMergeDriverOpts) {\n const attributesPath = await this.getGitAttributesPath(opts.global);\n const isGit = await fs.pathExists('.git');\n if (!isGit && !opts.global) {\n throw new BitError('This is not a git repository');\n }\n const fileExist = await fs.pathExists(attributesPath);\n if (!fileExist) {\n await fs.writeFile(attributesPath, GIT_ATTRIBUTES);\n } else {\n const gitAttributes = await fs.readFile(attributesPath, 'utf8');\n if (gitAttributes.includes(GIT_ATTRIBUTES)) {\n return; // already set\n }\n await fs.appendFile(attributesPath, `\\n${GIT_ATTRIBUTES}`);\n }\n }\n\n private async getGitAttributesPath(global = false) {\n const fromConfig = await gitconfig.get('core.attributesFile', { location: global ? 'global' : 'local' });\n if (fromConfig) {\n return fromConfig;\n }\n if (!global) {\n return '.gitattributes';\n }\n const xdgConfigHome = process.env.XDG_CONFIG_HOME;\n if (xdgConfigHome) {\n return join(xdgConfigHome, 'git', 'attributes');\n }\n return join(homedir(), '.config', 'git', 'attributes');\n }\n\n private stripBom(str) {\n return str[0] === '\\uFEFF' ? str.slice(1) : str;\n }\n\n static slots = [];\n // define your aspect dependencies here.\n // in case you need to use another aspect API.\n static dependencies = [CLIAspect, WorkspaceAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace]: [CLIMain, Workspace], config: GitExtWorkspaceConfig) {\n const gitMain = new GitMain(workspace, config);\n const gitCmd = new GitCmd();\n gitCmd.commands = [new SetGitMergeDriverCmd(gitMain), new MergeBitmapsCmd(gitMain)];\n cli.register(gitCmd);\n cli.registerGroup('git', 'Git');\n return gitMain;\n }\n}\n\nGitAspect.addRuntime(GitMain);\n\nexport default GitMain;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,WAAA;EAAA,MAAAR,IA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AAC;IAC9C,MAAMgD,MAAM,GAAG,KAAIC,cAAM,EAAC,CAAC;IAC3BD,MAAM,CAACE,QAAQ,GAAG,CAAC,KAAIC,yCAAoB,EAACJ,OAAO,CAAC,EAAE,KAAIK,+BAAe,EAACL,OAAO,CAAC,CAAC;IACnFD,GAAG,CAACO,QAAQ,CAACL,MAAM,CAAC;IACpBF,GAAG,CAACQ,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/B,OAAOP,OAAO;EAChB;AACF;AAACQ,OAAA,CAAA1D,OAAA,GAAAA,OAAA;AAAA1B,eAAA,CAnGY0B,OAAO,WAoFH,EAAE;AACjB;AACA;AAAA1B,eAAA,CAtFW0B,OAAO,kBAuFI,CAAC2D,gBAAS,EAAEC,4BAAe,CAAC;AAAAtF,eAAA,CAvFvC0B,OAAO,aAyFD6D,kBAAW;AAY9BC,gBAAS,CAACC,UAAU,CAAC/D,OAAO,CAAC;AAAC,IAAAgE,QAAA,GAAAN,OAAA,CAAArF,OAAA,GAEf2B,OAAO","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bitError","_os","_path","_gitconfig","_cli","_workspace","_git","_mergeBitmaps","_setGitMergeDriver","_git2","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","GIT_BASE_KEY","GIT_NAME_KEY","GIT_DRIVER_KEY","GIT_NAME_VALUE","GIT_DRIVER_VALUE","GIT_ATTRIBUTES","GitMain","constructor","workspace","config","mergeBitmaps","ancestor","current","other","encoding","currentContent","stripBom","fs","readFileSync","otherContent","opts","mergeStrategy","merged","bitMap","outputFile","setGitMergeDriver","setGitConfig","setGitAttributes","isGit","pathExists","global","BitError","location","gitVal","gitconfig","get","set","attributesPath","getGitAttributesPath","fileExist","writeFile","gitAttributes","readFile","includes","appendFile","fromConfig","xdgConfigHome","process","env","XDG_CONFIG_HOME","join","homedir","str","slice","provider","cli","gitMain","gitCmd","GitCmd","commands","SetGitMergeDriverCmd","MergeBitmapsCmd","register","registerGroup","exports","CLIAspect","WorkspaceAspect","MainRuntime","GitAspect","addRuntime","_default"],"sources":["git.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { BitError } from '@teambit/bit-error';\nimport { homedir } from 'os';\nimport { join } from 'path';\nimport gitconfig from 'gitconfig';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect, Workspace, BitmapMergeOptions } from '@teambit/workspace';\nimport { GitAspect } from './git.aspect';\nimport { MergeBitmapsCmd } from './merge-bitmaps.cmd';\nimport { SetGitMergeDriverCmd } from './set-git-merge-driver.cmd';\nimport { GitCmd } from './git.cmd';\n\ntype SetGitMergeDriverOpts = {\n global?: boolean;\n};\n\nconst GIT_BASE_KEY = 'merge.bitmap-driver';\nconst GIT_NAME_KEY = `${GIT_BASE_KEY}.name`;\nconst GIT_DRIVER_KEY = `${GIT_BASE_KEY}.driver`;\n\nconst GIT_NAME_VALUE = 'A custom merge driver used to resolve conflicts in .bitmap files';\n// const binName = process.argv[1];\nconst GIT_DRIVER_VALUE = 'bd git merge-bitmaps %O %A %B';\n\nconst GIT_ATTRIBUTES = '.bitmap merge=bitmap-driver';\n\nexport interface GitExtWorkspaceConfig {\n mergeStrategy: 'ours' | 'theirs' | 'manual';\n}\nexport class GitMain {\n constructor(\n private workspace: Workspace,\n /**\n * Git extension configuration.\n */\n readonly config: GitExtWorkspaceConfig\n ) {}\n\n async mergeBitmaps(ancestor: string, current: string, other: string) {\n const encoding = 'utf-8';\n // const ancestorContent = this.stripBom(fs.readFileSync(ancestor, encoding));\n const currentContent = this.stripBom(fs.readFileSync(current, encoding));\n const otherContent = this.stripBom(fs.readFileSync(other, encoding));\n const opts: BitmapMergeOptions = {\n mergeStrategy: this.config.mergeStrategy || 'manual',\n };\n const merged = this.workspace.bitMap.mergeBitmaps(currentContent, otherContent, opts);\n await fs.outputFile(current, merged);\n return merged;\n }\n\n async setGitMergeDriver(opts: SetGitMergeDriverOpts) {\n await this.setGitConfig(opts);\n await this.setGitAttributes(opts);\n return true;\n }\n\n private async setGitConfig(opts: SetGitMergeDriverOpts) {\n const isGit = await fs.pathExists('.git');\n if (!isGit && !opts.global) {\n throw new BitError('This is not a git repository');\n }\n const location = opts.global ? 'global' : 'local';\n let gitVal;\n try {\n gitVal = await gitconfig.get(GIT_NAME_KEY, { location });\n } catch {\n // do nothing, it just means that there is no config yet which is fine\n }\n if (gitVal) {\n return; // already set\n }\n await gitconfig.set(GIT_NAME_KEY, GIT_NAME_VALUE, { location });\n await gitconfig.set(GIT_DRIVER_KEY, GIT_DRIVER_VALUE, { location });\n }\n\n private async setGitAttributes(opts: SetGitMergeDriverOpts) {\n const attributesPath = await this.getGitAttributesPath(opts.global);\n const isGit = await fs.pathExists('.git');\n if (!isGit && !opts.global) {\n throw new BitError('This is not a git repository');\n }\n const fileExist = await fs.pathExists(attributesPath);\n if (!fileExist) {\n await fs.writeFile(attributesPath, GIT_ATTRIBUTES);\n } else {\n const gitAttributes = await fs.readFile(attributesPath, 'utf8');\n if (gitAttributes.includes(GIT_ATTRIBUTES)) {\n return; // already set\n }\n await fs.appendFile(attributesPath, `\\n${GIT_ATTRIBUTES}`);\n }\n }\n\n private async getGitAttributesPath(global = false) {\n const fromConfig = await gitconfig.get('core.attributesFile', { location: global ? 'global' : 'local' });\n if (fromConfig) {\n return fromConfig;\n }\n if (!global) {\n return '.gitattributes';\n }\n const xdgConfigHome = process.env.XDG_CONFIG_HOME;\n if (xdgConfigHome) {\n return join(xdgConfigHome, 'git', 'attributes');\n }\n return join(homedir(), '.config', 'git', 'attributes');\n }\n\n private stripBom(str) {\n return str[0] === '\\uFEFF' ? str.slice(1) : str;\n }\n\n static slots = [];\n // define your aspect dependencies here.\n // in case you need to use another aspect API.\n static dependencies = [CLIAspect, WorkspaceAspect];\n\n static runtime = MainRuntime;\n\n static async provider([cli, workspace]: [CLIMain, Workspace], config: GitExtWorkspaceConfig) {\n const gitMain = new GitMain(workspace, config);\n const gitCmd = new GitCmd();\n gitCmd.commands = [new SetGitMergeDriverCmd(gitMain), new MergeBitmapsCmd(gitMain)];\n cli.register(gitCmd);\n cli.registerGroup('git', 'Git');\n return gitMain;\n }\n}\n\nGitAspect.addRuntime(GitMain);\n\nexport default GitMain;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,KAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;E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AO,CAAC,CAAC;IACnFD,GAAG,CAACO,QAAQ,CAACL,MAAM,CAAC;IACpBF,GAAG,CAACQ,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/B,OAAOP,OAAO;EAChB;AACF;AAACQ,OAAA,CAAA1D,OAAA,GAAAA,OAAA;AAAA1B,eAAA,CAnGY0B,OAAO,WAoFH,EAAE;AACjB;AACA;AAAA1B,eAAA,CAtFW0B,OAAO,kBAuFI,CAAC2D,gBAAS,EAAEC,4BAAe,CAAC;AAAAtF,eAAA,CAvFvC0B,OAAO,aAyFD6D,kBAAW;AAY9BC,gBAAS,CAACC,UAAU,CAAC/D,OAAO,CAAC;AAAC,IAAAgE,QAAA,GAAAN,OAAA,CAAArF,OAAA,GAEf2B,OAAO","ignoreList":[]}
|
@@ -13,7 +13,7 @@ function _chalk() {
|
|
13
13
|
}
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
18
|
const COMMAND_NAME = 'merge-bitmaps';
|
19
19
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","COMMAND_NAME","MergeBitmapsCmd","constructor","git","report","ancestor","current","other","res","mergeBitmaps","chalk","green","red","exports"],"sources":["merge-bitmaps.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { GitMain } from './git.main.runtime';\n\nconst COMMAND_NAME = 'merge-bitmaps';\n\n// - `%O`: ancestor’s version of the conflicting file\n// - `%A`: current version of the conflicting file\n// - `%B`: other branch's version of the conflicting file\n\nexport class MergeBitmapsCmd implements Command {\n name = `${COMMAND_NAME} <ancestor> <current> <other>`;\n alias = '';\n description = `a special command to merge conflicting bitmap files during git merge`;\n options = [] as CommandOptions;\n group = 'git';\n commands: Command[] = [];\n private = true;\n // helpUrl = '';\n\n constructor(private git: GitMain) {}\n\n async report([ancestor, current, other]: string[]) {\n const res = await this.git.mergeBitmaps(ancestor, current, other);\n if (res) {\n return chalk.green('git merge driver was successfully set');\n }\n return chalk.red('git merge driver was not set');\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC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@@ -13,7 +13,7 @@ function _chalk() {
|
|
13
13
|
}
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
18
|
const COMMAND_NAME = 'set-merge-driver';
|
19
19
|
class SetGitMergeDriverCmd {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","COMMAND_NAME","SetGitMergeDriverCmd","constructor","git","report","_args","flags","res","setGitMergeDriver","chalk","green","red","exports"],"sources":["set-git-merge-driver.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { GitMain } from './git.main.runtime';\n\nconst COMMAND_NAME = 'set-merge-driver';\n\ntype SetGitMergeDriverFlags = {\n global?: boolean;\n};\n\nexport class SetGitMergeDriverCmd implements Command {\n name = COMMAND_NAME;\n alias = 'smd';\n description = `setup bit's git merge driver for bitmap files`;\n options = [['g', 'global', 'set the git merge driver globally']] as CommandOptions;\n group = 'git';\n commands: Command[] = [];\n // helpUrl = '';\n\n constructor(private git: GitMain) {}\n\n async report(_args, flags: SetGitMergeDriverFlags) {\n const res = await this.git.setGitMergeDriver(flags);\n if (res) {\n return chalk.green('git merge driver was successfully set');\n }\n return chalk.red('git merge driver was not set');\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAG1B,MAAMW,YAAY,GAAG,kBAAkB;AAMhC,MAAMC,oBAAoB,CAAoB;EAOnD;;EAEAC,WAAWA,CAASC,GAAY,EAAE;IAAA,KAAdA,GAAY,GAAZA,GAAY;IAAAvB,eAAA,eARzBoB,YAAY;IAAApB,eAAA,gBACX,KAAK;IAAAA,eAAA,sBACE,+CAA8C;IAAAA,eAAA,kBACnD,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,mCAAmC,CAAC,CAAC;IAAAA,eAAA,gBACxD,KAAK;IAAAA,eAAA,mBACS,EAAE;EAGW;EAEnC,MAAMwB,MAAMA,CAACC,KAAK,EAAEC,KAA6B,EAAE;IACjD,MAAMC,GAAG,GAAG,MAAM,IAAI,CAACJ,GAAG,CAACK,iBAAiB,CAACF,KAAK,CAAC;IACnD,IAAIC,GAAG,EAAE;MACP,OAAOE,gBAAK,CAACC,KAAK,CAAC,uCAAuC,CAAC;IAC7D;IACA,OAAOD,gBAAK,CAACE,GAAG,CAAC,8BAA8B,CAAC;EAClD;AACF;AAACC,OAAA,CAAAX,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/git",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.210",
|
4
4
|
"homepage": "https://bit.cloud/teambit/git/git",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.git",
|
8
8
|
"name": "git",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.210"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"@teambit/harmony": "0.4.6",
|
16
16
|
"@teambit/bit-error": "0.0.404",
|
17
17
|
"@teambit/cli": "0.0.858",
|
18
|
-
"@teambit/workspace": "1.0.
|
18
|
+
"@teambit/workspace": "1.0.210"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
21
|
"@types/fs-extra": "9.0.7",
|
File without changes
|