decap-cms-core 3.3.0-beta.3 → 3.3.0
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/dist/decap-cms-core.js +1 -1
- package/dist/decap-cms-core.js.map +1 -1
- package/dist/esm/backend.js +6 -1
- package/package.json +3 -3
- package/src/backend.ts +6 -1
package/dist/esm/backend.js
CHANGED
|
@@ -1039,7 +1039,12 @@ class Backend {
|
|
|
1039
1039
|
const format = (0, _formats.resolveFormat)(collection, entry.toJS());
|
|
1040
1040
|
const fieldsOrder = this.fieldsOrder(collection, entry);
|
|
1041
1041
|
const fieldsComments = (0, _collections.selectFieldsComments)(collection, entry);
|
|
1042
|
-
|
|
1042
|
+
let content = format.toFile(entry.get('data').toJS(), fieldsOrder, fieldsComments);
|
|
1043
|
+
if (content.slice(-1) != '\n') {
|
|
1044
|
+
// add the EOL if it does not exist.
|
|
1045
|
+
content += '\n';
|
|
1046
|
+
}
|
|
1047
|
+
return content;
|
|
1043
1048
|
}
|
|
1044
1049
|
fieldsOrder(collection, entry) {
|
|
1045
1050
|
const fields = collection.get('fields');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "decap-cms-core",
|
|
3
3
|
"description": "Decap CMS core application, see decap-cms package for the main distribution.",
|
|
4
|
-
"version": "3.3.0
|
|
4
|
+
"version": "3.3.0",
|
|
5
5
|
"repository": "https://github.com/decaporg/decap-cms/tree/master/packages/decap-cms-core",
|
|
6
6
|
"bugs": "https://github.com/decaporg/decap-cms/issues",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"types": "index.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
|
-
"develop": "
|
|
16
|
+
"develop": "npm run build:esm -- --watch",
|
|
17
17
|
"webpack": "node --max_old_space_size=4096 ../../node_modules/webpack/bin/webpack.js",
|
|
18
18
|
"build": "cross-env NODE_ENV=production run-s webpack",
|
|
19
19
|
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward --extensions \".js,.jsx,.ts,.tsx\""
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"@types/url-join": "^4.0.0",
|
|
97
97
|
"redux-mock-store": "^1.5.3"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "80fb16f775bc4a1ad026985ca85a2e9ee3f1e15c"
|
|
100
100
|
}
|
package/src/backend.ts
CHANGED
|
@@ -1313,7 +1313,12 @@ export class Backend {
|
|
|
1313
1313
|
const format = resolveFormat(collection, entry.toJS());
|
|
1314
1314
|
const fieldsOrder = this.fieldsOrder(collection, entry);
|
|
1315
1315
|
const fieldsComments = selectFieldsComments(collection, entry);
|
|
1316
|
-
|
|
1316
|
+
let content = format.toFile(entry.get('data').toJS(), fieldsOrder, fieldsComments);
|
|
1317
|
+
if (content.slice(-1) != '\n') {
|
|
1318
|
+
// add the EOL if it does not exist.
|
|
1319
|
+
content += '\n';
|
|
1320
|
+
}
|
|
1321
|
+
return content;
|
|
1317
1322
|
}
|
|
1318
1323
|
|
|
1319
1324
|
fieldsOrder(collection: Collection, entry: EntryMap) {
|