tailwind_dsl 0.0.20 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.builders/generators/utilities.rb +10 -10
  3. data/.components/readme.md +22 -0
  4. data/.components/tui/marketing/sections/cta-sections/01.data.json +10 -0
  5. data/.components/tui/marketing/sections/cta-sections/02.clean.html +10 -9
  6. data/.components/tui/marketing/sections/cta-sections/02.data.json +9 -0
  7. data/.components/tui/marketing/sections/cta-sections/02.html +10 -9
  8. data/.components/tui/marketing/sections/cta-sections/03.clean.html +16 -13
  9. data/.components/tui/marketing/sections/cta-sections/03.data.json +13 -0
  10. data/.components/tui/marketing/sections/cta-sections/03.html +16 -13
  11. data/.components/tui/marketing/sections/cta-sections/04.clean.html +13 -9
  12. data/.components/tui/marketing/sections/cta-sections/04.data.json +9 -0
  13. data/.components/tui/marketing/sections/cta-sections/04.html +13 -9
  14. data/.components/tui/marketing/sections/cta-sections/05.clean.html +16 -13
  15. data/.components/tui/marketing/sections/cta-sections/05.data.json +13 -0
  16. data/.components/tui/marketing/sections/cta-sections/05.html +16 -13
  17. data/.components/tui/marketing/sections/cta-sections/06.data.json +13 -0
  18. data/.components/tui/marketing/sections/cta-sections/07.data.json +14 -0
  19. data/.components/tui/marketing/sections/cta-sections/08.clean.html +40 -8
  20. data/.components/tui/marketing/sections/cta-sections/08.data.json +13 -0
  21. data/.components/tui/marketing/sections/cta-sections/08.html +54 -7
  22. data/.components/tui/marketing/sections/cta-sections/08.settings.json +6 -0
  23. data/CHANGELOG.md +16 -0
  24. data/lib/tailwind_dsl/etl/component_structures/generator.rb +2 -0
  25. data/lib/tailwind_dsl/etl/component_structures/raw_component_query.rb +4 -1
  26. data/lib/tailwind_dsl/etl/extractors/base_extractor.rb +22 -0
  27. data/lib/tailwind_dsl/etl/extractors/batch_extraction.rb +104 -0
  28. data/lib/tailwind_dsl/etl/extractors/data_extractor.rb +23 -0
  29. data/lib/tailwind_dsl/etl/raw_components/transformer.rb +1 -1
  30. data/lib/tailwind_dsl/version.rb +1 -1
  31. data/lib/tailwind_dsl.rb +3 -1
  32. data/package-lock.json +2 -2
  33. data/package.json +1 -1
  34. metadata +14 -3
  35. data/lib/tailwind_dsl/etl/component_models/extractor.rb +0 -99
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59f2ab634f3b594b52b4c320dd148ad583f9bc9f3b7b9fecefc930b5997d4dca
4
- data.tar.gz: 149b69e1c9c976f29d87e4d6f333a6649df648bb8cd43979bd8ac327119ea019
3
+ metadata.gz: b52114795df0523de540e30bd352f12ccbe578eedbf3d257aba35313450b2631
4
+ data.tar.gz: 412b03343badafa5f010eb2e8dea4f230b4c7c87398f84dd2946be8fc9beefe7
5
5
  SHA512:
6
- metadata.gz: 80de90f95be1c3a185718e37e1d81d06bd895f12af0c434e6f4a08c5ce45ad292653986d9d435bc73880e3293d33ecdfd0433b5cbf3ca6a4594a1b15152f22b3
7
- data.tar.gz: 6cb6df996df398e6651c365b99e5c401ff4ab300d68bc26477a186f20a519b245fd8df41bfeea22ca437aac36ed1d6330d236982489ecec783ee92a3c103f252
6
+ metadata.gz: 48fa80daa96fed641bd899da748f4e05d4ea77693bd25d92255a8d9ce82c8ed9de998e7bddddfc02cf40f3e0fbda920cae124503affd7e7401fc8f4a12a8fdda
7
+ data.tar.gz: 3243f22ccac987436ac435306a1ae39319cb52023846e5073713bd21e0df13e6930ea051f2a381db821a6c57946fea4510011c1e941092e3c7883de3e5e1ed17
@@ -20,7 +20,7 @@ KManager.action :utilities do
20
20
  target_component_model_path = k_builder.target_folders.get(:component_models)
21
21
 
22
22
  # Builds the design_system.json by reading all the HTML templates for every UIKit found the source_component_path
23
- uikit = helpers.build_design_systems(source_component_path)
23
+ uikit = helpers.load_design_systems(source_component_path)
24
24
 
25
25
  add('design_system.json', content: JSON.pretty_generate(uikit.to_h))
26
26
 
@@ -49,16 +49,16 @@ KManager.action :utilities do
49
49
 
50
50
  end
51
51
 
52
- def build_design_systems(source_component_path)
53
- director = TailwindDsl::Etl::RawComponents::Director.new
52
+ def load_design_systems(source_component_path)
53
+ loader = TailwindDsl::Etl::RawComponents::Load.new
54
54
 
55
- director.add_design_system(File.join(source_component_path, 'tui'))
56
- # director.add_design_system(File.join(source_component_path, 'codepen'))
57
- # director.add_design_system(File.join(source_component_path, 'devdojo'))
58
- # director.add_design_system(File.join(source_component_path, 'merakiui'))
59
- # director.add_design_system(File.join(source_component_path, 'noq'))
60
- # director.add_design_system(File.join(source_component_path, 'starter-kit'))
61
- director.uikit
55
+ loader.add_design_system(File.join(source_component_path, 'tui'))
56
+ # loader.add_design_system(File.join(source_component_path, 'codepen'))
57
+ # loader.add_design_system(File.join(source_component_path, 'devdojo'))
58
+ # loader.add_design_system(File.join(source_component_path, 'merakiui'))
59
+ # loader.add_design_system(File.join(source_component_path, 'noq'))
60
+ # loader.add_design_system(File.join(source_component_path, 'starter-kit'))
61
+ loader.uikit
62
62
  end
63
63
 
64
64
  def generate_components(uikit, source_component_path, target_folder, reset_root_path: false)
@@ -0,0 +1,22 @@
1
+ # UI Components
2
+
3
+ A set of UI Components with supporting files.
4
+
5
+ Most of these files started from `templates/tailwind` where the original HTML component examples were stored.
6
+
7
+ This list of files was then processed to generate files under `ui-components/tailwind`
8
+
9
+ The output files are segmented by their extension.
10
+
11
+ ## templates/tailwind
12
+
13
+ The original HTML file will contain tailwind CSS with both static content data. Any comments that were originally in the file are there as well. These files can be considered the source of truth and basically are copied form a source.
14
+
15
+ ## ui-components/tailwind
16
+
17
+ - `[component-group][component-name].settings.json` - any settings that can be extracted from original html or have been manually updated live in this file.
18
+ - `[component-group][component-name].data.json` - any data that can be extracted from the HTML is in this file, this is done using GPT3.
19
+ - `[component-group][component-name].astro` - the HTML component and it's data interface (Astro.props) go into this file
20
+
21
+
22
+
@@ -0,0 +1,10 @@
1
+ {
2
+ "heading": "Ready to dive in?",
3
+ "subheading": "Start your free trial today.",
4
+ "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur. Malesuada adipiscing sagittis vel nulla nec.",
5
+ "button": {
6
+ "text": "Sign up for free",
7
+ "url": "#"
8
+ },
9
+ "imageUrl": "https://tailwindui.com/img/component-images/full-width-with-sidebar.jpg"
10
+ }
@@ -1,9 +1,10 @@
1
- {
2
- "heading": "Boost your productivity.",
3
- "subheading": "Start using our app today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur. Malesuada adipiscing sagittis vel nulla nec.",
5
- "button": {
6
- "text": "Sign up for free",
7
- "url": "#"
8
- }
9
- }
1
+ <div class="bg-indigo-700">
2
+ <div class="mx-auto max-w-2xl py-16 px-4 text-center sm:py-20 sm:px-6 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-white sm:text-4xl">
4
+ <span class="block">Boost your productivity.</span>
5
+ <span class="block">Start using our app today.</span>
6
+ </h2>
7
+ <p class="mt-4 text-lg leading-6 text-indigo-200">Ac euismod vel sit maecenas id pellentesque eu sed consectetur. Malesuada adipiscing sagittis vel nulla nec.</p>
8
+ <a href="#" class="mt-8 inline-flex w-full items-center justify-center rounded-md border border-transparent bg-white px-5 py-3 text-base font-medium text-indigo-600 hover:bg-indigo-50 sm:w-auto">Sign up for free</a>
9
+ </div>
10
+ </div>
@@ -0,0 +1,9 @@
1
+ {
2
+ "heading": "Boost your productivity.",
3
+ "subheading": "Start using our app today.",
4
+ "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur. Malesuada adipiscing sagittis vel nulla nec.",
5
+ "button": {
6
+ "text": "Sign up for free",
7
+ "url": "#"
8
+ }
9
+ }
@@ -1,9 +1,10 @@
1
- {
2
- "heading": "Boost your productivity.",
3
- "subheading": "Start using our app today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur. Malesuada adipiscing sagittis vel nulla nec.",
5
- "button": {
6
- "text": "Sign up for free",
7
- "url": "#"
8
- }
9
- }
1
+ <div class="bg-indigo-700">
2
+ <div class="mx-auto max-w-2xl py-16 px-4 text-center sm:py-20 sm:px-6 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-white sm:text-4xl">
4
+ <span class="block">Boost your productivity.</span>
5
+ <span class="block">Start using our app today.</span>
6
+ </h2>
7
+ <p class="mt-4 text-lg leading-6 text-indigo-200">Ac euismod vel sit maecenas id pellentesque eu sed consectetur. Malesuada adipiscing sagittis vel nulla nec.</p>
8
+ <a href="#" class="mt-8 inline-flex w-full items-center justify-center rounded-md border border-transparent bg-white px-5 py-3 text-base font-medium text-indigo-600 hover:bg-indigo-50 sm:w-auto">Sign up for free</a>
9
+ </div>
10
+ </div>
@@ -1,13 +1,16 @@
1
- {
2
- "heading": "Ready to dive in?",
3
- "subheading": "Start your free trial today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
- "button1": {
6
- "text": "Get started",
7
- "url": "#"
8
- },
9
- "button2": {
10
- "text": "Learn more",
11
- "url": "#"
12
- }
13
- }
1
+ <div class="bg-white">
2
+ <div class="mx-auto max-w-7xl py-12 px-4 text-center sm:px-6 lg:py-16 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
4
+ <span class="block">Ready to dive in?</span>
5
+ <span class="block">Start your free trial today.</span>
6
+ </h2>
7
+ <div class="mt-8 flex justify-center">
8
+ <div class="inline-flex rounded-md shadow">
9
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700">Get started</a>
10
+ </div>
11
+ <div class="ml-3 inline-flex">
12
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-100 px-5 py-3 text-base font-medium text-indigo-700 hover:bg-indigo-200">Learn more</a>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -0,0 +1,13 @@
1
+ {
2
+ "heading": "Ready to dive in?",
3
+ "subheading": "Start your free trial today.",
4
+ "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
+ "button1": {
6
+ "text": "Get started",
7
+ "url": "#"
8
+ },
9
+ "button2": {
10
+ "text": "Learn more",
11
+ "url": "#"
12
+ }
13
+ }
@@ -1,13 +1,16 @@
1
- {
2
- "heading": "Ready to dive in?",
3
- "subheading": "Start your free trial today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
- "button1": {
6
- "text": "Get started",
7
- "url": "#"
8
- },
9
- "button2": {
10
- "text": "Learn more",
11
- "url": "#"
12
- }
13
- }
1
+ <div class="bg-white">
2
+ <div class="mx-auto max-w-7xl py-12 px-4 text-center sm:px-6 lg:py-16 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
4
+ <span class="block">Ready to dive in?</span>
5
+ <span class="block">Start your free trial today.</span>
6
+ </h2>
7
+ <div class="mt-8 flex justify-center">
8
+ <div class="inline-flex rounded-md shadow">
9
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700">Get started</a>
10
+ </div>
11
+ <div class="ml-3 inline-flex">
12
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-100 px-5 py-3 text-base font-medium text-indigo-700 hover:bg-indigo-200">Learn more</a>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -1,9 +1,13 @@
1
- {
2
- "heading": "Ready to dive in?",
3
- "subheading": "Start your free trial today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
- "button1": {
6
- "text": "Get started",
7
- "url": "#"
8
- }
9
- }
1
+ <div class="bg-indigo-50">
2
+ <div class="mx-auto max-w-7xl py-12 px-4 sm:px-6 lg:flex lg:items-center lg:justify-between lg:py-24 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-gray-900 md:text-4xl">
4
+ <span class="block">Ready to dive in?</span>
5
+ <span class="block text-indigo-600">Start your free trial today.</span>
6
+ </h2>
7
+ <div class="mt-8 flex lg:mt-0 lg:flex-shrink-0">
8
+ <div class="inline-flex rounded-md shadow">
9
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700">Get started</a>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ </div>
@@ -0,0 +1,9 @@
1
+ {
2
+ "heading": "Ready to dive in?",
3
+ "subheading": "Start your free trial today.",
4
+ "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
+ "button1": {
6
+ "text": "Get started",
7
+ "url": "#"
8
+ }
9
+ }
@@ -1,9 +1,13 @@
1
- {
2
- "heading": "Ready to dive in?",
3
- "subheading": "Start your free trial today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
- "button1": {
6
- "text": "Get started",
7
- "url": "#"
8
- }
9
- }
1
+ <div class="bg-indigo-50">
2
+ <div class="mx-auto max-w-7xl py-12 px-4 sm:px-6 lg:flex lg:items-center lg:justify-between lg:py-24 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-gray-900 md:text-4xl">
4
+ <span class="block">Ready to dive in?</span>
5
+ <span class="block text-indigo-600">Start your free trial today.</span>
6
+ </h2>
7
+ <div class="mt-8 flex lg:mt-0 lg:flex-shrink-0">
8
+ <div class="inline-flex rounded-md shadow">
9
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700">Get started</a>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ </div>
@@ -1,13 +1,16 @@
1
- {
2
- "heading": "Ready to dive in?",
3
- "subheading": "Start your free trial today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
- "button1": {
6
- "text": "Get started",
7
- "url": "#"
8
- },
9
- "button2": {
10
- "text": "Learn more",
11
- "url": "#"
12
- }
13
- }
1
+ <div class="bg-gray-50">
2
+ <div class="mx-auto max-w-7xl py-12 px-4 sm:px-6 lg:flex lg:items-center lg:justify-between lg:py-16 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
4
+ <span class="block">Ready to dive in?</span>
5
+ <span class="block text-indigo-600">Start your free trial today.</span>
6
+ </h2>
7
+ <div class="mt-8 flex lg:mt-0 lg:flex-shrink-0">
8
+ <div class="inline-flex rounded-md shadow">
9
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700">Get started</a>
10
+ </div>
11
+ <div class="ml-3 inline-flex rounded-md shadow">
12
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-white px-5 py-3 text-base font-medium text-indigo-600 hover:bg-indigo-50">Learn more</a>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -0,0 +1,13 @@
1
+ {
2
+ "heading": "Ready to dive in?",
3
+ "subheading": "Start your free trial today.",
4
+ "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
+ "button1": {
6
+ "text": "Get started",
7
+ "url": "#"
8
+ },
9
+ "button2": {
10
+ "text": "Learn more",
11
+ "url": "#"
12
+ }
13
+ }
@@ -1,13 +1,16 @@
1
- {
2
- "heading": "Ready to dive in?",
3
- "subheading": "Start your free trial today.",
4
- "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
- "button1": {
6
- "text": "Get started",
7
- "url": "#"
8
- },
9
- "button2": {
10
- "text": "Learn more",
11
- "url": "#"
12
- }
13
- }
1
+ <div class="bg-gray-50">
2
+ <div class="mx-auto max-w-7xl py-12 px-4 sm:px-6 lg:flex lg:items-center lg:justify-between lg:py-16 lg:px-8">
3
+ <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
4
+ <span class="block">Ready to dive in?</span>
5
+ <span class="block text-indigo-600">Start your free trial today.</span>
6
+ </h2>
7
+ <div class="mt-8 flex lg:mt-0 lg:flex-shrink-0">
8
+ <div class="inline-flex rounded-md shadow">
9
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700">Get started</a>
10
+ </div>
11
+ <div class="ml-3 inline-flex rounded-md shadow">
12
+ <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-white px-5 py-3 text-base font-medium text-indigo-600 hover:bg-indigo-50">Learn more</a>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -0,0 +1,13 @@
1
+ {
2
+ "heading": "Ready to dive in?",
3
+ "subheading": "Start your free trial today.",
4
+ "text": "Ac euismod vel sit maecenas id pellentesque eu sed consectetur.",
5
+ "button1": {
6
+ "text": "Get started",
7
+ "url": "#"
8
+ },
9
+ "button2": {
10
+ "text": "Learn more",
11
+ "url": "#"
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "image": {
3
+ "src": "https://images.unsplash.com/photo-1525130413817-d45c1d127c42?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1920&q=60&blend=6366F1&sat=-100&blend-mode=multiply",
4
+ "alt": "",
5
+ "caption": ""
6
+ },
7
+ "heading": "Award winning support",
8
+ "subheading": "We’re here to help",
9
+ "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
10
+ "button": {
11
+ "text": "Visit the help center",
12
+ "url": "#"
13
+ }
14
+ }
@@ -1,8 +1,40 @@
1
- {
2
- "heading": "Join our team",
3
- "text": "Varius facilisi mauris sed sit. Non sed et duis dui leo, vulputate id malesuada non. Cras aliquet purus dui laoreet diam sed lacus, fames.",
4
- "button": {
5
- "text": "Explore open positions",
6
- "url": "#"
7
- }
8
- }
1
+ <div class="relative bg-white py-16">
2
+ <div class="absolute inset-x-0 top-0 hidden h-1/2 bg-gray-50 lg:block" aria-hidden="true"></div>
3
+ <div class="mx-auto max-w-7xl bg-indigo-600 lg:bg-transparent lg:px-8">
4
+ <div class="lg:grid lg:grid-cols-12">
5
+ <div class="relative z-10 lg:col-span-4 lg:col-start-1 lg:row-start-1 lg:bg-transparent lg:py-16">
6
+ <div class="absolute inset-x-0 h-1/2 bg-gray-50 lg:hidden" aria-hidden="true"></div>
7
+ <div class="mx-auto max-w-md px-4 sm:max-w-3xl sm:px-6 lg:max-w-none lg:p-0">
8
+ <div class="aspect-w-10 aspect-h-6 sm:aspect-w-2 sm:aspect-h-1 lg:aspect-w-1">
9
+ <img class="rounded-3xl object-cover object-center shadow-2xl" src="https://images.unsplash.com/photo-1507207611509-ec012433ff52?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=934&q=80" alt="">
10
+ </div>
11
+ </div>
12
+ </div>
13
+ <div class="relative bg-indigo-600 lg:col-span-10 lg:col-start-3 lg:row-start-1 lg:grid lg:grid-cols-10 lg:items-center lg:rounded-3xl">
14
+ <div class="absolute inset-0 hidden overflow-hidden rounded-3xl lg:block" aria-hidden="true">
15
+ <svg class="absolute bottom-full left-full translate-y-1/3 -translate-x-2/3 transform xl:bottom-auto xl:top-0 xl:translate-y-0" width="404" height="384" fill="none" viewBox="0 0 404 384" aria-hidden="true">
16
+ <defs>
17
+ <pattern id="64e643ad-2176-4f86-b3d7-f2c5da3b6a6d" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
18
+ <rect x="0" y="0" width="4" height="4" class="text-indigo-500" fill="currentColor" />
19
+ </pattern>
20
+ </defs>
21
+ <rect width="404" height="384" fill="url(#64e643ad-2176-4f86-b3d7-f2c5da3b6a6d)" />
22
+ </svg>
23
+ <svg class="absolute top-full -translate-y-1/3 -translate-x-1/3 transform xl:-translate-y-1/2" width="404" height="384" fill="none" viewBox="0 0 404 384" aria-hidden="true">
24
+ <defs>
25
+ <pattern id="64e643ad-2176-4f86-b3d7-f2c5da3b6a6d" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
26
+ <rect x="0" y="0" width="4" height="4" class="text-indigo-500" fill="currentColor" />
27
+ </pattern>
28
+ </defs>
29
+ <rect width="404" height="384" fill="url(#64e643ad-2176-4f86-b3d7-f2c5da3b6a6d)" />
30
+ </svg>
31
+ </div>
32
+ <div class="relative mx-auto max-w-md space-y-6 py-12 px-4 sm:max-w-3xl sm:py-16 sm:px-6 lg:col-span-6 lg:col-start-4 lg:max-w-none lg:p-0">
33
+ <h2 class="text-3xl font-bold tracking-tight text-white" id="join-heading">Join our team</h2>
34
+ <p class="text-lg text-white">Varius facilisi mauris sed sit. Non sed et duis dui leo, vulputate id malesuada non. Cras aliquet purus dui laoreet diam sed lacus, fames.</p>
35
+ <a class="block w-full rounded-md border border-transparent bg-white py-3 px-5 text-center text-base font-medium text-indigo-700 shadow-md hover:bg-gray-50 sm:inline-block sm:w-auto" href="#">Explore open positions</a>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
@@ -0,0 +1,13 @@
1
+ {
2
+ "image": {
3
+ "src": "https://images.unsplash.com/photo-1507207611509-ec012433ff52?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=934&q=80",
4
+ "alt": "",
5
+ "caption": ""
6
+ },
7
+ "heading": "Join our team",
8
+ "text": "Varius facilisi mauris sed sit. Non sed et duis dui leo, vulputate id malesuada non. Cras aliquet purus dui laoreet diam sed lacus, fames.",
9
+ "button": {
10
+ "text": "Explore open positions",
11
+ "url": "#"
12
+ }
13
+ }
@@ -1,8 +1,55 @@
1
- {
2
- "heading": "Join our team",
3
- "text": "Varius facilisi mauris sed sit. Non sed et duis dui leo, vulputate id malesuada non. Cras aliquet purus dui laoreet diam sed lacus, fames.",
4
- "button": {
5
- "text": "Explore open positions",
6
- "url": "#"
1
+ <!--
2
+ This example requires some changes to your config:
3
+
4
+ ```
5
+ // tailwind.config.js
6
+ module.exports = {
7
+ // ...
8
+ plugins: [
9
+ // ...
10
+ require('@tailwindcss/aspect-ratio'),
11
+ ],
7
12
  }
8
- }
13
+ ```
14
+ -->
15
+ <div class="relative bg-white py-16">
16
+ <div class="absolute inset-x-0 top-0 hidden h-1/2 bg-gray-50 lg:block" aria-hidden="true"></div>
17
+ <div class="mx-auto max-w-7xl bg-indigo-600 lg:bg-transparent lg:px-8">
18
+ <div class="lg:grid lg:grid-cols-12">
19
+ <div class="relative z-10 lg:col-span-4 lg:col-start-1 lg:row-start-1 lg:bg-transparent lg:py-16">
20
+ <div class="absolute inset-x-0 h-1/2 bg-gray-50 lg:hidden" aria-hidden="true"></div>
21
+ <div class="mx-auto max-w-md px-4 sm:max-w-3xl sm:px-6 lg:max-w-none lg:p-0">
22
+ <div class="aspect-w-10 aspect-h-6 sm:aspect-w-2 sm:aspect-h-1 lg:aspect-w-1">
23
+ <img class="rounded-3xl object-cover object-center shadow-2xl" src="https://images.unsplash.com/photo-1507207611509-ec012433ff52?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=934&q=80" alt="">
24
+ </div>
25
+ </div>
26
+ </div>
27
+
28
+ <div class="relative bg-indigo-600 lg:col-span-10 lg:col-start-3 lg:row-start-1 lg:grid lg:grid-cols-10 lg:items-center lg:rounded-3xl">
29
+ <div class="absolute inset-0 hidden overflow-hidden rounded-3xl lg:block" aria-hidden="true">
30
+ <svg class="absolute bottom-full left-full translate-y-1/3 -translate-x-2/3 transform xl:bottom-auto xl:top-0 xl:translate-y-0" width="404" height="384" fill="none" viewBox="0 0 404 384" aria-hidden="true">
31
+ <defs>
32
+ <pattern id="64e643ad-2176-4f86-b3d7-f2c5da3b6a6d" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
33
+ <rect x="0" y="0" width="4" height="4" class="text-indigo-500" fill="currentColor" />
34
+ </pattern>
35
+ </defs>
36
+ <rect width="404" height="384" fill="url(#64e643ad-2176-4f86-b3d7-f2c5da3b6a6d)" />
37
+ </svg>
38
+ <svg class="absolute top-full -translate-y-1/3 -translate-x-1/3 transform xl:-translate-y-1/2" width="404" height="384" fill="none" viewBox="0 0 404 384" aria-hidden="true">
39
+ <defs>
40
+ <pattern id="64e643ad-2176-4f86-b3d7-f2c5da3b6a6d" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
41
+ <rect x="0" y="0" width="4" height="4" class="text-indigo-500" fill="currentColor" />
42
+ </pattern>
43
+ </defs>
44
+ <rect width="404" height="384" fill="url(#64e643ad-2176-4f86-b3d7-f2c5da3b6a6d)" />
45
+ </svg>
46
+ </div>
47
+ <div class="relative mx-auto max-w-md space-y-6 py-12 px-4 sm:max-w-3xl sm:py-16 sm:px-6 lg:col-span-6 lg:col-start-4 lg:max-w-none lg:p-0">
48
+ <h2 class="text-3xl font-bold tracking-tight text-white" id="join-heading">Join our team</h2>
49
+ <p class="text-lg text-white">Varius facilisi mauris sed sit. Non sed et duis dui leo, vulputate id malesuada non. Cras aliquet purus dui laoreet diam sed lacus, fames.</p>
50
+ <a class="block w-full rounded-md border border-transparent bg-white py-3 px-5 text-center text-base font-medium text-indigo-700 shadow-md hover:bg-gray-50 sm:inline-block sm:w-auto" href="#">Explore open positions</a>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ </div>
@@ -5,5 +5,11 @@
5
5
  "body": null
6
6
  },
7
7
  "tailwind_config": {
8
+ "plugins": {
9
+ "forms": false,
10
+ "aspect_ratio": true,
11
+ "line_clamp": false,
12
+ "typography": false
13
+ }
8
14
  }
9
15
  }
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [0.0.21](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.20...v0.0.21) (2022-10-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add unit tests for extracting data using FakeDataExtrator ([80f32f8](https://github.com/klueless-io/tailwind_dsl/commit/80f32f8b68d2d4a4a9321a62d4d2c92eb6ee5ad0))
7
+ * add unit tests for extracting data using FakeDataExtrator ([088edb1](https://github.com/klueless-io/tailwind_dsl/commit/088edb175f3f35b7e71a1225722676243aca88af))
8
+ * add unit tests for extracting data using FakeDataExtrator ([ef210a6](https://github.com/klueless-io/tailwind_dsl/commit/ef210a6dbc713a2642c1cf0c473684d3227ba9a0))
9
+
10
+ ## [0.0.20](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.19...v0.0.20) (2022-10-21)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * rename director to load ([db85a1b](https://github.com/klueless-io/tailwind_dsl/commit/db85a1b85804390865ec66dabe9d7561767c6578))
16
+
1
17
  ## [0.0.19](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.18...v0.0.19) (2022-10-21)
2
18
 
3
19
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Build/Translate COMPONENT STRUCTURE
4
+
3
5
  module TailwindDsl
4
6
  module Etl
5
7
  module ComponentStructures
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # This is Reusable across concerns, it should be in it's own folder or in the ETL root
4
+ # Rename to component_list or component_query
5
+
3
6
  module TailwindDsl
4
7
  module Etl
5
8
  module ComponentStructures
@@ -118,7 +121,7 @@ module TailwindDsl
118
121
  end
119
122
 
120
123
  def call
121
- @components = build_components
124
+ @components = build_components.sort_by { |component| [component.design_system.name, component.group.key, component.name] }
122
125
 
123
126
  self
124
127
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TailwindDsl
4
+ module Etl
5
+ module Extractors
6
+ # Extract component data an place into a new file using a an extractor.
7
+ #
8
+ # Currently designed to work with GPT3 to infer some type of target structure.
9
+ class BaseExtractor
10
+ attr_accessor :component
11
+
12
+ def target_file
13
+ raise NotImplementedError, 'target_file is not implemented'
14
+ end
15
+
16
+ def extract
17
+ raise NotImplementedError, 'extract is not implemented'
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,104 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TailwindDsl
4
+ module Etl
5
+ module Extractors
6
+ # Extract component data an place into a nwe file using a an extractor.
7
+ # Currently designed to work with GPT3 to infer some type of target structure.
8
+ class BatchExtraction
9
+ attr_reader :components
10
+ attr_reader :target_root_path
11
+ attr_reader :batch_size
12
+ attr_reader :use_prompt
13
+ attr_reader :filter_design_system # this should be renamed and reshaped to a complex filter object
14
+
15
+ # Create comment for this initialize method
16
+
17
+ # @param [Array] components list of components that can be used to extract data
18
+ # @param [String] target_root_path root directory where the extracted data will be written to, this is the root path for all design systems and groups
19
+ # @param [Hash] args
20
+ # @option args [Integer] :batch_size number of components to process, default is 1
21
+ # @option args [Boolean] :use_prompt console based prompt so the user can guide the extractor, default is false
22
+ # @option args [String] :filter_design_system name of the design system to filter on, default is nil meaning all
23
+ # @option args [Class] :extract_handler class that implements an extract method
24
+ def initialize(components, target_root_path, **args)
25
+ @components = components
26
+ @target_root_path = target_root_path
27
+ @batch_size = args[:batch_size] || 1
28
+ @use_prompt = args[:use_prompt] || false
29
+ @filter_design_system = args[:filter_design_system] || nil
30
+ @extract_handler = args[:extract_handler]
31
+ end
32
+
33
+ # Goal: Extract the next (batch_size) component models using GPT3 and save them to target_root_path
34
+ # Create a data file at: design_system.name -> group-hierarchy -> component-name.data.json
35
+ # Create a model file at: design_system.name -> group-hierarchy -> component-name.model.rb
36
+
37
+ # Process: Collect all components and optionally filter them by design system name.
38
+ # Also filter by other keys (to be determined)
39
+ # Only process files that have not been processed before.
40
+ # Look for the next component to be processed, if it does not exist in the target folder then process it.
41
+ # decrement the batch_left counter and continue until batch_left is 0.
42
+ # if :use_prompt is true then display the input/output files and ask if you wish to process the component or skip.
43
+ # process the component by calling the GPT3 API and save the results to the target folder.
44
+
45
+ def extract
46
+ raise "Batch size must be greater than 0, got: #{batch_size}" if batch_size <= 0
47
+
48
+ remaining = batch_size
49
+
50
+ filter_components.each do |component|
51
+ # puts "Processing: #{component.design_system.name} -> #{component.group.key} -> #{component.name} -> remaining#: #{remaining}"
52
+
53
+ component_guard(component)
54
+ extractor.component = component
55
+
56
+ next if File.exist?(extractor.target_file)
57
+
58
+ # if use_prompt
59
+ # puts "Input: #{component.cleansed_html_path}"
60
+ # puts "Output: #{component_model_path}"
61
+ # puts 'Process? (y/n)'
62
+ # next unless STDIN.gets.chomp == 'y'
63
+ # end
64
+
65
+ extractor.extract
66
+
67
+ remaining -= 1
68
+ break if remaining.zero?
69
+ end
70
+ end
71
+
72
+ def extractor
73
+ return @extractor if defined? @extractor
74
+
75
+ raise 'Extract handler is required' unless @extract_handler
76
+
77
+ @extractor = @extract_handler.new
78
+
79
+ raise 'Extract handler must implement extract method' unless @extractor.respond_to?(:extract)
80
+ raise 'Extract handler must implement target_file method' unless @extractor.respond_to?(:target_file)
81
+
82
+ @extractor
83
+ end
84
+
85
+ private
86
+
87
+ def component_guard(component)
88
+ path = File.join(component.design_system.target_path, component.group.folder)
89
+ raise "Folder does not exist: '#{path}', make sure you run component structure generator first." unless File.exist?(path)
90
+ end
91
+
92
+ def filter_components
93
+ return components unless filter_design_system
94
+
95
+ components.select { |component| component.design_system.name == filter_design_system }
96
+ end
97
+
98
+ # def target_file(component)
99
+ # raise NotImplementedError, 'target_file is not implemented'
100
+ # end
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TailwindDsl
4
+ module Etl
5
+ module Extractors
6
+ # Extract component data an place into a new file using a GTP3 extraction.
7
+ class DataExtractor < TailwindDsl::Etl::Extractors::BaseExtractor
8
+ attr_accessor :component
9
+
10
+ def target_file
11
+ component.absolute.target_data_file
12
+ end
13
+
14
+ def extract
15
+ puts 'do some magic and write to target_file'
16
+ puts "target_file: #{target_file}"
17
+ File.write(target_file, 'GTP3 data')
18
+ # do some GPT3 magic
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -31,7 +31,7 @@ module TailwindDsl
31
31
  private
32
32
 
33
33
  def process_files
34
- glob = File.join(path, '**', '*')
34
+ glob = File.join(path, '**', '*.html')
35
35
 
36
36
  Dir.glob(glob) do |entry|
37
37
  next if reject?(entry)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TailwindDsl
4
- VERSION = '0.0.20'
4
+ VERSION = '0.0.22'
5
5
  end
data/lib/tailwind_dsl.rb CHANGED
@@ -18,7 +18,9 @@ require_relative 'tailwind_dsl/etl/raw_components/schema/uikit'
18
18
  require_relative 'tailwind_dsl/etl/component_structures/raw_component_query'
19
19
  require_relative 'tailwind_dsl/etl/component_structures/generator'
20
20
 
21
- require_relative 'tailwind_dsl/etl/component_models/extractor'
21
+ require_relative 'tailwind_dsl/etl/extractors/base_extractor'
22
+ require_relative 'tailwind_dsl/etl/extractors/batch_extraction'
23
+ # require_relative 'tailwind_dsl/etl/extractors/data_extractor'
22
24
  # require_relative 'tailwind_dsl/astro_demo/generate_astro_page_data'
23
25
 
24
26
  module TailwindDsl
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "tailwind_dsl",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "tailwind_dsl",
9
- "version": "0.0.20",
9
+ "version": "0.0.22",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.1",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind_dsl",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "Tailwind DSL will build tailwind websites useing Domain Specific Language conventions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwind_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-21 00:00:00.000000000 Z
11
+ date: 2022-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmdlet
@@ -57,6 +57,7 @@ files:
57
57
  - ".builders/generators/domain-model.rb"
58
58
  - ".builders/generators/project-plan.rb"
59
59
  - ".builders/generators/utilities.rb"
60
+ - ".components/readme.md"
60
61
  - ".components/tui/application-ui/application-shells/multi-column/01.clean.html"
61
62
  - ".components/tui/application-ui/application-shells/multi-column/01.html"
62
63
  - ".components/tui/application-ui/application-shells/multi-column/01.settings.json"
@@ -1849,28 +1850,36 @@ files:
1849
1850
  - ".components/tui/marketing/sections/content/06.html"
1850
1851
  - ".components/tui/marketing/sections/content/06.settings.json"
1851
1852
  - ".components/tui/marketing/sections/cta-sections/01.clean.html"
1853
+ - ".components/tui/marketing/sections/cta-sections/01.data.json"
1852
1854
  - ".components/tui/marketing/sections/cta-sections/01.html"
1853
1855
  - ".components/tui/marketing/sections/cta-sections/01.settings.json"
1854
1856
  - ".components/tui/marketing/sections/cta-sections/01.tailwind.config.js"
1855
1857
  - ".components/tui/marketing/sections/cta-sections/02.clean.html"
1858
+ - ".components/tui/marketing/sections/cta-sections/02.data.json"
1856
1859
  - ".components/tui/marketing/sections/cta-sections/02.html"
1857
1860
  - ".components/tui/marketing/sections/cta-sections/02.settings.json"
1858
1861
  - ".components/tui/marketing/sections/cta-sections/03.clean.html"
1862
+ - ".components/tui/marketing/sections/cta-sections/03.data.json"
1859
1863
  - ".components/tui/marketing/sections/cta-sections/03.html"
1860
1864
  - ".components/tui/marketing/sections/cta-sections/03.settings.json"
1861
1865
  - ".components/tui/marketing/sections/cta-sections/04.clean.html"
1866
+ - ".components/tui/marketing/sections/cta-sections/04.data.json"
1862
1867
  - ".components/tui/marketing/sections/cta-sections/04.html"
1863
1868
  - ".components/tui/marketing/sections/cta-sections/04.settings.json"
1864
1869
  - ".components/tui/marketing/sections/cta-sections/05.clean.html"
1870
+ - ".components/tui/marketing/sections/cta-sections/05.data.json"
1865
1871
  - ".components/tui/marketing/sections/cta-sections/05.html"
1866
1872
  - ".components/tui/marketing/sections/cta-sections/05.settings.json"
1867
1873
  - ".components/tui/marketing/sections/cta-sections/06.clean.html"
1874
+ - ".components/tui/marketing/sections/cta-sections/06.data.json"
1868
1875
  - ".components/tui/marketing/sections/cta-sections/06.html"
1869
1876
  - ".components/tui/marketing/sections/cta-sections/06.settings.json"
1870
1877
  - ".components/tui/marketing/sections/cta-sections/07.clean.html"
1878
+ - ".components/tui/marketing/sections/cta-sections/07.data.json"
1871
1879
  - ".components/tui/marketing/sections/cta-sections/07.html"
1872
1880
  - ".components/tui/marketing/sections/cta-sections/07.settings.json"
1873
1881
  - ".components/tui/marketing/sections/cta-sections/08.clean.html"
1882
+ - ".components/tui/marketing/sections/cta-sections/08.data.json"
1874
1883
  - ".components/tui/marketing/sections/cta-sections/08.html"
1875
1884
  - ".components/tui/marketing/sections/cta-sections/08.settings.json"
1876
1885
  - ".components/tui/marketing/sections/cta-sections/08.tailwind.config.js"
@@ -2151,10 +2160,12 @@ files:
2151
2160
  - lib/_.rb
2152
2161
  - lib/tailwind_dsl.rb
2153
2162
  - lib/tailwind_dsl/astro_demo/generate_astro_page_data.rb
2154
- - lib/tailwind_dsl/etl/component_models/extractor.rb
2155
2163
  - lib/tailwind_dsl/etl/component_structures/generator.rb
2156
2164
  - lib/tailwind_dsl/etl/component_structures/raw_component_query.rb
2157
2165
  - lib/tailwind_dsl/etl/element.rb
2166
+ - lib/tailwind_dsl/etl/extractors/base_extractor.rb
2167
+ - lib/tailwind_dsl/etl/extractors/batch_extraction.rb
2168
+ - lib/tailwind_dsl/etl/extractors/data_extractor.rb
2158
2169
  - lib/tailwind_dsl/etl/raw_components/load.rb
2159
2170
  - lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
2160
2171
  - lib/tailwind_dsl/etl/raw_components/schema/group.rb
@@ -1,99 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module TailwindDsl
4
- module Etl
5
- module ComponentModels
6
- class Gpt3Extractor
7
- def extract_data(component)
8
- puts "extract data for #{component} using GPT3"
9
- end
10
-
11
- def extract_model(component)
12
- puts "extract model for #{component} using GPT3"
13
- end
14
- end
15
-
16
- # Extract component models by reading the cleansed component HTML and then using GPT3 to infer both the data/model structure.
17
- class Extractor
18
- attr_reader :components
19
- attr_reader :target_root_path
20
- attr_reader :batch_size
21
- attr_reader :batch_left
22
- attr_reader :use_prompt
23
- attr_reader :filter_design_system
24
- attr_reader :extract_handler
25
-
26
- def initialize(components, target_root_path, **args)
27
- @components = components
28
- @target_root_path = target_root_path
29
- @batch_size = args[:batch_size] || 1
30
- @batch_left = batch_size
31
- @use_prompt = args[:use_prompt] || false
32
- @filter_design_system = args[:filter_design_system] || nil
33
- @extract_handler = (args[:extract_handler] || Gpt3Extractor).new
34
- end
35
-
36
- # Goal: Extract the next (batch_size) component models using GPT3 and save them to target_root_path
37
- # Create a data file at: design_system.name -> group-hierarchy -> component-name.data.json
38
- # Create a model file at: design_system.name -> group-hierarchy -> component-name.model.rb
39
-
40
- # Process: Collect all components and optionally filter them by design system name.
41
- # Also filter by other keys (to be determined)
42
- # Only process files that have not been processed before.
43
- # Look for the next component to be processed, if it does not exist in the target folder then process it.
44
- # decrement the batch_left counter and continue until batch_left is 0.
45
- # if :use_prompt is true then display the input/output files and ask if you wish to process the component or skip.
46
- # process the component by calling the GPT3 API and save the results to the target folder.
47
-
48
- # rubocop:disable Metrics/AbcSize
49
- def extract
50
- guards
51
-
52
- filter_components.each do |component|
53
- puts "Processing: #{component.design_system.name} -> #{component.group.key} -> #{component.name} -> remaining#: #{batch_left}"
54
-
55
- component.debug
56
- # component_model_path = File.join(target_root_path, component.design_system.name, component.group_hierarchy, "#{component.name}.model.rb")
57
- # next if File.exist?(component_model_path)
58
-
59
- # if use_prompt
60
- # puts "Input: #{component.cleansed_html_path}"
61
- # puts "Output: #{component_model_path}"
62
- # puts 'Process? (y/n)'
63
- # next unless STDIN.gets.chomp == 'y'
64
- # end
65
-
66
- # puts "Processing: #{component_model_path}"
67
-
68
- # next if extract_handler
69
-
70
- # model = Gpt3::ComponentModel.new(component.cleansed_html_path)
71
- # model.save(component_model_path)
72
-
73
- extract_handler.extract_data(component)
74
- extract_handler.extract_model(component)
75
-
76
- @batch_left -= 1
77
- break if batch_left.zero?
78
- end
79
- end
80
- # rubocop:enable Metrics/AbcSize
81
-
82
- private
83
-
84
- def guards
85
- raise "Batch size must be greater than 0, got: #{batch_size}" if batch_size <= 0
86
- raise 'Extract handler is required' unless extract_handler
87
- raise 'Extract handler must implement extract_data method' unless extract_handler.respond_to?(:extract_data)
88
- raise 'Extract handler must implement extract_model method' unless extract_handler.respond_to?(:extract_model)
89
- end
90
-
91
- def filter_components
92
- return components unless filter_design_system
93
-
94
- components.select { |component| component.design_system.name == filter_design_system }
95
- end
96
- end
97
- end
98
- end
99
- end