apollo-elements/apollo-elements

View on GitHub
patches/rocket-preset-custom-elements-manifest+0.1.11.patch

Summary

Maintainability
Test Coverage
diff --git a/node_modules/rocket-preset-custom-elements-manifest/custom-elements-manifest.js b/node_modules/rocket-preset-custom-elements-manifest/custom-elements-manifest.js
index 2be8720..0cfe9aa 100644
--- a/node_modules/rocket-preset-custom-elements-manifest/custom-elements-manifest.js
+++ b/node_modules/rocket-preset-custom-elements-manifest/custom-elements-manifest.js
@@ -17,6 +17,8 @@ const path = resolve(dirname(fileURLToPath(import.meta.url)));
  */
 export function customElementsManifest(options) {
   const { typeLinks } = options ?? {};
+
+  const getter = getCustomElementsManifests(options);
   return {
     path,
 
@@ -24,46 +26,41 @@ export function customElementsManifest(options) {
 
     setupEleventyPlugins: [
 
-      addPlugin({ name: 'footnotes', plugin: footnotes }),
-
-      addPlugin({ name: 'markdown-shortcode', plugin: markdownShortcodePlugin }),
+      addPlugin(footnotes),
 
-      addPlugin({
-        name: 'custom-elements-manifest',
-        plugin: customElementsManifestPlugin,
-        options: {
-          typeLinks,
-          imports: { keepExtension: false },
-        },
-      }),
+      addPlugin(markdownShortcodePlugin),
 
-      addPlugin({
-        name: 'auto-import-custom-elements',
-        plugin: addWebComponentDefinitions,
-        location: 'bottom',
-        options: {
-          quiet: true,
-          singleScript: true,
-        },
+      addPlugin(customElementsManifestPlugin, {
+        typeLinks,
+        imports: { keepExtension: false },
       }),
 
-      adjustPluginOptions('auto-import-custom-elements', opts => ({
-        ...opts ?? {},
-        specifiers: {
-          ...opts?.specifiers,
-          'css-value-doc': '/_merged_assets/_static/custom-elements-manifest/css-value-doc.js',
-          'type-doc': '/_merged_assets/_static/custom-elements-manifest/type-doc.js',
-          'json-viewer': '/_merged_assets/_static/custom-elements-manifest/json-viewer.js',
-        },
-      })),
+      // addPlugin(addWebComponentDefinitions, {
+      //   quiet: true,
+      //   singleScript: true,
+      // }, {
+      //   location: 'bottom',
+      // }),
+      //
+      // adjustPluginOptions(addWebComponentDefinitions, opts => ({
+      //   ...opts ?? {},
+      //   specifiers: {
+      //     ...opts?.specifiers,
+      //     'css-value-doc': '/_merged_assets/_static/custom-elements-manifest/css-value-doc.js',
+      //     'type-doc': '/_merged_assets/_static/custom-elements-manifest/type-doc.js',
+      //     'json-viewer': '/_merged_assets/_static/custom-elements-manifest/json-viewer.js',
+      //   },
+      // })),
 
     ],
 
     setupEleventyComputedConfig: [
-      addPlugin({
-        name: 'cem',
-        plugin: getCustomElementsManifests,
-        options: options,
+      addPlugin(class CEM {
+        static dataName = 'cem';
+
+        async execute(data) {
+          return getter(data)
+        }
       }),
     ],