bare-stow 0.0.0 → 0.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/LICENSE +201 -0
- package/README.md +237 -0
- package/bin.js +109 -0
- package/index.d.ts +83 -0
- package/index.js +207 -0
- package/lib/fs.js +78 -0
- package/lib/host.d.ts +19 -0
- package/lib/host.js +62 -0
- package/lib/protocol.d.ts +16 -0
- package/lib/protocol.js +129 -0
- package/lib/rpc/bare-rpc.js +24 -0
- package/lib/rpc.js +23 -0
- package/lib/shim.js +86 -0
- package/lib/target/bare-sidecar.js +63 -0
- package/lib/target.js +27 -0
- package/package.json +91 -1
package/lib/target.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const registry = {
|
|
2
|
+
'bare-sidecar': () => require('./target/bare-sidecar')
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
module.exports = function target(name, resolve) {
|
|
6
|
+
if (typeof name !== 'string') return validate(name)
|
|
7
|
+
|
|
8
|
+
const load = registry[name]
|
|
9
|
+
|
|
10
|
+
if (load) return load()
|
|
11
|
+
|
|
12
|
+
if (resolve) return validate(resolve(name))
|
|
13
|
+
|
|
14
|
+
throw new Error(`Unknown target '${name}'`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function validate(target) {
|
|
18
|
+
if (!target || typeof target.generate !== 'function') {
|
|
19
|
+
throw new Error('Target must provide a generate() function')
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (!Array.isArray(target.hosts)) {
|
|
23
|
+
throw new Error('Target must provide a hosts array')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return target
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1,91 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "bare-stow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Module bundling and harness generation for Bare",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./package": "./package.json",
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"default": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"./protocol": {
|
|
12
|
+
"types": "./lib/protocol.d.ts",
|
|
13
|
+
"default": "./lib/protocol.js"
|
|
14
|
+
},
|
|
15
|
+
"./host": {
|
|
16
|
+
"types": "./lib/host.d.ts",
|
|
17
|
+
"default": "./lib/host.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"imports": {
|
|
21
|
+
"fs": {
|
|
22
|
+
"bare": "bare-fs",
|
|
23
|
+
"default": "fs"
|
|
24
|
+
},
|
|
25
|
+
"path": {
|
|
26
|
+
"bare": "bare-path",
|
|
27
|
+
"default": "path"
|
|
28
|
+
},
|
|
29
|
+
"url": {
|
|
30
|
+
"bare": "bare-url",
|
|
31
|
+
"default": "url"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"bin": {
|
|
35
|
+
"bare-stow": "bin.js"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"index.js",
|
|
39
|
+
"index.d.ts",
|
|
40
|
+
"bin.js",
|
|
41
|
+
"lib"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"format": "prettier --write . && lunte --fix",
|
|
45
|
+
"lint": "prettier --check . && lunte",
|
|
46
|
+
"test": "npm run test:bare && npm run test:node",
|
|
47
|
+
"test:bare": "brittle-bare --coverage test.js",
|
|
48
|
+
"test:node": "brittle-node --coverage test.js"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/holepunchto/bare-stow.git"
|
|
53
|
+
},
|
|
54
|
+
"author": "Holepunch",
|
|
55
|
+
"license": "Apache-2.0",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/holepunchto/bare-stow/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/holepunchto/bare-stow#readme",
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"bare-bundle": "^1.8.3",
|
|
62
|
+
"bare-bundle-id": "^1.0.0",
|
|
63
|
+
"bare-fs": "^4.2.1",
|
|
64
|
+
"bare-module-traverse": "^2.1.1",
|
|
65
|
+
"bare-pack": "^2.1.0",
|
|
66
|
+
"bare-path": "^3.0.0",
|
|
67
|
+
"bare-stream": "^2.13.1",
|
|
68
|
+
"paparam": "^1.5.0"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"bare-rpc": "^1.3.2",
|
|
72
|
+
"bare-sidecar": "^0.5.0",
|
|
73
|
+
"brittle": "^4.0.2",
|
|
74
|
+
"lunte": "^1.7.0",
|
|
75
|
+
"prettier": "^3.3.3",
|
|
76
|
+
"prettier-config-holepunch": "^2.0.0",
|
|
77
|
+
"which-runtime": "^1.4.0"
|
|
78
|
+
},
|
|
79
|
+
"peerDependencies": {
|
|
80
|
+
"bare-buffer": "^3.6.0",
|
|
81
|
+
"bare-url": "^2.4.0"
|
|
82
|
+
},
|
|
83
|
+
"peerDependenciesMeta": {
|
|
84
|
+
"bare-buffer": {
|
|
85
|
+
"optional": true
|
|
86
|
+
},
|
|
87
|
+
"bare-url": {
|
|
88
|
+
"optional": true
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|