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 +9 -0
- package/index.d.ts +1 -1
- package/index.js +10 -1
- package/package.json +3 -3
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
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
|
-
|
|
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
|
|
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": "
|
|
38
|
-
"lint": "lunte"
|
|
37
|
+
"test": "brittle-bare test/index.js",
|
|
38
|
+
"lint": "prettier . --check && lunte"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|