tailwind_dsl 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/tailwind_dsl/etl/component_models/extractor.rb +4 -4
- data/lib/tailwind_dsl/etl/component_structures/generator.rb +4 -2
- data/lib/tailwind_dsl/etl/component_structures/raw_component_query.rb +10 -12
- data/lib/tailwind_dsl/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6646b23144a973701ff3a0357cdf6eb27fcc34e26690d2fdbcd77abf1b4767b
|
4
|
+
data.tar.gz: 1930985fae4778a5d7576ba843f2f727c634c14802fa3c572d0513df5e2eb3f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ccea6907b5a4a1ff3cdc20fa20d0ce6dc814890d1cc4524e2fba9b124b85d599c5ae1046de94ddf10b20bde5292ddf79cdd7f0d0c38d6fa117a0bf7bb73ee1
|
7
|
+
data.tar.gz: 8feb59692ddaf59ffe373c1492e08e45dfe546ab63bfc09554afe47322975ad0fb8de5ec91046bb506b0ad303543157a1c0e86c0c5098db85098d12d059ebfc5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [0.0.14](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.13...v0.0.14) (2022-10-18)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* refactor sample data directories ([23e4efb](https://github.com/klueless-io/tailwind_dsl/commit/23e4efb2863643cfbc8744e656a873900a421572))
|
7
|
+
* refactor sample data directories ([4017917](https://github.com/klueless-io/tailwind_dsl/commit/401791784e51fbe771c841294a4ad837f99c8ec9))
|
8
|
+
* start working on component model extractor ([929292d](https://github.com/klueless-io/tailwind_dsl/commit/929292dcdae8d79ccd12e2eae30d3e6710bac3f2))
|
9
|
+
|
1
10
|
## [0.0.13](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.12...v0.0.13) (2022-10-18)
|
2
11
|
|
3
12
|
|
@@ -5,13 +5,13 @@ module TailwindDsl
|
|
5
5
|
module ComponentModels
|
6
6
|
# Extract component models by reading the cleansed component HTML and then using GPT3 to infer both the data/model structure.
|
7
7
|
class Extractor
|
8
|
-
attr_reader :
|
8
|
+
attr_reader :components
|
9
9
|
attr_reader :target_root_path
|
10
10
|
attr_reader :batch_size
|
11
11
|
attr_reader :use_prompt
|
12
12
|
|
13
|
-
def initialize(
|
14
|
-
@
|
13
|
+
def initialize(components, target_root_path, batch_size: 1, use_prompt: false, filter_design_system: nil)
|
14
|
+
@components = components
|
15
15
|
@target_root_path = target_root_path
|
16
16
|
@batch_size = batch_size
|
17
17
|
@batch_left = batch_size
|
@@ -31,7 +31,7 @@ module TailwindDsl
|
|
31
31
|
def extract; end
|
32
32
|
|
33
33
|
# def components
|
34
|
-
# @components ||=
|
34
|
+
# @components ||= components.design_systems.map do |design_system|
|
35
35
|
# design_system.components.map do |component|
|
36
36
|
# Component.new(design_system, component, source_root_path, target_root_path)
|
37
37
|
# end
|
@@ -21,7 +21,9 @@ module TailwindDsl
|
|
21
21
|
# .gsub(/(\n\s*\n)+/, "\n")
|
22
22
|
attr_reader :uikit
|
23
23
|
attr_reader :components
|
24
|
+
# Location for raw components
|
24
25
|
attr_reader :source_root_path
|
26
|
+
# Location for component structures
|
25
27
|
attr_reader :target_root_path
|
26
28
|
attr_reader :reset_root_path
|
27
29
|
|
@@ -54,8 +56,8 @@ module TailwindDsl
|
|
54
56
|
|
55
57
|
def query_components
|
56
58
|
RawComponentQuery.query(uikit,
|
57
|
-
|
58
|
-
|
59
|
+
source_root_path: source_root_path,
|
60
|
+
target_root_path: target_root_path).records
|
59
61
|
end
|
60
62
|
|
61
63
|
def process_components
|
@@ -8,8 +8,6 @@ module TailwindDsl
|
|
8
8
|
# This is a two pass process:
|
9
9
|
# 1. Query the raw component folder for all files that match the pattern and build up a graph with required information
|
10
10
|
# 2. Flatten the graph into a list of rows
|
11
|
-
#
|
12
|
-
# If you need to debug, then pass in the debug flag and it will output the graph to the console
|
13
11
|
class RawComponentQuery
|
14
12
|
DesignSystem = Struct.new(
|
15
13
|
:name,
|
@@ -64,22 +62,22 @@ module TailwindDsl
|
|
64
62
|
end
|
65
63
|
|
66
64
|
attr_reader :uikit
|
67
|
-
|
68
|
-
attr_reader :
|
65
|
+
# Location for raw components
|
66
|
+
attr_reader :source_root_path
|
67
|
+
# Location for component structures
|
68
|
+
attr_reader :target_root_path
|
69
69
|
attr_reader :current_design_system
|
70
|
-
attr_reader :debug
|
71
70
|
attr_reader :records
|
72
71
|
|
73
72
|
def initialize(uikit, **args)
|
74
73
|
@uikit = uikit
|
75
|
-
@
|
76
|
-
@
|
77
|
-
@debug = args[:debug] || false
|
74
|
+
@source_root_path = args[:source_root_path] || raise(ArgumentError, 'Missing source_root_path')
|
75
|
+
@target_root_path = args[:target_root_path] || raise(ArgumentError, 'Missing target_root_path')
|
78
76
|
end
|
79
77
|
|
80
78
|
class << self
|
81
|
-
def query(uikit,
|
82
|
-
instance = new(uikit,
|
79
|
+
def query(uikit, source_root_path:, target_root_path:)
|
80
|
+
instance = new(uikit, source_root_path: source_root_path, target_root_path: target_root_path)
|
83
81
|
instance.call
|
84
82
|
end
|
85
83
|
end
|
@@ -119,11 +117,11 @@ module TailwindDsl
|
|
119
117
|
end
|
120
118
|
|
121
119
|
def source_path
|
122
|
-
File.join(
|
120
|
+
File.join(source_root_path, design_system_name)
|
123
121
|
end
|
124
122
|
|
125
123
|
def target_path
|
126
|
-
File.join(
|
124
|
+
File.join(target_root_path, design_system_name)
|
127
125
|
end
|
128
126
|
|
129
127
|
def map_design_system
|
data/lib/tailwind_dsl/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "tailwind_dsl",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.15",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "tailwind_dsl",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.15",
|
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