@ember-tooling/blueprint-model 0.5.0 → 0.6.2
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-tooling/blueprint-model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/ember-cli/ember-cli.git",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"chalk": "^
|
|
11
|
+
"chalk": "^5.6.2",
|
|
12
12
|
"diff": "^7.0.0",
|
|
13
|
-
"isbinaryfile": "^5.0.
|
|
14
|
-
"lodash": "^4.17.
|
|
13
|
+
"isbinaryfile": "^5.0.7",
|
|
14
|
+
"lodash": "^4.17.23",
|
|
15
15
|
"promise.hash.helper": "^1.0.8",
|
|
16
|
-
"quick-temp": "^0.1.
|
|
16
|
+
"quick-temp": "^0.1.9",
|
|
17
17
|
"silent-error": "^1.1.1"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const util = require('util');
|
|
5
|
-
const
|
|
5
|
+
const { applyPatch, createPatch } = require('diff');
|
|
6
6
|
const quickTemp = require('quick-temp');
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const SilentError = require('silent-error');
|
|
@@ -38,7 +38,7 @@ class EditFileDiff {
|
|
|
38
38
|
diffString: readFile(resultHash.diffPath),
|
|
39
39
|
currentString: readFile(resultHash.outputPath),
|
|
40
40
|
}).then((result) => {
|
|
41
|
-
let appliedDiff =
|
|
41
|
+
let appliedDiff = applyPatch(result.currentString.toString(), result.diffString.toString());
|
|
42
42
|
|
|
43
43
|
if (!appliedDiff) {
|
|
44
44
|
let message = 'Patch was not cleanly applied.';
|
|
@@ -52,7 +52,7 @@ class EditFileDiff {
|
|
|
52
52
|
|
|
53
53
|
invokeEditor(result) {
|
|
54
54
|
let info = this.info;
|
|
55
|
-
let diff =
|
|
55
|
+
let diff = createPatch(info.outputPath, result.output.toString(), result.input);
|
|
56
56
|
let diffPath = path.join(this.tmpDifferenceDir, 'currentDiff.diff');
|
|
57
57
|
|
|
58
58
|
return writeFile(diffPath, diff)
|
package/utilities/experiments.js
CHANGED
package/utilities/file-info.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const util = require('util');
|
|
5
|
-
const chalk = require('chalk');
|
|
5
|
+
const { default: chalk } = require('chalk');
|
|
6
6
|
const EditFileDiff = require('./edit-file-diff');
|
|
7
7
|
const EOL = require('os').EOL;
|
|
8
8
|
const rxEOL = new RegExp(EOL, 'g');
|
|
@@ -73,12 +73,12 @@ class FileInfo {
|
|
|
73
73
|
|
|
74
74
|
displayDiff() {
|
|
75
75
|
let info = this,
|
|
76
|
-
|
|
76
|
+
{ createPatch } = require('diff');
|
|
77
77
|
return hash({
|
|
78
78
|
input: this.render(),
|
|
79
79
|
output: readFile(info.outputPath),
|
|
80
80
|
}).then((result) => {
|
|
81
|
-
let diff =
|
|
81
|
+
let diff = createPatch(
|
|
82
82
|
info.outputPath,
|
|
83
83
|
result.output.toString().replace(rxEOL, '\n'),
|
|
84
84
|
result.input.replace(rxEOL, '\n')
|