bun_bun_bundle 0.14.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39edf3123436dc20c093f42cf59baa94d7cfa12b80cb1024af6fac74d872a2e9
4
- data.tar.gz: 170ca35cd0f7fa6e81ac9e156ea0e2a2830edef61b54393e2c1eb8b8dd6d36c4
3
+ metadata.gz: 83cae9e5463f7df2c26023e77369676ee32206ee5460fe8e9aa3a9448bf69fae
4
+ data.tar.gz: a800d5ce3030e40a0fce533a8adee35036956406dc27e000bd59aa850f6c356a
5
5
  SHA512:
6
- metadata.gz: 2f25361191c1840f4642af90d0cac4e6836a069d6d7850fa4ebff0721b22c5044742776d8b6719efee4c604d09e6c39406f4a0cfeaf8733402680e42bea71b98
7
- data.tar.gz: 852f04b4ff3ba7cd7110bb083e8effb1d9d0f7e38584e7686afa64ac42158dec178517bce103711f385e07166bebda6b3e71fa22fba368083f9251e84b313fa5
6
+ metadata.gz: 8dc2812c44a0a19e59ec112528279a0ba3454808bf8cbab7b650adbf4ec27399f12667c6d85486e8b0ab60a5eb11ac24af728635b8ae0c72b8b0e8d78542affc
7
+ data.tar.gz: c8a21adc9822064299c0fa8db67570837ce04b18395b2b0932f4a7bffa33cb9faf6752effe538b62005c737f076d917c8544bdea96e58c2107f3a7149931f8e8
data/README.md CHANGED
@@ -82,6 +82,19 @@ replaces it entirely, you can clean up the default setup:
82
82
  - Delete `config/assets.js`
83
83
  - Remove all dev dependencies from `package.json`
84
84
 
85
+ > [!NOTE]
86
+ > BunBunBundle takes a different approach from `hanami-assets`, it doesn't
87
+ > integrate (well) with it. The key difference is coupling. `hanami-assets`
88
+ > ties front-end organisation to back-end slice structure: each slice gets its
89
+ > own `:assets` provider, its own manifest, and its own bundle, and helpers
90
+ > resolve through the slice container. BunBunBundle leaves the two independent.
91
+ > You can still bundle per slice though; just add the slice's entry point to
92
+ > `bun.json` and reference it like any other asset, but the front-end is free
93
+ > to organise itself differently from the slices (one shared bundle, multiple
94
+ > bundles split by audience or weight, whatever makes sense). On top of that,
95
+ > BunBunBundle ships live reload, CSS hot-reloading, and a plugin system that
96
+ > `hanami-assets` does not. Mixing the two is possible but not recommended.
97
+
85
98
  1. Set up the Hanami integration:
86
99
 
87
100
  ```ruby
@@ -29,6 +29,7 @@ export default {
29
29
  watchTimers: new Map(),
30
30
  watchers: [],
31
31
  plugins: [],
32
+ ok: true,
32
33
 
33
34
  SRI_ALGORITHMS: ['sha256', 'sha384', 'sha512'],
34
35
 
@@ -201,18 +202,21 @@ export default {
201
202
  console.error(` ▸ Failed to build ${entry}`)
202
203
  if (err.errors) for (const e of err.errors) console.error(e)
203
204
  else console.error(err)
205
+ this.ok = false
204
206
  continue
205
207
  }
206
208
 
207
209
  if (!result.success) {
208
210
  console.error(` ▸ Failed to build ${entry}`)
209
211
  for (const log of result.logs) console.error(log)
212
+ this.ok = false
210
213
  continue
211
214
  }
212
215
 
213
216
  const mainOutput = result.outputs.find(o => o.path.endsWith(ext))
214
217
  if (!mainOutput) {
215
218
  console.error(` ▸ No ${type.toUpperCase()} output for ${entry}`)
219
+ this.ok = false
216
220
  continue
217
221
  }
218
222
  const mapOutput = result.outputs.find(o => o.kind === 'sourcemap')
@@ -294,6 +298,7 @@ export default {
294
298
  const env = this.prod ? 'production' : 'development'
295
299
  console.log(`Building manifest for ${env}...`)
296
300
  const start = performance.now()
301
+ this.ok = true
297
302
  this.loadConfig()
298
303
  await this.loadPlugins()
299
304
  this.cleanOutDir()
@@ -302,7 +307,9 @@ export default {
302
307
  await this.buildCSS()
303
308
  await this.writeManifest()
304
309
  const ms = Math.round(performance.now() - start)
305
- console.log(`DONE Built successfully in ${ms} ms`, this.prettyManifest())
310
+ const status = this.ok ? 'DONE Built successfully' : ' ✖ Built with errors'
311
+ console.log(`${status} in ${ms} ms`, this.prettyManifest())
312
+ return this.ok
306
313
  },
307
314
 
308
315
  prettyManifest() {
@@ -458,6 +465,8 @@ export default {
458
465
  },
459
466
 
460
467
  async bake() {
461
- this.dev ? await this.serve() : await this.build()
468
+ if (this.dev) return this.serve()
469
+ const ok = await this.build()
470
+ if (!ok) process.exit(1)
462
471
  }
463
472
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunBunBundle
4
- VERSION = '0.14.0'
4
+ VERSION = '0.15.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bun_bun_bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wout Fierens
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubygems_version: 4.0.11
76
+ rubygems_version: 4.0.19
77
77
  specification_version: 4
78
78
  summary: A self-contained asset bundler powered by Bun
79
79
  test_files: []