bridgetown-core 1.3.0.beta2 → 1.3.0

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: 58cbef52cc9ace0226b8a2ba380589287678d686684bf4d81e5889a6d3ed25bc
4
- data.tar.gz: 14a1a0f631574b0df1e9844660eeff2a6e5e50ad53b998991a3b9a636654a05f
3
+ metadata.gz: 90337c7726115f901df3009e9e2d4b528e8439850ac995c38e2cfec4aca38109
4
+ data.tar.gz: 7f32a5135963a21cd915e3a2dd37576daed3c1a9783feb3c236bc5c73b0b138a
5
5
  SHA512:
6
- metadata.gz: 520791c7e08bdc24e4af37ac399bc0a2d73d939b8ea229188b162f90063b05e394e254dabfa7d529db2d41018bc2bf0fee62b5591a14961a2f88fd40d47a1ddc
7
- data.tar.gz: d623c999cb2ceadcacbed1b1dfbdfd365dd3b705e5583037cb23398d0519301d0052e20b9005b3ab0ce75d0b8c6143abc46f352fbeec7313eef1c8864da6ec57
6
+ metadata.gz: 94c3185a2170a979aaa6434b5f36e45e9e73fc331aa42ede507ad559b2dc4abee70f7b8c77b8349a6a7449bd17e15f8ea1a47f6356a7a577829342623c09f84e
7
+ data.tar.gz: 0d03a222870a2a66184498a04681e0b90252602d580e46b90208b10a76528543854ba4a5c6113fe623fead0dc95d49cf0e052cdc20466101ece87223c85e4134
@@ -1,8 +1,5 @@
1
1
  const build = require("./config/esbuild.defaults.js")
2
2
 
3
- // Update this if you need to configure a destination folder other than `output`
4
- const outputFolder = "output"
5
-
6
3
  // You can customize this as you wish, perhaps to add new esbuild plugins.
7
4
  //
8
5
  // ```
@@ -39,8 +36,8 @@ const esbuildOptions = {
39
36
  // add new plugins here...
40
37
  ],
41
38
  globOptions: {
42
- excludeFilter: /\.(dsd|lit)\.(css|js)$/
39
+ excludeFilter: /\.(dsd|lit)\.css$/
43
40
  }
44
41
  }
45
42
 
46
- build(outputFolder, esbuildOptions)
43
+ build(esbuildOptions)
@@ -103,6 +103,8 @@ const importPostCssPlugin = (options, configuration) => ({
103
103
  async setup(build) {
104
104
  // Process .css files with PostCSS
105
105
  build.onLoad({ filter: (configuration.filter || /\.css$/) }, async (args) => {
106
+ if (args.path.endsWith(".lit.css")) return;
107
+
106
108
  const additionalFilePaths = []
107
109
  const css = await fs.readFile(args.path, "utf8")
108
110
 
@@ -283,11 +285,11 @@ const bridgetownConfigured = (bridgetownConfig, outputFolder) => {
283
285
  // Load the PostCSS config from postcss.config.js or whatever else is a supported location/format
284
286
  const postcssrc = require("postcss-load-config")
285
287
 
286
- module.exports = async (esbuildOptions) => {
288
+ module.exports = async (esbuildOptions, ...args) => {
287
289
  let outputFolder;
288
290
  if (typeof esbuildOptions === "string") { // legacy syntax where first argument is output folder
289
- esbuildOptions = arguments[1]
290
- outputFolder = arguments[0]
291
+ outputFolder = esbuildOptions
292
+ esbuildOptions = args[0]
291
293
  }
292
294
  const bridgetownConfig = bridgetownConfigured(esbuildOptions.bridgetownConfig, outputFolder)
293
295
 
@@ -307,6 +309,9 @@ module.exports = async (esbuildOptions) => {
307
309
  if (esbuildOptions.bridgetownConfig) delete esbuildOptions.bridgetownConfig
308
310
 
309
311
  const esbuild = require("esbuild")
312
+ const entryPoints = esbuildOptions.entryPoints || ["./frontend/javascript/index.js"]
313
+ if (esbuildOptions.entryPoints) delete esbuildOptions.entryPoints
314
+
310
315
  const islands = glob.sync(`./${bridgetownConfig.source}/${bridgetownConfig.islandsDir}/*.{js,js.rb}`).map(item => `./${item}`)
311
316
 
312
317
  esbuild.context({
@@ -325,7 +330,7 @@ module.exports = async (esbuildOptions) => {
325
330
  minify: process.argv.includes("--minify"),
326
331
  sourcemap: true,
327
332
  target: "es2020",
328
- entryPoints: ["./frontend/javascript/index.js", ...islands],
333
+ entryPoints: [...entryPoints, ...islands],
329
334
  entryNames: "[dir]/[name].[hash]",
330
335
  outdir: path.join(process.cwd(), `${bridgetownConfig.destination}/_bridgetown/static`),
331
336
  publicPath: "/_bridgetown/static",
@@ -5,3 +5,5 @@ copy_file "jsconfig.json"
5
5
  say "🎉 esbuild configuration updated successfully!"
6
6
  say "You may need to add `$styles/` to the front of your main CSS imports."
7
7
  say "See https://www.bridgetownrb.com/docs/frontend-assets#esbuild-setup for details."
8
+ say "⚠️ Don't forget to update the esbuild version in your `package.json` file to \"^0.17.19\""
9
+ say "and run `yarn install`!"
@@ -11,9 +11,9 @@ end
11
11
 
12
12
  say_status :lit, "Installing Lit + SSR Plugin..."
13
13
 
14
- add_gem "bridgetown-lit-renderer", version: "2.1.0.beta1"
14
+ add_gem "bridgetown-lit-renderer", version: "2.1.0.beta2"
15
15
 
16
- run "yarn add lit esbuild-plugin-lit-css bridgetown-lit-renderer@2.1.0-beta1"
16
+ run "yarn add lit esbuild-plugin-lit-css bridgetown-lit-renderer@2.1.0-beta2"
17
17
 
18
18
  copy_file in_templates_dir("lit-ssr.config.js"), "config/lit-ssr.config.js"
19
19
  copy_file in_templates_dir("lit-components-entry.js"), "config/lit-components-entry.js"
@@ -28,9 +28,9 @@ insert_into_file "esbuild.config.js",
28
28
  end
29
29
 
30
30
  insert_into_file "esbuild.config.js",
31
- after: " plugins: [" do
31
+ after: "\n plugins: [\n" do
32
32
  <<-JS
33
- plugins: [...plugins],
33
+ ...plugins,
34
34
  JS
35
35
  end
36
36
 
@@ -23,7 +23,7 @@ insert_into_file "esbuild.config.js",
23
23
  end
24
24
 
25
25
  insert_into_file "esbuild.config.js",
26
- after: " plugins: [" do
26
+ after: "\n plugins: [\n" do
27
27
  <<-JS
28
28
  ruby2js(),
29
29
  JS
@@ -102,7 +102,7 @@ module Bridgetown
102
102
  def obfuscate_link(input, prefix = "mailto")
103
103
  link = "<a href=\"#{prefix}:#{input}\">#{input}</a>"
104
104
  script = "<script type=\"text/javascript\">document.currentScript.insertAdjacentHTML('"
105
- script += "beforebegin', '#{rot47(link).gsub(%r!\\!, '\\\\\\')}'.replace(/[!-~]/g," # rubocop:disable Style/StringLiteralsInInterpolation
105
+ script += "beforebegin', '#{rot47(link).gsub(%r!\\!, '\\\\\\')}'.replace(/[!-~]/g," # rubocop:disable Style/StringLiteralsInInterpolation, Style/RedundantRegexpArgument
106
106
  script += "function(c){{var j=c.charCodeAt(0);if((j>=33)&&(j<=126)){"
107
107
  script += "return String.fromCharCode(33+((j+ 14)%94));}"
108
108
  script += "else{return String.fromCharCode(j);}}}));</script>"
@@ -221,7 +221,7 @@ module Bridgetown
221
221
  view.view_context.resource
222
222
  end
223
223
 
224
- return unless resource
224
+ return false unless resource
225
225
 
226
226
  name = name.to_s
227
227
  resource.slots.any? do |slot|
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bridgetown
4
- VERSION = "1.3.0.beta2"
4
+ VERSION = "1.3.0"
5
5
  CODE_NAME = "Kelly Butte"
6
6
  end
@@ -133,6 +133,7 @@ module Bridgetown
133
133
 
134
134
  # rubocop:disable Layout/LineLength
135
135
  def component_frontend_matcher(options)
136
+ # TODO: maybe a negative lookbehind would make this regex cleaner?
136
137
  @fematcher ||=
137
138
  %r{(#{options[:components_dir]}|#{options[:islands_dir]})/(?:[^.]+|\.(?!dsd))+(\.js|\.jsx|\.js\.rb|\.css)$}
138
139
  end
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: 1.3.0.beta2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-18 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -590,9 +590,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
590
590
  version: 2.7.0
591
591
  required_rubygems_version: !ruby/object:Gem::Requirement
592
592
  requirements:
593
- - - ">"
593
+ - - ">="
594
594
  - !ruby/object:Gem::Version
595
- version: 1.3.1
595
+ version: '0'
596
596
  requirements: []
597
597
  rubygems_version: 3.1.4
598
598
  signing_key: