bridgetown-plugin-tailwindcss 0.1.5 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9986754f4c6f0a83586367fd810524cff649bef87c142982f717716c61b376c3
4
- data.tar.gz: 582319a24342772b910fb4c548aa386ac7f36354ddbad01007e26d1f3c8109f7
3
+ metadata.gz: 6907ae8359a1375066abb794044ba83dacd561ddfd981200134e9958b02e36dc
4
+ data.tar.gz: d6a1ba20c529991a1c8778b54c3de218dc6710f69070066b7a8a8ccb38e17851
5
5
  SHA512:
6
- metadata.gz: bd7a4d92bd480318bf7a09fe1d0ad78a92acedcf37e64fbe889e9c807776e863c7e9031ac83d45e58ecbbc81ee35bd365282ecb17e7a0f1ea249940a53ddefa6
7
- data.tar.gz: 7781f8c310ab4834f86fb03f3b7560682f04add80d5c49b914b154d89f3f5b9166a44f574450bbd00f066fb87cc779fb2582bcdaeb1e96f6b6777fa993873f00
6
+ metadata.gz: 3cbc34000352ca5d2e28d5357ab44cde6c6f3d4971df7d7e9947272a45b955a516b720f5a05df82ea97e3dd8cecc2d615b4fccef37f7e30aa99f3246a77becf2
7
+ data.tar.gz: ccbd01c59e859158372c934a08024934f4943e154824bcc3a6f4b4739804d42f25c4bf6a59057e23b3e872578a74a6dee40c9d596e747fd997bb3106043e2cba
@@ -12,7 +12,11 @@ module TailwindCss
12
12
  class Bump < Thor
13
13
  include Thor::Actions
14
14
 
15
+ RUBY_VERSION_REGEX = %r!(.*VERSION.?=.*)!.freeze
16
+ NPM_VERSION_REGEX = %r!(.*"version":.*)!.freeze
17
+ VERSION_LINE = Regexp.union(RUBY_VERSION_REGEX, NPM_VERSION_REGEX)
15
18
  VERSION_REGEX = %r!(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)!.freeze
19
+ GSUB_REGEX = %r!(?<version>#{VERSION_LINE})#{VERSION_REGEX}!.freeze
16
20
 
17
21
  # rubocop:disable Metrics/BlockLength
18
22
  no_commands do
@@ -23,30 +27,43 @@ module TailwindCss
23
27
  def bump_version_to_string(string)
24
28
  say("Bumping from #{VERSION} to #{string}", :red)
25
29
 
30
+ match = GSUB_REGEX.match(File.read(file))
31
+ gsub_string = "#{match[:version]}#{string}"
26
32
  version_files.each do |file|
27
- gsub_file(file, VERSION_REGEX, string)
33
+ gsub_file(file, GSUB_REGEX, gsub_string)
28
34
  end
29
35
  end
30
36
 
31
- def bump_version(type, version: VERSION, value: nil)
32
- say(version_change(type, version: version, value: value), :red)
37
+ def bump_version(type, version: VERSION)
38
+ say(version_change(type, version: version), :red)
33
39
 
34
40
  version_files.each do |file|
35
- gsub_file(file, VERSION_REGEX,
36
- to_version(type, version: version, value: value))
41
+ match = GSUB_REGEX.match(File.read(file))
42
+ gsub_string = "#{match[:version]}#{to_version(type, version: version)}"
43
+
44
+ gsub_file(file, GSUB_REGEX,
45
+ gsub_string)
37
46
  end
38
47
  end
39
48
 
40
49
  private
41
50
 
51
+ def gsub_match(file)
52
+ GSUB_REGEX.match(File.read(file))
53
+ end
54
+
42
55
  def version_files
43
- @package_json = File.expand_path("package.json")
44
- @version_file = File.expand_path(File.join(__dir__, "version.rb"))
56
+ package_json = File.expand_path("package.json")
57
+ version_file = File.expand_path(File.join(__dir__, "version.rb"))
45
58
 
46
- [@package_json, @version_file]
59
+ [package_json, version_file]
47
60
  end
48
61
 
49
- def to_version(type, version: nil, value: nil)
62
+ # ef version_replacement
63
+ # match = GSUB_REGEX.match(File.readlines
64
+ # end
65
+
66
+ def to_version(type, version: nil)
50
67
  from = version
51
68
  match = VERSION_REGEX.match(from)
52
69
 
@@ -61,7 +78,7 @@ module TailwindCss
61
78
  #{groups.keys}"
62
79
  end
63
80
 
64
- groups[type] = value || (groups[type].to_i + 1).to_s
81
+ groups[type] = (groups[type].to_i + 1).to_s
65
82
 
66
83
  bump_to_zero(type, groups)
67
84
 
@@ -78,8 +95,8 @@ module TailwindCss
78
95
  groups[:minor] = "0"
79
96
  end
80
97
 
81
- def version_change(type, version: nil, value: nil)
82
- "Bumping from #{version} to #{to_version(type, version: version, value: value)}"
98
+ def version_change(type, version: nil)
99
+ "Bumping from #{version} to #{to_version(type, version: version)}"
83
100
  end
84
101
  end
85
102
  # rubocop:enable Metrics/BlockLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TailwindCss
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.12"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bridgetown-plugin-tailwindcss",
3
- "version": "0.1.5",
3
+ "version": "0.1.12",
4
4
  "main": "frontend/javascript/index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,8 +14,8 @@
14
14
  "frontend"
15
15
  ],
16
16
  "dependencies": {
17
- "postcss-import": "^0.1.5",
18
- "postcss-loader": "^0.1.5",
19
- "tailwindcss": "^0.1.5"
17
+ "postcss-import": "^12.0.1",
18
+ "postcss-loader": "^3.0.0",
19
+ "tailwindcss": "^1.4.6"
20
20
  }
21
21
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-plugin-tailwindcss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konnor Rogers
@@ -140,7 +140,7 @@ homepage: https://github.com/paramagicdev/bridgetown-plugin-tailwindcss
140
140
  licenses:
141
141
  - MIT
142
142
  metadata:
143
- yarn-add: bridgetown-plugin-tailwindcss@0.1.5
143
+ yarn-add: bridgetown-plugin-tailwindcss@0.1.12
144
144
  post_install_message:
145
145
  rdoc_options: []
146
146
  require_paths: