tailwind_dsl 0.0.8 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/tailwind_dsl/etl/element.rb +18 -0
- data/lib/tailwind_dsl/etl/raw_components/schema/design_system.rb +1 -7
- data/lib/tailwind_dsl/etl/raw_components/schema/group.rb +2 -20
- 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: 40e1735a7ab823b626e62e1da89ee7987c50177c40b8f23a67a877225eb393d2
|
4
|
+
data.tar.gz: 511facb05203152eae4800af38aa2c0c7d209d9cd85e56a2efbedc37ade8e079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9833ddbabef4750b7c53ad17471d56e4f765bf59473e353ce27b44c214ac1cfa676ea2014b6f319f179539d11534b64338e7c36d5a841d165476cd84e1ebe140
|
7
|
+
data.tar.gz: 477cc658d824050f661946d046721153c3abd9bb554e0f015adf616a6b84306a1adad72b76dffe4b0aab962349bb5d31628fbfa7dddc7b5f884916f9ffd6ac83
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## [0.0.9](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.8...v0.0.9) (2022-10-13)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* add add_to_list to element ([acab18e](https://github.com/klueless-io/tailwind_dsl/commit/acab18e10e71624f549311eff0a8965411d87d66))
|
7
|
+
|
8
|
+
## [0.0.8](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.7...v0.0.8) (2022-10-13)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* add map_to to element ([216e93e](https://github.com/klueless-io/tailwind_dsl/commit/216e93ed8d1a59802132341b9501ee0921127061))
|
14
|
+
|
1
15
|
## [0.0.7](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.6...v0.0.7) (2022-10-13)
|
2
16
|
|
3
17
|
|
@@ -18,6 +18,10 @@ module TailwindDsl
|
|
18
18
|
value || default
|
19
19
|
end
|
20
20
|
|
21
|
+
# Map data to a class
|
22
|
+
#
|
23
|
+
# @param klass [Class] The class to map to
|
24
|
+
# @param data [Hash, Class] The data to map can be hash, an instance of the class or nil
|
21
25
|
def map_to(klass, data)
|
22
26
|
return nil if data.nil?
|
23
27
|
|
@@ -27,6 +31,20 @@ module TailwindDsl
|
|
27
31
|
puts "Data of type: #{data.class} cannot be converted to #{klass}"
|
28
32
|
nil
|
29
33
|
end
|
34
|
+
|
35
|
+
# Add data onto an array
|
36
|
+
#
|
37
|
+
# @param target_list [Array] The array to add to
|
38
|
+
# @param data [Hash, Class] The data to add can be hash or an instance of the class. Nil data will not be added
|
39
|
+
def add_to_list(klass, target_list, data)
|
40
|
+
item = map_to(klass, data)
|
41
|
+
|
42
|
+
return nil if item.nil?
|
43
|
+
|
44
|
+
target_list << item
|
45
|
+
|
46
|
+
item
|
47
|
+
end
|
30
48
|
end
|
31
49
|
end
|
32
50
|
end
|
@@ -18,17 +18,11 @@ module TailwindDsl
|
|
18
18
|
@type = grab_arg(args, :type, guard: 'Missing type')
|
19
19
|
@folder = grab_arg(args, :folder, guard: 'Missing folder')
|
20
20
|
@sub_keys = grab_arg(args, :sub_keys, guard: 'Missing sub_keys')
|
21
|
-
@files = grab_arg(args, :files, default: []).map { |file|
|
21
|
+
@files = grab_arg(args, :files, default: []).map { |file| map_to(SourceFile, file) }.compact
|
22
22
|
end
|
23
23
|
|
24
24
|
def add_file(file)
|
25
|
-
|
26
|
-
|
27
|
-
return nil if add.nil?
|
28
|
-
|
29
|
-
files << add
|
30
|
-
|
31
|
-
add
|
25
|
+
add_to_list(SourceFile, files, file)
|
32
26
|
end
|
33
27
|
|
34
28
|
def to_h
|
@@ -40,18 +34,6 @@ module TailwindDsl
|
|
40
34
|
files: files.map(&:to_h)
|
41
35
|
}
|
42
36
|
end
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
def convert_file(file)
|
47
|
-
return nil if file.nil?
|
48
|
-
|
49
|
-
return file if file.is_a?(SourceFile)
|
50
|
-
return SourceFile.new(**file) if file.is_a?(Hash)
|
51
|
-
|
52
|
-
puts "Unknown file type: #{file.class}"
|
53
|
-
nil
|
54
|
-
end
|
55
37
|
end
|
56
38
|
end
|
57
39
|
end
|
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.10",
|
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.10",
|
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