Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sfdx-git-delta

Package Overview
Dependencies
Maintainers
1
Versions
356
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sfdx-git-delta - npm Package Compare versions

Comparing version 0.8.10 to 1.0.2

__mocks__/child_process.js

286

.eslintrc.json
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": "error",
"array-bracket-spacing": "error",
"array-callback-return": "error",
"array-element-newline": "error",
"arrow-body-style": "off",
"arrow-parens": [
"error",
"as-needed",
{
"requireForBlockBody": true
}
],
"arrow-spacing": "off",
"block-scoped-var": "error",
"block-spacing": "error",
"brace-style": "error",
"callback-return": "error",
"camelcase": "error",
"capitalized-comments": "error",
"class-methods-use-this": "error",
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": [
"error",
"last"
],
"complexity": "error",
"computed-property-spacing": "error",
"consistent-return": "off",
"consistent-this": "error",
"curly": "error",
"default-case": "error",
"dot-location": [
"error",
"property"
],
"dot-notation": [
"error",
{
"allowKeywords": true
}
],
"eol-last": [
"error",
"never"
],
"eqeqeq": "error",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "error",
"func-style": "error",
"function-paren-newline": "error",
"generator-star-spacing": "error",
"global-require": "error",
"guard-for-in": "error",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "error",
"id-match": "error",
"implicit-arrow-linebreak": [
"error",
"beside"
],
"indent": "off",
"indent-legacy": "off",
"init-declarations": "error",
"jsx-quotes": "error",
"key-spacing": "error",
"line-comment-position": "error",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "error",
"lines-around-directive": "off",
"lines-between-class-members": "error",
"max-classes-per-file": "error",
"max-depth": "error",
"max-len": "off",
"max-lines": "error",
"max-lines-per-function": "error",
"max-nested-callbacks": "error",
"max-params": "error",
"max-statements": "error",
"max-statements-per-line": "error",
"multiline-comment-style": "error",
"new-cap": "error",
"new-parens": "error",
"newline-after-var": [
"error",
"always"
],
"newline-before-return": "error",
"newline-per-chained-call": "error",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "error",
"no-bitwise": "error",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-confusing-arrow": "error",
"no-console": "error",
"no-continue": "error",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "error",
"no-empty-function": "error",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "error",
"no-invalid-this": "error",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-magic-numbers": "error",
"no-mixed-operators": "error",
"no-mixed-requires": "error",
"no-multi-assign": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "error",
"no-negated-in-lhs": "error",
"no-nested-ternary": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "error",
"no-path-concat": "error",
"no-plusplus": "error",
"no-process-env": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "error",
"no-spaced-func": "error",
"no-sync": "error",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-undef-init": "error",
"no-undefined": "error",
"no-underscore-dangle": "error",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "error",
"no-use-before-define": "error",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "error",
"no-void": "error",
"no-warning-comments": "error",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "error",
"object-curly-spacing": "error",
"object-property-newline": "error",
"object-shorthand": "error",
"one-var": "off",
"one-var-declaration-per-line": "error",
"operator-assignment": "error",
"operator-linebreak": [
"error",
"before"
],
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": "error",
"prefer-named-capture-group": "error",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"quote-props": "error",
"quotes": "off",
"radix": "error",
"require-await": "error",
"require-jsdoc": "error",
"require-unicode-regexp": "error",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "error",
"semi-style": [
"error",
"last"
],
"sort-imports": "error",
"sort-keys": "error",
"sort-vars": "error",
"space-before-blocks": "error",
"space-before-function-paren": "error",
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"strict": "error",
"switch-colon-spacing": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "error",
"vars-on-top": "error",
"wrap-iife": "error",
"wrap-regex": "error",
"yield-star-spacing": "error",
"yoda": [
"error",
"never"
]
}
}
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"extends": ["eslint:recommended", "plugin:prettier/recommended", "prettier"],
"plugins": ["prettier"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"prettier/prettier": "error"
}
}

@@ -13,3 +13,2 @@ 'use strict'

typeof config.to !== 'string' ||
typeof config.from !== 'string' ||
typeof config.apiVersion !== 'string' ||

@@ -16,0 +15,0 @@ typeof config.output !== 'string' ||

@@ -1,4 +0,1 @@

/* eslint-disable max-lines-per-function */
/* eslint-disable no-undef */
/* eslint-disable no-sync */
'use strict'

@@ -23,3 +20,2 @@ const path = require('path')

if (!this.config.from) {
// eslint-disable-next-line array-element-newline
const firstCommitSHARaw = childProcess.spawnSync(

@@ -34,3 +30,3 @@ 'git',

}
// eslint-disable-next-line array-element-newline
const child = childProcess.spawn(

@@ -48,3 +44,2 @@ 'git',

// eslint-disable-next-line no-undef
child.stdout.on('data', data =>

@@ -54,3 +49,2 @@ fullResult.push(Buffer.from(data).toString(UTF8_ENCODING))

child.on('close', () => {
// eslint-disable-next-line object-property-newline
const work = { config: this.config, diffs: {}, promises: [] }

@@ -70,3 +64,3 @@ const typeHandlerFactory = new TypeHandlerFactory(work)

.forEach(line => typeHandlerFactory.getTypeHander(line).handle())
// eslint-disable-next-line no-console
Promise.all(

@@ -79,3 +73,2 @@ work.promises.map(promise =>

child.stderr.on('data', data => {
// eslint-disable-next-line no-undef
reject(Buffer.from(data).toString(UTF8_ENCODING))

@@ -82,0 +75,0 @@ })

@@ -1,2 +0,1 @@

/* eslint-disable max-lines */
'use strict'

@@ -3,0 +2,0 @@ const metadata = [

@@ -17,3 +17,3 @@ 'use strict'

this.splittedLine
// eslint-disable-next-line no-magic-numbers
.slice(this.splittedLine.indexOf(this.type) + 1)

@@ -20,0 +20,0 @@ .join(path.sep)

@@ -22,6 +22,5 @@ 'use strict'

const {
resourcepath: srcPath,
resource: resourceName,
} = this.getSrcPath.apply(this)
const [, srcPath, resourceName] = path
.join(this.config.repo, this.line)
.match(/(?<path>.*[/\\]staticresources)\/(?<name>[^/\\]*)+/u)
const [targetPath] = `${path.join(this.config.output, this.line)}`.match(

@@ -32,7 +31,5 @@ /.*[/\\]staticresources/u

if (!Object.prototype.hasOwnProperty.call(staticResourcesSrc, srcPath)) {
// eslint-disable-next-line no-sync
staticResourcesSrc[srcPath] = fs.readdirSync(srcPath)
}
staticResourcesSrc[srcPath]
// eslint-disable-next-line no-magic-numbers
.filter(src => src.indexOf(resourceName) !== -1)

@@ -54,8 +51,6 @@ .forEach(src =>

handleDeletion() {
const {
resourcepath: srcPath,
resource: resourceName,
} = this.getSrcPath.apply(this)
const [, srcPath, resourceName] = path
.join(this.config.repo, this.line)
.match(/(?<path>.*[/\\]staticresources)\/(?<name>[^/\\]*)+/u)
// eslint-disable-next-line no-sync
if (fs.existsSync(path.join(srcPath, resourceName))) {

@@ -67,15 +62,4 @@ this.handleModification.apply(this)

}
getSrcPath() {
const [, resourcepath, resource] = path
.join(this.config.repo, this.line)
.match(/(?<path>.*[/\\]staticresources)\/(?<name>[^/\\]*)+/u)
return {
resource: path.parse(resource.replace('resource', '')).name,
resourcepath,
}
}
}
module.exports = ResourceHandler

@@ -23,3 +23,3 @@ 'use strict'

this.config.repo,
// eslint-disable-next-line no-magic-numbers
this.splittedLine.slice(0, -1).join(path.sep)

@@ -29,3 +29,3 @@ ),

this.config.output,
// eslint-disable-next-line no-magic-numbers
this.splittedLine.slice(0, -1).join(path.sep)

@@ -32,0 +32,0 @@ )

@@ -20,3 +20,2 @@ 'use strict'

M: this.handleModification,
R: this.handleRenaming,
}

@@ -50,21 +49,10 @@ }

handleModification() {
this.handleAddtion.apply(this)
}
handleRenaming() {
this.handleAddtion.apply(this)
this.handleDeletion.apply(this)
}
handleDeletion() {
if (
(metadata[this.type].metaFile === true &&
// eslint-disable-next-line no-mixed-operators
!this.line.endsWith(StandardHandler.METAFILE_SUFFIX)) ||
// eslint-disable-next-line no-mixed-operators
metadata[this.type].metaFile === false
) {
this.diffs[this.type] = this.diffs[this.type] || new Set()
// eslint-disable-next-line no-magic-numbers
this.diffs[this.type].add(

@@ -77,2 +65,6 @@ this.splittedLine[this.splittedLine.indexOf(this.type) + 1]

}
handleModification() {
this.handleAddtion.apply(this)
}
}

@@ -79,0 +71,0 @@

@@ -15,3 +15,2 @@ 'use strict'

const prefix = `${
// eslint-disable-next-line no-magic-numbers
this.splittedLine[this.splittedLine.indexOf(this.type) - 1]

@@ -21,3 +20,2 @@ }`

const elementName = this.splittedLine[
// eslint-disable-next-line no-magic-numbers
this.splittedLine.indexOf(this.type) + 1

@@ -24,0 +22,0 @@ ]

@@ -14,3 +14,3 @@ 'use strict'

}
const promise = new Promise((resolve, reject) =>
return new Promise((resolve, reject) =>
fs.writeFile(

@@ -28,5 +28,3 @@ path.join(this.config.output, fileName),

)
return promise
}
}
{
"name": "sfdx-git-delta",
"version": "0.8.10",
"version": "1.0.2",
"description": "Generate the sfdx content in source format and destructive change from two git commits",

@@ -24,3 +24,4 @@ "keyword": [

"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "lint-staged",
"pre-push": "npm run test"
}

@@ -50,2 +51,3 @@ },

"scripts": {
"coveralls": "npm run test:coverage && cat ./__tests__/__coverage__/lcov.info | coveralls",
"test": "jest",

@@ -57,8 +59,16 @@ "test:coverage": "jest --coverage",

"devDependencies": {
"coveralls": "^3.0.6",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.1.0",
"husky": "^3.0.2",
"jest": "^24.8.0",
"lint-staged": "^9.2.1",
"prettier": "^1.18.2"
"mock-spawn": "^0.2.6",
"prettier": "^1.18.2",
"prettier-eslint": "^9.0.0"
},
"publishConfig": {
"access": "public"
}
}

@@ -1,6 +0,8 @@

# sfdx-git-delta
[![NPM](https://nodei.co/npm/sfdx-git-delta.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/sfdx-git-delta/) [![NPM](https://nodei.co/npm-dl/sfdx-git-delta.png)](https://nodei.co/npm/sfdx-git-delta/) [![HitCount](http://hits.dwyl.com/scolladon/sfdx-git-delta.svg)](http://hits.dwyl.com/scolladon/sfdx-git-delta)
# sfdx-git-delta [![Build Status](https://travis-ci.org/scolladon/sfdx-git-delta.svg?branch=master)](https://travis-ci.org/scolladon/sfdx-git-delta) [![Maintainability](https://api.codeclimate.com/v1/badges/95619399c7bb2cf60da4/maintainability)](https://codeclimate.com/github/scolladon/sfdx-git-delta/maintainability) [![Coverage Status](https://coveralls.io/repos/github/scolladon/sfdx-git-delta/badge.svg?branch=master)](https://coveralls.io/github/scolladon/sfdx-git-delta?branch=master) [![Known Vulnerabilities](https://snyk.io//test/github/scolladon/sfdx-git-delta/badge.svg?targetFile=package.json)](https://snyk.io//test/github/scolladon/sfdx-git-delta?targetFile=package.json)
Generate the sfdx content in source format and destructive change from two git commits
## Getting Started
## Getting Started [![npm version](https://badge.fury.io/js/sfdx-git-delta.svg)](https://badge.fury.io/js/sfdx-git-delta)

@@ -56,9 +58,8 @@ Works in Unix like system.

## Built With [![dependencies Status](https://david-dm.org/scolladon/sfdx-git-delta/status.svg)](https://david-dm.org/scolladon/sfdx-git-delta) [![devDependencies Status](https://david-dm.org/scolladon/sfdx-git-delta/dev-status.svg)](https://david-dm.org/scolladon/sfdx-git-delta?type=dev)
## Built With
- [commander](https://github.com/tj/commander.js/) - The complete solution for node.js command-line interfaces, inspired by Ruby's commander.
- [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) - An XML builder for node.js similar to java-xmlbuilder.
- [fs-extra](https://github.com/jprichardson/node-fs-extra) - Node.js: extra methods for the fs object like copy(), remove(), mkdirs().
* [commander](https://github.com/tj/commander.js/) - The complete solution for node.js command-line interfaces, inspired by Ruby's commander.
* [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) - An XML builder for node.js similar to java-xmlbuilder.
* [fs-extra](https://github.com/jprichardson/node-fs-extra) - Node.js: extra methods for the fs object like copy(), remove(), mkdirs().
## Versioning

@@ -68,5 +69,6 @@

## Authors
## Authors [![Join the chat at https://gitter.im/scolladon/sfdx-git-delta](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dwyl/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* **Sebastien Colladon** - *Initial work* - [scolladon](https://github.com/scolladon)
- **Sebastien Colladon** - Developer - [scolladon](https://github.com/scolladon)
- **Mehdi Cherfaoui** - Tester - [mehdisfdc](https://github.com/mehdisfdc)

@@ -73,0 +75,0 @@ ## License

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc