bun_bun_bundle 0.13.0 → 0.14.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: 344a23b7763c7396493c708342f37c5caf1df751cac1fbbaa77b4d6e73c31aea
4
- data.tar.gz: c82e810ba3503fc7f1808074ceb61cc8cb8095a6617d267692b61e9fb864780c
3
+ metadata.gz: 39edf3123436dc20c093f42cf59baa94d7cfa12b80cb1024af6fac74d872a2e9
4
+ data.tar.gz: 170ca35cd0f7fa6e81ac9e156ea0e2a2830edef61b54393e2c1eb8b8dd6d36c4
5
5
  SHA512:
6
- metadata.gz: 14da826847e471f03ad80b4763c34e10fb9cef6b91a41bd0525bcc62eb17039bd8043bf3d9c6ed0232aa2842f2daad1f05adde5121c5b45fe6925645a7bc713d
7
- data.tar.gz: 269aafe80a301d4c662e7417413a9e98d3fa5225320df0f641526ae978c1e363defb7019f0f2c67d398d48a8d85b4d4dbddfa3da0e7ee4dc356da0a23ac1bbf2
6
+ metadata.gz: 2f25361191c1840f4642af90d0cac4e6836a069d6d7850fa4ebff0721b22c5044742776d8b6719efee4c604d09e6c39406f4a0cfeaf8733402680e42bea71b98
7
+ data.tar.gz: 852f04b4ff3ba7cd7110bb083e8effb1d9d0f7e38584e7686afa64ac42158dec178517bce103711f385e07166bebda6b3e71fa22fba368083f9251e84b313fa5
data/README.md CHANGED
@@ -244,6 +244,10 @@ Place a `config/bun.json` in your project root:
244
244
  > Creating a `bun.json` file is entirely optional. All values shown above are
245
245
  > defaults, you only need to specify what you want to override.
246
246
 
247
+ `watchDirs` entries may be glob patterns. For example, in a Hanami app with
248
+ multiple slices, `"slices/*/assets"` will watch every slice's assets directory
249
+ without having to list them explicitly.
250
+
247
251
  If you're developing inside a Docker container, set `listenHost` so the
248
252
  WebSocket server accepts connections from the host machine:
249
253
 
@@ -1,4 +1,4 @@
1
- import {mkdirSync, readFileSync, existsSync, rmSync, watch} from 'fs'
1
+ import {mkdirSync, readFileSync, existsSync, rmSync, statSync, watch} from 'fs'
2
2
  import {join, dirname, basename, extname} from 'path'
3
3
  import {Glob} from 'bun'
4
4
  import {resolvePlugins} from './plugins/index.js'
@@ -382,13 +382,18 @@ export default {
382
382
  })()
383
383
  }
384
384
 
385
- for (const dir of this.config.watchDirs) {
386
- const fullDir = join(this.root, dir)
387
- if (!existsSync(fullDir)) {
388
- console.warn(` ▸ Watch directory ${dir} does not exist, skipping...`)
389
- continue
385
+ for (const pattern of this.config.watchDirs) {
386
+ const dirs = pattern.includes('*')
387
+ ? await Array.fromAsync(new Glob(pattern).scan({cwd: this.root, onlyFiles: false}))
388
+ : [pattern]
389
+ for (const dir of dirs) {
390
+ const fullDir = join(this.root, dir)
391
+ if (!existsSync(fullDir) || !statSync(fullDir).isDirectory()) {
392
+ console.warn(` ▸ Watch directory ${dir} does not exist, skipping...`)
393
+ continue
394
+ }
395
+ this.watchers.push(watch(fullDir, {recursive: true}, handler))
390
396
  }
391
- this.watchers.push(watch(fullDir, {recursive: true}, handler))
392
397
  }
393
398
 
394
399
  console.log('Beginning to watch your project')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunBunBundle
4
- VERSION = '0.13.0'
4
+ VERSION = '0.14.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.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wout Fierens