@adobe/helix-md2jcr 1.0.3 → 1.0.5
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/CHANGELOG.md +14 -0
- package/commitlint.config.js +17 -0
- package/package.json +5 -3
- package/src/mdast2jcr/hb/partials/grid-table.js +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.0.5](https://github.com/adobe/helix-md2jcr/compare/v1.0.4...v1.0.5) (2025-01-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **sites-28655:** blocks that have no model are missing properties ([#42](https://github.com/adobe/helix-md2jcr/issues/42)) ([7b07416](https://github.com/adobe/helix-md2jcr/commit/7b07416bb0fb691c9cfc1213b8e87362a87980b6))
|
|
7
|
+
|
|
8
|
+
## [1.0.4](https://github.com/adobe/helix-md2jcr/compare/v1.0.3...v1.0.4) (2025-01-28)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fix typo and silence eslint warning ([#41](https://github.com/adobe/helix-md2jcr/issues/41)) ([b1f9e51](https://github.com/adobe/helix-md2jcr/commit/b1f9e51dc08caef83ab092a4195d2f6a95a26af3))
|
|
14
|
+
|
|
1
15
|
## [1.0.3](https://github.com/adobe/helix-md2jcr/compare/v1.0.2...v1.0.3) (2025-01-28)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export default {
|
|
13
|
+
extends: ['@commitlint/config-conventional'],
|
|
14
|
+
rules: {
|
|
15
|
+
'footer-max-line-length': [0],
|
|
16
|
+
},
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-md2jcr",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Helix Service that converts markdown to JCR content structure",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"lint": "eslint .",
|
|
10
10
|
"semantic-release": "semantic-release",
|
|
11
11
|
"semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH",
|
|
12
|
-
"prepare": "husky
|
|
12
|
+
"prepare": "husky"
|
|
13
13
|
},
|
|
14
14
|
"mocha": {
|
|
15
15
|
"spec": "test/*.test.js",
|
|
@@ -56,6 +56,8 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@adobe/eslint-config-helix": "2.0.8",
|
|
58
58
|
"@adobe/helix-mediahandler": "2.5.48",
|
|
59
|
+
"@commitlint/cli": "^19.6.1",
|
|
60
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
59
61
|
"@semantic-release/changelog": "6.0.3",
|
|
60
62
|
"@semantic-release/exec": "6.0.3",
|
|
61
63
|
"@semantic-release/git": "10.0.1",
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
"eslint-import-resolver-exports": "1.0.0-beta.5",
|
|
66
68
|
"eslint-plugin-header": "3.1.1",
|
|
67
69
|
"eslint-plugin-import": "2.31.0",
|
|
68
|
-
"husky": "9.1.7",
|
|
70
|
+
"husky": "^9.1.7",
|
|
69
71
|
"junit-report-builder": "5.1.1",
|
|
70
72
|
"lint-staged": "15.4.3",
|
|
71
73
|
"mocha": "10.8.2",
|
|
@@ -29,6 +29,8 @@ import image from './supports/image.js';
|
|
|
29
29
|
import FieldGroupFieldResolver from '../../domain/FieldGroupFieldResolver.js';
|
|
30
30
|
import ModelHelper from '../../domain/ModelHelper.js';
|
|
31
31
|
|
|
32
|
+
/* eslint-disable no-console */
|
|
33
|
+
|
|
32
34
|
/**
|
|
33
35
|
* @typedef {import('../../index.d.ts').FieldDef} Field
|
|
34
36
|
* @typedef {import('../../index.d.ts').DefinitionDef} Definition
|
|
@@ -250,9 +252,9 @@ function extractProperties(mdast, model, mode, component, fields, properties) {
|
|
|
250
252
|
extractKeyValueProperties(row, model, fieldResolver, fieldGroup, properties);
|
|
251
253
|
} else {
|
|
252
254
|
// for each cell in the row, process the nodes that exist in the cell
|
|
253
|
-
let
|
|
255
|
+
let processing = false;
|
|
254
256
|
for (const cell of cells) {
|
|
255
|
-
if (mode === 'blockItem' && !
|
|
257
|
+
if (mode === 'blockItem' && !processing) {
|
|
256
258
|
fieldGroup = fieldsCloned.shift();
|
|
257
259
|
}
|
|
258
260
|
|
|
@@ -260,7 +262,7 @@ function extractProperties(mdast, model, mode, component, fields, properties) {
|
|
|
260
262
|
if (nodes.length === 0) {
|
|
261
263
|
// throw away the field that was associated with the cell
|
|
262
264
|
fieldGroup.fields.shift();
|
|
263
|
-
|
|
265
|
+
processing = true;
|
|
264
266
|
// if there are no nodes in the cell, then we need to skip it
|
|
265
267
|
} else {
|
|
266
268
|
while (nodes.length > 0) {
|
|
@@ -456,17 +458,17 @@ function gridTablePartial(context) {
|
|
|
456
458
|
if (model) {
|
|
457
459
|
fieldGroup = modelHelper.getModelFieldGroup(model.id);
|
|
458
460
|
extractProperties(mdast, model, mode, component, fieldGroup.fields, properties);
|
|
459
|
-
|
|
460
|
-
// sort all the properties so that they are in a consistent order
|
|
461
|
-
// helpful for debugging and xml readability
|
|
462
|
-
const sorted = Object.entries(properties).sort(sortJcrProperties);
|
|
463
|
-
blockProperties = sorted.map(([k, v]) => `${k}="${v}"`).join(' ');
|
|
464
461
|
} else {
|
|
465
462
|
// because we have no model we expect the block to have a filter with a component that does
|
|
466
463
|
// so that means we can remove the header row from the mdast tree
|
|
467
464
|
remove(mdast, (n) => is(n, { type: 'gtHeader' }));
|
|
468
465
|
}
|
|
469
466
|
|
|
467
|
+
// sort all the properties so that they are in a consistent order
|
|
468
|
+
// helpful for debugging and xml readability
|
|
469
|
+
const sorted = Object.entries(properties).sort(sortJcrProperties);
|
|
470
|
+
blockProperties = sorted.map(([k, v]) => `${k}="${v}"`).join(' ');
|
|
471
|
+
|
|
470
472
|
// *****************************************************
|
|
471
473
|
// Component Block Processing
|
|
472
474
|
// *****************************************************
|