bridgetown-plugin-tailwindcss 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/bridgetown-plugin-tailwindcss/command.rb +148 -82
- data/lib/bridgetown-plugin-tailwindcss/version.rb +1 -1
- data/package.json +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ab0b8f81c3e205877d2ecfa2c7805b9db1c49471727ac7ce08162591b6fd412
|
4
|
+
data.tar.gz: 452f62b1662159e5460ac44a70f09fc5b7fe226a509ec1f7a984c2da1ea7fe61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0a5a9ee06575bb1e7bded3d9ae9afa72f7bcd8ae3bff74594604bf2b7a5428c59c9c1185017ae21eafa6c3c8de201fed6d626207a07ba9a225ec0d85c4710aa
|
7
|
+
data.tar.gz: 4a288d736261f5dd0780699102d7ad79659f6da9bf1551b6623e4631f86eb077a529cd88dad747c89c3e016afa61bd0349860290e96a962210b3e9e1fba3016c
|
data/Rakefile
CHANGED
@@ -3,102 +3,168 @@
|
|
3
3
|
require "bridgetown"
|
4
4
|
require_relative "utils"
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
24
|
+
private
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
def run
|
27
|
+
write_files
|
28
|
+
end
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
43
|
+
return unless File.exist?(frontend_stylesheet)
|
42
44
|
|
43
|
-
|
44
|
-
|
45
|
+
ACTIONS.prepend_to_file(frontend_stylesheet, import_tailwind_contents)
|
46
|
+
end
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
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
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
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
|
-
|
163
|
+
};
|
164
|
+
|
165
|
+
WEBPACK
|
166
|
+
end
|
167
|
+
end
|
102
168
|
end
|
103
169
|
end
|
104
170
|
end
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "bridgetown-plugin-tailwindcss",
|
3
|
-
"version": "0.1.
|
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.
|
18
|
-
"postcss-loader": "^0.1.
|
19
|
-
"tailwindcss": "^0.1.
|
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.
|
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-
|
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.
|
143
|
+
yarn-add: bridgetown-plugin-tailwindcss@0.1.3
|
144
144
|
post_install_message:
|
145
145
|
rdoc_options: []
|
146
146
|
require_paths:
|