bridgetown-core 1.3.0.beta2 → 1.3.0
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/lib/bridgetown-core/commands/esbuild/esbuild.config.js +2 -5
- data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +9 -4
- data/lib/bridgetown-core/commands/esbuild/update.rb +2 -0
- data/lib/bridgetown-core/configurations/lit.rb +4 -4
- data/lib/bridgetown-core/configurations/ruby2js.rb +1 -1
- data/lib/bridgetown-core/filters.rb +1 -1
- data/lib/bridgetown-core/helpers.rb +1 -1
- data/lib/bridgetown-core/version.rb +1 -1
- data/lib/bridgetown-core/watcher.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90337c7726115f901df3009e9e2d4b528e8439850ac995c38e2cfec4aca38109
|
4
|
+
data.tar.gz: 7f32a5135963a21cd915e3a2dd37576daed3c1a9783feb3c236bc5c73b0b138a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)\.
|
39
|
+
excludeFilter: /\.(dsd|lit)\.css$/
|
43
40
|
}
|
44
41
|
}
|
45
42
|
|
46
|
-
build(
|
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
|
-
|
290
|
-
|
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: [
|
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.
|
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-
|
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
|
-
|
33
|
+
...plugins,
|
34
34
|
JS
|
35
35
|
end
|
36
36
|
|
@@ -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>"
|
@@ -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
|
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-
|
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:
|
595
|
+
version: '0'
|
596
596
|
requirements: []
|
597
597
|
rubygems_version: 3.1.4
|
598
598
|
signing_key:
|