bridgetown-core 0.18.5 → 0.19.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bridgetown +6 -0
  3. data/bridgetown-core.gemspec +3 -3
  4. data/lib/bridgetown-core.rb +24 -2
  5. data/lib/bridgetown-core/commands/apply.rb +4 -3
  6. data/lib/bridgetown-core/commands/concerns/actions.rb +0 -5
  7. data/lib/bridgetown-core/commands/configure.rb +62 -0
  8. data/lib/bridgetown-core/commands/new.rb +28 -1
  9. data/lib/bridgetown-core/commands/plugins.rb +1 -0
  10. data/lib/bridgetown-core/configurations/.keep +0 -0
  11. data/lib/bridgetown-core/configurations/bt-postcss.rb +26 -0
  12. data/lib/bridgetown-core/configurations/bt-postcss/postcss.config.js +21 -0
  13. data/lib/bridgetown-core/configurations/minitesting.rb +95 -0
  14. data/lib/bridgetown-core/configurations/netlify.rb +6 -0
  15. data/lib/bridgetown-core/configurations/netlify/netlify.sh +14 -0
  16. data/lib/bridgetown-core/configurations/netlify/netlify.toml +44 -0
  17. data/lib/bridgetown-core/configurations/purgecss.rb +49 -0
  18. data/lib/bridgetown-core/configurations/stimulus.rb +49 -0
  19. data/lib/bridgetown-core/configurations/swup.rb +37 -0
  20. data/lib/bridgetown-core/configurations/tailwindcss.rb +29 -0
  21. data/lib/bridgetown-core/configurations/tailwindcss/css_imports.css +4 -0
  22. data/lib/bridgetown-core/configurations/tailwindcss/postcss.config.js +12 -0
  23. data/lib/bridgetown-core/configurations/turbo.rb +16 -0
  24. data/lib/bridgetown-core/converters/erb_templates.rb +6 -13
  25. data/lib/bridgetown-core/filters.rb +3 -3
  26. data/lib/bridgetown-core/generator.rb +2 -1
  27. data/lib/bridgetown-core/page_without_a_file.rb +3 -0
  28. data/lib/bridgetown-core/plugin.rb +2 -26
  29. data/lib/bridgetown-core/ruby_template_view.rb +9 -2
  30. data/lib/bridgetown-core/utils/ruby_exec.rb +4 -4
  31. data/lib/bridgetown-core/version.rb +2 -2
  32. data/lib/site_template/README.md +70 -0
  33. data/lib/site_template/frontend/javascript/index.js.erb +11 -0
  34. data/lib/site_template/frontend/styles/index.css +19 -0
  35. data/lib/site_template/{package.json → package.json.erb} +16 -9
  36. data/lib/site_template/postcss.config.js.erb +11 -0
  37. data/lib/site_template/src/_components/footer.liquid +1 -1
  38. data/lib/site_template/src/_posts/0000-00-00-welcome-to-bridgetown.md.erb +1 -1
  39. data/lib/site_template/{webpack.config.js → webpack.config.js.erb} +42 -2
  40. metadata +41 -23
  41. data/lib/site_template/frontend/javascript/index.js +0 -3
@@ -0,0 +1,70 @@
1
+ # Bridgetown Website README
2
+
3
+ Welcome to your new Bridgetown website! You can update this README file to provide additional context and setup information for yourself or other contributors.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Prerequisites](#prerequisites)
8
+ - [Install](#install)
9
+ - [Development](#development)
10
+ - [Commands](#commands)
11
+ - [Deployment](#deployment)
12
+ - [Contributing](#contributing)
13
+
14
+ ## Prerequisites
15
+
16
+ - [GCC](https://gcc.gnu.org/install/)
17
+ - [Make](https://www.gnu.org/software/make/)
18
+ - [Ruby](https://www.ruby-lang.org/en/downloads/)
19
+ - `>= 2.5`
20
+ - [Bridgetown Gem](https://rubygems.org/gems/bridgetown)
21
+ - `gem install bundler bridgetown -N`
22
+ - [Node](https://nodejs.org)
23
+ - `>= 10.13`
24
+ - [Yarn](https://yarnpkg.com)
25
+
26
+ ## Install
27
+
28
+ ```sh
29
+ cd bridgetown-site-folder
30
+ bundle install && yarn install
31
+ ```
32
+ > Learn more: [Bridgetown Getting Started Documentation](https://www.bridgetownrb.com/docs/).
33
+
34
+ ## Development
35
+
36
+ To start your site in development mode, run `yarn start` and navigate to [localhost:4000](https://localhost:4000/)!
37
+
38
+ Use a [theme](https://github.com/topics/bridgetown-theme), add some [plugins](https://www.bridgetownrb.com/plugins/), and/or run some [automations](https://github.com/topics/bridgetown-automation) to get started quickly.
39
+
40
+ ### Commands
41
+
42
+ ```sh
43
+ # running locally
44
+ yarn start
45
+
46
+ # build & deploy to production
47
+ yarn deploy
48
+
49
+ # load the site up within a Ruby console (IRB)
50
+ bundle exec bridgetown console
51
+ ```
52
+
53
+ > Learn more: [Bridgetown CLI Documentation](https://www.bridgetownrb.com/docs/command-line-usage)
54
+
55
+ ## Deployment
56
+
57
+ You can deploy Bridgetown sites on "Jamstack" hosts (Netlify, Vercel, Render, etc.) or virtually any tranditional web server by simply building and copying the output folder to your HTML root.
58
+
59
+ > Read the [Bridgetown Deployment Documentation](https://www.bridgetownrb.com/docs/deployment) for more information.
60
+
61
+ ## Contributing
62
+
63
+ If repo is on GitHub:
64
+
65
+ 1. Fork it
66
+ 2. Clone the fork using `git clone` to your local development machine.
67
+ 3. Create your feature branch (`git checkout -b my-new-feature`)
68
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
69
+ 5. Push to the branch (`git push origin my-new-feature`)
70
+ 6. Create a new Pull Request
@@ -0,0 +1,11 @@
1
+ <% if options["use-postcss"] %>
2
+ import "index.css"
3
+ <% else %>
4
+ import "index.scss"
5
+ <% end %>
6
+
7
+ // Import all javascript files from src/_components
8
+ const componentsContext = require.context("bridgetownComponents", true, /.js$/)
9
+ componentsContext.keys().forEach(componentsContext)
10
+
11
+ console.info("Bridgetown is loaded!")
@@ -0,0 +1,19 @@
1
+ :root {
2
+ --body-background: #fafafa;
3
+ --body-color: #444;
4
+ }
5
+
6
+ body {
7
+ background: var(--body-background);
8
+ color: var(--body-color);
9
+ font-family: sans-serif;
10
+ }
11
+
12
+ h1, nav, footer {
13
+ text-align: center;
14
+ }
15
+
16
+ main {
17
+ margin: 4rem auto;
18
+ max-width: 60rem;
19
+ }
@@ -1,13 +1,14 @@
1
1
  {
2
- "name": "new-bridgetown-site",
2
+ "name": "<%= @site_name %>",
3
3
  "version": "1.0.0",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "build": "bundle exec bridgetown build",
7
7
  "serve": "bundle exec bridgetown serve",
8
+ "clean": "bundle exec bridgetown clean",
8
9
  "webpack-build": "webpack --mode production",
9
10
  "webpack-dev": "webpack --mode development -w",
10
- "deploy": "yarn webpack-build && yarn build",
11
+ "deploy": "yarn clean && yarn webpack-build && yarn build",
11
12
  "sync": "node sync.js",
12
13
  "start": "node start.js"
13
14
  },
@@ -20,14 +21,20 @@
20
21
  "babel-loader": "^8.1.0",
21
22
  "browser-sync": "^2.26.7",
22
23
  "concurrently": "^5.2.0",
23
- "css-loader": "^3.4.2",
24
- "file-loader": "^6.0.0",
25
- "mini-css-extract-plugin": "^0.9.0",
24
+ "css-loader": "^4.3.0",
25
+ "file-loader": "^6.2.0",
26
+ "mini-css-extract-plugin": "^1.3.1",
27
+ <% if options["use-postcss"] %>
28
+ "postcss": "^8.1.9",
29
+ "postcss-flexbugs-fixes": "^4.1.0",
30
+ "postcss-loader": "^4.1.0",
31
+ "postcss-preset-env": "^6.7.0",
32
+ <% else %>
26
33
  "node-sass": "^4.13.1",
27
- "sass-loader": "^8.0.2",
28
- "style-loader": "^1.1.3",
29
- "webpack": "^4.42.1",
34
+ "sass-loader": "^8.0.2",
35
+ <% end %>
36
+ "webpack": "^4.44.2",
30
37
  "webpack-cli": "^3.3.11",
31
- "webpack-manifest-plugin": "^2.2.0"
38
+ "webpack-manifest-plugin": "^2.1.0"
32
39
  }
33
40
  }
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ plugins: {
3
+ 'postcss-flexbugs-fixes': {},
4
+ 'postcss-preset-env': {
5
+ autoprefixer: {
6
+ flexbox: 'no-2009'
7
+ },
8
+ stage: 3
9
+ }
10
+ }
11
+ }
@@ -1,3 +1,3 @@
1
1
  <footer>
2
- Contact me at {{ metadata.email }}
2
+ Contact me at <a href="mailto:{{ metadata.email }}">{{ metadata.email }}</a>
3
3
  </footer>
@@ -23,4 +23,4 @@ print_hi('Tom')
23
23
  #=> prints 'Hi, Tom' to STDOUT.
24
24
  ````
25
25
 
26
- Check out the [Bridgetown docs](https://bridgetownrb.com/docs/) for more info on how to get the most out of Bridgetown. File all bugs/feature requests at [Bridgetown’s GitHub repo](https://github.com/bridgetownrb/bridgetown). If you have questions, you can ask them on [Bridgetown Community Forum](https://community.bridgetownrb.com).
26
+ Check out the [Bridgetown docs](https://bridgetownrb.com/docs/) for more info on how to get the most out of Bridgetown. File all bugs/feature requests at [Bridgetown’s GitHub repo](https://github.com/bridgetownrb/bridgetown). If you have questions, you can ask them on [Bridgetown Discussions on GitHub](https://github.com/bridgetownrb/bridgetown/discussions).
@@ -18,6 +18,14 @@ module.exports = {
18
18
  },
19
19
  resolve: {
20
20
  extensions: [".js", ".jsx"],
21
+ modules: [
22
+ path.resolve(__dirname, 'frontend', 'javascript'),
23
+ path.resolve(__dirname, 'frontend', 'styles'),
24
+ path.resolve('./node_modules')
25
+ ],
26
+ alias: {
27
+ bridgetownComponents: path.resolve(__dirname, "src", "_components")
28
+ }
21
29
  },
22
30
  plugins: [
23
31
  new MiniCssExtractPlugin({
@@ -48,11 +56,32 @@ module.exports = {
48
56
  },
49
57
  },
50
58
  },
59
+ <% if options["use-postcss"] %>
60
+ {
61
+ test: /\.(s[ac]|c)ss$/,
62
+ use: [
63
+ MiniCssExtractPlugin.loader,
64
+ {
65
+ loader: "css-loader",
66
+ options: {
67
+ url: url => !url.startsWith('/'),
68
+ importLoaders: 1
69
+ }
70
+ },
71
+ "postcss-loader"
72
+ ],
73
+ },
74
+ <% else %>
51
75
  {
52
76
  test: /\.(s[ac]|c)ss$/,
53
77
  use: [
54
78
  MiniCssExtractPlugin.loader,
55
- "css-loader",
79
+ {
80
+ loader: "css-loader",
81
+ options: {
82
+ url: url => !url.startsWith('/')
83
+ }
84
+ },
56
85
  {
57
86
  loader: "sass-loader",
58
87
  options: {
@@ -65,14 +94,25 @@ module.exports = {
65
94
  },
66
95
  ],
67
96
  },
97
+ <% end %>
68
98
  {
69
- test: /\.woff2?$|\.ttf$|\.eot$|\.svg$/,
99
+ test: /\.woff2?$|\.ttf$|\.eot$/,
70
100
  loader: "file-loader",
71
101
  options: {
102
+ name: "[name]-[contenthash].[ext]",
72
103
  outputPath: "../fonts",
73
104
  publicPath: "../fonts",
74
105
  },
75
106
  },
107
+ {
108
+ test: /\.png?$|\.gif$|\.jpg$|\.svg$/,
109
+ loader: "file-loader",
110
+ options: {
111
+ name: "[name]-[contenthash].[ext]",
112
+ outputPath: "../images",
113
+ publicPath: "../images",
114
+ },
115
+ },
76
116
  ],
77
117
  },
78
118
  };
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.5
4
+ version: 0.19.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-09 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '4.0'
173
+ version: '5.0'
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '4.0'
180
+ version: '5.0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: liquid-component
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +192,6 @@ dependencies:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0.1'
195
- - !ruby/object:Gem::Dependency
196
- name: liquid-render-tag
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: '0.2'
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: '0.2'
209
195
  - !ruby/object:Gem::Dependency
210
196
  name: listen
211
197
  requirement: !ruby/object:Gem::Requirement
@@ -282,14 +268,14 @@ dependencies:
282
268
  requirements:
283
269
  - - "~>"
284
270
  - !ruby/object:Gem::Version
285
- version: '1.0'
271
+ version: '1.1'
286
272
  type: :runtime
287
273
  prerelease: false
288
274
  version_requirements: !ruby/object:Gem::Requirement
289
275
  requirements:
290
276
  - - "~>"
291
277
  - !ruby/object:Gem::Version
292
- version: '1.0'
278
+ version: '1.1'
293
279
  - !ruby/object:Gem::Dependency
294
280
  name: tilt
295
281
  requirement: !ruby/object:Gem::Requirement
@@ -304,6 +290,20 @@ dependencies:
304
290
  - - "~>"
305
291
  - !ruby/object:Gem::Version
306
292
  version: '2.0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: webrick
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - "~>"
298
+ - !ruby/object:Gem::Version
299
+ version: '1.7'
300
+ type: :runtime
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - "~>"
305
+ - !ruby/object:Gem::Version
306
+ version: '1.7'
307
307
  description: Bridgetown is a Webpack-aware, Ruby-powered static site generator for
308
308
  the modern Jamstack era
309
309
  email: maintainers@bridgetownrb.com
@@ -328,6 +328,7 @@ files:
328
328
  - lib/bridgetown-core/commands/concerns/build_options.rb
329
329
  - lib/bridgetown-core/commands/concerns/configuration_overridable.rb
330
330
  - lib/bridgetown-core/commands/concerns/summarizable.rb
331
+ - lib/bridgetown-core/commands/configure.rb
331
332
  - lib/bridgetown-core/commands/console.rb
332
333
  - lib/bridgetown-core/commands/doctor.rb
333
334
  - lib/bridgetown-core/commands/new.rb
@@ -348,6 +349,20 @@ files:
348
349
  - lib/bridgetown-core/concerns/site/writable.rb
349
350
  - lib/bridgetown-core/concerns/validatable.rb
350
351
  - lib/bridgetown-core/configuration.rb
352
+ - lib/bridgetown-core/configurations/.keep
353
+ - lib/bridgetown-core/configurations/bt-postcss.rb
354
+ - lib/bridgetown-core/configurations/bt-postcss/postcss.config.js
355
+ - lib/bridgetown-core/configurations/minitesting.rb
356
+ - lib/bridgetown-core/configurations/netlify.rb
357
+ - lib/bridgetown-core/configurations/netlify/netlify.sh
358
+ - lib/bridgetown-core/configurations/netlify/netlify.toml
359
+ - lib/bridgetown-core/configurations/purgecss.rb
360
+ - lib/bridgetown-core/configurations/stimulus.rb
361
+ - lib/bridgetown-core/configurations/swup.rb
362
+ - lib/bridgetown-core/configurations/tailwindcss.rb
363
+ - lib/bridgetown-core/configurations/tailwindcss/css_imports.css
364
+ - lib/bridgetown-core/configurations/tailwindcss/postcss.config.js
365
+ - lib/bridgetown-core/configurations/turbo.rb
351
366
  - lib/bridgetown-core/converter.rb
352
367
  - lib/bridgetown-core/converters/erb_templates.rb
353
368
  - lib/bridgetown-core/converters/identity.rb
@@ -434,12 +449,15 @@ files:
434
449
  - lib/bridgetown-core/watcher.rb
435
450
  - lib/site_template/.gitignore
436
451
  - lib/site_template/Gemfile.erb
452
+ - lib/site_template/README.md
437
453
  - lib/site_template/bridgetown.config.yml
438
- - lib/site_template/frontend/javascript/index.js
454
+ - lib/site_template/frontend/javascript/index.js.erb
455
+ - lib/site_template/frontend/styles/index.css
439
456
  - lib/site_template/frontend/styles/index.scss
440
- - lib/site_template/package.json
457
+ - lib/site_template/package.json.erb
441
458
  - lib/site_template/plugins/builders/.keep
442
459
  - lib/site_template/plugins/site_builder.rb
460
+ - lib/site_template/postcss.config.js.erb
443
461
  - lib/site_template/src/404.html
444
462
  - lib/site_template/src/_components/footer.liquid
445
463
  - lib/site_template/src/_components/head.liquid
@@ -457,7 +475,7 @@ files:
457
475
  - lib/site_template/src/posts.md
458
476
  - lib/site_template/start.js
459
477
  - lib/site_template/sync.js
460
- - lib/site_template/webpack.config.js
478
+ - lib/site_template/webpack.config.js.erb
461
479
  homepage: https://www.bridgetownrb.com
462
480
  licenses:
463
481
  - MIT
@@ -1,3 +0,0 @@
1
- import "../styles/index.scss"
2
-
3
- console.info("Bridgetown is loaded!")