bridgetown-plugin-tailwindcss 0.1.2 → 0.1.3

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: 02adc20df692a49f8c838710481f8f51ae1769e214a957715330c2a46b4a4f0f
4
- data.tar.gz: 70e248fd006a26c49f284c11d43b0700019f34b93ac9de72caa2778d6b45972a
3
+ metadata.gz: 9ab0b8f81c3e205877d2ecfa2c7805b9db1c49471727ac7ce08162591b6fd412
4
+ data.tar.gz: 452f62b1662159e5460ac44a70f09fc5b7fe226a509ec1f7a984c2da1ea7fe61
5
5
  SHA512:
6
- metadata.gz: 8c9133b819b886276eb8542ebd734fd4dc99f02a51e991ea348be7c51baf02cf95ffdb34ecfca77da7d715aa5f289b6692e6815e3556236603da15b46ce78b2d
7
- data.tar.gz: b32326cad89045140db9a2bd0510ad25f13284f1cd9ed0d46f30c7690777ad990e1e9150da04f202b08c08b9dfff7e70f058ce018292d2033c1c9554be9e8535
6
+ metadata.gz: e0a5a9ee06575bb1e7bded3d9ae9afa72f7bcd8ae3bff74594604bf2b7a5428c59c9c1185017ae21eafa6c3c8de201fed6d626207a07ba9a225ec0d85c4710aa
7
+ data.tar.gz: 4a288d736261f5dd0780699102d7ad79659f6da9bf1551b6623e4631f86eb077a529cd88dad747c89c3e016afa61bd0349860290e96a962210b3e9e1fba3016c
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ RSpec::Core::RakeTask.new(:spec)
9
9
  task :default => :spec
10
10
  task :test => :spec
11
11
 
12
- task :release do
12
+ task :deploy do
13
13
  Rake.sh "./script/release"
14
14
  end
15
15
 
@@ -3,102 +3,168 @@
3
3
  require "bridgetown"
4
4
  require_relative "utils"
5
5
 
6
- class TailwindInit < Bridgetown::Command
7
- ACTIONS = TailwindCss::Utils::Actions.new
8
-
9
- class << self
10
- def init_with_program(prog)
11
- prog.command(:tailwind_init) do |c|
12
- c.syntax "tailwind_init"
13
- c.description "Initialize config for Tailwind"
14
- # c.option 'path', '--path', 'Choose the path to install tailwind'
15
-
16
- c.action do |_args, _options|
17
- Bridgetown::Commands::TailwindInit.new.run
6
+ module Bridgetown
7
+ module Commands
8
+ class TailwindInit < Bridgetown::Command
9
+ ACTIONS = TailwindCss::Utils::Actions.new
10
+
11
+ class << self
12
+ def init_with_program(prog)
13
+ prog.command(:tailwind_init) do |c|
14
+ c.syntax "tailwind_init"
15
+ c.description "Initialize config for Tailwind"
16
+ # c.option 'path', '--path', 'Choose the path to install tailwind'
17
+
18
+ c.action do |_args, _options|
19
+ run
20
+ end
21
+ end
18
22
  end
19
- end
20
- end
21
23
 
22
- private
24
+ private
23
25
 
24
- def run
25
- write_files
26
- end
26
+ def run
27
+ write_files
28
+ end
27
29
 
28
- def write_files
29
- webpack_config = File.expand_path("webpack.config.js")
30
- tailwind_config = File.expand_path("tailwind.config.js")
30
+ def write_files
31
+ webpack_config = File.expand_path("webpack.config.js")
32
+ tailwind_config = File.expand_path("tailwind.config.js")
31
33
 
32
- ACTIONS.create_file(webpack_config, webpack_file_contents)
33
- ACTIONS.create_file(tailwind_config, tailwind_config_contents)
34
- prepend_to_stylesheet
35
- end
34
+ ACTIONS.create_file(webpack_config, webpack_file_contents)
35
+ ACTIONS.create_file(tailwind_config, tailwind_config_contents)
36
+ prepend_to_stylesheet
37
+ end
36
38
 
37
- def prepend_to_stylesheet
38
- frontend_stylesheet = File.join("frontend", "styles", "index.scss")
39
- frontend_stylesheet = File.expand_path(frontend_stylesheet)
39
+ def prepend_to_stylesheet
40
+ frontend_stylesheet = File.join("frontend", "styles", "index.scss")
41
+ frontend_stylesheet = File.expand_path(frontend_stylesheet)
40
42
 
41
- return unless File.exist?(frontend_stylesheet)
43
+ return unless File.exist?(frontend_stylesheet)
42
44
 
43
- ACTIONS.prepend_to_file(frontend_stylesheet, import_tailwind_contents)
44
- end
45
+ ACTIONS.prepend_to_file(frontend_stylesheet, import_tailwind_contents)
46
+ end
45
47
 
46
- def import_tailwind_contents
47
- <<~IMPORT
48
- @import 'tailwindcss/base';
49
- @import 'tailwindcss/components';
50
- @import 'tailwindcss/utilities';
51
- IMPORT
52
- end
48
+ def import_tailwind_contents
49
+ <<~IMPORT
50
+ @import 'tailwindcss/base';
51
+ @import 'tailwindcss/components';
52
+ @import 'tailwindcss/utilities';
53
53
 
54
- def tailwind_config_contents
55
- <<~TAILWIND
56
- module.exports = {
57
- purge: {
58
- enabled: true,
59
- content: ['./src/**/*.html'],
60
- },
61
- theme: {
62
- extend: {},
63
- },
64
- variants: {},
65
- plugins: [],
66
- }
67
- TAILWIND
68
- end
54
+ IMPORT
55
+ end
56
+
57
+ def tailwind_config_contents
58
+ <<~TAILWIND
59
+ module.exports = {
60
+ purge: {
61
+ enabled: true,
62
+ content: ['./src/**/*.html'],
63
+ },
64
+ theme: {
65
+ extend: {},
66
+ },
67
+ variants: {},
68
+ plugins: [],
69
+ }
70
+ TAILWIND
71
+ end
72
+
73
+ def webpack_file_contents
74
+ <<~WEBPACK
75
+ const path = require("path");
76
+ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
77
+ const ManifestPlugin = require("webpack-manifest-plugin");
69
78
 
70
- def webpack_file_contents
71
- <<~WEBPACK
72
- {
73
- test: /\.(s[ac]|c)ss$/,
74
- use: [
75
- MiniCssExtractPlugin.loader,
76
- "css-loader",
77
- {
78
- loader: "sass-loader",
79
- options: {
80
- sassOptions: {
81
- includePaths: [
82
- path.resolve(__dirname, "src/_components"),
83
- path.resolve(__dirname, "src/_includes"),
84
- ],
85
- },
79
+ module.exports = {
80
+ entry: "./frontend/javascript/index.js",
81
+ devtool: "source-map",
82
+ // Set some or all of these to true if you want more verbose logging:
83
+ stats: {
84
+ modules: false,
85
+ builtAt: false,
86
+ timings: false,
87
+ children: false,
86
88
  },
87
- },
88
- {
89
- loader: "postcss-loader",
90
- options: {
91
- ident: "postcss",
92
- plugins: [
93
- require("postcss-import"),
94
- require("tailwindcss"),
95
- require("autoprefixer"),
89
+ output: {
90
+ path: path.resolve(__dirname, "output", "_bridgetown", "static", "js"),
91
+ filename: "all.[contenthash].js",
92
+ },
93
+ resolve: {
94
+ extensions: [".js", ".jsx"],
95
+ },
96
+ plugins: [
97
+ new MiniCssExtractPlugin({
98
+ filename: "../css/all.[contenthash].css",
99
+ }),
100
+ new ManifestPlugin({
101
+ fileName: path.resolve(__dirname, ".bridgetown-webpack", "manifest.json"),
102
+ }),
103
+ ],
104
+ module: {
105
+ rules: [
106
+ {
107
+ test: /\.(js|jsx)/,
108
+ use: {
109
+ loader: "babel-loader",
110
+ options: {
111
+ presets: ["@babel/preset-env"],
112
+ plugins: [
113
+ "@babel/plugin-proposal-class-properties",
114
+ [
115
+ "@babel/plugin-transform-runtime",
116
+ {
117
+ helpers: false,
118
+ },
119
+ ],
120
+ ],
121
+ },
122
+ },
123
+ },
124
+ {
125
+ test: /\.(s[ac]|c)ss$/,
126
+ use: [
127
+ MiniCssExtractPlugin.loader,
128
+ "css-loader",
129
+ {
130
+ loader: "sass-loader",
131
+ options: {
132
+ sassOptions: {
133
+ includePaths: [
134
+ path.resolve(__dirname, "src/_components"),
135
+ path.resolve(__dirname, "src/_includes"),
136
+ ],
137
+ },
138
+ },
139
+ },
140
+ ],
141
+ },
142
+ {
143
+ loader: "postcss-loader",
144
+ options: {
145
+ ident: "postcss",
146
+ plugins: [
147
+ require("postcss-import"),
148
+ require("tailwindcss"),
149
+ require("autoprefixer"),
150
+ ],
151
+ },
152
+ },
153
+ {
154
+ test: /\.woff2?$|\.ttf$|\.eot$|\.svg$/,
155
+ loader: "file-loader",
156
+ options: {
157
+ outputPath: "../fonts",
158
+ publicPath: "../fonts",
159
+ },
160
+ },
96
161
  ],
97
162
  },
98
- },
99
- ],
100
- },
101
- WEBPACK
163
+ };
164
+
165
+ WEBPACK
166
+ end
167
+ end
102
168
  end
103
169
  end
104
170
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TailwindCss
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bridgetown-plugin-tailwindcss",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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
  "devDependencies": {
17
- "postcss-import": "^0.1.2",
18
- "postcss-loader": "^0.1.2",
19
- "tailwindcss": "^0.1.2"
17
+ "postcss-import": "^0.1.3",
18
+ "postcss-loader": "^0.1.3",
19
+ "tailwindcss": "^0.1.3"
20
20
  }
21
21
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-plugin-tailwindcss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konnor Rogers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-31 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -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.2
143
+ yarn-add: bridgetown-plugin-tailwindcss@0.1.3
144
144
  post_install_message:
145
145
  rdoc_options: []
146
146
  require_paths: