bundlebee 1.0.6 → 1.1.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.
package/README.md CHANGED
@@ -40,6 +40,15 @@ const mod = await b.load(new URL('file:///path/to/project/'), '/index.js')
40
40
  const { source, resolutions } = await b1.get('/entrypoint.js', 1)
41
41
  ```
42
42
 
43
+ ### Checkout a specific version on init
44
+
45
+ ```js
46
+ const b = new Bundlebee(store, { key, length })
47
+
48
+ // get remote bundle
49
+ const mod = await b.load(new URL('file:///path/to/project/'), '/index.js')
50
+ ```
51
+
43
52
  ## API
44
53
 
45
54
  #### `const b = new Bundlebee(store, [opts])`
package/index.d.ts CHANGED
@@ -49,7 +49,7 @@ declare module 'bundlebee' {
49
49
  }
50
50
 
51
51
  class Bundlebee extends ReadyResource {
52
- constructor(store: any, opts?: BundlebeeOptions)
52
+ constructor(store: any, opts?: BundlebeeOptions) // lunte-disable-line
53
53
 
54
54
  static require(
55
55
  store: any,
package/index.js CHANGED
@@ -24,7 +24,15 @@ const PEERDEPS_KEY = b4a.from(PEERDEPS_KEY_VALUE)
24
24
  module.exports = class Bundlebee extends ReadyResource {
25
25
  constructor(store, opts = {}) {
26
26
  super()
27
- this._bee = new Bee(store, { autoUpdate: true, ...opts })
27
+
28
+ const { key, length = -1 } = opts
29
+ const autoUpdate = !key || length === -1
30
+
31
+ this._bee = new Bee(store, { autoUpdate, ...opts })
32
+
33
+ if (key && length !== -1) {
34
+ this._bee.move({ key, length })
35
+ }
28
36
 
29
37
  this.ready().catch(noop)
30
38
  }
@@ -161,6 +169,7 @@ module.exports = class Bundlebee extends ReadyResource {
161
169
 
162
170
  return d.head
163
171
  }
172
+ return null
164
173
  }
165
174
 
166
175
  async *allABIs() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bundlebee",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "bundlebee",
5
5
  "main": "index.js",
6
6
  "imports": {
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "scripts": {
36
36
  "format": "prettier . --write",
37
- "test": "prettier . --check && lunte && brittle-bare test/index.js",
38
- "lint": "lunte"
37
+ "test": "brittle-bare test/index.js",
38
+ "lint": "prettier . --check && lunte"
39
39
  },
40
40
  "repository": {
41
41
  "type": "git",