@adobe/helix-md2jcr 1.0.13 → 1.0.15

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.0.15](https://github.com/adobe/helix-md2jcr/compare/v1.0.14...v1.0.15) (2025-02-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency hast-util-to-html to v9.0.5 ([#58](https://github.com/adobe/helix-md2jcr/issues/58)) ([9089f60](https://github.com/adobe/helix-md2jcr/commit/9089f609c6704c5c2853895b879e6b56e66b716d))
7
+
8
+ ## [1.0.14](https://github.com/adobe/helix-md2jcr/compare/v1.0.13...v1.0.14) (2025-02-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **sites-24827:** parse and map page properties ([#57](https://github.com/adobe/helix-md2jcr/issues/57)) ([93448a0](https://github.com/adobe/helix-md2jcr/commit/93448a0fb3da7694fc01513d598a16ae0f10eefb))
14
+
1
15
  ## [1.0.13](https://github.com/adobe/helix-md2jcr/compare/v1.0.12...v1.0.13) (2025-02-18)
2
16
 
3
17
 
@@ -0,0 +1,21 @@
1
+ # Local Development Setup
2
+ When you make changes to the helix-md2jcr, you can test them locally in the Helix Importer UI, before submitting a pull request.
3
+ This is a great way to ensure that your changes work as expected and don't introduce any new issues.
4
+
5
+ ## Prerequisites
6
+ Clone [helix-importer](https://github.com/adobe/helix-importer), and [helix-importer-ui](https://github.com/adobe/helix-importer-ui) repositories.
7
+
8
+
9
+ ## Development Setup
10
+ 1. Have a sample crosswalk project setup with import scripts etc.
11
+ 2. In helix-md2jcr run `npm link` in the helix-md2jcr project directory.
12
+ 3. In helix-importer run `npm link && npm link @adobe/helix-md2jcr` in the helix-importer project directory to create a symbolic link to the helix-md2jcr project.
13
+ 4. In helix-importer-ui run `npm link @adobe/helix-importer` in the helix-importer-ui project directory to create a symbolic link to the helix-importer project.
14
+ 5. In helix-importer-ui run `npm run build:local` in the helix-importer-ui project directory to generate the dist folder and files.
15
+ 6. In the sample crosswalk project make sure a ./tools/importer folder exists. From within this folder run `ln -s /path/to/helix-importer-ui`.
16
+ A symbolic link will be created to the helix-importer-ui project.
17
+ 7. From your sample crosswalk project root folder, run `aem import --skip-ui`, this will launch the helix-importer-ui and not try to sync the remote repository,
18
+ and use the local projects as the source for the UI.
19
+
20
+ Any changes make to the helix-md2jcr project, you must run `npm run build:local` in the helix-importer-ui project directory, and refresh the browser to see the changes.
21
+ You can open the browser console and set breakpoints to debug the UI and helix-md2jcr changes.
Binary file
Binary file
@@ -0,0 +1,43 @@
1
+ # Releasing
2
+
3
+ After merging a PR into `main`, a build will run and perform a release automatically. For example, the 1.0.14 build was done
4
+ [here](https://github.com/adobe/helix-md2jcr/commit/36604f967d4c694daa5a05f020b87f387ac46040) for PR [57](https://github.com/adobe/helix-md2jcr/pull/57).
5
+ Once the `main` build is successful, the PR is updated with the release information.
6
+
7
+ ![1014-release.png](images/1014-release.png)
8
+
9
+ ### Updating Project Dependencies
10
+
11
+ #### Helix-Importer
12
+
13
+ To move the release to the next stage, update the projects that require the new version. For example, the
14
+ [helix-importer](https://github.com/adobe/helix-importer). Navigate to the [Dependency Dashboard](https://github.com/adobe/helix-importer/issues/6)
15
+ and click the checkbox to get Renovate to run again.
16
+
17
+ Once the Renovate bot has completed its execution, a new PR will be opened with the updated version. For example, the
18
+ PR [here](https://github.com/adobe/helix-importer/pull/492) updates the helix-importer to use the new version of helix-md2jcr. Squash and
19
+ merge the PR to complete the release process into the helix-importer project.
20
+
21
+ Wait until the `main` branch has been updated with the new version before moving on to the next project and note the release version.
22
+ For example, the helix-importer project was updated to version [1.0.14](https://github.com/adobe/helix-importer/commit/9a1ba65bc5a4507f214027e6ce076af86cb04567)
23
+ and released with version 3.4.58.
24
+
25
+ The next step is to update the [helix-importer-ui](https://github.com/adobe/helix-importer-ui) project to use the new version of helix-importer.
26
+
27
+ #### Helix Importer UI Update
28
+
29
+ Navigate to the [Dependency Dashboard](https://github.com/adobe/helix-importer-ui/issues/19) and click the checkbox to get Renovate to run again.
30
+ Review the PRs and select the PR for the helix-importer version update.
31
+
32
+ You may see the following dialog which requires your attention to select the checkbox with the updated version.
33
+ ![renovate-pr.png](images/renovate-pr.png)
34
+
35
+ Once selected, a new PR will be opened.
36
+
37
+ For example, the PR [here](https://github.com/adobe/helix-importer-ui/pull/470) updates the helix-importer-ui to use the new version of
38
+ helix-importer. Wait for the build to complete and merge the PR to complete the release process into the helix-importer-ui project.
39
+
40
+ If you wish to test the changes locally, you can follow the development setup [document](development.md). Once you are satisfied with the changes,
41
+ merge the PR.
42
+
43
+ Once the changes have been merged to `main`, they are now available for use in the Helix Importer UI for the world to use.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-md2jcr",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "Helix Service that converts markdown to JCR content structure",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -39,7 +39,14 @@ function buildPageMetadata(table, models) {
39
39
  const key = toString(cells[0]);
40
40
 
41
41
  // if the model has the field, then add it to the metadata
42
- const field = getField(model, key);
42
+ let field;
43
+ if (Object.keys(aemMapping).includes(key.toLowerCase())) {
44
+ const aemValue = aemMapping[key.toLowerCase()];
45
+ field = getField(model, aemValue);
46
+ } else {
47
+ field = getField(model, key);
48
+ }
49
+
43
50
  if (field) {
44
51
  // if the field is an image then we need to dig into the row to find the image
45
52
  if (find(row.children[1], { type: 'image' })) {
@@ -59,13 +66,9 @@ function buildPageMetadata(table, models) {
59
66
  }
60
67
  });
61
68
 
62
- // now go through the metadata and map the fields to aem fields
63
- const mappedMetadata = {};
64
- Object.entries(metadata).forEach(([key, value]) => {
65
- const mappedKey = aemMapping[key] || key;
66
- mappedMetadata[mappedKey] = value;
67
- });
68
-
69
+ const mappedMetadata = { ...metadata };
70
+ // we need to add a property called modelFields for the Universal Editor
71
+ // that has all the fields for the model
69
72
  if (model) {
70
73
  const fields = getModelFields(model);
71
74
  mappedMetadata.modelFields = `[${fields}]`;