Browse Source

Merge pull request #1932 from ChandlerVer5/babel-fix

fix: 🐛 babel document duplicate and do not display
Simon Legner 2 years ago
parent
commit
f2faeaffd8
2 changed files with 9 additions and 5 deletions
  1. 4 4
      lib/docs/filters/babel/entries.rb
  2. 5 1
      lib/docs/scrapers/babel.rb

+ 4 - 4
lib/docs/filters/babel/entries.rb

@@ -3,13 +3,13 @@ module Docs
     class EntriesFilter < Docs::EntriesFilter
 
       ENTRIES = {
-        'Usage' => ['Options', 'Config Files', '@babel/cli', '@babel/polyfill',
+        'Usage' => ['Options', 'Plugins', 'Config Files', 'Compiler assumptions', '@babel/cli', '@babel/polyfill',
                     '@babel/plugin-transform-runtime', '@babel/register'],
 
-        'Presets' => ['@babel/preset-env', '@babel/preset-flow', '@babel/preset-react', '@babel/preset-typescript'],
+        'Presets' => ['@babel/preset'],
 
         'Tooling' => ['@babel/parser', '@babel/core', '@babel/generator', '@babel/code-frame',
-                      '@babel/helpers', '@babel/runtime', '@babel/template', '@babel/traverse', '@babel/types']
+                      '@babel/helper', '@babel/runtime', '@babel/template', '@babel/traverse', '@babel/types', '@babel/standalone']
       }
 
       def get_name
@@ -18,7 +18,7 @@ module Docs
 
       def get_type
         ENTRIES.each do |key, value|
-          return key if value.include?(name)
+          return key if value.any? { |val| name.start_with?(val) }
           return 'Other Plugins' if subpath.include?('babel-plugin')
         end
       end

+ 5 - 1
lib/docs/scrapers/babel.rb

@@ -24,13 +24,17 @@ module Docs
       /roadmap/
     ]
 
+    options[:skip_link] = ->(link) {
+       link['href'].include?('https://babeljs.io/docs/en/')
+    }
+
     options[:attribution] = <<-HTML
       &copy; 2014-present Sebastian McKenzie<br>
       Licensed under the MIT License.
     HTML
 
     version '7' do
-      self.release = '7.21.1'
+      self.release = '7.21.4'
     end
 
     version '6' do